<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    the caller side builds the ack inccorectly.<br>
    <br>
    The Contact in 200ok for INVITE is:<br>
    <br>
    Contact: <a class="moz-txt-link-rfc2396E" href="sip:10004@10.10.11.232:5060"><sip:10004@10.10.11.232:5060></a>.<br>
    <br>
    But the ACK coming to the server has:<br>
    <br>
    ACK <a class="moz-txt-link-freetext" href="sip:10004@44.44.44.148:5060">sip:10004@44.44.44.148:5060</a> SIP/2.0.<br>
    <br>
    I see that there is proxy between the caller and the server, it
    could be the one doing some wrong mangling of Contact in 200ok.<br>
    <br>
    Do you control the sip proxy that adds the header:<br>
    <br>
    Record-Route: <a class="moz-txt-link-rfc2396E" href="sip:194.213.29.92;lr=on;ftag=as62247c45"><sip:194.213.29.92;lr=on;ftag=as62247c45></a>.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 29/09/15 15:42, Miroslav Dunaev
      wrote:<br>
    </div>
    <blockquote
cite="mid:CADOrUk5mL1GWCtnC4s71_A_u9UsD_Z6DDOxmcOzDYXrqo1Q2ag@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">Hello
          everyone,</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">I have a
          setup where ​kamailio acts as UAC to a SIP provider.</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">Kamailio is
          also configured to pass all incoming calls to an Asterisk.</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">Here is a
          diagram:</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)"><br>
        </div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">Phone<-->Asterisk(10.10.11.232)<--->(PRIV:10.10.11.238)Kamailio(PUB:44.44.44.148)<--->(194.213.29.92)SIP-provider.</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)"><br>
        </div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">When a call
          comes in from the SIP-provider, it gets all the way to the
          phone.</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">But when the
          SIP-provider sends BYE or ACK (during hungup event or
           200OK/SDP asterisk response.).</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">I get this
          errors in my kamailio log:<br>
        </div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">
            <div class="gmail_default"> siputils [checks.c:100]:
              has_totag(): totag found</div>
            <div class="gmail_default"><core>
              [parser/parse_rr.c:49]: do_parse_rr_body():
              parse_rr_body(): No body for record-route</div>
            <div class="gmail_default">rr [loose.c:106]:
              find_first_route(): failed to parse Route HF</div>
            <div class="gmail_default">rr [loose.c:929]: loose_route():
              There is no Route HF</div>
            <div class="gmail_default">tm [t_lookup.c:648]:
              t_lookup_request(): DEBUG: t_lookup_request: no
              transaction found</div>
            <div class="gmail_default">tm [t_lookup.c:1011]:
              t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=0 T
              start=0xffffffffffffffff</div>
            <div class="gmail_default">tm [t_lookup.c:466]:
              t_lookup_request(): t_lookup_request: start searching:
              hash=10101, isACK=1</div>
            <div class="gmail_default">tm [t_lookup.c:424]:
              matching_3261(): DEBUG: RFC3261 transaction matching
              failed</div>
          </div>
        </div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">.....</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">....</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">....</div>
        <div class="gmail_default" style="font-family:'times new
          roman',serif;font-size:large;color:rgb(68,68,68)">
          <div class="gmail_default">siputils [checks.c:100]:
            has_totag(): totag found</div>
          <div class="gmail_default">tm [t_lookup.c:1312]: t_newtran():
            DEBUG: t_newtran: msg id=2 , global msg id=1 , T on
            entrance=0xffffffffffffffff</div>
          <div class="gmail_default">tm [t_lookup.c:466]:
            t_lookup_request(): t_lookup_request: start searching:
            hash=10101, isACK=1</div>
          <div class="gmail_default">tm [t_lookup.c:424]:
            matching_3261(): DEBUG: RFC3261 transaction matching failed</div>
          <div class="gmail_default">tm [t_lookup.c:648]:
            t_lookup_request(): DEBUG: t_lookup_request: no transaction
            found</div>
          <div class="gmail_default">tm [t_funcs.c:279]: t_relay_to():
            SER: forwarding ACK  statelessly</div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">here is the link to: kamailio.cfg,
            ngrep -i any capture, debug_level6 log: <a
              moz-do-not-send="true" href="http://labmir.com/kamailio/"><a class="moz-txt-link-freetext" href="http://labmir.com/kamailio/">http://labmir.com/kamailio/</a></a></div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">Looking at the SIP ACK that comes
            from SIP provider I can see that they use strict routing.</div>
          <div class="gmail_default">(i.e. TO field is set to kamailio's
             public IP that is next hop to them). </div>
          <div class="gmail_default">Maybe I am wrong to judge that its
            not loose routing just because of the TO field.<br>
          </div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">Anyways, because of (failed to
            parse Route HF) error, ACKs and BYEs are forwarded by
            kamailio statelessly, as a result kamailio uses wrong
            interface to forward them (SIP_dailog.txt line:233) and
            therefore asterisk never sees ACKs or BYEs.</div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">How can I make kamailio recognize
            ACKs and BYEs belonging to a dialog and pass them statefully
            through the right interface?</div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">It is worth to mention that I use
            exactly the same config with a different SIP-provider (which
            is peered to our PUB IP not registered through UAC like in
            this case) and it works flawlessly.</div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default">Thank you,</div>
          <div class="gmail_default">Mir</div>
          <div class="gmail_default"><br>
          </div>
          <div class="gmail_default"><br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a></pre>
  </body>
</html>