Index: chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.898 diff -u -r1.898 chan_sip.c --- chan_sip.c 27 Oct 2005 02:19:37 -0000 1.898 +++ chan_sip.c 28 Oct 2005 04:39:34 -0000 @@ -97,6 +97,9 @@ /* #define VOCAL_DATA_HACK */ +/* Uncomment this define if you have more than about 500 outgoing registrations (!) */ +/* #define SENDING_MANY_REGISTRATIONS */ + #define SIPDUMPER #define DEFAULT_DEFAULT_EXPIRY 120 #define DEFAULT_MAX_EXPIRY 3600 @@ -12865,12 +12873,20 @@ { int ms; + ms = 20; ASTOBJ_CONTAINER_TRAVERSE(®l, 1, do { ASTOBJ_WRLOCK(iterator); if (iterator->expire > -1) ast_sched_del(sched, iterator->expire); +#ifdef SENDING_MANY_REGISTRATIONS + /* this is the 1000s to get done version - send 'em at 50 per second */ + iterator->expire = ast_sched_add(sched, ms, sip_reregister, iterator); + ms += 20; +#else + /* original version sends them all spread over 8 seconds or so */ ms = (rand() >> 12) & 0x1fff; iterator->expire = ast_sched_add(sched, ms, sip_reregister, iterator); +#endif ASTOBJ_UNLOCK(iterator); } while (0) );