<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=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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 bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><pre><span style='color:#1F497D'>Hi,<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am using Resedential.conf file with permission module<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have a problem that when a call behind nat send  a call to voipswitch and voipswitch forward the call to opensips -</span><span style='font-size:11.0pt;font-family:Wingdings;color:#1F497D'>à</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>trunk,<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The 100 trying ,180 ringing and the 200 Ok work fine unless the ACK reply for the 200 ok will be directly forwarded from voipswitch to trunk ,without passing by opensips .<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As I can see in the capture that when opensips send the 200 OK to Voipswitch the <o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&lt;sip:3450966508993881@opensips IP address&gt;;tag=9302846936345048301<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Contact: &lt;sip:966508993881@</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:red'>Trunk IP address instead of opensips IP ADDRESS </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>:5060;user=phone;transport=udp;nat=yes&gt;<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>We try to do some work around as but it didn&#8217;t succeed as  the call ends with forbidden <o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                    if(!(is_method(&quot;INVITE|ACK|CANCEL|BYE|UPDATE|OPTIONS|INFO&quot;))) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         xlog(&quot;L_INFO&quot;, &quot;&gt;&gt;&gt;&gt;&gt; Rejecting method '$rm' from '$fu' to '$ru' - User-Agent: $ua &lt;&lt;&lt;&lt;&lt;\n&quot;);<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         sl_send_reply(&quot;405&quot;,&quot;Method Not Allowed&quot;);<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         exit;<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                    } else {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         if (is_method(&quot;REGISTER&quot;)) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                                             fix_nated_register();<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         } else {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                                             fix_nated_contact();<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         }<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         setflag(5);<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         setbflag(6);<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                    }<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>route[1] {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        if (subst_uri('/(sip:.*);nat=yes/\1/')) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                setbflag(6);<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        }<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        if (isflagset(5)) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                search_append('Contact:.*sip:[^&gt;[:cntrl:]]*', ';nat=yes');<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        }<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>onreply_route[2] {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        search_append('Contact:.*sip:[^&gt;[:cntrl:]]*', ';nat=yes');<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        if (isbflagset(6)) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                fix_nated_contact();<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        };<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                    if (t_check_status(&quot;200&quot;) ) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         if (is_method(&quot;INVITE&quot;)) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                                             if (subst('/^Contact: &lt;sip:([0-9]+)@(.*)$/Contact: &lt;sip:\1@$Ri:$Rp&gt;\r/ig')) {<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                                                                 xlog(&quot;L_INFO&quot;,&quot;-- Contact modified!&quot;);<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                                             };<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                                         }<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Please advice<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards<o:p></o:p></span></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                    <o:p></o:p></span></pre></div></body></html>