[asterisk-dev] SDP Manger feature

Matt Fredrickson creslin at digium.com
Wed Nov 2 09:27:44 CDT 2016


On Tue, Nov 1, 2016 at 10:00 AM, Canuck . <canuck15 at hotmail.com> wrote:
> Has there been any discussions of adding an SDP mangler to Asterisk? One
> possible application I can think of is allowing directmedia to peers that
> are behind NAT. It's probably more difficult than just SDP mangling but that
> is probably a good start. I am sure it would have other uses as well.
>
> Essentially, I am look for an equivalent to the SDP mangler available for
> Kamailio without having to install Kamailio and integrate it with Asterisk
> just for that feature.
>
> http://www.kamailio.org/docs/modules/4.1.x/modules/mangler.html
>
> For directmedia use, it would basically use the same values as
> nat=force_rport, comedia does. So it would replace the SDP port and IP with
> those values if it detects a private IP address.
>
> Before I start experimenting with the Kamailio module, am I on the right
> track with this?  How feasable is this as a new asterisk feature?

If your purpose is for providing address rewriting for purposes of NAT
(on pre-mapped and opened port ranges) you can already do this in
pjsip.conf on the transport object:

[transport-udp-nat]
type=transport
protocol=udp
bind=0.0.0.0
local_net=192.0.2.0/24
external_media_address=203.0.113.1
external_signaling_address=203.0.113.1

You only need to set your localnet to a proper internal value, and set
your external_* addresses to whatever your public IP is set to.

Hope that helps!

-- 
Matthew Fredrickson
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA



More information about the asterisk-dev mailing list