<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>H<tt>i Rik,<br>
        <br>
        <tt>The<tt>re is no need for <tt>such extra logs, just use <tt>the
                <tt>script_trace<tt>() fu<tt>nction:<br>
                      <tt>   
                        <a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43">http://www.opensips.org/Documentation/Script-CoreFunctions-2-3#toc43</a><br>
                        <br>
                        <br>
                        <tt>Now, there must be something wrong with that
                          ACK (it is a hop by hop <tt>AC<tt>K to a
                              negative reply)<tt>, if it is not <tt><tt>caught</tt><tt>
                                  </tt></tt><tt></tt><tt>b<tt>y t_c<tt>heck_trans().
                                      Could you run this function in
                                      debug 4, so we can see what is
                                      going on ?<br>
                                      <br>
                                      <tt><tt>Best regards,</tt></tt><br>
                                    </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>

OpenSIPS Summit May 2017 Amsterdam
  <a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2017Amsterdam.html">http://www.opensips.org/events/Summit-2017Amsterdam.html</a>
</pre>
    <div class="moz-cite-prefix">On 05/15/2017 10:59 AM, Rik Broers
      wrote:<br>
    </div>
    <blockquote
cite="mid:AM5PR0602MB3331F763849464C010D30B9AD2E10@AM5PR0602MB3331.eurprd06.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <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";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
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;}
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;}
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.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-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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><a moz-do-not-send="true"
            name="_MailEndCompose"><span style="color:windowtext"
              lang="EN-GB">Hi Bogdan,<o:p></o:p></span></a></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB">Put some logs in my
              script, and the ACK is hitting exit/red highlighted part.
              In this part of the sequential route.<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">               
              } else {<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                       
              if ( is_method("ACK") ) {<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                               
              if ( t_check_trans() ) {<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">             
                                        # non loose-route, but stateful
              ACK; must be an ACK after
              <o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                                        #
              a 487 or e.g. 404 from upstream server<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                                       
              t_relay();<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                                      
               exit;<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                               
              } else {<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:red" lang="EN-GB">                                       
              xlog("L_WARN", "[$ci] ACK without matching transaction");<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                                       
              # ignore and discard<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                                       
              exit;<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">  
                                           }<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="font-family:Consolas;color:windowtext" lang="EN-GB">                       
              }<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB">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.<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><o:p> </o:p></span></span></p>
        <div>
          <p class="MsoNormal"
            style="margin-bottom:12.0pt;line-height:12.75pt"><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
                style="mso-fareast-language:NL"></span></span></p>
          <br>
        </div>
        <p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span
              style="color:windowtext" lang="EN-GB"><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"
                  lang="EN-GB">Van:</span></b><span
                style="color:windowtext;mso-fareast-language:NL"
                lang="EN-GB"> Bogdan-Andrei Iancu
                [<a class="moz-txt-link-freetext" href="mailto:bogdan@opensips.org">mailto:bogdan@opensips.org</a>]
                <br>
                <b>Verzonden:</b> 12 May 2017 18:28<br>
                <b>Aan:</b> <a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>; Rik Broers
                <a class="moz-txt-link-rfc2396E" href="mailto:RBroers@motto.nl"><RBroers@motto.nl></a><br>
                <b>Onderwerp:</b> Re: [OpenSIPS-Users] Cancel ACK
                routing<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><tt><span style="font-size:10.0pt"
              lang="EN-GB">Hi Rik,</span></tt><span
            style="font-size:10.0pt;font-family:"Courier New""
            lang="EN-GB"><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>
          </span><span style="mso-fareast-language:NL" lang="EN-GB"><o:p></o:p></span></p>
        <pre><span lang="EN-GB">Bogdan-Andrei Iancu<o:p></o:p></span></pre>
        <pre><span lang="EN-GB">  OpenSIPS Founder and Developer<o:p></o:p></span></pre>
        <pre><span lang="EN-GB">  </span><a moz-do-not-send="true" href="http://www.opensips-solutions.com"><span lang="EN-GB">http://www.opensips-solutions.com</span></a><span lang="EN-GB"><o:p></o:p></span></pre>
        <pre><span lang="EN-GB"><o:p> </o:p></span></pre>
        <pre><span lang="EN-GB">OpenSIPS Summit May 2017 Amsterdam<o:p></o:p></span></pre>
        <pre><span lang="EN-GB">  </span><a moz-do-not-send="true" href="http://www.opensips.org/events/Summit-2017Amsterdam.html"><span lang="EN-GB">http://www.opensips.org/events/Summit-2017Amsterdam.html</span></a><span lang="EN-GB"><o:p></o:p></span></pre>
        <div>
          <p class="MsoNormal"><span lang="EN-GB">On 05/12/2017 12:28
              PM, Rik Broers wrote:<o:p></o:p></span></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span lang="EN-GB">Hi!<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB">I’m building a proxy
              between two public endpoints, so no nat involved luckily.<o:p></o:p></span></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.<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB">Attached a visual of
              the traffic flow. Not attached, at link here:
            </span><a moz-do-not-send="true"
              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><span
              lang="EN-GB"><o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></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.<o:p></o:p></span></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:<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"># non loose-route, but
              stateful ACK; must be an ACK after
              <o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"># a 487 or e.g. 404
              from upstream server<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></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.<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB">version: opensips
              2.3.0-beta (x86_64/linux)<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB">git revision: 2f688b5<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></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 style="font-family:Wingdings" lang="EN-GB">J</span><span
              lang="EN-GB"><o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB">Did I hit an opensips
              bug or am I missing something?<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></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 moz-do-not-send="true"
              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>
              <o:p></o:p></span></p>
          <pre><span lang="EN-GB">_______________________________________________<o:p></o:p></span></pre>
          <pre><span lang="EN-GB">Users mailing list<o:p></o:p></span></pre>
          <pre><a moz-do-not-send="true" href="mailto:Users@lists.opensips.org"><span lang="EN-GB">Users@lists.opensips.org</span></a><span lang="EN-GB"><o:p></o:p></span></pre>
          <pre><a moz-do-not-send="true" 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><span lang="EN-GB"><o:p></o:p></span></pre>
        </blockquote>
        <p class="MsoNormal"><span style="mso-fareast-language:NL"
            lang="EN-GB"><o:p> </o:p></span></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>