<div dir="ltr"><div><div><div><div><div><div><div>Dear Bogdan and Ben,<br>Thanks for your replies.<br><br></div>Previously, I set t_on_failure() when forwarded call came back to OpenSIPS(not in failure_route) , Now after your suggestion I set <b>t_on_failure()</b> before <b>t_relay()</b> in <b>failure_route</b>. <br><br></div>That Indeed solved the issue of forwarding and timeout, but faced another issue after this change.<br><br></div>Here is the brief of issue: <br><br></div>in failure_route, I fetched some <b>headers</b> from <b>SIP Message,</b> that checks the number of forwarding and if not exceeded max count, it proceed to forward the call(t_relay()).<br></div>Now in this logic I added <b>t_on_failure()</b> before <b>t_relay()</b> , now here I am not able to get the headers from SIP Message in failure_route where I am checking the max forwarding count.<br><br></div>Is there any way to get the headers in failure_route after using t_on_failure in failure_route ??<br><br></div>Hope I explained well.<br><div><div><div><div><div><div><br></div><div>Let me know If you need anything else from my side.<br></div><div><br></div><div>Regards,<br></div><div>Ravi Patel<br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 28, 2017 at 4:12 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <tt>Hello Ravi,<br>
      <br>
      It looks like the failed call to 3333 has no failure route set
      (this is why you directly get the 408 default timeout, as there is
      no failure route to handle the timeout event). Are you sure you
      t_on_failure() for each call attempt (especially when handling the
      call failure to 2222) ?<br>
      <br>
      Best regards,<br>
    </tt><span class="">
    <pre class="m_4329720253646911009moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_4329720253646911009moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a>

OpenSIPS Bootcamp 2017, Houston, US
  <a class="m_4329720253646911009moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2017.html" target="_blank">http://opensips.org/training/<wbr>OpenSIPS_Bootcamp_2017.html</a>
</pre>
    </span><div><div class="h5"><div class="m_4329720253646911009moz-cite-prefix">On 07/26/2017 04:35 PM, Ravi Patel
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>Dear Bogdan,<br>
                            <br>
                          </div>
                          I am Grateful for your reply.<br>
                          <br>
                        </div>
                        I applied <b>$T_fr_inv_timeout</b> before doing
                        each <b>t_relay().</b> by applying it , I am
                        able to achieve it at 1st forwarding but
                        unfortunately not working for 2nd forwarding.<br>
                        <br>
                      </div>
                      The scenario is:<br>
                      1111<br>
                      2222 (fr_inv_timeout 10 sec)<br>
                      3333 (fr_inv_timeout 5 sec)<br>
                      4444 (fr_inv_timeout 20 sec)<br>
                      <br>
                    </div>
                    when 1111 calls 2222 : OpenSIPS generates CANCEL at
                    10 secs and forwards call to 3333.<br>
                    now --> 3333 : OpenSIPS generates CANCEL at 5
                    secs<b> </b>but does not forward call to 4444
                    instead it sends <b>408 to Caller(1111)</b> and
                    drops call.<br>
                    <br>
                  </div>
                  I am attaching packets where <a href="http://sip.client.com" target="_blank">sip.client.com</a>
                  refers to the SIP clients and <a href="http://sip.server.com" target="_blank">sip.server.com</a>
                  refers to the OpenSIPS Server.<br>
                  <br>
                </div>
                Also find the attached snapshots of the call flow. <br>
                <br>
              </div>
              Please guide what can be done or where I am doing wrong ?
              <br>
            </div>
            Let me know if you need any other information.<br>
            <br>
          </div>
          Best Regards,<br>
        </div>
        Ravi Patel<br>
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div><br>
                    <div>
                      <div><br>
                        <div>
                          <div>
                            <div><br>
                              <div class="gmail_extra"><br>
                                <div class="gmail_quote">On Tue, Jul 25,
                                  2017 at 9:07 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
                                  wrote:<br>
                                  <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                    <div bgcolor="#FFFFFF"> <tt>Hi
                                        Ravi,<br>
                                        <br>
                                        Before each t_rely() you have to
                                        set the your custom
                                        $T_fr_inv_timeout and
                                        $T_fr_timeout, otherwise the
                                        default values will be used.  As
                                        you have a serial forking
                                        scenario, you do a new t_relay()
                                        at each step.<br>
                                        <br>
                                        Regards,<br>
                                      </tt>
                                      <pre class="m_4329720253646911009gmail-m_-1108370517068494377moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_4329720253646911009gmail-m_-1108370517068494377moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a>

OpenSIPS Bootcamp 2017, Houston, US
  <a class="m_4329720253646911009gmail-m_-1108370517068494377moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2017.html" target="_blank">http://opensips.org/training/O<wbr>penSIPS_Bootcamp_2017.html</a>
