Rewriting media address in SDP as well as contact IP/port
Is there a way to get FreeSWITCH to rewrite the media address as well as the contact header info coming from connected endpoints? With the proper settings, FS does a great job of taking care of just about any NAT-related issue on the SIP side, but going through the documentation I've been unable to find a way to get it to touch the SDP. Is there a setting to get it to use the same address for media? Thanks, Phil Quesinberry Q Systems Engineering, Inc. Embedded Systems Development and VoIP Business Telephone Hosting Improve your business telephone services and save money (410) 969-8002 http://www.qsystemsengineering.com <http://www.qsystemsengineering.com/>
Are you talking about the inbound SDP from the broken endpoint behind nat that has little to no clue that its behind nat? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH_Wire T: +1.918.420.9266 | F: +1.918.420.9267 | M: +1.918.424.WEST iNUM: +883 5100 1420 9266 UK: +44 20 3298 4900 ISN: 410*543 On Nov 19, 2012, at 8:45 AM, Phil Quesinberry <philq@qsystemsengineering.com> wrote:
Is there a way to get FreeSWITCH to rewrite the media address as well as the contact header info coming from connected endpoints? With the proper settings, FS does a great job of taking care of just about any NAT-related issue on the SIP side, but going through the documentation I’ve been unable to find a way to get it to touch the SDP. Is there a setting to get it to use the same address for media?
Yes, exactly. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... Sent from the freeswitch-users mailing list archive at Nabble.com.
What're you trying to achieve? The FS NAT handling should take care of clients that send the wrong (internal) IP in the SDP. FS will return its public IP in the returned SDP, they then send from their RTP port to the FS port. FS will see the IP/port the packets are arriving from (the external side of their NAT) and auto-adjust to sending packets to there. You'll see a auto-adjusting rtp log message when that happens. That can't happen until they send media though, which can cause a problem during call setup, eg for ringback. FS behind NAT would be slightly different, there are multiple options there including the ext-rtp-ip param. For rewriting packets it's worth bearing in mind that FS is a B2BUA, not a SIP proxy. Rewriting the SDP is possible from the dialplan, but I have no experience in that. http://wiki.freeswitch.org/wiki/Codec_negotiation#Rewriting_SDP -Steve On 19 November 2012 14:45, Phil Quesinberry <philq@qsystemsengineering.com>wrote:
**
Is there a way to get FreeSWITCH to rewrite the media address as well as the contact header info coming from connected endpoints? With the proper settings, FS does a great job of taking care of just about any NAT-related issue on the SIP side, but going through the documentation I’ve been unable to find a way to get it to touch the SDP. Is there a setting to get it to use the same address for media?
Thanks,
*******Phil Quesinberry*
Q Systems Engineering, Inc.
Embedded Systems Development and VoIP Business Telephone Hosting
*******Improve your business telephone services and save money*
(410) 969-8002
*****http://www.qsystemsengineering.com*<http://www.qsystemsengineering.com/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
We're running in bypass media mode with aggressive-nat-detection enabled. FS handles the signaling but passes the internal 10.x.x.x addresses for media along unchanged, even between different sites. Any recommendations for SIP proxies if FS can't do it automatically? Rewriting the SDP from the dialplan might be worth looking into depending upon how it's implemented. Thanks for the info. - Phil -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... Sent from the freeswitch-users mailing list archive at Nabble.com.
We use OpenSIPs as SIP proxy it has all the SDP rewriting and it works great with FreeSWITCH OpenSIPs is a great product On Tue, Nov 20, 2012 at 12:35 PM, PhilQ <philq@qsystemsengineering.com>wrote:
We're running in bypass media mode with aggressive-nat-detection enabled. FS handles the signaling but passes the internal 10.x.x.x addresses for media along unchanged, even between different sites.
Any recommendations for SIP proxies if FS can't do it automatically? Rewriting the SDP from the dialplan might be worth looking into depending upon how it's implemented.
Thanks for the info.
- Phil
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks for the recommendation. I've been looking at OpenSIPS and Kamailio and was sort of leaning toward OpenSIPS myself. I seem to recall someone on the list here (one of the developers, I think) saying that Kamailio had a better network stack and was better for TLS (or something to that effect) but the two projects look very similar. If the person who mentioned that or anyone else would like to weigh-in on this, I'm sure that many would love to hear what they had to say, I know I would! - Phil -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... Sent from the freeswitch-users mailing list archive at Nabble.com.
IIRC freeswitch has never re-written this... In bypass media mode FreeSWITCH can not accurately re-write the SDP for the RTP, it doesn't know what PORT the NAT device is going to expose the RTP port on... NAT devices have a bad habit of translating ports from whatever the host behind them says to something completely different... To handle this, FreeSWITCH adjusts media on the fly to send media back to where it came from.... On 11/20/12 2:35 PM, "PhilQ" <philq@qsystemsengineering.com> wrote:
We're running in bypass media mode with aggressive-nat-detection enabled. FS handles the signaling but passes the internal 10.x.x.x addresses for media along unchanged, even between different sites.
Any recommendations for SIP proxies if FS can't do it automatically? Rewriting the SDP from the dialplan might be worth looking into depending upon how it's implemented.
Thanks for the info.
- Phil
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... s-well-as-contact-IP-port-tp7584712p7584773.html Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ken http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org irc.freenode.net #freeswitch
You can rewrite the SDP to anything you want but that doesn't mean you'll get media. I suggest you do some research on the two main schools for SIP NAT traversal (far end and near end). In a nutshell, far end NAT traversal is implemented by the server. This is the FreeSWITCH default. The SDPs are rewritten to the address of the FreeSWITCH server and passed to the remote endpoint. This causes the media to be relayed at the server between the endpoints. This has the advantage of being universally compatible - regardless of how dumb the endpoint(s) is/are. Disadvantages are many - increased sever load, bandwidth, latency, etc. However, with many endpoints this is the only choice. Near end NAT traversal relies on advances technologies such as STUN, TURN, and ICE to be supported by the client (and the servers to enable them configured and available). TURN actually blurs the lines between these two strategies, as do various hybrid approaches using local proxies, etc but that's for another day. Bypass media is incompatible with NAT unless you're using STUN/TURN/ICE in your clients and even then I'm not sure FreeSWITCH will completely and cleanly handle the various ICE/SIP/SDP interactions. On Tue, Nov 20, 2012 at 3:35 PM, PhilQ <philq@qsystemsengineering.com> wrote:
We're running in bypass media mode with aggressive-nat-detection enabled. FS handles the signaling but passes the internal 10.x.x.x addresses for media along unchanged, even between different sites.
Any recommendations for SIP proxies if FS can't do it automatically? Rewriting the SDP from the dialplan might be worth looking into depending upon how it's implemented.
Thanks for the info.
- Phil
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Kristian Kielhofner
I'm trying to approach the problem from the 'far-end' side if at all possible. So far, in order to get bypass media to work, I've had to take a combination of the two approaches which includes rport on both the server and client-side, configuring endpoints to use a particular port for RTP and then forwarding a range of ports for each endpoint, etc. I'd like to get the server-side of the fence doing as much as possible to minimize the work needed on the client end. And yes... I realize that folks in Hell would really like some ice-water too. There seems to be almost as much art as science involved and despite many years of advanced networking experience I feel like I'm only recently starting to get the big picture when it comes to VoIP... there's a lot going on here. So while I'm not the first to do so, I'd like to express a big thank you to everyone on here who is so willing to help everyone out and of course to the FS developers and other contributors, helping us in our attempts at "avoiding deadlock". :) - Phil -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Rewriting-media-address-in-SDP... Sent from the freeswitch-users mailing list archive at Nabble.com.
On Wed, Nov 21, 2012 at 3:11 PM, PhilQ <philq@qsystemsengineering.com> wrote:
I'm trying to approach the problem from the 'far-end' side if at all possible. So far, in order to get bypass media to work, I've had to take a combination of the two approaches which includes rport on both the server and client-side, configuring endpoints to use a particular port for RTP and then forwarding a range of ports for each endpoint, etc. I'd like to get the server-side of the fence doing as much as possible to minimize the work needed on the client end. And yes... I realize that folks in Hell would really like some ice-water too.
Woah. Sounds like an interesting environment... If you're doing that much work you shouldn't have an issue using the SER family nathelper module to rewrite what you need. -- Kristian Kielhofner
configuring endpoints to use a particular port for RTP and then forwarding a range of ports for each endpoint
Guessing this is how you're working around the fact the external RTP port won't be the same as the internal one through most NAT implementations. Seems an awful lot of work to go to when it'd be easier to configure a client correctly (assuming they support NAT correctly). A lot of work for you to setup and maintain, and that won't scale well. If the clients can't support NAT correctly you could try using the SIP ALG on the NAT router (if available) which should rewrite the RTP IP/port automatically. Usually the advice is to disable that and let FS & the client handle the NAT (because generally it just causes more problems if you're handling the NAT twice). But in the bypass_media case it might help. Does mean you can't use TLS though (since the router can't see inside the encrypted packets), and it'll probably only spot SIP on port 5060. -Steve On 21 November 2012 20:11, PhilQ <philq@qsystemsengineering.com> wrote:
configuring endpoints to use a particular port for RTP and then forwarding a range of ports for each endpoint
participants (7)
-
Brian West
-
Ken Rice
-
Kristian Kielhofner
-
Phil Quesinberry
-
PhilQ
-
Steven Ayre
-
Yiftach Golan