login | register
Sat 19 of Jul, 2008 [23:27 UTC]

voip-info.org

Discuss [1] History

Asterisk SIP srvlookup

Created by: oej,Last modification on Fri 13 of Apr, 2007 [19:44 UTC] by joro.mitev

Asterisk SIP option srvlookup (sip.conf)


Synopsis:

 srvlookup = yes | no

Default

 srvlookup=no

If srvlookup is turned on, Asterisk supports DNS SRV lookups partially. Currently, Asterisk only reads the first SRV entry without bothering with priorities and weights. This option is NOT turned on by default!!!
A SRV lookup is only performed when the FQDN hostname is specified in the Dial() command; if instead in Dial() you specify a peername (as defined in sip.conf with host=...) a SRV lookup will not be performed!

  • Note I am not sure the above statement is still true. See below.


Note


Enabling this option can break things in unexpected ways.

Testing on 1.2.14 If you have any "register =>" statements in sip.conf, then a SRV lookup is also performed, even if you explicitly specify both the IP address and port number.

Also, there appears to be a bug in the hints code that causes spurious DNS lookups. This may not be related to srvlookup itself, but more of a DNS issue with asterisk SIP channel.
http://bugs.digium.com/view.php?id=9057

Note that you need to have a very robust DNS service (preferably local instance of caching resolver/BIND) to accommodate all these (mostly spurious) SRV lookups, because if asterisk cannot resolve DNS requests, then the SIP service completely grinds to a halt, and subsequent registraion attempts fail, as currently asterisk's DNS lookups are blocking. (As noted in dns.h)

It seems to affect us when we have more than about 8 register => statements in sip.conf, as all of these dns requests have to time out, by which time the SIP keepalives have timed out, and then another registration attempt begins resulting in a continuous state of clients being unable to register (This is worse if you have qualify= set) for SIP handset registration entries, as asterisk sends out the qualify packets, but is then unable to process the incoming responses, and so it marks the SIP peer as UNREACHABLE.)


Attention

This option is not turned on by default, I spend 3 days in researching for solution for this error:
   ttechgroup*CLI> 
   Apr 13 22:03:15 NOTICE[2553]: chan_sip.c:5473 sip_reg_timeout:    — Registration for '02490XXXX@nexcom.bg' timed out, trying again (Attempt #1)
   Apr 13 22:03:35 NOTICE[2553]: chan_sip.c:5473 sip_reg_timeout:    — Registration for '02490XXXX@nexcom.bg' timed out, trying again (Attempt #2)
   ttechgroup*CLI> 

When I added
   [general]
   srvlookup=yes 

to my sip.conf, the problem was solved

Comments

Comments Filter
222

333SIP Stops working when internet goes down

by bromont, Tuesday 25 of September, 2007 [13:59:55 UTC]

Ok, well I've noticed that SIP stops working when my internet connection goes down. Basically I lose all external SIP peers (of course) but also my internal peers which still can access my DNS server. I lose SIP registration even when setting internal peers to register via IP address. I think I've narrowed it down to setting srvlookup=no in sip.conf as per the above explanation.