<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Did you put the mcontact_avp parameter I asked you to?<br>
      Can you print the value of the register just before save()? Also,
      can you send over some logs for the reply?<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 11/02/2017 12:26 AM, Dragomir
      Haralambiev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADzurOKTrqSZCPnCvs_u7h_dYDfGv_zMsvACZn2QpMWyw1srQw@mail.gmail.com">
      <div dir="ltr">Hi,<br>
        <br>
        I try this but in location table I not see real IP. Problem
        exists.<br>
        <br>
        When make save location $avp(register)=<a
          href="http://sip:55996201@192.27.47.139:5060"
          moz-do-not-send="true">sip:55996201@192.27.47.139:5060</a><br>
        <br>
        <div>opensipsctl ul show <a
            href="mailto:55996201@192.27.47.139" moz-do-not-send="true">55996201@192.27.47.139</a><br>
          <br>
        </div>
        <div>AOR:: 55996201</div>
        <div>        Contact:: <a
            href="http://sip:57996201@192.168.22.201:5060"
            moz-do-not-send="true">sip:57996201@192.168.22.201:5060</a>
          Q=</div>
        <div>        ContactID:: 182005870676967428</div>
        <div>  </div>
        <div>Where is problem?</div>
        <br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2017-11-01 15:08 GMT+02:00 OpenSIPS
          Marketing <span dir="ltr"><<a
              href="mailto:marketing@opensips.org" target="_blank"
              moz-do-not-send="true">marketing@opensips.org</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> <tt>OK, I managed to
                figure out why you get the private IP in the location
                table - that's because you are saving the registration
                in the onreply route, where you no longer have access to
                the fix_nated_contact() value.<br>
                <br>
                To fix your issue, you need to do the following:<br>
                a. specify a mcontact_avp[1] in your script:<br>
                modparam("registrar", "mcontact_avp", "$avp(register)")<br>
                <br>
                b. just after fix_nated_contact() on your REGISTER
                request, store the changed contact in that AVP:<br>
                fix_nated_contact();<br>
                $avp(register) = $ct.fields(uri);<br>
                <br>
                Doing these two changes to your script should store the
                real IP in the location table.<br>
                <br>
                [1]
                <a class="m_5861672758880187697moz-txt-link-freetext"
