diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-09 04:56:51 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-09 04:56:51 +0000 |
commit | 603ade2a2c51430e68df33c18317323e4456bf44 (patch) | |
tree | 14436a45879b533d0532c3816a5e7be334524fce /channels | |
parent | 92739d261c53472bf805a27eac61b589e2bc1a8d (diff) |
Slow down the registrations to space them out
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5154 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 5 |
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(®l, 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) ); |