[zaptel-commits] russell: branch 1.4 r3011 - /branches/1.4/wctdm.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Tue Sep 11 12:50:35 CDT 2007


Author: russell
Date: Tue Sep 11 12:50:34 2007
New Revision: 3011

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3011
Log:
Make ringdebounce a module parameter
(closes issue #10218, pnlarsson

Modified:
    branches/1.4/wctdm.c

Modified: branches/1.4/wctdm.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm.c?view=diff&rev=3011&r1=3010&r2=3011
==============================================================================
--- branches/1.4/wctdm.c (original)
+++ branches/1.4/wctdm.c Tue Sep 11 12:50:34 2007
@@ -251,12 +251,13 @@
 #define FLAG_WRITE	1
 #define FLAG_READ	2
 
+#define DEFAULT_RING_DEBOUNCE	64		/* Ringer Debounce (64 ms) */
+
 /* the constants below control the 'debounce' periods enforced by the
    check_hook routines; these routines are called once every 4 interrupts
    (the interrupt cycles around the four modules), so the periods are
    specified in _4 millisecond_ increments
 */
-#define RING_DEBOUNCE		4		/* Ringer Debounce (64 ms) */
 #define DEFAULT_BATT_DEBOUNCE	4		/* Battery debounce (64 ms) */
 #define POLARITY_DEBOUNCE 	4		/* Polarity debounce (64 ms) */
 #define DEFAULT_BATT_THRESH	3		/* Anything under this is "no battery" */
@@ -368,6 +369,7 @@
 
 static int battdebounce = DEFAULT_BATT_DEBOUNCE;
 static int battthresh = DEFAULT_BATT_THRESH;
+static int ringdebounce = DEFAULT_RING_DEBOUNCE;
 static int debug = 0;
 static int robust = 0;
 static int timingonly = 0;
@@ -862,14 +864,14 @@
 		res = wc->reg0shadow[card];
 		if ((res & 0x60) && wc->mod[card].fxo.battery) {
 			wc->mod[card].fxo.ringdebounce += (ZT_CHUNKSIZE * 16);
-			if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * 64) {
+			if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
 				if (!wc->mod[card].fxo.wasringing) {
 					wc->mod[card].fxo.wasringing = 1;
 					zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 					if (debug)
 						printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
 				}
-				wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * 64;
+				wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * ringdebounce;
 			}
 		} else {
 			wc->mod[card].fxo.ringdebounce -= ZT_CHUNKSIZE * 4;
@@ -2479,6 +2481,7 @@
 module_param(fxshonormode, int, 0600);
 module_param(battdebounce, int, 0600);
 module_param(battthresh, int, 0600);
+module_param(ringdebounce, int, 0600);
 module_param(alawoverride, int, 0600);
 module_param(fastpickup, int, 0600);
 module_param(fxotxgain, int, 0600);
@@ -2499,6 +2502,7 @@
 MODULE_PARM(fxshonormode, "i");
 MODULE_PARM(battdebounce, "i");
 MODULE_PARM(battthresh, "i");
+MODULE_PARM(ringdebounce, "i");
 MODULE_PARM(alawoverride, "i");
 MODULE_PARM(fastpickup, "i");
 MODULE_PARM(fxotxgain, "i");




More information about the zaptel-commits mailing list