href="http://www.opensips.org/html/docs/modules/2.4.x/registrar.html#idp5598160"
                  target="_blank" moz-do-not-send="true">http://www.opensips.org/html/<wbr>docs/modules/2.4.x/registrar.<wbr>html#idp5598160</a><br>
                <br>
                Best regards,<br>
              </tt>
              <div>
                <div class="h5"><br>
                  <div class="m_5861672758880187697moz-cite-prefix">On
                    11/01/2017 10:24 AM, Răzvan Crainea wrote:<br>
                  </div>
                  <blockquote type="cite"> <tt>Can you print
                      $ct.fields(uri) instead of $ct?<br>
                      Also, please post the output on <a
                        href="http://pastebin.com" target="_blank"
                        moz-do-not-send="true">pastebin.com</a>.<br>
                      <br>
                      Best regards,<br>
                    </tt>
                    <pre class="m_5861672758880187697moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_5861672758880187697moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">www.opensips-solutions.com</a></pre>
                    <div class="m_5861672758880187697moz-cite-prefix">On
                      10/31/2017 03:47 PM, Răzvan Crainea wrote:<br>
                    </div>
                    <blockquote type="cite"> <tt>Hi, Dragomir!<br>
                        <br>
                        Please post the logs I asked you to.<br>
                        <br>
                        Best regards,<br>
                      </tt>
                      <pre class="m_5861672758880187697moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_5861672758880187697moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">www.opensips-solutions.com</a></pre>
                      <div class="m_5861672758880187697moz-cite-prefix">On
                        10/31/2017 03:45 PM, Sumit Birla wrote:<br>
                      </div>
                      <blockquote type="cite">
                        <div>X-Lite figures out its public IP and uses
                          that in Via: and Contact: headers unless you
                          set ‘Firewall traversal method’ to ‘None’ in
                          the account settings.</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div>
                          <blockquote type="cite">
                            <div>On Oct 31, 2017, at 9:14 AM, Dragomir
                              Haralambiev <<a
                                href="mailto:goup2010@gmail.com"
                                target="_blank" moz-do-not-send="true">goup2010@gmail.com</a>>
                              wrote:</div>
                            <br
                              class="m_5861672758880187697Apple-interchange-newline">
                            <div>
                              <div dir="ltr">When REGISTER received from
                                X-lite all is OK. Here part from
                                REGISTER message:<br>
                                <br>
                                <div>    REGISTER <a
                                    moz-do-not-send="true">sip:OpenSip_IP:Opensips_port;<wbr>transport=UDP</a>
                                  SIP/2.0</div>
                                <div>    Via: SIP/2.0/UDP
                                  219.101.241.150:64726;branch=<wbr>z9hG4bK-524287-1---<wbr>39ee8718032a1a5a;rport<br>
                                      Contact: <<a
                                    moz-do-not-send="true">sip:577222@219.101.241.150:<wbr>64726;transport=UDP;rinstance=<wbr>d6122d9250e9d0bd</a>><br>
                                  <br>
                                  Here  "Via" contains real IP (this is
                                  Route IP).<br>
                                  <br>
                                  When REGISTER received from Yealink
                                  VoIP phone I have problem. Here part
                                  from REGISTER message:<br>
                                  <br>
                                </div>
                                <div>
                                  <div>    REGISTER <a
                                      moz-do-not-send="true">sip:OpenSip_IP:Opensips_port</a> <wbr>SIP/2.0</div>
                                  <div>    Via: SIP/2.0/UDP
                                    192.168.2.207:5062;branch=<wbr>z9hG4bK77238423<br>
                                        Contact: <<a
                                      href="http://sip:55896207@192.168.2.207:5062/"
                                      target="_blank"
                                      moz-do-not-send="true">sip:55896207@192.168.2.207:<wbr>5062</a>><br>
                                    <br>
                                    Here  "Via" contains not real IP
                                    (this is Yealink IP).<br>
                                    <br>
                                    What I do ?</div>
                                </div>
                                 </div>
                              <div class="gmail_extra"><br>
                                <div class="gmail_quote">2017-10-31
                                  14:18 GMT+02:00 Răzvan Crainea <span
                                    dir="ltr"><<a
                                      href="mailto:razvan@opensips.org"
                                      target="_blank"
                                      moz-do-not-send="true">razvan@opensips.org</a>></span>:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div text="#000000"
                                      bgcolor="#FFFFFF"> <tt>So you did
                                        manage to fix your problem?</tt><span><br>
                                        <pre class="m_5861672758880187697m_2339828074249716840moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_5861672758880187697m_2339828074249716840moz-txt-link-abbreviated" href="http://www.opensips-solutions.com/" target="_blank" moz-do-not-send="true">www.opensips-solutions.com</a></pre>
                                      </span>
                                      <div>
                                        <div
                                          class="m_5861672758880187697h5">
                                          <div
                                            class="m_5861672758880187697m_2339828074249716840moz-cite-prefix">On
                                            10/31/2017 02:17 PM,
                                            Dragomir Haralambiev wrote:<br>
                                          </div>
                                          <blockquote type="cite">
                                            <div dir="ltr">Hi,
                                              <div><br>
                                              </div>
                                              <div>Thanks for your
                                                replay.</div>
                                              <div><br>
                                              </div>
                                              <div>I execute
                                                fix_nated_contact()
                                                after
                                                fix_nated_register().<br>
                                                <br>
                                                Here part of my script:</div>
                                              <div>
                                                <div><span style="white-space:pre-wrap">  </span>if
                                                  (isflagset(NAT)) {</div>
                                                <div>                if
(is_method("REGISTER")) {</div>
                                                <div>                   
                                                     
                                                  fix_nated_register();</div>
                                                <div><span style="white-space:pre-wrap">                  </span>setbflag(NAT_BFLAG);
                                                  # nat register</div>
                                                <div>                }</div>
                                                <div><span style="white-space:pre-wrap">          </span>fix_nated_contact();</div>
                                                <div><span style="white-space:pre-wrap">  </span>}</div>
                                              </div>
                                              <div><br>
                                              </div>
                                              <div>In this case
                                                fix_nated_contact() will
                                                be fix contact records
                                                in location table.<br>
                                                <br>
                                              </div>
                                            </div>
                                            <div class="gmail_extra"><br>
                                              <div class="gmail_quote">2017-10-31
                                                14:02 GMT+02:00 Răzvan
                                                Crainea <span dir="ltr"><<a
