<div dir="ltr">Hello Rodrigo,<div><br></div><div>Maybe the function fix_nated_sdp, from nathelper module, would help.</div><div><br></div><div><div>1.5.2.  fix_nated_sdp(flags [, ip_address])</div><div><br></div><div>Alters the SDP information in orer to facilitate NAT traversal. What changes to be performed may be controled via the “flags” paramter.</div><div><br></div><div>Meaning of the parameters is as follows:</div><div><br></div><div>flags - the value may be a bitwise OR of the following flags:</div><div>0x01 - adds “a=direction:active” SDP line;<br></div><div>0x02 - rewrite media IP address (c=) with source address of the message or the provided IP address (the provide IP address take precedence over the source address).<br></div><div>0x04 - adds “a=nortpproxy:yes” SDP line;<br></div><div>0x08 - rewrite IP from origin description (o=) with source address of the message or the provided IP address (the provide IP address take precedence over the source address).<br></div><div><br></div><div>ip_address - IP to be used for rewriting SDP. If not specified, the received signalling IP will be used. The parameter allows pseudo-variables usage. NOTE: For the IP to be used, you need to use 0x02 or 0x08 flags, otherwise it will have no effect.</div><div><br></div><div>This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.</div></div><div><br></div><div>Example:</div><div><div>if (search(&quot;User-Agent: Cisco ATA.*&quot;) {fix_nated_sdp(&quot;3&quot;);};</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-30 14:57 GMT-03:00 Rodrigo Pimenta Carvalho <span dir="ltr">&lt;<a href="mailto:pimenta@inatel.br" target="_blank">pimenta@inatel.br</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi.</p>
<p><br>
</p>
<p>I have a case when a peer answering a call (INVITE) is behind a NAT.</p>
<p>So, in its SIP OK message I would like to see the SDP containing a valid IP and media Port valid to receive audio from the caller. That is, the caller need to know a valid IP and Port where he/she can send his/her audio packets.</p>
<p><br>
</p>
<p>1 - Is it possible to &quot;fix&quot; SDP content for such objective?</p>
<p>2 - <span style="font-family:Calibri,Arial,Helvetica,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,NotoColorEmoji,&#39;Segoe UI Symbol&#39;,&#39;Android Emoji&#39;,EmojiSymbols;font-size:16px">Can OpenSIPS do something for this idea works or must I to use
 something more like a stun server?</span></p>
<p><span style="font-size:12pt">3 - What is the OpenSIPS module that can help me with this task?</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">I guess I will have to fix 2 fiels in SDP:</span></p>
<p><span style="font-size:12pt"></span></p>
<div>    Media Description, name and address (m): audio 55142 RTP/AVP 8 101  ( to fix the port)</div>
<div>    Connection Information (c): IN IP4 192.168.100.156                                  ( to fix the IP)</div>
<br>

<p></p>
<p><span style="font-size:12pt">P.S.: I have already a solution (opensips.cfg) that let SIP messages cross NATs without problems. Only SDP has to be fixed. </span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Any hint will be very helpful!</span></p>
<p><span style="font-size:12pt">Best regards.</span></p><span class="HOEnZb"><font color="#888888">
<p><br>
</p>
<p><br>
</p>
<div>
<div name="divtagdefaultwrapper">
<div><font size="2">
<div>RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200" target="_blank">+55 35 3471 9200</a> RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</font></span></div>
</div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><b>Carlos E. Wagner</b></div><div style="font-family:arial;font-size:small"><font style="font-family:arial,sans-serif;font-size:13px"><font style="font-size:x-small;color:rgb(0,0,0)"><i>Tecnólogo em Telecomunicações, OCP, dCAA</i></font><br><font size="1"><i></i></font><br></font><b><font face="arial, sans-serif" color="#444444">Gnotel Tecnologia</font></b></div><div style="font-family:arial;font-size:small"><b><font color="#000000" face="arial, sans-serif">E-mail:</font></b><font face="arial, sans-serif"> <u><a href="mailto:kaduww@gmail.com" target="_blank">kaduww@gmail.com</a></u></font><br><font color="#000000" style="font-family:arial,sans-serif;font-size:13px"><b>Fone:</b></font><font face="arial, sans-serif"> +55 48 9981-0894</font><br><font color="#000000" style="font-family:arial,sans-serif;font-size:13px"><b>Skype:</b></font><font face="arial, sans-serif"> </font><font face="arial, sans-serif">carlos.e.wagner</font></div></div></div></div></div>
</div>