Thanks Carlo, that fixed it!  It was strange, since I have other devices that don&#39;t set rport either, and they don&#39;t have the same problem.<br><br>I had actually tried fix_nated_register and fix_nated_contact, they both had the same results, and I&#39;m not sure I&#39;m exactly clear on the specific difference between then.<br>
<br>-dg<br><br><br>On Thu, Nov 5, 2009 at 2:20 AM, AsteriskGuide &lt;<a href="mailto:flavio@asteriskguide.com">flavio@asteriskguide.com</a>&gt; wrote:<br>&gt;<br>&gt; Hi Daniel,<br>&gt;<br>&gt;  <br>&gt;<br>&gt; For REGISTER you should use fix_nated_register instead of fix_nated_contact. The Contact header for REGISTER should not be changed.  Try using force_rport before handling the NAT.  What really matters for replies is the Via Header.<br>
&gt;<br>&gt;  <br>&gt;<br>&gt; Regards,<br>&gt;<br>&gt;  <br>&gt;<br>&gt; Flavio E. Goncalves<br>&gt;<br>&gt;  <br>&gt;<br>&gt; De: <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> [mailto:<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>] Em nome de Daniel Goepp<br>
&gt; Enviada em: Thursday, November 05, 2009 5:11 AM<br>&gt; Para: <a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>&gt; Assunto: [OpenSIPS-Users] Register response going to wrong port<br>&gt;<br>
&gt;  <br>&gt;<br>&gt; Really banging my head here, so any help is much appreciated.  I am doing some interop work on various devices, and one is causing some problems, and I can&#39;t seem to tell why.  The problem is that the 401 is going back to 5060, not the port the device is coming through NAT from.<br>
&gt;<br>&gt; U <a href="http://76.102.118.209:1296">76.102.118.209:1296</a> -&gt; <a href="http://10.251.27.180:5060">10.251.27.180:5060</a><br>&gt; REGISTER sip:<a href="http://vidtel.com:5060">vidtel.com:5060</a> SIP/2.0.<br>
&gt; To: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;.<br>&gt; From: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;;tag=868361b7108d.<br>
&gt; Contact: &quot;Daniel Goepp&quot; &lt;<a href="http://sip:2007@192.168.1.115:5060">sip:2007@192.168.1.115:5060</a>&gt;.<br>&gt; Call-ID: <a href="mailto:c6fe66a3a272-4a136765ae26@192.168.1.115">c6fe66a3a272-4a136765ae26@192.168.1.115</a>.<br>
&gt; CSeq: 27 REGISTER.<br>&gt; User-Agent: AVSR-C3-ME/1.0.1.ME.149.<br>&gt; Via: SIP/2.0/UDP 192.168.1.115:5060;branch=z9hG4bK-828683511-102.<br>&gt; Max-Forwards: 70.<br>&gt; Expires: 3600.<br>&gt; Content-Length: 0.<br>
&gt;<br>&gt; U <a href="http://10.251.27.180:5060">10.251.27.180:5060</a> -&gt; <a href="http://76.102.118.209:5060">76.102.118.209:5060</a><br>&gt; SIP/2.0 401 Unauthorized.<br>&gt; To: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;;tag=c97b4d1cb1f3d0da549e06a8d482ef63.7365.<br>
&gt; From: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;;tag=868361b7108d.<br>&gt; Call-ID: <a href="mailto:c6fe66a3a272-4a136765ae26@192.168.1.115">c6fe66a3a272-4a136765ae26@192.168.1.115</a>.<br>
&gt; CSeq: 27 REGISTER.<br>&gt; Via: SIP/2.0/UDP 192.168.1.115:5060;branch=z9hG4bK-828683511-102;received=76.102.118.209.<br>&gt; WWW-Authenticate: Digest realm=&quot;<a href="http://vidtel.com">vidtel.com</a>&quot;, nonce=&quot;4af0cca800000047afe210458683fcb29c42c67bbfd52f53&quot;.<br>
&gt; Server: OpenSIPS (1.6.0-notls (i386/linux)).<br>&gt; Content-Length: 0.<br>&gt;<br>&gt; I&#39;m fixing contact info in my config:<br>&gt;<br>&gt;         if (nat_uac_test(&quot;3&quot;)) {<br>&gt;                 setbflag(6); # Mark as NATed<br>
&gt;                 if (is_method(&quot;REGISTER&quot;)) {<br>&gt;                         fix_nated_contact();<br>&gt;                 }<br>&gt;         }<br>&gt;<br>&gt; I&#39;m interested in any input on how the destination port of the response is being figured here.  I have several different devices hitting this server with very similar signaling, coming from behind NAT, that don&#39;t have this problem.<br>
&gt;<br>&gt; Thanks<br>&gt;<br>&gt; -dg<br>&gt;<br>&gt; _______________________________________________<br>&gt; Users mailing list<br>&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br><br>