[asterisk-users] Change Media IP in SDP

Max Grobecker max.grobecker at ml.grobecker.info
Tue Dec 6 17:17:51 CST 2016


normally, Asterisk handles RTP IP addresses in SDP correctly, if you have specified
 - that NAT traversal is enabled for all peers (e.g. nat=force_rport,comedia)
 - your local network with "localnet=yournetwork/networkmask" - e.g. "localnet="
 - directmedia, canreinvite, directrtpsetup is deacitivated

In this case, your Asterisk will always stay in the RTP stream and signalling only it's own IP address to other peers
which is configured for the interface which Asterisk uses to reach the peer.

But: If you have only one interface configured on your Asterisk server and an external firewall/router is managing your separated networks, this might not help.
In this case you can use "externip" on a per peer basis in your SIP configuration to specify the IP address Asterisk uses in the SDP.
Maybe, a global configuration of "externip" and "localnet" is all you need to help Asterisk setting the SDP address correctly.
Also, enabling ICE support can help you getting the correct IP address if the remote peer supports it.


Am 07.12.2016 um 00:02 schrieb Harel:
> Hello List,
> I need your help with information going out on my SDP.
> Is it possible to update the Media Address on a per-call basis or a per-channel basis?
> Reason:
> My Asterisk is in a private network and needs to connect to UA on its internal network and also few external networks. One network is public and the others are not public. Between each other the external networks are not routable. Signaling is flowing with no issues because SIP Registers and NAT boxes maintain sessions correctly. The problem is with RTP. After making traces on all possible nodes of this network I clearly found out that the RTP fails because the Asterisk doesn't manage to communicate the correct address to the UAs in the SDP. It will report its internal IP address and the remote UA will try to send its RTP to this address which, of course, will fail miserably. 
> Obviously I can't use externaddr or media_address in sip.conf because it will only be good for one network while the other external networks will fail just the same. Same applies for STUN, it will only be good for the network the STUN requests are being sent from. 
> On all networks I have fix IP addresses on my side and I fully control a professional security box. 
> Asterisk is 13.6.0
> I can't, and don't want to, touch user-side equipment which is normally some kind of voip phone behind a standard home VDSL router.
> Any ideas how can I transmit the correct IP address in SDP to UAs on different networks?
> Many thanks,
> Harel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20161207/cd4ec666/attachment.pgp>

More information about the asterisk-users mailing list