<div dir="ltr">Dear <span style="font-size:12.8px">Rodrigo,</span><div><span style="font-size:12.8px">The way you have configured NAT handling in your cfg worked for me perfectly thank you for you to the point and wonderful assistance.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards,</span></div><div><span style="font-size:12.8px">Husnain Taseer</span></div><div><span style="font-size:12.8px">VoIP Developer</span></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 5, 2016 at 10:23 PM,  <span dir="ltr">&lt;<a href="mailto:users-request@lists.opensips.org" target="_blank">users-request@lists.opensips.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Users mailing list submissions to<br>
        <a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<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>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:users-request@lists.opensips.org">users-request@lists.opensips.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:users-owner@lists.opensips.org">users-owner@lists.opensips.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Users digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Re: NAT handling for internally generated messages in<br>
      local_route (Rodrigo Pimenta Carvalho)<br>
   2. Re: NAT handling for internally generated messages in<br>
      local_route (Rodrigo Pimenta Carvalho)<br>
   3. How to fix contact info and RTP port in SDP? Is fix_nated_sdp<br>
      function enough? (Rodrigo Pimenta Carvalho)<br>
   4. Re: How to fix contact info and RTP port in SDP? Is<br>
      fix_nated_sdp function enough? (Newlin, Ben)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 5 Feb 2016 18:49:44 +0000<br>
From: Rodrigo Pimenta Carvalho &lt;<a href="mailto:pimenta@inatel.br">pimenta@inatel.br</a>&gt;<br>
Subject: Re: [OpenSIPS-Users] NAT handling for internally generated<br>
        messages in     local_route<br>
