[Asterisk-cvs] asterisk/channels chan_zap.c,1.419,1.420

markster at lists.digium.com markster at lists.digium.com
Wed Mar 23 15:17:35 CST 2005


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

Modified Files:
	chan_zap.c 
Log Message:
Allow resetinterval to be "never"


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.419
retrieving revision 1.420
diff -u -d -r1.419 -r1.420
--- chan_zap.c	22 Mar 2005 16:26:54 -0000	1.419
+++ chan_zap.c	23 Mar 2005 21:12:01 -0000	1.420
@@ -7525,7 +7525,7 @@
 		numdchans = i;
 		time(&t);
 		ast_mutex_lock(&pri->lock);
-		if (pri->switchtype != PRI_SWITCH_GR303_TMC) {
+		if (pri->switchtype != PRI_SWITCH_GR303_TMC && (pri->resetinterval > 0)) {
 			if (pri->resetting && pri_is_up(pri)) {
 				if (pri->resetpos < 0)
 					pri_check_restart(pri);
@@ -7703,8 +7703,10 @@
 				time(&pri->lastreset);
 
 				/* Restart in 5 seconds */
-				pri->lastreset -= pri->resetinterval;
-				pri->lastreset += 5;
+				if (pri->resetinterval > -1) {
+					pri->lastreset -= pri->resetinterval;
+					pri->lastreset += 5;
+				}
 				pri->resetting = 0;
 				/* Take the channels from inalarm condition */
 				for (i=0; i<pri->numchans; i++)
@@ -9942,10 +9944,12 @@
 			} else if (!strcasecmp(v->name, "unknownprefix")) {
 				strncpy(unknownprefix, v->value, sizeof(unknownprefix)-1);
 			} else if (!strcasecmp(v->name, "resetinterval")) {
-				if( atoi(v->value) >= 60 )
+				if (!strcasecmp(v->value, "never"))
+					resetinterval = -1;
+				else if( atoi(v->value) >= 60 )
 					resetinterval = atoi(v->value);
 				else
-					ast_log(LOG_WARNING, "'%s' is not a valid reset interval, should be >= 60 seconds at line %d\n",
+					ast_log(LOG_WARNING, "'%s' is not a valid reset interval, should be >= 60 seconds or 'never' at line %d\n",
 						v->value, v->lineno);
 			} else if (!strcasecmp(v->name, "minunused")) {
 				minunused = atoi(v->value);




More information about the svn-commits mailing list