summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-03-09 04:56:51 +0000
committerMark Spencer <markster@digium.com>2005-03-09 04:56:51 +0000
commit98a3c16be4a00bbbd8d22aee00ebee29ab21e676 (patch)
tree14436a45879b533d0532c3816a5e7be334524fce /channels
parent4e395aac8b3b5f2b94578021357e9a3ad0e3c4c8 (diff)
Slow down the registrations to space them out
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ad52a1da3..3efc7c5a1 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10128,9 +10128,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;
ASTOBJ_CONTAINER_TRAVERSE(&regl, 1, do {
ASTOBJ_WRLOCK(iterator);
- __sip_do_register(iterator);
+ if (iterator->expire > -1)
+ ast_sched_del(sched, iterator->expire);
+ iterator->expire = ast_sched_add(sched, ms, sip_reregister, iterator);
ASTOBJ_UNLOCK(iterator);
} while (0)
);