actually space out the registrations :) (bug #3104)
authorRussell Bryant <russell@russellbryant.com>
Wed, 6 Apr 2005 17:03:50 +0000 (17:03 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 6 Apr 2005 17:03:50 +0000 (17:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5427 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index f0fb733..2f053f7 100755 (executable)
@@ -10754,11 +10754,12 @@ static void sip_poke_all_peers(void)
 /*--- sip_send_all_registers: Send all known registrations */
 static void sip_send_all_registers(void)
 {
-       int ms = (rand() >> 12) & 0x1fff;
+       int ms;
        ASTOBJ_CONTAINER_TRAVERSE(&regl, 1, do {
                ASTOBJ_WRLOCK(iterator);
                if (iterator->expire > -1)
                        ast_sched_del(sched, iterator->expire);
+               ms = (rand() >> 12) & 0x1fff;
                iterator->expire = ast_sched_add(sched, ms, sip_reregister, iterator);
                ASTOBJ_UNLOCK(iterator);
        } while (0)