When sip is behind a NAT do not forget to specify:
in sip.conf
[general]
nat=yes
externip = X.X.X.X
fromdomain = yourdomain.com
localnet = 192.168.X.0/255.255.255.0
qualify=yes
The host specified by externip can be either a fully qualified domain name (FQDN) or an IP address.
For versions of Asterisk pre v1.2, the hostname associated with externip is only looked up when Asterisk startups up or if a ‘sip reload’ is executed.
You should also add qualify=yes (it wasn’t said here before) if You don’t add this line You won’t be able to do or receive any SIP-call from behind NAT