[Home]

Summary:ASTERISK-12525: SIP registration does never work, in case DNS not available during firstregistration
Reporter:reinerotto (reinerotto)Labels:
Date Opened:2008-08-05 16:22:39Date Closed:2008-12-11 14:24:33.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk_debug_DNS.dbg
( 1) screen_1.jpg
Description:Effekt:
When asterisk is started, and DNS does not completely work in that instant of time, sip registration will never succeed, even when DNS is OK
later on.

On my SuSE-LINUX 10.3, there is both a caching name server (named), and asterisk.
named is started before asterisk.
However, named does not complete its initialization, before asterisk tries to register SIP.
This might be caused by a slow/broken connection establishment to internet via pppoe (DSL).
Then the following message shows up:

WARNING[3523] chan_sip.c:7595 transmit_register: Probably a DNS error for registration to .... trying register again

But even after named works a bit later on, SIP registration never succeeds.
Only restart of asterisk helps then immediately.
So it looks like, that the second and any further registration attempts do not completely start "from scratch".

****** ADDITIONAL INFORMATION ******

As a workaround, I introduced a 30s delay in the /etc/init.d/asterisk script, before starting asterisk. Then no problem.
Comments:By: Mark Michelson (mmichelson) 2008-08-06 13:01:34

Does Asterisk give any indication that it is attempting further registration after the first attempt? Could you print all the console messages that occur in this scenario? I suggest turning the verbose and debug levels up and uploading the console output. Thanks.

By: reinerotto (reinerotto) 2008-08-08 05:04:57

>Does Asterisk give any indication that it is attempting further registration after the first attempt?<
YES. Asterisk prints messages, that it is continously trying to register. But without success.

Attached you find some logs. I did the following:
- DSL-connections disconnected.
- Linux booted, asterisk started automatically from etc/init.d
- About 13:00 DSL-connected


asterisk-sip still trying to register.

By: Russell Bryant (russell) 2008-12-09 15:23:23.000-0600

There is nothing we can do in Asterisk code to fix this.  You can see in the logs that Asterisk is attempt to do a DNS lookup each time it retries the registration.  You see "No such host" messages.  That comes out after a DNS lookup fails.

Since this is an issue that exists outside of the Asterisk code, I'm closing this out.

By: reinerotto (reinerotto) 2008-12-09 15:52:29.000-0600

>You can see in the logs that Asterisk is attempt to do a DNS lookup each time it retries the registration. You see "No such host" messages. That comes out after a DNS lookup fails. <
That is correct. However, your conclusion,
>Since this is an issue that exists outside of the Asterisk code, I'm closing this out.<
is too fast and not necessarily correct. Because the question is, whether asterisk does the retry of the DNS lookup the right way or not. In case, the retry is not "completely from scratch", then simply the retry might be wrong.
Should be easy to reproduce on another system: Disconnect the internet connection, and start asterisk, incl. registration.


By: Russell Bryant (russell) 2008-12-11 14:24:32.000-0600

The code takes the hostname string and does a lookup using the glibc function gethostbyname() every time it retries.  There isn't anything we can do differently here ...