Nat issues on asterisk 11

Dear Asterisk Gurus,

I would like to ask your help about my installation of asterisk 11.5.0. I installed it fine, it works normally but the if you are behind NAT, it has issues (No audio on both ends).

Before, when I use asterisk 1.8, I apply the configurations below to make it work.

sip.conf

externip=xxx.xxx.xxx.xxx
localnet=192.168.0.0/255.255.0.0

[siptrunk]
nat = yes

When I use asterisk 11, I apply the configurations below. I connect to my voip provider fine but with an “OK” status in sip show peers but when I make a call, i don’t hear any audio.
sip.conf

externip=xxx.xxx.xxx.xxx
localnet=192.168.0.0/255.255.0.0

[siptrunk]
nat = force_rport, comedia

What seems to be the problem?

Regards,
Lui

I solved my problem. I accidentally placed my lines
"externip=xxx.xxx.xxx.xxx
localnet=192.168.0.0/255.255.0.0"

in the bottom part of my sip.conf which makes it included in a separate context. It worked fine when I put them in the general context.

Thanks!
Lui

Thanks so much for sharing this! Your post made me realise this stupid mistake I made! I had included another file with the include statement in sip.conf at the bottom, not realising it just reads it as if it is one big file. I can’t believe I didn’t get any errors in the CLI about this. It must be because all many of the global statements are also valid for the sip contexts. And here I was thinking I had an aggravating NAT problem again…

Note that nat=yes is deprecated in Asterisk 11. If you actually need it (and I think it is overused), you should enable the individual sub-options that you actually need.