<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>if I didn't mixed the order of nodes with their IP addresses,
      then the ACK is havingĀ  the wrong address.</p>
    <p>ACK being a request within dialog, it must have in R-URI the
      address (URI) that was set by the callee, however, in no way the
      IP of the dispatcher. So there is something in the path of sip
      signaling that is breaking the Contact of the 200ok.</p>
    <p>It could be that some node is using mistakenly
      fix_nated_contact() when not being the first hop after NAT router.
      It is anyhow recommended to use set_contact_alias() together with
      handle_ruri_alias() (see default config for v5.1.x on how these
      are used).</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 12.10.18 09:29, Abdulaziz Alghosh
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAP61AuyR23Ua=AqX1E_exaHzO2qVt47xjjgFKkeSG4+WsQbZ2g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div>Greetings,</div>
                <div><br>
                </div>
                <div>in order to upgrade kamailio server from 3.0.3 to
                  5.1.4 version, I am conducting test calls and it is
                  not completelly successful. The main components I have
                  are:</div>
                <div>1- Media Gateway (Asterisk) :
                  192.168.226.133
                </div>
                <div>2- Signalling Gateway (Kamailio 5.1.4)
                  192.168.226.132
                </div>
                <div>3- Global Dispatcher (Kamailio 3.0.3 in front of
                  the Signalling Gateway.) : 192.168.226.130
                </div>
                <div><br>
                </div>
                <div>Both caller and callee have the dispatcher's IP as
                  a proxy and their registration requests is passed to
                  be registered at the Signalling Gateway (Kamailio
                  5.1.4) and saved on the MySQL server. The caller
                  reaches the callee properly, who in its turn answeres
                  the call and sends the OK msg to the caller who gets
                  it. Unfortunately, when the caller sends the ACK for
                  this INVITE to the callee, the ACK does not reach the
                  callee because it is trapped by the dispatcher at the
                  last stage because the uri was dropped and the Route
                  header was used instead. This behaviour is abnormal
                  since as I know the Route header should be converted
                  into a Via header and the uri stays untouchable.</div>
                <div><br>
                </div>
                <div>The ACK was looped into the dispatcher itself .i.e.
                  the dispatcher sent it to itself adding always the via
                  header ""Via: SIP/2.0/UDP 192.168.226.130;branch=0""
                  endlessly.<br>
                </div>
                <div><br>
                </div>
                <div>Once again, here is an example of the ACK before
                  the dispatcher and how the dispatcher forwards the ACK
                  afterwards.</div>
                <div><br>
                </div>
                <div>the supposed path is as following:</div>
                <div>caller --> GDP--> SGW --> MGW--> SGW
                  --> GDP --> callee</div>
                <div><br>
                </div>
                <div>Although the GDP (before the calle after the SGW)
                  received the uri well from SGW inside the ACK as it
                  appears below:</div>
                <div><br>
                </div>
                <div>ACK
<a class="moz-txt-link-freetext" href="sip:yyyyyyyyyyyy@192.168.226.130:5060;rinstance=1608f7c153f40093;transport=UDP">sip:yyyyyyyyyyyy@192.168.226.130:5060;rinstance=1608f7c153f40093;transport=UDP</a>
                  SIP/2.0<br>
                  Record-Route:
                  <a class="moz-txt-link-rfc2396E" href="sip:192.168.226.132;lr=on;ftag=as3b989c5f"><sip:192.168.226.132;lr=on;ftag=as3b989c5f></a><br>
                  Via: SIP/2.0/UDP
                  192.168.226.132;branch=z9hG4bK136f.1e8349c235fff01ee1849f3456f8868a.0<br>
                  Via: SIP/2.0/UDP
                  192.168.226.133:5060;rport=5060;branch=z9hG4bK34871fe9<br>
                  Route:
                  <a class="moz-txt-link-rfc2396E" href="sip:192.168.226.130;lr;ftag=as3b989c5f;did=d5b.87890dc6"><sip:192.168.226.130;lr;ftag=as3b989c5f;did=d5b.87890dc6></a><br>
                  Max-Forwards: 69<br>
                  From: "xxxxxxxxxxxxxx" <<a
                    href="mailto:sip%3Axxxxxxxxxxxx@domain.com"
                    target="_blank" moz-do-not-send="true">sip:xxxxxxxxxxxx@domain.com</a>>;tag=as3b989c5f<br>
                  To: <<a
                    href="http://sip:yyyyyyyyyyyyy@192.168.226.132:5060"
                    target="_blank" moz-do-not-send="true">sip:yyyyyyyyyyyyy@192.168.226.132:5060</a>>;tag=1af2c424<br>
                  Contact: <<a
                    href="http://sip:xxxxxxxxx@192.168.226.133:5060"
                    target="_blank" moz-do-not-send="true">sip:xxxxxxxxx@192.168.226.133:5060</a>><br>
                  Call-ID: <a
                    href="mailto:7ed2ab533d4c43086746d0e620bdff06@domain.com"
                    target="_blank" moz-do-not-send="true">7ed2ab533d4c43086746d0e620bdff06@domain.com</a><br>
                  CSeq: 102 ACK<br>
                  User-Agent: MGW <br>
                  Content-Length: 0</div>
                <div><br>
                </div>
                <div>The global dipstacher (GDP) has used the Route
                  header (which has no R-URI yyyyyyyyy) instead of the
                  uri:</div>
                <div><br>
                </div>
                <div>ACK
                  <a class="moz-txt-link-freetext" href="sip:192.168.226.130;lr;ftag=as3b989c5f;did=d5b.87890dc6">sip:192.168.226.130;lr;ftag=as3b989c5f;did=d5b.87890dc6</a>
                  SIP/2.0<br>
                  Record-Route:
                  <a class="moz-txt-link-rfc2396E" href="sip:192.168.226.132;lr=on;ftag=as3b989c5f"><sip:192.168.226.132;lr=on;ftag=as3b989c5f></a><br>
                  Via: SIP/2.0/UDP 192.168.226.130;branch=0<br>
                  Via: SIP/2.0/UDP
192.168.226.132;rport=5060;branch=z9hG4bK136f.1e8349c235fff01ee1849f3456f8868a.0<br>
                  Via: SIP/2.0/UDP
                  192.168.226.133:5060;rport=5060;branch=z9hG4bK34871fe9<br>
                  Max-Forwards: 68<br>
                  From: "xxxxxxxxxx" <<a
                    href="mailto:sip%3Axxxxxxxxxxx@domain.com"
                    target="_blank" moz-do-not-send="true">sip:xxxxxxxxxxx@domain.com</a>>;tag=as3b989c5f<br>
                  To: <<a
                    href="http://sip:yyyyyyyyy@192.168.226.132:5060"
                    target="_blank" moz-do-not-send="true">sip:yyyyyyyyy@192.168.226.132:5060</a>>;tag=1af2c424<br>
                  Contact: <<a
                    href="http://sip:xxxxxxx@192.168.226.132:5060"
                    target="_blank" moz-do-not-send="true">sip:xxxxxxx@192.168.226.132:5060</a>><br>
                  Call-ID: <a
                    href="mailto:7ed2ab533d4c43086746d0e620bdff06@domain.com"
                    target="_blank" moz-do-not-send="true">7ed2ab533d4c43086746d0e620bdff06@domain.com</a><br>
                  CSeq: 102 ACK<br>
                  User-Agent: MGW<br>
                  Content-Length: 0</div>
                <div><br>
                </div>
                <div>Thanks in advance for your contribution <br>
                </div>
                <div>Abdulaziz<br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<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>
    <br>
    <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 World Conference -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
  </body>
</html>