href="mailto:razvan@opensips.org" target="_blank" moz-do-not-send="true">razvan@opensips.org</a>></span>:<br>
                                                <blockquote
                                                  class="gmail_quote"
                                                  style="margin:0 0 0
                                                  .8ex;border-left:1px
                                                  #ccc
                                                  solid;padding-left:1ex">
                                                  <div text="#000000"
                                                    bgcolor="#FFFFFF"> <tt>Hi,
                                                      Dragomir!<br>
                                                      <br>
fix_nated_register() does not change the contact of the message,
                                                      fix_nated_contact()
                                                      does that.<br>
                                                      Please print the
                                                      Contact header as
                                                      I instructed
                                                      earlier and send
                                                      back the script
                                                      trace. Also,
                                                      please post the
                                                      logs on <a
                                                        href="http://pastebin.com/"
                                                        target="_blank"
moz-do-not-send="true">pastebin.com</a> or something, don't do it
                                                      directly in the
                                                      email.<br>
                                                      <br>
                                                      Best regards,</tt><span>
                                                      <pre class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433moz-txt-link-abbreviated" href="http://www.opensips-solutions.com/" target="_blank" moz-do-not-send="true">www.opensips-solutions.com</a></pre>
                                                    </span><span>
                                                      <div
class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433moz-cite-prefix">On
                                                        10/31/2017 12:40
                                                        AM, Dragomir
                                                        Haralambiev
                                                        wrote:<br>
                                                      </div>
                                                      <blockquote
                                                        type="cite">
                                                        <div dir="ltr">What
                                                          will I do to
                                                          solve this
                                                          problem?</div>
                                                        <div
                                                          class="gmail_extra"><br>
                                                          <div
                                                          class="gmail_quote">2017-10-27
                                                          11:50
                                                          GMT+03:00
                                                          Dragomir
                                                          Haralambiev <span
                                                          dir="ltr"><<a
href="mailto:goup2010@gmail.com" target="_blank" moz-do-not-send="true">goup2010@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">
                                                          <div>Oct 27
                                                          11:47:32 web
                                                          /usr/local/sbin/opensips[30490<wbr>]: <span
style="font-size:12.8px;white-space:nowrap">57995010</span>: REGISTER
                                                          before
                                                          fix_nated_register
                                                          <sip:<span
style="font-size:12.8px;white-space:nowrap">57995010</span>@<a
                                                          href="http://192.168.2.196:5060/"
target="_blank" moz-do-not-send="true">192.168.2.196:50<wbr>60</a>>[1]</div>
                                                          <div>Oct 27
                                                          11:47:32 web
                                                          /usr/local/sbin/opensips[30490<wbr>]: <span
style="font-size:12.8px;white-space:nowrap">57995010</span>: REGISTER
                                                          after
                                                          fix_nated_register
                                                          <sip:<span
style="font-size:12.8px;white-space:nowrap">57995010</span>@<a
                                                          href="http://192.168.2.196:5060/"
target="_blank" moz-do-not-send="true">192.168.2.196:50<wbr>60</a>>[1]</div>
                                                          <div><br>
                                                          </div>
                                                          </div>
                                                          <div
class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433HOEnZb">
                                                          <div
