[Asterisk-cvs] zaptel wcfxs.c,1.57,1.58

markster at lists.digium.com markster at lists.digium.com
Sat May 15 15:14:53 CDT 2004


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

Modified Files:
	wcfxs.c 
Log Message:
Don't accept ring when there is no battery, print which ports things hapepn on


Index: wcfxs.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxs.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- wcfxs.c	10 May 2004 01:46:33 -0000	1.57
+++ wcfxs.c	15 May 2004 19:26:16 -0000	1.58
@@ -290,14 +290,14 @@
 		if (!wc->mod.fxo.ring[card] && (wc->mod.fxo.pegcount[card] > PEGCOUNT)) {
 			/* It's ringing */
 			if (debug)
-				printk("RING!\n");
+				printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
 			zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 			wc->mod.fxo.ring[card] = 1;
 		}
 		if (wc->mod.fxo.ring[card] && !wc->mod.fxo.pegcount[card]) {
 			/* No more ring */
 			if (debug)
-				printk("NO RING!\n");
+				printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
 			zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 			wc->mod.fxo.ring[card] = 0;
 		}
@@ -1193,14 +1193,14 @@
 #ifndef AUDIO_RINGCHECK
 	if (!wc->mod.fxo.offhook[card]) {
 		res = wcfxs_getreg(wc, card, 5);
-		if (res & 0x60) {
+		if ((res & 0x60) && wc->mod.fxo.battery[card]) {
 			wc->mod.fxo.ringdebounce[card] += (ZT_CHUNKSIZE * 4);
 			if (wc->mod.fxo.ringdebounce[card] >= ZT_CHUNKSIZE * 32) {
 				if (!wc->mod.fxo.wasringing[card]) {
 					wc->mod.fxo.wasringing[card] = 1;
 					zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 					if (debug)
-						printk("RING!\n");
+						printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
 				}
 				wc->mod.fxo.ringdebounce[card] = ZT_CHUNKSIZE * 32;
 			}
@@ -1211,7 +1211,7 @@
 					wc->mod.fxo.wasringing[card] =0;
 					zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 					if (debug)
-						printk("NO RING!\n");
+						printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
 				}
 				wc->mod.fxo.ringdebounce[card] = 0;
 			}
@@ -1236,7 +1236,7 @@
 #endif
 		if (wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) {
 			if (debug)
-				printk("NO BATTERY!\n");
+				printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1);
 			wc->mod.fxo.battery[card] =  0;
 #ifdef	JAPAN
 			if ((!wc->ohdebounce) && wc->offhook) {
@@ -1256,7 +1256,7 @@
 	} else if (abs(b) > BATT_THRESH) {
 		if (!wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) {
 			if (debug)
-				printk("BATTERY!\n");
+				printk("BATTERY on %d/%d!\n", wc->span.spanno, card + 1);
 #ifdef	ZERO_BATT_RING
 			if (wc->onhook) {
 				wc->onhook = 0;




More information about the svn-commits mailing list