</pre>
                                      <div>
                                        <div class="m_4329720253646911009gmail-h5">
                                          <div class="m_4329720253646911009gmail-m_-1108370517068494377moz-cite-prefix">On
                                            07/25/2017 05:34 PM, Ravi
                                            Patel wrote:<br>
                                          </div>
                                        </div>
                                      </div>
                                      <blockquote type="cite">
                                        <div>
                                          <div class="m_4329720253646911009gmail-h5">
                                            <div dir="ltr">
                                              <div>
                                                <div>
                                                  <div>Hi Team,<br>
                                                    <br>
                                                    What is the right
                                                    way to reset timers
                                                    <b>$T_fr_inv_timeout</b>
                                                    and <b>$T_fr_timeout</b>
                                                    ??<br>
                                                    <br>
                                                    I am using
                                                    OpenSIPS-2.2 version<br>
                                                    The below scenario
                                                    will help to
                                                    understand issue,<br>
                                                    <br>
                                                    There are 4 SIP
                                                    users,<br>
                                                    1111,2222,3333,4444
                                                    <br>
                                                    <br>
                                                    What I want to
                                                    achieve is:<br>
                                                    1111 ---> 2222
                                                    (FORWARD ON
                                                    NOANSWER) --->
                                                    3333 (FORWARD ON
                                                    NOANSWER) --->
                                                    4444<br>
                                                    <br>
                                                    <b>1st Test Case
                                                      Scenario:</b><br>
                                                    <br>
                                                    1111<br>
                                                    2222 (fr_inv_timeout
                                                    20 sec)<br>
                                                    3333 (fr_inv_timeout
                                                    25 sec)<br>
                                                    4444 (fr_inv_timeout
                                                    30 sec)<br>
                                                    <br>
                                                    <br>
                                                    when 1111 calls 2222
                                                    : OpenSIPS generates
                                                    CANCEL at 20 secs
                                                    (thats working
                                                    proper as expexted)
                                                    and forwards call to
                                                    3333 as per my
                                                    configuration.<br>
                                                    so in --> 3333 :
                                                    OpenSIPS generates
                                                    CANCEL at <b>20
                                                      secs instead of 25
                                                      secs</b> and send
                                                    408 to 1111. and not
                                                    processing the 2nd
                                                    forwarding.<br>
                                                    <br>
                                                    <b>2nd Test Case
                                                      Scenario:</b><br>
                                                    1111<br>
                                                    2222 (fr_inv_timeout
                                                    20 sec)<br>
                                                    3333 (fr_inv_timeout
                                                    15 sec)<br>
                                                    4444 (fr_inv_timeout
                                                    30 sec)<br>
                                                    <br>
                                                    when 1111 calls 2222
                                                    : OpenSIPS generates
                                                    CANCEL at 20 secs
                                                    (that is working
                                                    proper as expexted)
                                                    and forwards call to
                                                    3333 as per my
                                                    configuration.<br>
                                                    now --> 3333 :
                                                    OpenSIPS generates
                                                    CANCEL at 15 secs
                                                    and forwards the
                                                    call to 4444, Here
                                                    OpenSIPS generates
                                                    CANCEL <b>after 5
                                                      secs instead of 30
                                                      secs.</b><br>
                                                    <br>
                                                    <br>
                                                    We set timeout by
                                                    using
                                                    $T_fr_inv_timeout.<br>
                                                    ------------<br>
                                                    route[ring_timeout]{<br>
                                                                   
                                                    xlog("L_INFO","---------------<wbr>----
                                                    RING_TIMEOUT
                                                    ---------------\n");<br>
                                                                    if
                                                    (!is_method("INVITE"))<br>
                        return;<br>
                                                                   
                                                    avp_db_load("$rU","$avp(ringti<wbr>meout)/usr_preferences");
                                                    <br>
                                                                   
                                                    if($avp(ringtimeout)!=null)   <wbr> 
                                                    <br>
                                                                    {<br>
                        $T_fr_inv_timeout = NULL;<br>
                        xlog("L_INFO","$rU: Ring timeout :
                                                    $avp(ringtimeout)");<br>
                        $T_fr_inv_timeout =$(avp(ringtimeout){<a href="http://s.int" target="_blank">s.int</a>})
                                                    ;<br>
                        xlog("L_INFO","$rU: Ring timeout is setted:
                                                    [$T_fr_inv_timeout]");<br>
                                                                    }<br>
                                                                    else<br>
                                                                    {<br>
                        xlog("L_INFO","$rU: Ring timeout is NOT
                                                    setted");<br>
                                                                    }<br>
                                                    }<br>
                                                    ------------------<br>
                                                    <br>
                                                    From both the
                                                    scenarios what we
                                                    found, it sticks to
                                                    the first timeout of
                                                    2222,that is 20secs
                                                    in our case.<br>
                                                    In first scenario it
                                                    generates CANCEL on
                                                    3333 at 20 secs
                                                    instead of 25 that
                                                    is 2222's Timeout.<br>
                                                    In second scenario
                                                    it generates CANCEL
                                                    on 3333 at 15sec and
                                                    on 4444 at 5 sec (15
                                                    + 5 = 20 sec) that
                                                    is also 2222's
                                                    timeout.<br>
                                                    <br>
                                                    <br>
                                                    Can I know the right
                                                    method to set
                                                    $T_fr_inv_timeout ?<br>
                                                    <br>
                                                  </div>
                                                  Let me know if any
                                                  other information is
                                                  needed.<br>
                                                  <br>
                                                  <br>
                                                </div>
                                                Thanks,<br>
                                              </div>
                                              Ravi<br>
                                              <div>
                                                <div>
                                                  <div><br>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                            <br>
                                            <fieldset class="m_4329720253646911009gmail-m_-1108370517068494377mimeAttachmentHeader"></fieldset>
                                            <br>
                                          </div>
                                        </div>
                                        <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_4329720253646911009gmail-m_-1108370517068494377moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_4329720253646911009gmail-m_-1108370517068494377moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                                      </blockquote>
                                      <br>
                                    </div>
                                  </blockquote>
                                </div>
                                <br>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div>