class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433h5">
                                                          <div
                                                          class="gmail_extra"><br>
                                                          <div
                                                          class="gmail_quote">2017-10-27
                                                          10:41
                                                          GMT+03:00
                                                          Răzvan Crainea
                                                          <span
                                                          dir="ltr"><<a
href="mailto:razvan@opensips.org" target="_blank" moz-do-not-send="true">razvan@opensips.org</a>></span>:<br>
                                                          <blockquote
                                                          class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                                          <div
                                                          text="#000000"
bgcolor="#FFFFFF"> <tt>Hi, Dragomir!<br>
                                                          <br>
                                                          Can you also
                                                          print the
                                                          Contact header
                                                          ($ct[1]).<br>
                                                          <br>
                                                          [1] <a
class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433m_1988118695986928569m_-3317261220468934746moz-txt-link-freetext"
href="http://www.opensips.org/Documentation/Script-CoreVar-2-4#toc26"
                                                          target="_blank"
moz-do-not-send="true">http://www.opensips.org/Docume<wbr>ntation/Script-CoreVar-2-4#toc<wbr>26</a><br>
                                                          <br>
                                                          Best regards,<br>
                                                          </tt><span>
                                                          <pre class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433m_1988118695986928569m_-3317261220468934746moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_5861672758880187697m_2339828074249716840m_-6119473667299360433m_1988118695986928569m_-3317261220468934746moz-txt-link-abbreviated" href="http://www.opensips-solutions.com/" target="_blank" moz-do-not-send="true">www.opensips-solutions.com</a>
</pre>
                                                          </span></div>
                                                          </blockquote>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                        </div>
                                                      </blockquote>
                                                    </span></div>
                                                  <br>
______________________________<wbr>_________________<br>
                                                  Users mailing list<br>
                                                  <a
                                                    href="mailto:Users@lists.opensips.org"
                                                    target="_blank"
                                                    moz-do-not-send="true">Users@lists.opensips.org</a><br>
                                                  <a
                                                    href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                                                    rel="noreferrer"
                                                    target="_blank"
                                                    moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
                                                  <br>
                                                </blockquote>
                                              </div>
                                              <br>
                                            </div>
                                            <br>
                                            <fieldset
                                              class="m_5861672758880187697m_2339828074249716840mimeAttachmentHeader"></fieldset>
                                            <br>
                                            <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_5861672758880187697m_2339828074249716840moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_5861672758880187697m_2339828074249716840moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                                          </blockquote>
                                          <br>
                                        </div>
                                      </div>
                                    </div>
                                    <br>
                                    ______________________________<wbr>_________________<br>
                                    Users mailing list<br>
                                    <a
                                      href="mailto:Users@lists.opensips.org"
                                      target="_blank"
                                      moz-do-not-send="true">Users@lists.opensips.org</a><br>
                                    <a
                                      href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                                      rel="noreferrer" target="_blank"
                                      moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
                                    <br>
                                  </blockquote>
                                </div>
                                <br>
                              </div>
                              ______________________________<wbr>_________________<br>
                              Users mailing list<br>
                              <a href="mailto:Users@lists.opensips.org"
                                target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a><br>
                              <a
                                class="m_5861672758880187697moz-txt-link-freetext"
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                                target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
                            </div>
                          </blockquote>
                        </div>
                        <br>
                        <br>
                        <fieldset
                          class="m_5861672758880187697mimeAttachmentHeader"></fieldset>
                        <br>
                        <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_5861672758880187697moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_5861672758880187697moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                      </blockquote>
                      <br>
                      <br>
                      <fieldset
                        class="m_5861672758880187697mimeAttachmentHeader"></fieldset>
                      <br>
                      <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_5861672758880187697moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_5861672758880187697moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                    </blockquote>
                    <br>
                    <br>
                    <fieldset
                      class="m_5861672758880187697mimeAttachmentHeader"></fieldset>
                    <br>
                    <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_5861672758880187697moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_5861672758880187697moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            ______________________________<wbr>_________________<br>
            Users mailing list<br>
            <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
            <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>