[asterisk-commits] oej: branch oej/reinvite-racing r91736 - /team/oej/reinvite-racing/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 7 04:36:39 CST 2007


Author: oej
Date: Fri Dec  7 04:36:38 2007
New Revision: 91736

URL: http://svn.digium.com/view/asterisk?view=rev&rev=91736
Log:
Try to implement random delays

Modified:
    team/oej/reinvite-racing/channels/chan_sip.c

Modified: team/oej/reinvite-racing/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/reinvite-racing/channels/chan_sip.c?view=diff&rev=91736&r1=91735&r2=91736
==============================================================================
--- team/oej/reinvite-racing/channels/chan_sip.c (original)
+++ team/oej/reinvite-racing/channels/chan_sip.c Fri Dec  7 04:36:38 2007
@@ -12226,9 +12226,11 @@
 			} else {
 				/* This is a re-invite that failed. */
 				/* Reset the flag after a while 
-				   The 5 should be random really, but let's test this now.
 				 */
-				p->waitid = ast_sched_add(sched, 5, sip_reinvite_retry, p); 
+				int wait = 3 + ast_random() % 5;
+				p->waitid = ast_sched_add(sched, wait, sip_reinvite_retry, p); 
+				if (option_debug > 2)
+					ast_log(LOG_DEBUG, "Reinvite race. Waiting %d secs before retry\n", wait);
 			}
 		}
 		break;




More information about the asterisk-commits mailing list