I will follow your indications and after that I will give you feedback about this solution.<br>Thanks,<br><br><br><div class="gmail_quote">On Mon, Mar 10, 2008 at 4:14 PM, Andrei Pelinescu-Onciul &lt;<a href="mailto:andrei@iptel.org">andrei@iptel.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Mar 10, 2008 at 12:14, Nuno Ribeiro &lt;<a href="mailto:nribeiro82@gmail.com">nribeiro82@gmail.com</a>&gt; wrote:<br>

&gt; Hi Andrei,<br>
&gt;<br>
&gt; Thanks for your availability to help me...<br>
&gt; Note that this situation only occurs if the CANCEL message is originated a<br>
&gt; few moments after the INVITE. I think that the transaction from the INVITE<br>
&gt; is not &nbsp;yet completely created so when the CANCEL is received it doesn&#39;t<br>
&gt; match any transaction (t_lookup_request: no transaction found).<br>
&gt; I send in attachment the wireshark log where you can the network traces that<br>
&gt; you referred.<br>
<br>
</div>No, in fact the CANCEL matches and terminates the transaction<br>
(you go INVITE, 100 Trying, INVITE forwarded, CANCEL, 487 to the orig.<br>
INVITE due to the CANCEL and the 200 to the CANCEL).<br>
The problem is when the CANCEL arrives the INVITE transaction has not<br>
received any reply yet (if you look in the dump you&#39;ll see an 100 trying<br>
&nbsp;from .5 long after the CANCEL is received). In ser in this case (CANCEL<br>
&nbsp;received and no response yet on a branch) &nbsp;the branch is dropped<br>
&nbsp;immediately and a &quot;fake&quot; 487 is sent back (the ideea is that most<br>
&nbsp;likely the UA to which the INVITE was forwarded is dead and it saves a<br>
&nbsp;lot of resources if we quickly kill the transaction -- unfortunately this<br>
&nbsp;backfires in your case). The CANCEL is also not forwarded downstream (the<br>
&nbsp;rfc says that CANCEL should be sent only on replied branches).<br>
<br>
So to make a long story short, upgrade to the latest cvs version and set<br>
&nbsp;modparam(&quot;tm&quot;, &quot;cancel_b_method&quot;, 1). This will keep retransmitting<br>
 &nbsp;the INVITE if no reply was received, even after the CANCEL arrives and<br>
 &nbsp;it will avoid all the above problems (see modules/tm/README |grep<br>
 &nbsp;cancel_b_method for a more detailed description).<br>
