[SR-Users] media between 2 clients behind separate NAT

Klaus Darilion klaus.mailinglists at pernau.at
Mon Oct 28 09:37:22 CET 2013



On 25.10.2013 14:19, Vassilis Radis wrote:
> Hello,
> When I have 2 clients using a kamailio proxy, and both of the clients
> are behind their own NAT, then my only options for relaying media
> between them is using some kind of intermediate rtp proxy or STUN etc?

STUN is just a method for a client to find out if it is behind NAT or 
not. Using this information also for NAT traversal is error prone and 
thus deprecated.

> Proxy is on a public IP and essentially I am asking if I can avoid
> setting up stuff to proxy the media or mess with STUN, by using some
> kind of request response mangling. i.e. have both clients's sdp
> address/port changed to their public facing ip/port and then each client
> can send an initial packet to the other end. Those initial packets will
> be blocked by the other receiver router, but they will open a nat hole
> so that next package from the peer will pass through. Is that feasible?

Sometimes this may work, but there too many different NAT and firewall 
types so this will not work in general. There are 2 approaches:

1. ICE: If the clients do support ICE, they can do the NAT traversal 
them self and you will get around 90% (just a guess) done by using ICE.

2. Relaying. Either use something integrated into Kamilio (rtpproxy, 
mediaproxy-ng) or a dedicated stand-alone TURN server (must be supported 
by the clients).

Thus, if you want to have 100% working media, with various types of NATs 
and SIP clients, you must use a media relay. Either use ICE and an 
optional media relay (to offload your relay) or just enforce a relay for 
every call.

regards
Klaus



More information about the sr-users mailing list