<p>Bogdan, normally the script uses nat_traversal/client_nat_test("3") . I have tested flags 7 &amp; 15 and NAT was still not detected; also tested all the flags incrementally for nathelper/nat_uac_test("127") and also not detected.  </p>

<p>I'm tending to think it is something out of the norm with the client's mobile network or the client itself and is a special case.</p>

<p>The script below enables the client to register (effectively client_nat_test("7")). Not yet known how this will affect other clients.</p>

<pre><code>route(CHECKTOPVIA);
if (isflagset(RFC1918) || client_nat_test("3")) { 
    force_rport();
    fix_contact();
    if (is_method("REGISTER") ) {
        $avp(received_uri) = $source_uri;
        setbflag(NAT_BFLAG);
    } else {
        setflag(NAT);
    }
    if (!has_totag() &amp;&amp; is_method("REGISTER|INVITE|SUBSCRIBE")) {
        if (proto==UDP) {
            nat_keepalive();
        } else {
            setflag(TCP_PERSISTENT_FLAG);
        }
    }
}
</code></pre>

<p><code><br>
route[CHECKTOPVIA] {<br>
    if (pcre_match("$(hdr(via)[0])",".<em>UDP (172.\b([1][6-9]|[2][0-9]|[3][0-1])\b.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b).</em>") || pcre_match("$(hdr(via)[0])",".<em>UDP (10.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b).</em>") || pcre_match("$(hdr(via)[0])",".<em>UDP (192.\b([0-9]|[1-9][0-9]|1[0-6][0-8])\b.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b.\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b).</em>") ) {<br>
        setflag(RFC1918);<br>
    } <br>
}<br>
</code></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/401#issuecomment-68877883">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciYeXeo5CyKp28kj3Wa7D-M_DsBgnks5ne_QQgaJpZM4DOPEM.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/401#issuecomment-68877883"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>