[Asterisk-cvs] zaptel wct4xxp.c,1.46,1.47

markster at lists.digium.com markster at lists.digium.com
Mon Jun 14 17:29:33 CDT 2004


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv5487

Modified Files:
	wct4xxp.c 
Log Message:
Add optional debounce timer for red alarm


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- wct4xxp.c	26 May 2004 15:45:31 -0000	1.46
+++ wct4xxp.c	14 Jun 2004 22:34:12 -0000	1.47
@@ -59,6 +59,7 @@
 static int highestorder;
 static int t1e1override = -1;
 static int loopback = 0;
+static int alarmdebounce = 0;
 
 #ifdef FANCY_ALARM
 static int altab[] = {
@@ -93,6 +94,7 @@
 	int alarmtimer[4];		/* Alarm timer */
 	int redalarms[4];
 	int blinktimer;
+	int alarmcount[4];			/* How much red alarm we've seen */
 #ifdef FANCY_ALARM
 	int alarmpos;
 #endif
@@ -1169,8 +1171,13 @@
 			alarms |= ZT_ALARM_NOTOPEN;
 	}
 
-	if (c & 0xa0) 
-		alarms |= ZT_ALARM_RED;
+	if (c & 0xa0) {
+		if (wc->alarmcount[span] >= alarmdebounce) 
+			alarms |= ZT_ALARM_RED;
+		else
+			wc->alarmcount[span]++;
+	} else
+		wc->alarmcount[span] = 0;
 	if (c & 0x4)
 		alarms |= ZT_ALARM_BLUE;
 
@@ -1714,6 +1721,7 @@
 MODULE_PARM(loopback, "i");
 MODULE_PARM(timingcable, "i");
 MODULE_PARM(t1e1override, "i");
+MODULE_PARM(alarmdebounce, "i");
 
 MODULE_DEVICE_TABLE(pci, t4_pci_tbl);
 




More information about the svn-commits mailing list