<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Rodrigo,<br>
      <br>
      I feel there might be a confusion somewhere here. what is behind
      the NAT ? your opensips ? or the end point ?<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 08.01.2016 13:20, Rodrigo Pimenta
      Carvalho wrote:<br>
    </div>
    <blockquote
cite="mid:BY2PR02MB16551C99640AA17C134602B9B5F50@BY2PR02MB1655.namprd02.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
        <p>Hi Bogdan.</p>
        <p><br>
        </p>
        <p>Thank you very much for the hint! I got more another
          explanations here too and I was able to conclude the
          following:</p>
        <p><br>
        </p>
        <p><tt>To be sure the traffic sent out by opensips has the
            public IP and not the local private one, I will set a stun
            server in the softphone behind the NAT. In this case, such
            softphone will send SIP messages (that has Contact header
            field) already considering the public IP. I guess this
            solution will be enough for my case.</tt></p>
        <p><tt><br>
          </tt></p>
        <p><tt>I can't set <tt>advertise_address</tt> and <tt>advertise_port</tt>,
            because my project will have lots of copies, to be installed
            in lots of homes. In every home, there will be a different
            public IP (and another private too).</tt></p>
        <p><br>
        </p>
        <p><tt>Today I will configure a NAT device, put it in my
            network, bind the proxy and sofphone to behind it and
            execute some tests.</tt></p>
        <p><br>
        </p>
        <p><tt>Best regards.</tt></p>
        <p><br>
        </p>
        <p><br>
        </p>
        <div id="Signature">
          <div name="divtagdefaultwrapper"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:; margin:0">
            <div class="BodyFragment"><font size="2">
                <div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
                  Inatel Competence Center<br>
                  Software<br>
                  Ph: +55 35 3471 9200 RAMAL 979<br>
                </div>
              </font></div>
          </div>
        </div>
        <br>
        <br>
        <div style="color: rgb(0, 0, 0);">
          <hr tabindex="-1" style="display:inline-block; width:98%">
          <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
              face="Calibri, sans-serif" color="#000000"><b>De:</b>
              Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org">&lt;bogdan@opensips.org&gt;</a><br>
              <b>Enviado:</b> quinta-feira, 7 de janeiro de 2016 12:43<br>
              <b>Para:</b> OpenSIPS users mailling list; Rodrigo Pimenta
              Carvalho<br>
              <b>Assunto:</b> Re: [OpenSIPS-Users] Is
              fix_nated_contact() useful when proxy and callee is behind
              NAT?</font>
            <div> </div>
          </div>
          <div><tt>Hi Rodrigo,<br>
              <br>
              If opensips is behind NAT, you should not use the nat
              related modules (as the incoming traffic is correct from
              nat perspective, as originating from public network). What
              you need to do is to be sure the traffic sent out by
              opensips has the public IP and not the local private one.
              For this, look at :<br>
                  advertise_address<br>
                  advertise_port<br>
              (<a moz-do-not-send="true" title="Ctrl+Clique ou toque
                para seguir o link" id="LPlnk670445"
                class="moz-txt-link-freetext"
href="http://www.opensips.org/Documentation/Script-CoreParameters-2-1#toc25">http://www.opensips.org/Documentation/Script-CoreParameters-2-1#toc25</a>)
              <div style="margin-bottom: 20px; overflow: auto; width:
                100%;" id="LPBorder_GT_14521855617220.8488133584271775">
                <table style="width: 90%; background-color: rgb(255,
                  255, 255); position: relative; overflow: auto;
                  padding-top: 20px; padding-bottom: 20px; margin-top:
                  20px; border-top: 1px dotted rgb(200, 200, 200);
                  border-bottom: 1px dotted rgb(200, 200, 200);"
                  id="LPContainer_14521855617160.06634622296197401"
                  cellspacing="0">
                  <tbody>
                    <tr style="border-spacing: 0px;" valign="top">
                      <td colspan="1" style="width: 250px; position:
                        relative; display: table-cell; padding-right:
                        20px;"
                        id="ImageCell_14521855617190.7038851542901949">
                        <div style="background-color: rgb(255, 255,
                          255); height: 84px; position: relative;
                          margin: auto; display: table; width: 250px;"
                          id="LPImageContainer_14521855617190.8749885604963141">
                          <a moz-do-not-send="true" target="_blank"
