<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=koi8-r">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
-->
</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=RU link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span lang=EN-US>Hello! I have some trouble with nat
handling.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I have such scheme:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>uac1---opensips---(NAT)---uac2<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I call to UAC2 and signaling establishment
is ok. Whenš UAC2 sends BYEš opensips translates 200OK (received from UAC1) to
the wrong port. <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>BYE generated by UAC2 has such via header:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>“Via: SIP/2.0/UDP
192.168.18.137:5060;branch=z9hG4bK8b517b11a415”<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>and the BYE comes from U 2013/04/04
17:21:50.287792 1.1.1.1:59292 -> 2.2.2.2:5068<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Where 1.1.1.1 – nat, 2.2.2.2 -
opensips<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Opensips adds one more via header to the
BYE:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Via: SIP/2.0/UDP
2.2.2.2;branch=z9hG4bK7f45.debc1592.0. <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>and changes first via header by adding
received field:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Via: SIP/2.0/UDP
192.168.18.137:5060;received=1.1.1.1;branch=z9hG4bK8b517b11a415<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>200 OK got from UAC1 opensips tries to send
not to 1.1.1.1:59292 but to 1.1.1.1:5060<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>The question is how can we make opensips to
send 200 OK to 59292 port?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Thank you for any help.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>