If you still have problem, drop me another mail. I&#39;m very interested if<br>
the cancel fix works properly, not only in my testbed. I&#39;m starting to think<br>
that making this the default behaviour might be a good ideea (since it<br>
seems that it causes problems quite frequently). It might even become a<br>
&nbsp;candidate for a backport to stable.<br>
<br>
<br>
Andrei<br>
<div class="Ih2E3d"><br>
&gt;<br>
&gt; PS: the first message was rejected by the list as the message was to big....<br>
&gt;<br>
&gt; Best Regards,<br>
&gt;<br>
&gt; On Sat, Mar 8, 2008 at 12:39 AM, Andrei Pelinescu-Onciul &lt;<a href="mailto:andrei@iptel.org">andrei@iptel.org</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Mar 06, 2008 at 17:45, Nuno Ribeiro &lt;<a href="mailto:nribeiro82@gmail.com">nribeiro82@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;m facing a problem &nbsp;with &quot;early CANCEL&#39;s&quot; such the one described in<br>
&gt; &gt; this<br>
&gt; &gt; &gt; thread. The scenario is the following &nbsp;one:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; A PSTN call to a SIP phone. When the PSTN decides to cancel the call<br>
&gt; &gt; only a<br>
&gt; &gt; &gt; right after initiating, the PSTN will send the CANCEL message to the SER<br>
&gt; &gt; but<br>
&gt; &gt; &gt; this is discarded and not forwarded to the correct path to the SIP<br>
&gt; &gt; Phone. So<br>
&gt; &gt; &gt; what happens is that we have a ghost call.... The PSTN has already<br>
&gt; &gt; canceled<br>
&gt; &gt; &gt; the call but the SIP phone continues to ring.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The code that I have in the SER script is really simple and the behavior<br>
&gt; &gt; to<br>
&gt; &gt; &gt; a CANCEL is the same as to a INVITE:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; if(subst_uri(&#39;/^sip:(\+[0-9]+)@<br>
</div>&gt; &gt; &gt; <a href="http://192.168.20.69.*user=phone$/sip:%5C1@xlab.com/i%27%29%29%7B" target="_blank">192.168.20.69.*user=phone$/sip:\1@xlab.com/i&#39;)){</a>&lt;<a href="http://192.168.20.69.*user=phone$/sip:%5C1@xlab.com/i%27%29%29%7B" target="_blank">http://192.168.20.69.*user=phone$/sip:%5C1@xlab.com/i%27%29%29%7B</a>&gt;<br>

<div><div></div><div class="Wj3C7c">&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;record_route();<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;loose_route();<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_relay_to_udp(&quot;<a href="http://192.168.20.5" target="_blank">192.168.20.5</a>&quot;, &quot;5060&quot;);<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>
&gt; &gt; &gt; }<br>
&gt; &gt; &gt; In the log file I see that:<br>
&gt; &gt; &gt; RFC3261 transaction matching failed<br>
&gt; &gt; &gt; t_lookup_request: no transaction found<br>
&gt; &gt; &gt; e2e_cancel: e2e cancel proceeding<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; During this thread I saw that a &nbsp;CANCEL handling tm option was decided<br>
&gt; &gt; to be<br>
&gt; &gt; &gt; created. Maybe this option can help me to solve the ghost call issue.<br>
&gt; &gt; How<br>
&gt; &gt; &gt; can I change the default behavior ? &nbsp;this feature is available &nbsp;from<br>
&gt; &gt; which<br>
&gt; &gt; &gt; SER release ?<br>
&gt; &gt;<br>
&gt; &gt; The option is unmatched_cancel and is present for ser 2.1 (cvs head).<br>
&gt; &gt; However what this does is select between dropping unmatched cancels,<br>
&gt; &gt; forwarding them statelessly or statefully.<br>
&gt; &gt; Older ser versions always forward the cancel statefully, which is what<br>
&gt; &gt; you want in most cases (including yours).<br>
&gt; &gt;<br>
&gt; &gt; It&#39;s strage that the cancel doesn&#39;t seem to match the invite transaction<br>
&gt; &gt; in your case.<br>
&gt; &gt; If you would send me some networks dumps with the invite and the cancel<br>
&gt; &gt; I could tell you more.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Andrei<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any idea how I can solve this isse?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks in advance.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Best Regards<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Thu, Mar 29, 2007 at 6:19 PM, Jiri Kuthan &lt;<a href="mailto:jiri@iptel.org">jiri@iptel.org</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; At 15:58 26/02/2007, Klaus Darilion wrote:<br>
&gt; &gt; &gt; &gt; &gt;FYI: This is the pragmatic approach how openser users handle the<br>
&gt; &gt; problem:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;1. drop the CANCEL if there is no corresponding INVITE transaction.<br>
&gt; &gt; The<br>
&gt; &gt; &gt; &gt; UAC must retransmit the CANCEL and meanwhile there should be the<br>
&gt; &gt; INVITE<br>
&gt; &gt; &gt; &gt; transaction. (since 1.0)<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;if ( is_method(&quot;CANCEL&quot;) &amp;&amp; !t_check_trans() ) {<br>
&gt; &gt; &gt; &gt; &gt; &nbsp;# CANCEL without matching INVITE transaction, ignore!<br>
&gt; &gt; &gt; &gt; &gt; &nbsp;# May happen if the INVITE is slower than the CANCEL.<br>
&gt; &gt; &gt; &gt; &gt; &nbsp;# Ignore the CANCEL, as the client will retransmit it, and maybe<br>
&gt; &gt; &gt; &gt; &gt; &nbsp;# the INVITE transaction is already created for the next CANCEL<br>
&gt; &gt; &gt; &gt; &gt; &nbsp;xlog(&quot;L_WARN&quot;,&quot;$ci CANCEL without matching transaction ...<br>
&gt; &gt; ignore\n&quot;);<br>
&gt; &gt; &gt; &gt; &gt; &nbsp;exit;<br>
&gt; &gt; &gt; &gt; &gt;}<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; which does not appear really reboot-safe to me. What it can lead to<br>
&gt; &gt; that<br>
&gt; &gt; &gt; &gt; ser reboot<br>
&gt; &gt; &gt; &gt; affects pending calls in that cancels are never forwarded and ringing<br>
&gt; &gt; &gt; &gt; phones will<br>
&gt; &gt; &gt; &gt; never stop ringing -- not very pleasant indeed, is it.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; -jiri<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; Jiri Kuthan &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://iptel.org/%7Ejiri/" target="_blank">http://iptel.org/~jiri/</a>&lt;<a href="http://iptel.org/%7Ejiri/" target="_blank">http://iptel.org/%7Ejiri/</a>&gt;&lt;<br>
&gt; &gt; <a href="http://iptel.org/%7Ejiri/" target="_blank">http://iptel.org/%7Ejiri/</a>&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt; Serusers mailing list<br>
&gt; &gt; &gt; &gt; <a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br>
&gt; &gt; &gt; &gt; <a href="http://lists.iptel.org/mailman/listinfo/serusers" target="_blank">http://lists.iptel.org/mailman/listinfo/serusers</a><br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; Nuno Ribeiro<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Nuno Ribeiro<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Nuno Ribeiro