No Khaled, loose_route is not inside ACK if condition, it should be where it is in your script. Also the INVITE if he mentioned is in else of has_totag, not loose_route. Read his reply carefully and you will get the idea. ;-)<div>
<br></div><div>Thank you.<br><div><br><br><div class="gmail_quote">On Sat, Mar 16, 2013 at 10:24 PM, M.Khaled W Chehab <span dir="ltr"><<a href="mailto:kchehab@icucall.com" target="_blank">kchehab@icucall.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Dear Bogdan,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Please can you confirm the changes I mark down with red color or please correct it if its wrong .<u></u><u></u></span></p>
<div class="im"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><tt><span style="font-size:9.0pt;color:windowtext"><u></u> <u></u></span></tt></p><p class="MsoNormal"><tt><span style="font-size:9.0pt;color:windowtext"><u></u> <u></u></span></tt></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext">if (has_totag()) {</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<b><span style="font-size:9.0pt;font-family:"Courier New";color:red">if (is_method("ACK")) {<u></u><u></u></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:9.0pt;font-family:"Courier New";color:red"> $avp(timeout2) = 3540; <u></u><u></u></span></b></p><p class="MsoNormal" style="text-autospace:none">
<b><span style="font-size:9.0pt;font-family:"Courier New";color:red"><u></u> <u></u></span></b></p><p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:9.0pt;font-family:"Courier New";color:red"><u></u> <u></u></span></b></p>
</div><p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:9.0pt;font-family:"Courier New";color:red">###should I add here loose_route();<u></u><u></u></span></b></p><p class="MsoNormal" style="text-autospace:none">
<b><span style="font-size:9.0pt;font-family:"Courier New";color:red"> }<u></u><u></u></span></b></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # sequential request withing a dialog should<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # take the path determined by record-routing<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> if (loose_route()) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # validate the sequential request against dialog<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> #if ( $DLG_status!=NULL && !validate_dialog() ) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # xlog("In-Dialog $rm from $si (callid=$ci) is not valid according to dialog\n");<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # #exit;<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> #}<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> if (is_method("BYE")) {<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> end_media_session();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> setflag(1); # do accounting ...<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> setflag(3); #transaction falis<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> } else if (is_method("INVITE")) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # even if in most of the cases is useless, do RR for<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # re-INVITEs alos, as some buggy clients do change route set<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # during the dialog.<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> record_route();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> }<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> if (check_route_param("nat=yes")) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> setflag(5);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # route it out to whatever destination was set by loose_route()<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # in $du (destination URI).<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> route(1);<u></u><u></u></span></p><div class="im"><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> } else {<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><tt><span style="font-size:9.0pt;color:windowtext"> </span></tt><tt><b><span style="font-size:9.0pt;color:red">if ( is_method("INVITE")) {</span></b></tt><b><span style="font-size:10.0pt;font-family:"Courier New";color:red"><br>
</span></b><tt><b><span style="font-size:9.0pt;color:red"> $avp(timeout2) = 3; </span></b></tt><b><span style="font-size:10.0pt;font-family:"Courier New";color:red"><br></span></b><tt><b><span style="font-size:9.0pt;color:red"> }</span></b></tt><b><span style="font-size:9.0pt;font-family:"Courier New";color:red"><u></u><u></u></span></b></p>
</div><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> if ( is_method("ACK") ) {<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> if ( t_check_trans() ) {<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # non loose-route, but stateful ACK; must be an ACK after <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # a 487 or e.g. 404 from upstream server<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> t_relay();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> exit;<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> } else {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # ACK without matching transaction -><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> # ignore and discard<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> exit;<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> }<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> sl_send_reply("404","Not here");<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> exit;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"> }</span><span style="font-size:9.0pt;font-family:"Courier New";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal">
<b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Bogdan-Andrei Iancu [mailto:<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>] <br>
<b>Sent:</b> Thursday, March 14, 2013 6:59 PM<br><b>To:</b> OpenSIPS users mailling list<br><b>Cc:</b> M.Khaled W Chehab; 'Brito Nicolas'</span></p><div class="im"><br><b>Subject:</b> Re: [OpenSIPS-Users] ACK Timer<u></u><u></u></div>
<p></p></div></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span style="font-size:10.0pt">Hi Khaled,</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span></p><div class="im"><br><tt>your mistake here is to set the timeout for INVITE under the </tt></div><tt><span style="font-size:9.0pt">has_totag() branch - initial INVITEs do not have TO tags.</span></tt><div class="im">
<span style="font-size:10.0pt;font-family:"Courier New""><br><br></span><tt><span style="font-size:9.0pt;color:windowtext">Try:</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
<br></span><tt><span style="font-size:9.0pt;color:windowtext">if (has_totag()) {</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br></span><tt><span style="font-size:9.0pt;color:windowtext"> if (is_method("ACK")) {</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span><tt><span style="font-size:9.0pt;color:windowtext"> $avp(timeout2) = 3540; </span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br></span><tt><span style="font-size:9.0pt;color:windowtext"> }</span></tt><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br>
</span><tt><span style="font-size:10.0pt;color:windowtext"> ..... (loose_route)</span></tt><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br></span><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span><tt><span style="font-size:9.0pt;color:windowtext">} else {</span></tt><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br></span><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span><tt><span style="font-size:9.0pt;color:windowtext"> if ( is_method("INVITE")) {</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br></span><tt><span style="font-size:9.0pt;color:windowtext"> $avp(timeout2) = 3; </span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span><tt><span style="font-size:9.0pt;color:windowtext"> }</span></tt><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br><br></span><tt><span style="font-size:10.0pt;color:windowtext"> .......</span></tt><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br>
</span><span style="font-size:10.0pt;font-family:"Courier New""><br></span><tt><span style="font-size:9.0pt;color:windowtext">}</span></tt><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br>
</span><span style="font-size:10.0pt;font-family:"Courier New""><br></span><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br></span><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span><tt><span style="font-size:10.0pt;color:windowtext">Regards,</span></tt><span style="font-size:10.0pt;font-family:"Courier New";color:windowtext"><br><tt>Bogdan</tt></span><span style="font-size:9.0pt;font-family:"Courier New";color:windowtext"><br>
<br></span><u></u><u></u></div><p></p><div class="im"><pre>Bogdan-Andrei Iancu<u></u><u></u></pre><pre>OpenSIPS Founder and Developer<u></u><u></u></pre><pre><a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a><u></u><u></u></pre>
<p class="MsoNormal"><br><br><u></u><u></u></p><pre><u></u> <u></u></pre></div></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Mit freundlichen Grüßen</span></div>
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Muhammad Shahzad</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">------------------------------</span><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-----</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Rich Media Communication Specialist (CRMCS)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Certified Network Associate (CCNA)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Cell: +49 176 99 83 10 85</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">MSN: </span><a href="mailto:shari_786pk@hotmail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shari_786pk@hotmail.com</a><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Email: </span><a href="mailto:shaheryarkh@googlemail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shaheryarkh@googlemail.com</a>
</div></div>