I am trying to Setup an Asterisk-Server to accept calls from a client in an other Network. The Server and the client are behind an NAT.
I have already activated STUN on the client, but I am still having problems hearing the other side on both.
After some time, the call get's ended and on Asterisk logs a message about Retransmission Timeout reached and No reply to critival packet received appears.
Best Answer
The simplest, lazy way around this is to set your asterisk box in a 1:1 nat config (often called DMZ host on home routers) and to make sure externip= is set in sip.conf.
The usual troubles with SIP and NAT are:
Assuming you can't 1:1 NAT asterisk, try these:
In the general section of sip.conf:
In the device section for the problem phone: - qualify=5000 (This will cause asterisk to check on the extension every 5 seconds. Adjust as desired, as long as it's shorter than your NAT timeout it should keep the mapping preserved)
On your NAT/firewall - make sure the entire range of UDP ports listed in rtp.conf have forward entries to your asterisk server. Typically this would be something like 10000-12000 (each call can use up to 4 RTP channels, so that setting would handle at least 500 simultaneous calls). And of course 5060 (SIP signalling)
I've found this page helpful in the past: http://asteriskguru.com/tutorials/sip_nat_oneway_or_no_audio_asterisk.html
If you're using one of the asterisk distros with a web-interface (FreePBX, Elastix, Trixbox, PBX-in-a-flash etc) let me know and I can suggest some GUI settings rather than editing conf files directly. I've had the displeasure of debugging issues with most of them...