<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p><br>
    </p>
    <p>which of the xlog messages were printed?</p>
    <p><br>
    </p>
    <p>Cheers,<br>
      Daniel</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 25.10.19 13:04, Lars Olsson wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:AM6PR0102MB35895C59A4668B60518E6624E0650@AM6PR0102MB3589.eurprd01.prod.exchangelabs.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Hi Daniel,</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Thanks for your reply.</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Used the following script for testing:</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <span>if (is_method("BYE")) {<br>
        </span>
        <div><br>
        </div>
        <div>            xlog("CALLID: $ci\n");<br>
        </div>
        <div>            xlog("CSEQ: $cs\n");<br>
        </div>
        <div><br>
        </div>
        <div>            if (t_cancel_callid("$ci", "$cs", "0")) {<br>
        </div>
        <div>               xlog("Transaction cancelled\n");<br>
        </div>
        <div>            } else {<br>
        </div>
        <div>               xlog("Failed to cancel transaction\n");<br>
        </div>
        <div>            }<br>
        </div>
        <div>            send_reply("200", "OK");<br>
        </div>
        <div>            exit;<br>
        </div>
        <div>}<br>
        </div>
        <span></span><br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        No cancel message was triggered.</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Best Regards,</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Lars</div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>From:</b>
          Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
          <b>Sent:</b> Friday, October 25, 2019 12:32 PM<br>
          <b>To:</b> Kamailio (SER) - Users Mailing List
          <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a>; Lars Olsson
          <a class="moz-txt-link-rfc2396E" href="mailto:lars.olsson@optimobile.se"><lars.olsson@optimobile.se></a><br>
          <b>Subject:</b> Re: [SR-Users] Rewrite BYE to Cancel</font>
        <div> </div>
      </div>
      <div style="background-color:#FFFFFF">
        <p>Hello,</p>
        <p><br>
        </p>
        <p>actually sending BYE for an in-progress call setup (initial
          INVITE routed, but 200ok was not received yet) is valid from
          SIP RFC point of view. So it is not really a broken
          implementation (or, not to put all my money in, it can be, but
          not because of this kind of BYE).</p>
        <p><br>
        </p>
        <p>Practically the BYE can be used to terminate a specific
          branch in a call setup. Think about parallel forking, and many
          branches start sending back 183. The caller UA can send BYE to
          some of the branches and let the others wait to complete.</p>
        <p><br>
        </p>
        <p>The CANCEL has to be used when all the branches should be
          terminated. If there is a single branch, then the BYE
          terminates the call in progress, I am not sure what the callee
          UA should reply to the INVITE.</p>
        <p><br>
        </p>
        <p>On the other hand, in the very few cases when I saw UAs
          sending BYE for early call setup, the other side was rejecting
          it, expecting the cancel.</p>
        <p><br>
        </p>
        <p>I expect it should work with kamailio to send 200ok for such
          BYE and then use t_cancel_callid():</p>
        <p><br>
        </p>
        <p><a
