<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    can you get the SIP trace with all the packets of such dialog
    outside of the NAT router? It will help to see the headers and based
    on that we may be able to provide a solution.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 12/01/16 19:13, Nelson Migliaro
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALcOv0S6+__VNPeCXYdYZi1XFf1BnoQfeRfObHyA78WRwHfpuA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Thank you for your answer.<br>
            <br>
          </div>
          The problem I have is with internet router doing to PAT to SIP
          port.<br>
        </div>
        I am already advertising public IP but unfortunately I cant know
        the public port I am using.<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-12-28 18:17 GMT+01:00 Alexandru
          Covalschi <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:568691@gmail.com" target="_blank">568691@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">AFAIK bye is usually sent to the address
              stored in record_route. Try setting changing
              record_route() to
              record_route_preset("PUBLICIP:5060;nat=yes:)<br>
            </div>
            <div class="gmail_extra"><br>
              <div class="gmail_quote">
                <div>
                  <div class="h5">2015-12-23 16:28 GMT+02:00 Nelson
                    Migliaro <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:eng.migliaro@gmail.com"
                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:eng.migliaro@gmail.com">eng.migliaro@gmail.com</a></a>></span>:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <div dir="ltr"> 
                        <div>
                          <div>
                            <div>
                              <div>
                                <div>
                                  <div>Hello,<br>
                                    <br>
                                  </div>
                                  I am running Kamailio behind NAT.<br>
                                  <br>
                                </div>
                                Kanailio has a private IP and I am
                                relaying NAT to internet router.<br>
                                <br>
                              </div>
                              I am using:<br>
                              <br>
                              - #!define WITH_NAT<br>
                              - listen=udp:PRIVATE-IP:5060 advertise
                              PUBLIC-IP:5060<br>
                              <br>
                            </div>
                            - Patched RTP proxy including the advertise
                            option<br>
                            <br>
                          </div>
                          And everything goes fine. I can make calls and
                          have two way audio.<br>
                          <br>
                        </div>
                        The problem begins when the callee ends the
                        call. BYE is not received in Kamailio (caller)<br>
                        <div>
                          <div><br>
                          </div>
                          <div>I included the public IP using
                            "add_contact_alias" because
                            "set_contact_alias" was not adding the
                            public IP. I included this in in NATDETECT
                            (pre loaded router)<br>
                          </div>
                          <div><br>
                                    if(is_first_hop()) {<br>
                                        xlog("L_NOTICE","Metodo: $rm
                            \n");<br>
                                        xlog("L_NOTICE","is first
                            hop\n");<br>
                                        #set_contact_alias();<br>
                                             if
                            (!add_contact_alias("PUBLIC-IP", "$Rp",
                            "udp")) {<br>
                                             xlog("L_ERR", "Error in
                            aliasing contact $ct\n");<br>
                                                send_reply("400", "Bad
                            request");<br>
                                                        exit;<br>
                                                }<br>
                                    }<br>
                            <br>
                          </div>
                          <div>I think the problem is related to
                            destination that BYE is sent by the vendor.
                            From what I see IP and port is taken from
                            advertised in contact (PUBLIC-IP and 5060).
                            <br>
                            The problem is that internet router changes
                            the source port.<br>
                            <br>
                            Contact:
                            <a class="moz-txt-link-rfc2396E" href="sip:999999999@PRIVATE-IP:5060;alias=PUBLIC-IP~5060~1"><sip:999999999@PRIVATE-IP:5060;alias=PUBLIC-IP~5060~1></a><br>
                            <br>
                          </div>
                          <div>--- Is it correcto to
                            add_contact_alias("PUBLIC-IP", "$Rp", "udp")
                            in order to received new transactions or
                            should I follow a different procedure???<br>
                            <br>
                          </div>
                          <div>Thank you<br>
                            <br>
                            <br>
                          </div>
                          <div><br>
                          </div>
                        </div>
                      </div>
                      <br>
                    </div>
                  </div>
                  _______________________________________________<br>
                  SIP Express Router (SER) and Kamailio (OpenSER) -
                  sr-users mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:sr-users@lists.sip-router.org"
                    target="_blank">sr-users@lists.sip-router.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                    rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                  <br>
                </blockquote>
              </div>
              <span class="HOEnZb"><font color="#888888"><br>
                  <br clear="all">
                  <br>
                  -- <br>
                  <div>
                    <div dir="ltr">Alexandru Covalschi<br>
                      ABRISS-Solutions
                      <div>VoIP engineer and system administrator<br>
                        phone: <a moz-do-not-send="true"
                          href="tel:%2B37367398493" value="+37367398493"
                          target="_blank">+37367398493</a><br>
                        web: <a moz-do-not-send="true"
                          href="http://abs-telecom.com/" target="_blank">http://abs-telecom.com/</a></div>
                    </div>
                  </div>
                </font></span></div>
            <br>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
              rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </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>
<a class="moz-txt-link-freetext" href="http://miconda.eu">http://miconda.eu</a></pre>
  </body>
</html>