[Home]

Summary:ASTERISK-18000: If asterisk starts before my Internet connection is up, asterisk cannot register to any of my registrations and reports DNS errors
Reporter:Iordan Iordanov (dancho)Labels:
Date Opened:2011-06-12 21:17:09Date Closed:2011-08-29 16:40:22
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:1.6.2.18 1.8.4 Frequency of
Occurrence
Related
Issues:
must be completed before resolvingASTERISK-18393 Asterisk 1.8.7.0 Blockers
Environment:DD-WRT, OpenWRT, Debian 6 SqueezeAttachments:( 0) asterisk_errors.txt
( 1) bugASTERISK-18000.patch
( 2) dnsmgr_status.txt
( 3) sip_reload_fix.txt
Description:I use Asterisk in a home setting, and frequently, the Asterisk server starts up before my router has had a chance to acquire an IP address from my ISP. Very often after that, it is stuck in an infinite loop trying to register to my VOIP providers and failing to do so. Here is a sample of the messages I get:

[Jun 13 01:52:50] WARNING[1011]: chan_sip.c:12565 transmit_register: Probably a DNS error for registration to someaccount@actionvoip, trying REGISTER again (after 20 seconds)
[Jun 13 01:52:50] NOTICE[1011]: chan_sip.c:12480 sip_reg_timeout:    -- Registration for 'someaccount@actionvoip' timed out, trying again (Attempt #17)
[Jun 13 01:52:50] WARNING[1011]: chan_sip.c:12565 transmit_register: Probably a DNS error for registration to someotheraccount@freephoneline, trying REGISTER again (after 20 seconds)
[Jun 13 01:52:50] NOTICE[1011]: chan_sip.c:12480 sip_reg_timeout:    -- Registration for 'someotheraccount@freephoneline' timed out, trying again (Attempt #17)

At the same time, my Google Talk accounts in jabber.conf is successfully connected:

somehost*CLI> jabber show connections
Jabber Users and their status:
      [gtalkaccount] somedude@gmail.com     - Connected

This used to happen with Asterisk 1.6, and is now confirmed with Asterisk 1.8 as well. I can't remember whether it was an issue in 1.4 anymore, but it's possible. I was hoping it would get caught at some point, but it hasn't so I am trying to let you know about it :).

Here is the way someaccount is defined, in case it's relevant:

[actionvoip]
defaultuser  = someaccount
type         = peer
secret       = somepassword
qualify      = yes
insecure     = port,invite
host         = sip.actionvoip.com
fromdomain   = actionvoip.com
authuser     = someaccount
nat           = yes
canreinvite   = no

Also, here is the registration string:

register =>         someaccount:somepassword@actionvoip/someextension

I am *not* using a hostname as the account name (i.e. I am using actionvoip instead of sip.actionvoip.com). There was some confusion as to which to use in the docs at some point, but from all my reading it seemed it's better if it's not a hostname. Could this be a contributing factor?

The simplest way to resolve this condition, I've found is to issue a single "sip reload" at the asterisk command-line. What happens is that everything magically starts working right away!

somehost*CLI> sip reload
[Jun 13 02:13:06] NOTICE[1011]: chan_sip.c:19842 handle_response_peerpoke: Peer 'freephoneline' is now Reachable. (66ms / 2000ms)
[Jun 13 02:13:07] NOTICE[1011]: chan_sip.c:19842 handle_response_peerpoke: Peer 'actionvoip' is now Reachable. (396ms / 2000ms)
[Jun 13 02:13:07] NOTICE[1011]: chan_sip.c:19842 handle_response_peerpoke: Peer 'voipraider' is now Reachable. (186ms / 2000ms)
[Jun 13 02:13:07] NOTICE[1011]: chan_sip.c:19842 handle_response_peerpoke: Peer 'powervoip' is now Reachable. (211ms / 2000ms)

Note that those other accounts (voipraider and powervoip) were also "unreachable", but I am not registering to them and that's why they didn't show up in the registration failure messages. The point is that this is not a problem just with registration but a general problem with the SIP module.
Comments:By: Leif Madsen (lmadsen) 2011-06-13 13:49:23.009-0500

Do you have dnsmgr enabled?

By: Iordan Iordanov (dancho) 2011-06-13 16:07:25.577-0500

Hi Leif,

Thanks for looking into this for me. I didn't have dnsmgr enabled, and as per your suggestion, I immediately configured it, and reproduced the error. Now, the errors have grown in number, surprisingly so things have changed, but not for the better.

I am attaching the following files. The asterisk errors *after* dnsmgr was configured, the dnsmgr status, and finally, proof that a "sip reload" fixes things immediately.

Many thanks!
Iordan

By: Iordan Iordanov (dancho) 2011-06-16 11:06:10.540-0500

Hi Leif,

I see the status for the bug-report is still "waiting for feedback", and I was wondering - is there more information that you need, can I try anything else for you? I don't want the issue to get marked as "suspended" due to "no response" :D

Thanks!
Iordan



By: Leif Madsen (lmadsen) 2011-06-17 10:09:22.321-0500

Interesting. I've had this issue before too, but I thought it was resolved. Can you test with the latest 1.8 branch to see if it is fixed there? Thanks!

By: Iordan Iordanov (dancho) 2011-07-27 11:53:57.168-0500

Hi Leif,

My apologies for the delayed response, but your system never notified me of your reply, even though I am "Watching" the topic! I only saw the update that there has been a duplicate report of this.

I am using Asterisk on a RT-N16 router running Debian unstable. The latest version available pre-built in Debian unstable is versioned thus by Debian:

1.8.4.4~dfsg-2

I can test this version without recompiling, and recompiling on this machine will take a bit of effort and a long time :). Is this an acceptably knew enough version? Do you suspect/know that something has been done about this issue in the latest release and that's why you are asking me to try it? The bug has been present for many years, so unless it's targeted specifically it's unlikely to have been resolved!

Thanks for your feedback. Please let me know if you still would like me to build your latest branch for testing or whether the Debian unstable package is good enough.

Thanks!
Iordan

By: Iordan Iordanov (dancho) 2011-07-27 11:58:09.079-0500

I just updated and was able to easily reproduce the issue with Debian unstable's version (1.8.4.4~dfsg-2).

Cheers,
Iordan

By: Iordan Iordanov (dancho) 2011-07-27 12:15:20.448-0500

Hey, I just discovered something which will probably be quite helpful in your search for a fix for this. I have an entry in sip.conf for a peer actionvoip, e.g.:

[actionvoip]
; config stuff here

and my registry line looks like this:

register => user:password@actionvoip/default

and with these settings, the error occurs consistently with and without dnsmgr enabled. However, if I only change the registry line from specifying a peer name to specifying a HOSTNAME, the issue is unreproducible, regardless of whether dnsmgr is enabled or not. The registry entry must look like this for the issue to not be reproducible:

register => user:password@sip.actionvoip.com/default

I remember reading that specifying the peer in the register line is valid syntax, and it does work under all other circumstances. Should it work properly?

I hope this helps!

Sincerely,
Iordan

By: Terry Wilson (twilson) 2011-08-16 17:03:34.249-0500

Please test the attached patch and let me know how it works for you.

By: Iordan Iordanov (dancho) 2011-08-24 07:37:00.307-0500

Hi Terry,

I patched the Asterisk included in Debian unstable, built it, and tested with and without dnsmgr. In both cases, I am unable to reproduce the problem anymore, so the bug has been fixed!

Thanks!
Iordan

By: Terry Wilson (twilson) 2011-08-29 16:40:22.393-0500

Fixed in 1.8r333836