Jul
03
2017




How to connect Asterisk SIP Clients over Duel Layers of NAT

A common problem with SIP is it’s difficulty handling NAT(especially over multiple layers).  A common symptom is no audio stream.  The Asterisk CLI  shows a successful call connection succeeding followed by an error in /var/log/asterisk/messages:

[Jun 14 17:16:26] WARNING[2967] chan_sip.c: Retransmission timeout reached on transmission 4e2a8586-3a91c1cf-e73f6b64@10.1.10.115 for seqno 2 (Critical Response) — See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6399ms with no response

The SIP phone is registered in this case and configured for NAT.  The phone can is registered and can dial calls on the Asterisk server, but no audio.  As you can see above the call setup is being directed to setup the audio stream to the remote phones internal address.

This can easily be remedied by setting the following global /etc/asterisk/sip.conf options:

externip=x.x.x.x(public facing IP)
localnet=192.168.1.0/255.255.255.0

Reload Asterisk for the changes to take effect.  If you still are having an issue double check the port forwarding rules.  Asterisk SIP clients need at minimum ports 5060 UDP/TCP for SIP and (10,000-20,000 UDP) for RTP(audio stream).  Good Luck!

If you like this article tell Google!!









Written by mattb in: Asterisk,Linux | Tags: , , , , , , ,

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment