[OpenSIPS-Users] NAT handling for internally generated messages in local_route

Husnain Taseer husnain.taseer at gmail.com
Fri Feb 5 21:35:33 CET 2016


Dear Rodrigo,
The way you have configured NAT handling in your cfg worked for me
perfectly thank you for you to the point and wonderful assistance.

Regards,
Husnain Taseer
VoIP Developer

On Fri, Feb 5, 2016 at 10:23 PM, <users-request at lists.opensips.org> wrote:

> Send Users mailing list submissions to
>         users at lists.opensips.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> or, via email, send a message with subject or body 'help' to
>         users-request at lists.opensips.org
>
> You can reach the person managing the list at
>         users-owner at lists.opensips.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Users digest..."
>
>
> Today's Topics:
>
>    1. Re: NAT handling for internally generated messages in
>       local_route (Rodrigo Pimenta Carvalho)
>    2. Re: NAT handling for internally generated messages in
>       local_route (Rodrigo Pimenta Carvalho)
>    3. How to fix contact info and RTP port in SDP? Is fix_nated_sdp
>       function enough? (Rodrigo Pimenta Carvalho)
>    4. Re: How to fix contact info and RTP port in SDP? Is
>       fix_nated_sdp function enough? (Newlin, Ben)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 5 Feb 2016 18:49:44 +0000
> From: Rodrigo Pimenta Carvalho <pimenta at inatel.br>
> Subject: Re: [OpenSIPS-Users] NAT handling for internally generated
>         messages in     local_route
> To: OpenSIPS users mailling list <users at lists.opensips.org>
> Message-ID:
>         <
> BY2PR02MB1655FAC5B55C57297C9FE446B5D20 at BY2PR02MB1655.namprd02.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> In my configuration I have something like this:
>
>
> #### USeR LOCation module
> loadmodule "usrloc.so"
> modparam("usrloc", "nat_bflag", "NAT")
> modparam("usrloc", "db_mode",   1)
> modparam("usrloc", "db_url",
> "sqlite:///usr/local/opensips/db/sisc.sqlite") # CUSTOMIZE ME
>
>
>
>
> route{
>
>
>         force_rport();
>         if (nat_uac_test("23")) {
>                 if (is_method("REGISTER")) {
>                         fix_nated_register();
>                         setbflag(NAT);
>                 } else {
>                         fix_nated_contact();
>                         setflag(NAT);
>                 }
>         }
>
>
>
> .
>
> .
>
> .
>
>
> onreply_route[handle_nat] {
>         if (nat_uac_test("1"))
>                 fix_nated_contact();
>         #if ( isflagset(NAT) )
>                 #rtpproxy_answer("ro");
>         xlog("incoming reply\n");
> }
>
>
>
> Hopefully it can give you a direction to follow.
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> ________________________________
> De: users-bounces at lists.opensips.org <users-bounces at lists.opensips.org>
> em nome de Husnain Taseer <husnain.taseer at gmail.com>
> Enviado: sexta-feira, 5 de fevereiro de 2016 15:06
> Para: users at lists.opensips.org
> Assunto: [OpenSIPS-Users] NAT handling for internally generated messages
> in local_route
>
> Dear Users,
> I am facing the same issue as discussed in the below thread few years ago.
>
> http://opensips.org/pipermail/users/2009-March/003648.html
>
> 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't disconnects. Is there any solution available to handle
> this issue.
>
> Regards,
> Husnain Taseer
> VoIP Developer
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.opensips.org/pipermail/users/attachments/20160205/16a7b91f/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 5 Feb 2016 18:52:29 +0000
> From: Rodrigo Pimenta Carvalho <pimenta at inatel.br>
> Subject: Re: [OpenSIPS-Users] NAT handling for internally generated
>         messages in     local_route
> To: OpenSIPS users mailling list <users at lists.opensips.org>
> Message-ID:
>         <
> BY2PR02MB1655E1DAD955E6C0AA7439F1B5D20 at BY2PR02MB1655.namprd02.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I was right now reading about nat traversal.
>
> I think it will be important for you too:
> http://www.opensips.org/html/docs/modules/2.2.x/nat_traversal.html
>
> NAT Traversal Module - OpenSIPS<
> http://www.opensips.org/html/docs/modules/2.2.x/nat_traversal.html>
> www.opensips.org
> The nat_traversal module implements a very sophisticated keepalive
> mechanism, that is able to handle the most complex environments and use
> cases ...
>
> If can help you keep the NAT mappings valid during calls, until SIP BYE is
> sent.
>
>
> Best regards.
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> ________________________________
> De: users-bounces at lists.opensips.org <users-bounces at lists.opensips.org>
> em nome de Husnain Taseer <husnain.taseer at gmail.com>
> Enviado: sexta-feira, 5 de fevereiro de 2016 15:06
> Para: users at lists.opensips.org
> Assunto: [OpenSIPS-Users] NAT handling for internally generated messages
> in local_route
>
> Dear Users,
> I am facing the same issue as discussed in the below thread few years ago.
>
> http://opensips.org/pipermail/users/2009-March/003648.html
>
> 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't disconnects. Is there any solution available to handle
> this issue.
>
> Regards,
> Husnain Taseer
> VoIP Developer
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.opensips.org/pipermail/users/attachments/20160205/62144100/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 3
> Date: Fri, 5 Feb 2016 19:16:27 +0000
> From: Rodrigo Pimenta Carvalho <pimenta at inatel.br>
> Subject: [OpenSIPS-Users] How to fix contact info and RTP port in SDP?
>         Is fix_nated_sdp function enough?
> To: "users at lists.opensips.org" <users at lists.opensips.org>
> Message-ID:
>         <
> BY2PR02MB165545A67977151CEF72F86BB5D20 at BY2PR02MB1655.namprd02.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear OpenSIPS-users,
>
>
> 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.
>
>
> However, it seems that such function replaces the original contact IP, but
> not the RTP ports.
>
> 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?
>
>
> Any hint will be very very helpful!!
>
>
> Best regards.
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.opensips.org/pipermail/users/attachments/20160205/31e8cf36/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 4
> Date: Fri, 5 Feb 2016 19:23:49 +0000
> From: "Newlin, Ben" <Ben.Newlin at inin.com>
> Subject: Re: [OpenSIPS-Users] How to fix contact info and RTP port in
>         SDP? Is fix_nated_sdp function enough?
> To: OpenSIPS users mailling list <users at lists.opensips.org>
> Message-ID: <26BFFF06-904D-4DB4-9839-E5C8B2F43AAD at inin.com>
> Content-Type: text/plain; charset="utf-8"
>
> Rodrigo,
>
> 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.
>
> Ben Newlin
>
> From: <users-bounces at lists.opensips.org<mailto:
> users-bounces at lists.opensips.org>> on behalf of Rodrigo Pimenta Carvalho <
> pimenta at inatel.br<mailto:pimenta at inatel.br>>
> Reply-To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:
> users at lists.opensips.org>>
> Date: Friday, February 5, 2016 at 2:16 PM
> To: "users at lists.opensips.org<mailto:users at lists.opensips.org>" <
> users at lists.opensips.org<mailto:users at lists.opensips.org>>
> Subject: [OpenSIPS-Users] How to fix contact info and RTP port in SDP? Is
> fix_nated_sdp function enough?
>
>
> Dear OpenSIPS-users,
>
>
> 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.
>
>
> However, it seems that such function replaces the original contact IP, but
> not the RTP ports.
>
> 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?
>
>
> Any hint will be very very helpful!!
>
>
> Best regards.
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.opensips.org/pipermail/users/attachments/20160205/e5f61679/attachment.htm
> >
>
> ------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> End of Users Digest, Vol 91, Issue 39
> *************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160205/36f1b8cc/attachment-0001.htm>


More information about the Users mailing list