To: OpenSIPS users mailling list &lt;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:BY2PR02MB1655FAC5B55C57297C9FE446B5D20@BY2PR02MB1655.namprd02.prod.outlook.com">BY2PR02MB1655FAC5B55C57297C9FE446B5D20@BY2PR02MB1655.namprd02.prod.outlook.com</a>&gt;<br>
<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
In my configuration I have something like this:<br>
<br>
<br>
#### USeR LOCation module<br>
loadmodule &quot;usrloc.so&quot;<br>
modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, &quot;NAT&quot;)<br>
modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,   1)<br>
modparam(&quot;usrloc&quot;, &quot;db_url&quot;, &quot;sqlite:///usr/local/opensips/db/sisc.sqlite&quot;) # CUSTOMIZE ME<br>
<br>
<br>
<br>
<br>
route{<br>
<br>
<br>
        force_rport();<br>
        if (nat_uac_test(&quot;23&quot;)) {<br>
                if (is_method(&quot;REGISTER&quot;)) {<br>
                        fix_nated_register();<br>
                        setbflag(NAT);<br>
                } else {<br>
                        fix_nated_contact();<br>
                        setflag(NAT);<br>
                }<br>
        }<br>
<br>
<br>
<br>
.<br>
<br>
.<br>
<br>
.<br>
<br>
<br>
onreply_route[handle_nat] {<br>
        if (nat_uac_test(&quot;1&quot;))<br>
                fix_nated_contact();<br>
        #if ( isflagset(NAT) )<br>
                #rtpproxy_answer(&quot;ro&quot;);<br>
        xlog(&quot;incoming reply\n&quot;);<br>
}<br>
<br>
<br>
<br>
Hopefully it can give you a direction to follow.<br>
<br>
<br>
RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200">+55 35 3471 9200</a> RAMAL 979<br>
<br>
<br>
________________________________<br>
De: <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> &lt;<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>&gt; em nome de Husnain Taseer &lt;<a href="mailto:husnain.taseer@gmail.com">husnain.taseer@gmail.com</a>&gt;<br>
Enviado: sexta-feira, 5 de fevereiro de 2016 15:06<br>
Para: <a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>
Assunto: [OpenSIPS-Users] NAT handling for internally generated messages in local_route<br>
<br>
Dear Users,<br>
I am facing the same issue as discussed in the below thread few years ago.<br>
<br>
<a href="http://opensips.org/pipermail/users/2009-March/003648.html" rel="noreferrer" target="_blank">http://opensips.org/pipermail/users/2009-March/003648.html</a><br>
<br>
I am setting $DLG_timeout for every call so after this amount of seconds BYE is generated by TM module and sent to both caller and callee. But if callee or caller are behind NAT then the contact IP address (in their respective contact fields in dialog table) is private because of which opensips is sending BYE to their private addresses which is not reaching them and call don&#39;t disconnects. Is there any solution available to handle this issue.<br>
<br>
Regards,<br>
Husnain Taseer<br>
VoIP Developer<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.opensips.org/pipermail/users/attachments/20160205/16a7b91f/attachment-0001.htm" rel="noreferrer" target="_blank">http://lists.opensips.org/pipermail/users/attachments/20160205/16a7b91f/attachment-0001.htm</a>&gt;<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 5 Feb 2016 18:52:29 +0000<br>
From: Rodrigo Pimenta Carvalho &lt;<a href="mailto:pimenta@inatel.br">pimenta@inatel.br</a>&gt;<br>
Subject: Re: [OpenSIPS-Users] NAT handling for internally generated<br>
        messages in     local_route<br>
To: OpenSIPS users mailling list &lt;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:BY2PR02MB1655E1DAD955E6C0AA7439F1B5D20@BY2PR02MB1655.namprd02.prod.outlook.com">BY2PR02MB1655E1DAD955E6C0AA7439F1B5D20@BY2PR02MB1655.namprd02.prod.outlook.com</a>&gt;<br>
<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
I was right now reading about nat traversal.<br>
<br>
I think it will be important for you too: <a href="http://www.opensips.org/html/docs/modules/2.2.x/nat_traversal.html" rel="noreferrer" target="_blank">http://www.opensips.org/html/docs/modules/2.2.x/nat_traversal.html</a><br>
<br>
NAT Traversal Module - OpenSIPS&lt;<a href="http://www.opensips.org/html/docs/modules/2.2.x/nat_traversal.html" rel="noreferrer" target="_blank">http://www.opensips.org/html/docs/modules/2.2.x/nat_traversal.html</a>&gt;<br>
<a href="http://www.opensips.org" rel="noreferrer" target="_blank">www.opensips.org</a><br>
The nat_traversal module implements a very sophisticated keepalive mechanism, that is able to handle the most complex environments and use cases ...<br>
<br>
If can help you keep the NAT mappings valid during calls, until SIP BYE is sent.<br>
<br>
<br>
Best regards.<br>
<br>
<br>
RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200">+55 35 3471 9200</a> RAMAL 979<br>
<br>
<br>
________________________________<br>
De: <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> &lt;<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>&gt; em nome de Husnain Taseer &lt;<a href="mailto:husnain.taseer@gmail.com">husnain.taseer@gmail.com</a>&gt;<br>
Enviado: sexta-feira, 5 de fevereiro de 2016 15:06<br>
Para: <a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>
Assunto: [OpenSIPS-Users] NAT handling for internally generated messages in local_route<br>
<br>
Dear Users,<br>
I am facing the same issue as discussed in the below thread few years ago.<br>
<br>
<a href="http://opensips.org/pipermail/users/2009-March/003648.html" rel="noreferrer" target="_blank">http://opensips.org/pipermail/users/2009-March/003648.html</a><br>
<br>
I am setting $DLG_timeout for every call so after this amount of seconds BYE is generated by TM module and sent to both caller and callee. But if callee or caller are behind NAT then the contact IP address (in their respective contact fields in dialog table) is private because of which opensips is sending BYE to their private addresses which is not reaching them and call don&#39;t disconnects. Is there any solution available to handle this issue.<br>
<br>
Regards,<br>
Husnain Taseer<br>
VoIP Developer<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.opensips.org/pipermail/users/attachments/20160205/62144100/attachment-0001.htm" rel="noreferrer" target="_blank">http://lists.opensips.org/pipermail/users/attachments/20160205/62144100/attachment-0001.htm</a>&gt;<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 5 Feb 2016 19:16:27 +0000<br>
From: Rodrigo Pimenta Carvalho &lt;<a href="mailto:pimenta@inatel.br">pimenta@inatel.br</a>&gt;<br>
Subject: [OpenSIPS-Users] How to fix contact info and RTP port in SDP?<br>
        Is fix_nated_sdp function enough?<br>
To: &quot;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&quot; &lt;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:BY2PR02MB165545A67977151CEF72F86BB5D20@BY2PR02MB1655.namprd02.prod.outlook.com">BY2PR02MB165545A67977151CEF72F86BB5D20@BY2PR02MB1655.namprd02.prod.outlook.com</a>&gt;<br>
<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Dear OpenSIPS-users,<br>
<br>
<br>
Two clients of my OpenSIPS are located behind different NATs and I have just started to search a way to mangles the SDP messages for both of them in a way that will make the parties talk directly with each other (direct media). After reading the proxy documentation (modules NATHELPER, STUN, MEDIAPROXY and NAT_TRAVERSAL) I have found the function fix_nated_sdp.<br>
<br>
<br>
However, it seems that such function replaces the original contact IP, but not the RTP ports.<br>
<br>
So I ask: what is the utility of the function fix_nated_sdp, if it fixes the contact info, but not the port? I mean, how can I fix the SDP in a way that contact info and RTP port will be valid to send media to a peer that is behind a NAT?<br>
<br>
<br>
Any hint will be very very helpful!!<br>
<br>
<br>
Best regards.<br>
<br>
<br>
<br>
RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200">+55 35 3471 9200</a> RAMAL 979<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.opensips.org/pipermail/users/attachments/20160205/31e8cf36/attachment-0001.htm" rel="noreferrer" target="_blank">http://lists.opensips.org/pipermail/users/attachments/20160205/31e8cf36/attachment-0001.htm</a>&gt;<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Fri, 5 Feb 2016 19:23:49 +0000<br>
From: &quot;Newlin, Ben&quot; &lt;<a href="mailto:Ben.Newlin@inin.com">Ben.Newlin@inin.com</a>&gt;<br>
Subject: Re: [OpenSIPS-Users] How to fix contact info and RTP port in<br>
        SDP? Is fix_nated_sdp function enough?<br>
To: OpenSIPS users mailling list &lt;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:26BFFF06-904D-4DB4-9839-E5C8B2F43AAD@inin.com">26BFFF06-904D-4DB4-9839-E5C8B2F43AAD@inin.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Rodrigo,<br>
<br>
What port should the module change it to? Until you receive RTP from the endpoint, there is no way to know what the correct RTP port is. It would require support on the endpoints to detect the RTP source port once RTP has been received. Most clients do not implement this, so direct media in the presence of NAT is not usually possible without other, external protocols like STUN.<br>
<br>
Ben Newlin<br>
<br>
From: &lt;<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>&lt;mailto:<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>&gt;&gt; on behalf of Rodrigo Pimenta Carvalho &lt;<a href="mailto:pimenta@inatel.br">pimenta@inatel.br</a>&lt;mailto:<a href="mailto:pimenta@inatel.br">pimenta@inatel.br</a>&gt;&gt;<br>
Reply-To: OpenSIPS users mailling list &lt;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&lt;mailto:<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;&gt;<br>
Date: Friday, February 5, 2016 at 2:16 PM<br>
To: &quot;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&lt;mailto:<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;&quot; &lt;<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&lt;mailto:<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;&gt;<br>
Subject: [OpenSIPS-Users] How to fix contact info and RTP port in SDP? Is fix_nated_sdp function enough?<br>
<br>
<br>
Dear OpenSIPS-users,<br>
<br>
<br>
Two clients of my OpenSIPS are located behind different NATs and I have just started to search a way to mangles the SDP messages for both of them in a way that will make the parties talk directly with each other (direct media). After reading the proxy documentation (modules NATHELPER, STUN, MEDIAPROXY and NAT_TRAVERSAL) I have found the function fix_nated_sdp.<br>
<br>
<br>
However, it seems that such function replaces the original contact IP, but not the RTP ports.<br>
<br>
So I ask: what is the utility of the function fix_nated_sdp, if it fixes the contact info, but not the port? I mean, how can I fix the SDP in a way that contact info and RTP port will be valid to send media to a peer that is behind a NAT?<br>
<br>
<br>
Any hint will be very very helpful!!<br>
<br>
<br>
Best regards.<br>
<br>
<br>
<br>
RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200">+55 35 3471 9200</a> RAMAL 979<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.opensips.org/pipermail/users/attachments/20160205/e5f61679/attachment.htm" rel="noreferrer" target="_blank">http://lists.opensips.org/pipermail/users/attachments/20160205/e5f61679/attachment.htm</a>&gt;<br>
<br>
------------------------------<br>
<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>
<br>
End of Users Digest, Vol 91, Issue 39<br>
*************************************<br>
</blockquote></div><br></div></div></div>