[Asterisk-cvs] asterisk/channels chan_sip.c,1.671,1.672

markster at lists.digium.com markster at lists.digium.com
Tue Mar 8 23:00:38 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv28891/channels

Modified Files:
	chan_sip.c 
Log Message:
Slow down the registrations to space them out


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.671
retrieving revision 1.672
diff -u -d -r1.671 -r1.672
--- chan_sip.c	4 Mar 2005 06:47:24 -0000	1.671
+++ chan_sip.c	9 Mar 2005 04:56:51 -0000	1.672
@@ -10128,9 +10128,12 @@
 /*--- 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)
 	);




More information about the svn-commits mailing list