Summary:ASTERISK-00515: Asterisk will block if you have register statments in sip.conf and you reload config.
Reporter:yamez (yamez)Labels:
Date Opened:2003-11-11 13:17:45.000-0600Date Closed:2011-06-07 14:01:05
Versions:Frequency of
Description:Asterisk will block and stop taking new connection and will not be able to register sip phones. If you have register =>  statments in sip.conf and type reload a few time at the console. I can reproduce this by type reload about five times
in a row. I have to killall asterisk to get things right again.  I have about 50 register statements in sip.conf.  


Nothing odd shows up in any logs.
Comments:By: Brian West (bkw918) 2003-11-11 14:25:51.000-0600

50 outbound register statements ... HOLY HECK BATMAN.  No wonder.  The outbound SIP registration stuff is for the lack of a better word is "Flakey".  Try not to type reload so close together.  The blocking I'm sure is coming from * trying to re-register with all 50 of those.  If you don't mind me asking why 50?
If these are gateways for outbound calls you shouldn't have to register with them.


By: Mark Spencer (markster) 2003-11-11 17:50:03.000-0600

If you can find me on irc, i'll happily ssh in and gdb it to try to see where it's getting stuck.

By: John Todd (jtodd) 2003-11-14 01:58:46.000-0600

Another data point that would be useful to add to this ticket would be knowing how many of those REGISTER statements are failing at any point due to unreachable servers, which has caused some problems in the past which I thought were resolved.  Maybe that's not part of the issue, but it's worth noting what the results are of your REGISTER attempts.

By: x martinp (martinp) 2003-11-17 17:43:37.000-0600

Does that help ?

Index: loader.c
RCS file: /usr/cvsroot/asterisk/loader.c,v
retrieving revision 1.17
diff -u -r1.17 loader.c
--- loader.c    26 Oct 2003 18:50:49 -0000      1.17
+++ loader.c    18 Nov 2003 00:03:12 -0000
@@ -99,6 +99,7 @@
} *updaters = NULL;

static ast_mutex_t modlock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t reloadlock = AST_MUTEX_INITIALIZER;

static struct module *module_list=NULL;

@@ -149,6 +150,11 @@
       struct module *m;

       /* We'll do the logger and manager the favor of calling its reload here
first */
+       if (ast_mutex_trylock(&reloadlock)) {
+               ast_verbose("The previous reload command didn't finish yet\n");
+               return;
+       }
@@ -165,6 +171,7 @@
               m = m->next;
+       ast_mutex_unlock(&reloadlock);

int ast_load_resource(char *resource_name)

By: x martinp (martinp) 2003-11-19 14:54:40.000-0600

I assume this fixes it ... though there is no feedback

By: yamez (yamez) 2003-11-20 02:35:40.000-0600

Sorry was on vacation.

As to the question why do I use so many register statements
because I use asterisk as a B2bua to allow call features
for Vocal.

All register statements do register and pretty fast to, So
I don't think it was blocking do to timeouts.

Yes this patch did fix the blocking issue, now it just crashes.
Which from my point of view is much better! I have a watchdog
that will restart Asterisk from a crash instantly the watchdog is much
slower to detect blocks.

By: yamez (yamez) 2003-11-20 02:36:41.000-0600

I'll try and find you on irc.

By: x martinp (martinp) 2003-11-20 10:26:01.000-0600

email me at martinp@digium.com. I'd like to see the backtrace.

By: yamez (yamez) 2003-12-14 01:57:10.000-0600

This fixed itself with this weeks cvs, I am no longer able to reproduce this bug

Please close ticket.