href="https://www.kamailio.org/docs/modules/stable/modules/tmx.html#tmx.f.t_cancel_callid"
            moz-do-not-send="true">https://www.kamailio.org/docs/modules/stable/modules/tmx.html#tmx.f.t_cancel_callid</a></p>
        <p><br>
        </p>
        <div class="x_moz-cite-prefix">The call-id and cseq values
          should be the same in the BYE request.</div>
        <div class="x_moz-cite-prefix"><br>
        </div>
        <div class="x_moz-cite-prefix">Try it and write back if works, I
          am quite curious about...<br>
        </div>
        <div class="x_moz-cite-prefix"><br>
        </div>
        <div class="x_moz-cite-prefix">Cheers,<br>
          Daniel</div>
        <div class="x_moz-cite-prefix"><br>
        </div>
        <div class="x_moz-cite-prefix">On 25.10.19 12:17, Lars Olsson
          wrote:<br>
        </div>
        <blockquote type="cite">
          <style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            Yes it is a BROKEN behavior from the remote system,
            unfortunately it can not be changed.</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt">Besides this issue, the remote system
              works as it should.</span><br>
          </div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt"><br>
            </span></div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt">A custom b2bua can for sure resolve this,
              but perhaps not in a standard way.</span></div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt">Question is if it is possible to resolve
              with Kamailio or if I need to patch SEMS to handle this.</span></div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt"><br>
            </span></div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            Something like this:</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <br>
          </div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            if ("BYE" && dialog not confirmed)</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
                reply back 200 OK</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
                cancel other side of dialog</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <br>
          </div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            As Kamailio can terminate active dialog with sending bye in
            both directions, I thought that it might be possible to
            resolve this as well.  <span style="color:rgb(0,0,0);
              font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt">Hence asking for ideas.</span></div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <br>
          </div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            Best Regards,</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            Lars</div>
          <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            <br>
          </div>
          <hr tabindex="-1" style="display:inline-block; width:98%">
          <div id="x_divRplyFwdMsg" dir="ltr"><font
              style="font-size:11pt" face="Calibri, sans-serif"
              color="#000000"><b>From:</b> sr-users
              <a class="x_moz-txt-link-rfc2396E"
                href="mailto:sr-users-bounces@lists.kamailio.org"
                moz-do-not-send="true">
                <sr-users-bounces@lists.kamailio.org></a> on
              behalf of Steve Davies <a class="x_moz-txt-link-rfc2396E"
                href="mailto:steve-lists-srusers@connection-telecom.com"
                moz-do-not-send="true">
                <steve-lists-srusers@connection-telecom.com></a><br>
              <b>Sent:</b> Friday, October 25, 2019 11:25 AM<br>
              <b>To:</b> Kamailio (SER) - Users Mailing List <a
                class="x_moz-txt-link-rfc2396E"
                href="mailto:sr-users@lists.kamailio.org"
                moz-do-not-send="true">
                <sr-users@lists.kamailio.org></a><br>
              <b>Subject:</b> Re: [SR-Users] Rewrite BYE to Cancel</font>
            <div> </div>
          </div>
          <div>
            <div dir="ltr">Hi,
              <div><br>
              </div>
              <div>I'm normally a bystander.  But on this occasion I've
                got to comment - there are broken SIP implementations,
                and there are BROKEN ones.  Surely there is no hope with
                this one?  If they can't get this right just imagine how
                many more problems it will have.</div>
              <div><br>
              </div>
              <div>Steve</div>
              <div><br>
              </div>
            </div>
            <br>
            <div class="x_x_gmail_quote">
              <div dir="ltr" class="x_x_gmail_attr">On Fri, 25 Oct 2019
                at 11:19, Lars Olsson <<a
                  href="mailto:lars.olsson@optimobile.se"
                  moz-do-not-send="true">lars.olsson@optimobile.se</a>>
                wrote:<br>
              </div>
              <blockquote class="x_x_gmail_quote" style="margin:0px 0px
                0px 0.8ex; border-left:1px solid rgb(204,204,204);
                padding-left:1ex">
                <div dir="ltr">
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    hi,</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    <br>
                  </div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    I have a Kamailio setup infront of a SIP system that
                    do not handle cancellation of a INVITE correctly.</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    The system sends out a BYE request instead of a
                    Cancel request on non connected dialogs.</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    <br>
                  </div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    I am trying to find a way to let Kamailio
                    "translate" the BYE request to a Cancel reqeust for
                    the ongoing INVITE dialog.</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    <br>
                  </div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    Alternative if SEMS b2bua can do it, but currently
                    it replies: "not sip-relaying BYE in not connected
                    dlg", and I have not found any obvious way to
                    rewrite it there.</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    <br>
                  </div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    Any thoughts. I can not change the behavior of the
                    remote system.</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    <br>
                  </div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    Best Regards,</div>
                  <div
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    Lars</div>
                </div>
                _______________________________________________<br>
                Kamailio (SER) - Users Mailing List<br>
                <a href="mailto:sr-users@lists.kamailio.org"
                  target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                <a
                  href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
              </blockquote>
            </div>
          </div>
          <br>
          <fieldset class="x_mimeAttachmentHeader"></fieldset>
          <pre class="x_moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="x_moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a class="x_moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
        </blockquote>
        <pre class="x_moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="x_moz-txt-link-abbreviated" href="http://www.asipto.com" moz-do-not-send="true">www.asipto.com</a>
<a class="x_moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="x_moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- <a class="x_moz-txt-link-freetext" href="https://asipto.com/u/kat" moz-do-not-send="true">https://asipto.com/u/kat</a></pre>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- <a class="moz-txt-link-freetext" href="https://asipto.com/u/kat">https://asipto.com/u/kat</a></pre>
  </body>
</html>