diff options
author | Mark Spencer <markster@digium.com> | 2005-10-30 21:36:27 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-10-30 21:36:27 +0000 |
commit | 39d27dbab8ad540a2620d9a54ef966b92c254413 (patch) | |
tree | 30d0672e3bb4c473f33fbad8a0bd3a3ac7e9797f /channels/chan_sip.c | |
parent | ccc121825f844532cf8c6ccfe98e16cbb22ed56a (diff) |
Fix ability to do lots of outbound registrations (bug #5529)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-x | channels/chan_sip.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8b538b5fd..fb48e19f9 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12891,12 +12891,18 @@ static void sip_poke_all_peers(void) static void sip_send_all_registers(void) { int ms; - + int regspacing; + if (!regobjs) + return; + regspacing = default_expiry * 1000/regobjs; + if (regspacing > 100) + regspacing = 100; + ms = regspacing; ASTOBJ_CONTAINER_TRAVERSE(®l, 1, do { ASTOBJ_WRLOCK(iterator); if (iterator->expire > -1) ast_sched_del(sched, iterator->expire); - ms = (rand() >> 12) & 0x1fff; + ms += regspacing; iterator->expire = ast_sched_add(sched, ms, sip_reregister, iterator); ASTOBJ_UNLOCK(iterator); } while (0) |