<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body 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>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>

OpenSIPS Bootcamp 2017, Houston, US
  <a class="moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2017.html">http://opensips.org/training/OpenSIPS_Bootcamp_2017.html</a>
</pre>
    <div class="moz-cite-prefix">On 07/26/2017 04:35 PM, Ravi Patel
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEh7C84vqP6ukoOG4btri+Jo6QyFDo5qiY4KzgRxp374Nq63Bw@mail.gmail.com">
      <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" moz-do-not-send="true">sip.client.com</a>
                  refers to the SIP clients and <a
                    href="http://sip.server.com" moz-do-not-send="true">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"
                                      moz-do-not-send="true">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="gmail-m_-1108370517068494377moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="gmail-m_-1108370517068494377moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a>

OpenSIPS Bootcamp 2017, Houston, US
  <a class="gmail-m_-1108370517068494377moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2017.html" target="_blank" moz-do-not-send="true">http://opensips.org/training/<wbr>OpenSIPS_Bootcamp_2017.html</a>
</pre>
                                      <div>
                                        <div class="gmail-h5">
                                          <div
                                            class="gmail-m_-1108370517068494377moz-cite-prefix">On
                                            07/25/2017 05:34 PM, Ravi
                                            Patel wrote:<br>
                                          </div>
                                        </div>
                                      </div>
                                      <blockquote type="cite">
                                        <div>
                                          <div class="gmail-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(<wbr>ringtimeout)/usr_preferences")<wbr>;
                                                    <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"
                                                      moz-do-not-send="true">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="gmail-m_-1108370517068494377mimeAttachmentHeader"></fieldset>
                                            <br>
                                          </div>
                                        </div>
                                        <pre>______________________________<wbr>_________________
Users mailing list
<a class="gmail-m_-1108370517068494377moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="gmail-m_-1108370517068494377moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">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>
  </body>
</html>