<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <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="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/25/2017 05:34 PM, Ravi Patel
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEh7C87dMZRVJpzYY568yPfpprKzhFjJ9zg5PpRbzHLwJOTtew@mail.gmail.com">
      <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","-------------------
              RING_TIMEOUT ---------------\n");<br>
                              if (!is_method("INVITE"))<br>
                                      return;<br>
                             
              avp_db_load("$rU","$avp(ringtimeout)/usr_preferences"); <br>
                              if($avp(ringtimeout)!=null)     <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"
                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="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>