href="http://www.opensips.org/Documentation/Script-CoreParameters-2-1#toc25"
                            style="display: table-cell; text-align:
                            center;"
                            id="LPImageAnchor_14521855617190.31064499400332635"><img
                              moz-do-not-send="true" aria-label="Imagem
                              de visualização com link selecionado.
                              Toque duas vezes para abrir o link."
                              style="display: inline-block; margin-left:
                              auto; margin-right: auto; max-width:
                              250px; max-height: 250px; height: 84px;
                              width: 250px; border-width: 0px;
                              vertical-align: bottom;"
                              src="http://www.opensips.org/pub/skins/opensips/images/logo2.jpg"
                              height="84" width="250"></a></div>
                      </td>
                      <td colspan="2" style="vertical-align: top;
                        position: relative; padding: 0px; display:
                        table-cell;"
                        id="TextCell_14521855617200.2839225283589162">
                        <div style="top: 0px; color: rgb(0, 120, 215);
                          font-weight: 400; font-size: 21px;
                          font-family:
                          &quot;wf_segoe-ui_light&quot;,&quot;Segoe UI
                          Light&quot;,&quot;Segoe WP
                          Light&quot;,&quot;Segoe UI&quot;,&quot;Segoe
                          WP&quot;,Tahoma,Arial,sans-serif; line-height:
                          21px;"
                          id="LPTitle_14521855617200.10409105474772062">
                          <a moz-do-not-send="true" target="_blank"
href="http://www.opensips.org/Documentation/Script-CoreParameters-2-1#toc25"
                            style="text-decoration: none;"
                            id="LPUrlAnchor_14521855617210.8282630275036953">openSIPS
                            | Documentation / Core Parameters - 2.1</a></div>
                        <div style="margin: 10px 0px 16px; color:
                          rgb(102, 102, 102); font-weight: 400;
                          font-family:
                          &quot;wf_segoe-ui_normal&quot;,&quot;Segoe
                          UI&quot;,&quot;Segoe
                          WP&quot;,Tahoma,Arial,sans-serif; font-size:
                          14px; line-height: 14px;"
                          id="LPMetadata_14521855617210.36052753702374385">
                          <a class="moz-txt-link-abbreviated" href="http://www.opensips.org">www.opensips.org</a></div>
                        <div style="display: block; color: rgb(102, 102,
                          102); font-weight: 400; font-family:
                          &quot;wf_segoe-ui_normal&quot;,&quot;Segoe
                          UI&quot;,&quot;Segoe
                          WP&quot;,Tahoma,Arial,sans-serif; font-size:
                          14px; line-height: 20px; max-height: 100px;
                          overflow: hidden;"
                          id="LPDescription_14521855617210.15241080238277693">
                          This section lists the all the parameters
                          exported by OpenSIPS core for script usage (to
                          be used in opensips.cfg) This document is for
                          OpenSIPS 1.12.x</div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <br>
              <br>
              And be sure you have do port fwd of the SIP port from the
              public address of the NAT to the private IP of your
              opensips.<br>
              <br>
              Regards,<br>
            </tt>
            <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" title="Ctrl+Clique ou toque para seguir o link" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
            <div class="moz-cite-prefix">On 07.01.2016 13:30, Rodrigo
              Pimenta Carvalho wrote:<br>
            </div>
            <blockquote type="cite">
              <div id="divtagdefaultwrapper" style="font-size:12pt;
                color:#000000; background-color:#FFFFFF;
                font-family:Calibri,Arial,Helvetica,sans-serif">
                <p>Hi.</p>
                <p><br>
                </p>
                <p>I have read the entire OpenSIPS' documentation about
                  how to deal with NATs.</p>
                <p>I found ways of dealing with messages from client
                  that is behind NAT. OpenSIPS can fix Contact headers
                  fields and registers, when SIP messages comes from
                  clients and cross NATs before reaching this proxy.</p>
                <p><br>
                </p>
                <p>However, my OpenSIPS and callee is behind NAT, not
                  the client. That is, if a client (caller) calls the
                  callee, how could OpenSIPS with its functions fixes
                  Contact header fields in responses that go from callee
                  to caller, so that the client will be able to send
                  ACKs? It is still obscure to me.</p>
                <p><br>
                </p>
                <p>Any idea?</p>
                <p><br>
                </p>
                <p>Best regards.<br>
                </p>
                <p><br>
                </p>
                <div id="Signature">
                  <div name="divtagdefaultwrapper"
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:; margin:0">
                    <div class="BodyFragment"><font size="2">
                        <div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
                          Inatel Competence Center<br>
                          Software<br>
                          Ph: +55 35 3471 9200 RAMAL 979<br>
                        </div>
                      </font></div>
                  </div>
                </div>
              </div>
              <br>
              <fieldset class="mimeAttachmentHeader"></fieldset>
              <br>
              <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" 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>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>