Definition
In a client definitionnat=yes|no|never|route
If a peer is configured with nat=yes, it causes Asterisk to ignore the address information in the SIP and SDP headers from this peer, and reply to the sender's IP address and port. nat=yes enables a form of Symmetric RTP and SIP Comedia mode in Asterisk.
Comedia mode means that Asterisk will ignore the IP and port in the received SDP from the peer and will wait for incoming RTP. This RTP should arrive to the port that Asterisk replied in the "200 OK" SDP. After that, Asterisk already knows where to send its RTP.
This make communication possible with UA's behind NAT which don't solve NAT problem in client side (STUN, ICE, ALG enabled router, etc). This options works properly in conjuntion with qualify=yes option in order to keep open the connection from Asterisk to the peer behind NAT.
If your phone does not support "rport"
nat=never was added around June 29, 2004 to solve a problem where some SIP UAs can't handle the addition of support for "rport" in the header (see RFC3581 ), one of those UAs being the Uniden SIP phone UIP200, for which nat=route was then introduced.It is unfortunate that this "feature" was intermingled with the symmetric NAT option (NAT=yes) on the same parameter, since they are quite different mechanism. A separate parameter to control the RFC3581 behavior
would have been better. 'no' now means "No NAT and/or RFC3581"
See also
- Siproxd: Has the ability to be run as a transparent sip proxy thus not needing any NAT support to be enabled in asterisk.
- Asterisk config sip.conf
- Asterisk sip qualify: The qualify option
- NAT and VOIP
- Asterisk How to connect to FWD: Examples of configurations
- SIP express router: The SIP express router may be used as an outbound proxy and nat helper for clients inside a NAT device.
- Asterisk Avoid SIP NAT Traversal
- ip_nat_sip Problems with this Linux Module
Back to Asterisk SIP channels
Page Changes
How to set the rport parameter
nat issue in sip.conf
nat issue in sip.conf
A useful site on the topic
Scroll down to "SIP and NAT - what is the problem, really?"