[Asterisk-cvs] asterisk/channels chan_iax2.c,1.203,1.204

markster at lists.digium.com markster at lists.digium.com
Sat Oct 9 21:41:55 CDT 2004


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

Modified Files:
	chan_iax2.c 
Log Message:
Add autokill to IAX2, too


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- chan_iax2.c	9 Oct 2004 16:34:12 -0000	1.203
+++ chan_iax2.c	10 Oct 2004 01:42:46 -0000	1.204
@@ -114,6 +114,7 @@
 static int jittershrinkrate=2;
 static int trunkfreq = 20;
 static int authdebug = 1;
+static int autokill = 0;
 static int iaxcompat = 0;
 
 static int iaxdefaultdpcache=10 * 60;	/* Cache dialplan entries for 10 minutes by default */
@@ -2346,6 +2347,9 @@
 		/* Initialize pingtime and auto-congest time */
 		iaxs[callno]->pingtime = iaxs[callno]->maxtime / 2;
 		iaxs[callno]->initid = ast_sched_add(sched, iaxs[callno]->maxtime * 2, auto_congest, CALLNO_TO_PTR(callno));
+	} else if (autokill) {
+		iaxs[callno]->pingtime = autokill / 2;
+		iaxs[callno]->initid = ast_sched_add(sched, autokill * 2, auto_congest, CALLNO_TO_PTR(callno));
 	}
 	send_command(iaxs[callno], AST_FRAME_IAX,
 		IAX_COMMAND_NEW, 0, ied.buf, ied.pos, -1);
@@ -6792,6 +6796,7 @@
 	char *cat;
 	char *utype;
 	int format;
+	int  x;
 	struct iax2_user *user;
 	struct iax2_peer *peer;
 #if 0
@@ -6849,6 +6854,17 @@
 			trunkfreq = atoi(v->value);
 			if (trunkfreq < 10)
 				trunkfreq = 10;
+		} else if (!strcasecmp(v->name, "autokill")) {
+			if (sscanf(v->value, "%i", &x) == 1) {
+				if (x >= 0)
+					autokill = x;
+				else
+					ast_log(LOG_NOTICE, "Nice try, but autokill has to be >0 or 'yes' or 'no' at line %d\n", v->lineno);
+			} else if (ast_true(v->value)) {
+				autokill = DEFAULT_MAXMS;
+			} else {
+				autokill = 0;
+			}
 		} else if (!strcasecmp(v->name, "bandwidth")) {
 			if (!strcasecmp(v->value, "low")) {
 				capability = IAX_CAPABILITY_LOWBANDWIDTH;




More information about the svn-commits mailing list