<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Rodrigo,<br>
      <br>
      After doing the lookup(location), you can do :<br>
          if ( isbflagset("NAT") ) {}<br>
      <br>
      Best 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>

OpenSIPS Summit May 2017 Amsterdam
  <a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2017Amsterdam.html">http://www.opensips.org/events/Summit-2017Amsterdam.html</a>
</pre>
    <div class="moz-cite-prefix">On 04/20/2017 09:37 PM, Rodrigo Pimenta
      Carvalho wrote:<br>
    </div>
    <blockquote
cite="mid:BN6PR02MB27210E0FD0797780026C3FB5B51B0@BN6PR02MB2721.namprd02.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
        dir="ltr">
        <p>Dear OpenSIPS users,</p>
        <p><br>
        </p>
        <p>Every time a SIP UAC registers in my OpenSIPS, if such agent
          is behind a NAT, the location record receives the NAT flag in
          the
          <span>Cflags</span> column. My Opensips configuration file is
          responsible for that.</p>
        <p>For example:</p>
        <p><br>
        </p>
        <div>AOR:: 1000<br>
              Contact:: <a class="moz-txt-link-abbreviated" href="mailto:sip:1000@192.168.21.5:59047;transport=TLS;ob">sip:1000@192.168.21.5:59047;transport=TLS;ob</a> Q=<br>
                  Expires:: 298<br>
                  Callid:: ec88647d89564d9b8cf112cb254d0f04<br>
                  Cseq:: 34066<br>
                  User-agent:: MicroSIP/3.11.0<br>
                  Received:: sip:XXXXXXXXXXXX:59047;transport=TLS<br>
                  State:: CS_SYNC<br>
                  Flags:: 0<br>
                  Cflags:: NAT   <<===============  HERE IS THE
          NAT FLAG.<span style="font-family:
            Calibri,Arial,Helvetica,sans-serif;"><br>
            <br>
            <br>
            Now, if a SIP INVITE arrives in my OpenSIPS, from a UAC that
            is behind a NAT, I need do something like this:<br>
          </span><br>
        </div>
        <span>if (<span>Cflags == NAT</span>) { <br>
        </span>
        <p><span>    fix_nated_sdp("10")</span></p>
        <p><span>};</span></p>
        <p><span><br>
          </span></p>
        <p><span>What is the correct way to investigate if Cflags is
            equals to NAT ? I mean, how to program such check in the
            script file?</span></p>
        <p><span><br>
          </span></p>
        <p><span>Any hint will be very helpful!</span></p>
        <p><span><br>
          </span></p>
        <p><span>Best regards!<br>
          </span></p>
        <p><span></span><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 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>