<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EstiloDeEmail17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Daniel, <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>For REGISTER you should use fix_nated_register instead of
fix_nated_contact. The Contact header for REGISTER should not be changed. &nbsp;Try
using force_rport before handling the NAT.&nbsp; What really matters for replies is
the Via Header.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Regards, <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Flavio E. Goncalves<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
users-bounces@lists.opensips.org [mailto:users-bounces@lists.opensips.org] <b>Em
nome de </b>Daniel Goepp<br>
<b>En</b></span><b><span lang=PT-BR style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>viada
em:</span></b><span lang=PT-BR style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
Thursday, November 05, 2009 5:11 AM<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> [OpenSIPS-Users] Register response going to wrong port<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Really banging my head here, so any help is much
appreciated.&nbsp; I am doing some interop work on various devices, and one is
causing some problems, and I can't seem to tell why.&nbsp; The problem is that
the 401 is going back to 5060, not the port the device is coming through NAT
from.<br>
<br>
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>
REGISTER sip:<a href="http://vidtel.com:5060">vidtel.com:5060</a> SIP/2.0.<br>
To: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;.<br>
From: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;;tag=868361b7108d.<br>
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>
Call-ID: <a href="mailto:c6fe66a3a272-4a136765ae26@192.168.1.115">c6fe66a3a272-4a136765ae26@192.168.1.115</a>.<br>
CSeq: 27 REGISTER.<br>
User-Agent: AVSR-C3-ME/1.0.1.ME.149.<br>
Via: SIP/2.0/UDP 192.168.1.115:5060;branch=z9hG4bK-828683511-102.<br>
Max-Forwards: 70.<br>
Expires: 3600.<br>
Content-Length: 0.<br>
<br>
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>
SIP/2.0 401 Unauthorized.<br>
To: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;;tag=c97b4d1cb1f3d0da549e06a8d482ef63.7365.<br>
From: &quot;Daniel Goepp&quot; &lt;<a href="mailto:sip%3A2007@vidtel.com">sip:2007@vidtel.com</a>&gt;;tag=868361b7108d.<br>
Call-ID: <a href="mailto:c6fe66a3a272-4a136765ae26@192.168.1.115">c6fe66a3a272-4a136765ae26@192.168.1.115</a>.<br>
CSeq: 27 REGISTER.<br>
Via: SIP/2.0/UDP
192.168.1.115:5060;branch=z9hG4bK-828683511-102;received=76.102.118.209.<br>
WWW-Authenticate: Digest realm=&quot;<a href="http://vidtel.com">vidtel.com</a>&quot;,
nonce=&quot;4af0cca800000047afe210458683fcb29c42c67bbfd52f53&quot;.<br>
Server: OpenSIPS (1.6.0-notls (i386/linux)).<br>
Content-Length: 0.<br>
<br>
I'm fixing contact info in my config:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nat_uac_test(&quot;3&quot;)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
setbflag(6); # Mark as NATed<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (is_method(&quot;REGISTER&quot;)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fix_nated_contact();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
I'm interested in any input on how the destination port of the response is
being figured here.&nbsp; I have several different devices hitting this server
with very similar signaling, coming from behind NAT, that don't have this
problem.<br>
<br>
Thanks<br>
<br>
-dg<o:p></o:p></p>

</div>

</body>

</html>