Cool. So in theory, i should just be able to place<br><br>t_check_trans(); <br><br>right inline in my script in place of all my incorrect logic and it will just take care of everything, right? If I am reading this correctly, I don't even need to conditionally check to see the result as I am only concerned about the retransmission scenario and the t_check_trans() call will break/exit the script...<br>
<br>Thanks for your help.<br><br><div class="gmail_quote">On Mon, Aug 30, 2010 at 1:28 PM, Uriel Rozenbaum <span dir="ltr"><<a href="mailto:uriel.rozenbaum@gmail.com">uriel.rozenbaum@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
Check t_check_trans() from tm module.<br>
<br>
It does all on its own<br>
<br>
<a href="http://kamailio.org/docs/modules/1.5.x/tm.html#id2509242" target="_blank">http://kamailio.org/docs/modules/1.5.x/tm.html#id2509242</a><br>
<br>
Cheers,<br>
Uriel<br>
<div><div></div><div class="h5"><br>
On Mon, Aug 30, 2010 at 2:19 PM, Geoffrey Mina <<a href="mailto:geoffreymina@gmail.com">geoffreymina@gmail.com</a>> wrote:<br>
> Hello,<br>
> I have a question about what the proper way to handle a duplicate<br>
> presentation of an INVITE is. On occasion I am seeing some packet loss<br>
> and/or timing issues which are causing some of my end-points to retransmit<br>
> the INVITE. Here is what I am doing in the most basic sense:<br>
><br>
><br>
> ITSP (Bandwidth.com) --> INVITE --> KAMAILIO --> DISPATCHER --> Asterisk<br>
> (B2BUA)<br>
><br>
><br>
> I am seeing Bandwidth.com send an INVITE which I already received. I keep<br>
> track of all running transactions in a htable which has a key of<br>
><br>
> $ci::$cs::$ft (as per RFC 3261).<br>
><br>
> If I get an invite for something which already has a key in the hashmap, I<br>
> am currently sending a "482 Loop Detected", but I don't think that is<br>
> correct as it causes the whole call to tear down instead of letting it<br>
> continue and assuring Bandwidth.com that I received the initial INVITE and<br>
> am currently working on it.<br>
><br>
> This is what I am currently doing:<br>
><br>
> ##<br>
> ## Check to make sure we don't already have an active<br>
> ## transaction for this call-id, c-seq, and from-tag<br>
> ## RFC3261 - 8.2.2.2<br>
> ##<br>
> ## We are going to add a key for this unique record if one<br>
> ## doesn't already exist. The key automatically times out<br>
> ## after 30 seconds, so we need not worry about cleanup<br>
> ##<br>
> if($sht(loop_check=>$ci::$cs::$ft) == null){<br>
> xlog("L_INFO","No transaction found, adding to our hashtable\n");<br>
> $sht(loop_check=>$ci::$cs::$ft) = 1;<br>
> }else{<br>
> xlog("L_ERR","Loop Detected: $ci::$cs::$ft\n");<br>
> sl_send_reply("482","Loop Detected - Duplicate Session<br>
> Presentation");<br>
> exit;<br>
> }<br>
><br>
> Can I just swallow the second INVITE and do an exit; in my script?<br>
> Should I do an sl_send_reply(100,"Trying")?<br>
><br>
> Any advice would be greatly appreciated.<br>
><br>
> Thanks,<br>
><br>
</div></div>> _______________________________________________<br>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
><br>
</blockquote></div><br>