[Asterisk-cvs] asterisk/channels chan_sip.c,1.588,1.589

markster at lists.digium.com markster at lists.digium.com
Sat Dec 11 22:47:12 CST 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Make registertimeout be configurable (bug #2874)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.588
retrieving revision 1.589
diff -u -d -r1.588 -r1.589
--- chan_sip.c	12 Dec 2004 01:15:54 -0000	1.588
+++ chan_sip.c	12 Dec 2004 03:44:16 -0000	1.589
@@ -74,6 +74,7 @@
 #define SIPDUMPER
 #define DEFAULT_DEFAULT_EXPIRY  120
 #define DEFAULT_MAX_EXPIRY      3600
+#define DEFAULT_REGISTRATION_TIMEOUT	20
 
 /* guard limit must be larger than guard secs */
 /* guard min must be < 1000, and should be >= 250 */
@@ -154,6 +155,8 @@
 
 static int global_progressinband = 0;
 
+static int global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
+
 #ifdef OSP_SUPPORT
 static int global_ospauth = 0;		/* OSP = Open Settlement Protocol */
 #endif
@@ -4160,7 +4163,7 @@
 			ast_log(LOG_WARNING, "Still have a timeout, %d\n", r->timeout);
 			ast_sched_del(sched, r->timeout);
 		}
-		r->timeout = ast_sched_add(sched, 20*1000, sip_reg_timeout, r);
+		r->timeout = ast_sched_add(sched, global_reg_timeout*1000, sip_reg_timeout, r);
 		ast_log(LOG_DEBUG, "Scheduled a timeout # %d\n", r->timeout);
 	}
 
@@ -8809,6 +8812,10 @@
 			default_expiry = atoi(v->value);
 			if (default_expiry < 1)
 				default_expiry = DEFAULT_DEFAULT_EXPIRY;
+		} else if (!strcasecmp(v->name, "registertimeout")){
+			global_reg_timeout = atoi(v->value);
+			if (global_reg_timeout < 1)
+				global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
 		} else if (!strcasecmp(v->name, "bindaddr")) {
 			if (!(hp = ast_gethostbyname(v->value, &ahp))) {
 				ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);




More information about the svn-commits mailing list