<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
On 3/30/12 5:17 PM, Stephen Dodge (Bistech) wrote:
<blockquote
cite="mid:63C98A4100A7D34C9D3B85021AA8F0EA149DBFA0D1@BIS-EXS01-VIC-V.office.bistech.co.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi Guys,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have a question regarding the correct
processing for cancelled requests<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-GB">1.
(A)--------------------INVITE ------------------->(B)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-GB">2.
(A)<------------------180 RIGING------------------(B)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-GB">3.
(A)--------------------CANCEL-------------------->(B)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-GB">4.
(A)<------------------OK--------------------------(B)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-GB">5.
(A)<---------487 Request Terminated---------------(B)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-GB">6.
(A)--------------------ACK----------------------->(B)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have the following section to deal with
cancel messages however I am finding that the 487 response
still hits my failure_route block. The failure_route block
is called for serial forking.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"># CANCEL processing<o:p></o:p></p>
<p class="MsoNormal">if (is_method("CANCEL"))<o:p></o:p></p>
<p class="MsoNormal"> {<o:p></o:p></p>
<p class="MsoNormal"> if (t_check_trans())<o:p></o:p></p>
<p class="MsoNormal"> xdbg("## BISNET ##
- Cancel Processing\n");<o:p></o:p></p>
<p class="MsoNormal"> t_relay();<o:p></o:p></p>
<p class="MsoNormal"> exit;<o:p></o:p></p>
<p class="MsoNormal"> }<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
first, a quick note about cfg snippet above:<br>
- you added xdbg() after the IF which makes t_relay() to be executed
always -- you should add curly braces when having more than one
action in an IF statement.<br>
<br>
<blockquote
cite="mid:63C98A4100A7D34C9D3B85021AA8F0EA149DBFA0D1@BIS-EXS01-VIC-V.office.bistech.co.uk"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">I can obviously do something like a
(!t_check_status("487")) within the failure block but is there
a better way to deal with this response ?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Although this doesn’t really cause me a
problem at the moment I see the following error in the debug<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">/usr/sbin/kamailio[23786]: ERROR: tm
[tm.c:1368]: ERROR: w_t_relay_to: t_relay_to failed<o:p></o:p></p>
<p class="MsoNormal">/usr/sbin/kamailio[23786]: ERROR: sl
[sl_funcs.c:282]: ERROR: sl_reply_error used: transaction
canceled (487/SL)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As always your help is appreciated.</p>
</div>
</blockquote>
you have to add at the top of failure route:<br>
<br>
if (t_is_canceled()) {<br>
exit;<br>
}<br>
<br>
The failed transaction is the INVITE, which gets 487. While makes no
point in rerouting the INVITE since the caller canceled, it is
useful in some cases to get to failure route (e.g., statistics, end
rtpproxy relay session initiated for INVITE, ...).<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
</body>
</html>