<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>the CANCEL to be sent is generated locally by tm module from the
      INVITE that was sent on the branch, so the errors is actually
      about a duplicate To header in that INVITE. Check it on the
      network to see if that's the case.<br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 05.05.21 16:25, Ilie Soltanici
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJQ6-U3DAMGXXjnTn8obF2HV12AEz2BO_ri6ph8RKxA-Arijkg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello,<br>
        <div><br>
        </div>
        <div>We are having an issue here where Kamailio is complaining
          about duplicate To header, while in the SIP Packet there is
          just one. See below the log message:</div>
        <div><br>
        </div>
        <div>DEBUG: tm [t_msgbuilder.c:391]: build_local_reparse():
          duplicate To header</div>
        <div>ERROR: tm [t_msgbuilder.c:531]: build_local_reparse():
          cannot build CANCEL request<br>
          ERROR: tm [t_cancel.c:297]: cancel_branch(): attempt to build
          a CANCEL failed<br>
          ERROR: tm [t_fwd.c:1434]: e2e_cancel(): cancel error<br>
        </div>
        <div><br>
        </div>
        <div>And this is the sip message:</div>
        <div><br>
        </div>
        <div>CANCEL <a href="http://sip:123456789@1.2.3.4:5060"
            moz-do-not-send="true">sip:123456789@1.2.3.4:5060</a>
          SIP/2.0<br>
          Via: SIP/2.0/UDP
          192.168.1.1:19373;branch=z9hG4bK-524287-1---7774073fad1a3264;rport<br>
          Max-Forwards: 70<br>
          To: <<a href="http://sip:123456789@1.2.3.4:5060"
            moz-do-not-send="true">sip:123456789@1.2.3.4:5060</a>><br>
          From: "101"<<a href="http://sip:101@1.2.3.4:5060"
            moz-do-not-send="true">sip:101@1.2.3.4:5060</a>>;tag=6f373b66<br>
          Call-ID: hC2O6zx8ZaUJ1di046<br>
          CSeq: 2 CANCEL<br>
          Proxy-Authorization: Digest
username="101",realm="1.2.3.4",nonce="YJKbfWCSmlFTHxdJfKmySydF9L7FzfaqcgyOo4A=",uri="<a
            href="http://sip:123456789@1.2.3.4:5060"
            moz-do-not-send="true">sip:123456789@1.2.3.4:5060</a>",response="2bf2ba8ef2374d6aa8c39d650613077d",algorithm=MD5<br>
          User-Agent: TEST<br>
          Content-Length: 0<br>
        </div>
        <div><br>
        </div>
        <div>version: kamailio 5.5.0 (x86_64/linux) d4c1a1</div>
        <div><br>
        </div>
        <div>The route itself, is like in the standard documentation:</div>
        <div><br>
        </div>
        <div># CANCEL processing<br>
                    if KSR.is_CANCEL() :<br>
                        KSR.info(RANDOM_LOG + 'KSR.is_CANCEL')<br>
                        if KSR.tm.t_check_trans()>0 :<br>
                            self.ksr_route_relay(msg)<br>
                        return 1<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>   def ksr_route_relay(self, msg):<br>
                  if KSR.is_method_in("IBSU") :<br>
                      if KSR.tm.t_is_set("branch_route")<0 :<br>
                          KSR.tm.t_on_branch("ksr_branch_manage")<br>
          <br>
                  if KSR.is_method_in("ISU") :<br>
                      if KSR.tm.t_is_set("onreply_route")<0 :<br>
                          KSR.tm.t_on_reply("ksr_onreply_manage")<br>
          <br>
                  if KSR.is_INVITE() :<br>
                      if KSR.tm.t_is_set("failure_route")<0 :<br>
                          KSR.tm.t_on_failure("ksr_failure_manage")<br>
          <br>
                  if KSR.tm.t_relay()<0 :<br>
                      KSR.sl.sl_reply_error()<br>
          <br>
                  return -255<br>
        </div>
        <div><br>
        </div>
        <div>Thanks</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </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 - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>