[Asterisk-cvs] asterisk/channels chan_sip.c,1.899,1.900

markster markster
Sun Oct 30 16:44:16 CST 2005


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

Modified Files:
	chan_sip.c 
Log Message:
Fix ability to do lots of outbound registrations (bug #5529)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.899
retrieving revision 1.900
diff -u -d -r1.899 -r1.900
--- chan_sip.c	28 Oct 2005 13:37:31 -0000	1.899
+++ chan_sip.c	30 Oct 2005 21:36:27 -0000	1.900
@@ -12891,12 +12891,18 @@
 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(&regl, 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)




More information about the svn-commits mailing list