Can't register to sip account with DNS working!

Hi All!

I’m new to the forum and I decided to write here after more than 1 week fighting with this problem.

I have an Asterisk server behind an Firewall (pfSense) and I have 1 SIP account with a local voip provider.

My problem is that Asterisk can’t register to the SIP provider if the DNS is correctly configured at /etc/resolv.conf!

If I comment all the lines on resolv.conf and let the server without any kind of name resolution it works ok!!

Does anyone could give any tip of what should I check to solve it???

Below are the technical details:

Asterisk version (happens with 1.4.42 and 1.8.7.0

sip.conf
nat=yes
externip=
localnet=192.168.10.0/24

[11XXXX]
username=11XXXX
type=peer
secret=*********
qualify=yes
insecure=very
host=200.x.x.x
fromuser=11XXXX
fromdomain=200.x.x.x
dtmfmode=rfc2833
disallow=all
context=from-pstn
canreinvite=no
allow=alaw&ulaw&gsm

11XXXX:********@200.x.x.x:5060/11XXXX

Thank you very much!!!

Well, I could fix my problem but I really didn’t know what is happening with my setup! :neutral_face:

To fix my SIP register problem i did the following steps:

fix /etc/resolv.conf to point to my DNS servers
Remove all fixed entries from /etc/hosts

And the most absurd part, I let my sip.conf in this way:

nat=yes

I removed the localnet and externip entries and now I can register to the provider, make and receive voip calls normally.

Does anyone could explain to me what is happening here??

Thanks!

nat=yes causes Asterisk to respond to the IP level address, not to the Contact header in the application level data. That suggest the service provider hasn’t got their NAT configuration right (nat= is about the remote NAT status, not yours).

Please note that insecure=very is undefined on 1.8 and was almost certainly more insecure than you needed in 1.4 (it equates to port,invite, but most people do not need the port). Also, canreinvite is deprecated and may actually have be removed in 1.8, in favour of direct media.