<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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;
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML - vooraf opgemaakt Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New",serif;
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New",serif;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;
mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
span.HTML-voorafopgemaaktChar
{mso-style-name:"HTML - vooraf opgemaakt Char";
mso-style-priority:99;
mso-style-link:"HTML - vooraf opgemaakt";
font-family:Consolas;
color:black;}
span.E-mailStijl22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-mailStijl23
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-mailStijl24
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-mailStijl25
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-mailStijl26
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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]-->
</head>
<body bgcolor="white" lang="NL" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:windowtext">Hi,<o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="color:windowtext"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span lang="EN-GB" style="color:windowtext">I’ve run this exact scenario against log_level 4 and sent you the output in a separate mail.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span lang="EN-GB" style="color:windowtext">It should be a hop-by-hop ACK against the 487, only thing that strikes me is that opensips already ACKS the 487 to the Callee side. Instead of sending
the 487 all the way first before the ACK gets generated by the caller and routed..<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></span></p>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="mso-fareast-language:NL">Met vriendelijke groet,<br>
<br>
</span></span><span style="mso-bookmark:_MailEndCompose"><b><span style="color:#84C41B;mso-fareast-language:NL">Rik Broers</span></b></span><span style="mso-bookmark:_MailEndCompose"><span style="mso-fareast-language:NL"><br>
</span></span><span style="mso-bookmark:_MailEndCompose"><span style="font-size:9.0pt;color:#212735;mso-fareast-language:NL">Voice Engineer</span></span><span style="mso-bookmark:_MailEndCompose"><span lang="EN-GB" style="color:windowtext;mso-fareast-language:NL"><o:p></o:p></span></span></p>
</div>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></span></p>
<span style="mso-bookmark:_MailEndCompose"></span>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext;mso-fareast-language:NL">Van:</span></b><span style="color:windowtext;mso-fareast-language:NL"> Bogdan-Andrei Iancu [mailto:bogdan@opensips.org]
<br>
<b>Verzonden:</b> 15 May 2017 10:42<br>
<b>Aan:</b> Rik Broers <RBroers@motto.nl>; users@lists.opensips.org<br>
<b>Onderwerp:</b> Re: [OpenSIPS-Users] Cancel ACK routing<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><tt><span style="font-size:10.0pt">Hi Rik,</span></tt><span style="font-size:10.0pt;font-family:"Courier New",serif"><br>
<br>
<tt>There is no need for such extra logs, just use the script_trace() function:</tt><br>
<tt> <a href="http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43">
http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43</a></tt><br>
<br>
<br>
<tt>Now, there must be something wrong with that ACK (it is a hop by hop ACK to a negative reply), if it is not caught by t_check_trans(). Could you run this function in debug 4, so we can see what is going on ?</tt><br>
<br>
<tt>Best regards,</tt><br>
<br>
</span><span style="mso-fareast-language:NL"><o:p></o:p></span></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre> OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre> <a href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>OpenSIPS Summit May 2017 Amsterdam<o:p></o:p></pre>
<pre> <a href="http://www.opensips.org/events/Summit-2017Amsterdam.html">http://www.opensips.org/events/Summit-2017Amsterdam.html</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 05/15/2017 10:59 AM, Rik Broers wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">Hi Bogdan,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">Put some logs in my script, and the ACK is hitting exit/red highlighted part. In this part of the sequential route.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> } else {</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> if ( is_method("ACK") ) {</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> if ( t_check_trans() ) {</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> # non loose-route, but stateful ACK; must be an ACK after
</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> # a 487 or e.g. 404 from upstream server</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> t_relay();</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> exit;</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> } else {</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:red"> xlog("L_WARN", "[$ci] ACK without matching transaction");</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> # ignore and discard</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> exit;</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> }</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas;color:windowtext"> }</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">So apparently it can’t find a transaction. Should the ACK be forwarded all the way to the right endpoint? As that leg has already been acked by opensips directly according to the trace.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;line-height:12.75pt"><span style="mso-fareast-language:NL">Met vriendelijke groet,<br>
<br>
</span><b><span style="color:#84C41B;mso-fareast-language:NL">Rik Broers</span></b><span style="mso-fareast-language:NL"><br>
</span><span style="font-size:9.0pt;color:#212735;mso-fareast-language:NL">Voice Engineer</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:NL"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-GB" style="color:windowtext;mso-fareast-language:NL">Van:</span></b><span lang="EN-GB" style="color:windowtext;mso-fareast-language:NL"> Bogdan-Andrei Iancu [<a href="mailto:bogdan@opensips.org">mailto:bogdan@opensips.org</a>]
<br>
<b>Verzonden:</b> 12 May 2017 18:28<br>
<b>Aan:</b> <a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>; Rik Broers
<a href="mailto:RBroers@motto.nl"><RBroers@motto.nl></a><br>
<b>Onderwerp:</b> Re: [OpenSIPS-Users] Cancel ACK routing</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><tt><span lang="EN-GB" style="font-size:10.0pt">Hi Rik,</span></tt><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New",serif"><br>
<br>
<tt>So, without the TH part, it seems that the incoming ACK (from caller side) is not recognized and the 487 is retransmitted. How do you handle that ACK? are you sure it hits a t_relay() or t_newtran() function ?</tt><br>
<br>
<tt>Regards,</tt><br>
<br>
<br>
</span><o:p></o:p></p>
<pre><span lang="EN-GB">Bogdan-Andrei Iancu</span><o:p></o:p></pre>
<pre><span lang="EN-GB"> OpenSIPS Founder and Developer</span><o:p></o:p></pre>
<pre><span lang="EN-GB"> </span><a href="http://www.opensips-solutions.com"><span lang="EN-GB">http://www.opensips-solutions.com</span></a><o:p></o:p></pre>
<pre><span lang="EN-GB"> </span><o:p></o:p></pre>
<pre><span lang="EN-GB">OpenSIPS Summit May 2017 Amsterdam</span><o:p></o:p></pre>
<pre><span lang="EN-GB"> </span><a href="http://www.opensips.org/events/Summit-2017Amsterdam.html"><span lang="EN-GB">http://www.opensips.org/events/Summit-2017Amsterdam.html</span></a><o:p></o:p></pre>
<div>
<p class="MsoNormal"><span lang="EN-GB">On 05/12/2017 12:28 PM, Rik Broers wrote:</span><o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-GB">Hi!</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I’m building a proxy between two public endpoints, so no nat involved luckily.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I’ve got everything to work except for the CANCEL. It breaks the same if I start the call from the other endpoint.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Attached a visual of the traffic flow. Not attached, at link here:
</span><a href="https://www.dropbox.com/s/m45wwjlt4cmhy7k/Captuasdre.JPG?dl=0"><span lang="EN-GB">https://www.dropbox.com/s/m45wwjlt4cmhy7k/Captuasdre.JPG?dl=0</span></a><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Now I would like to fix the final 487 ACK bouncing, and it seems to me that opensips should just accept the ACK from the 487 and end the transaction.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">The script is based on the standard one after install with some routing logic. So the ACK is handled in the sequential path with this comment:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"># non loose-route, but stateful ACK; must be an ACK after
</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"># a 487 or e.g. 404 from upstream server</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I also tried to fix/workaround it with the topology_hiding module, but as soon as the ACK (packet 12 in the diagram) is sent back opensips crashes with
<br>
CRITICAL:core:free_lump: called on a not free-able lump:0x7f9ba2cc9d68 flags=2<br>
and no 487 is being sent to the left endpoint.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">version: opensips 2.3.0-beta (x86_64/linux)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">git revision: 2f688b5</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-GB">Crash dump with dbg on for the topo hiding scenario available on request, rather not share it on the list
</span><span lang="EN-GB" style="font-family:Wingdings">J</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Did I hit an opensips bug or am I missing something?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="mso-fareast-language:NL">Met vriendelijke groet,<br>
<br>
</span><b><span style="color:#84C41B;mso-fareast-language:NL">Rik Broers</span></b><span style="mso-fareast-language:NL"><br>
</span><span style="font-size:9.0pt;color:#212735;mso-fareast-language:NL">Voice Engineer</span><span style="mso-fareast-language:NL"><br>
<br>
</span><a href="mailto:rbroers@motto.nl"><span style="font-size:9.0pt">rbroers@motto.nl</span></a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:NL"><br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<pre><span lang="EN-GB">_______________________________________________</span><o:p></o:p></pre>
<pre><span lang="EN-GB">Users mailing list</span><o:p></o:p></pre>
<pre><a href="mailto:Users@lists.opensips.org"><span lang="EN-GB">Users@lists.opensips.org</span></a><o:p></o:p></pre>
<pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"><span lang="EN-GB">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</span></a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:NL"> </span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span style="mso-fareast-language:NL"><o:p> </o:p></span></p>
</div>
</body>
</html>