Directmedia = nonat - not working

Hi,

I have 2 SIP peers registered to Asterisk, one of them behind NAT. When I make a call between them, Asterisk makes “Remotely bridging” instead of “Locally bridging” even though I have “directmedia = nonat”. As a result I get one-way audio. When I use “directmedia = no” audio is OK.

In some docs they say:

;directmedia=nonat ; An additional option is to allow media path redirection ; (reinvite) but only when the peer where the media is being ; sent is known to not be behind a NAT (as the RTP core can ; determine it based on the apparent IP address the media ; arrives from).
It’s not working. A bug?

Asterisk version: 1.8.5.0-1digium1~squeeze (from packages.asterisk.org)

It could be a bug, but to be sure You should determine the IP-address Asterisk sees of the natted client causing the problem here: If Asterisk knows a client IP of a private IP-range, nonat should work. But if Asterisk sees a public IP I guess, that nonat won’t work no matter if the client itself is “behind” this public IP as the comment says:

You could easily look at this by eenabling a sip debug for the peer affected and have a look at the IP-addresses printed out in the several messages during the callflow.