[svn-commits] tzafrir: trunk r1291 - /trunk/xpp/card_fxo.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Aug 9 20:40:10 MST 2006


Author: tzafrir
Date: Wed Aug  9 22:40:10 2006
New Revision: 1291

URL: http://svn.digium.com/view/zaptel?rev=1291&view=rev
Log:
Fix ring detection logic in FXO:
Detect ring stop only when register 0x05 shows no ring voltage for
enough samples. This is done via noring_thresh[].

Modified:
    trunk/xpp/card_fxo.c

Modified: trunk/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxo.c?rev=1291&r1=1290&r2=1291&view=diff
==============================================================================
--- trunk/xpp/card_fxo.c (original)
+++ trunk/xpp/card_fxo.c Wed Aug  9 22:40:10 2006
@@ -72,7 +72,8 @@
 
 #ifdef SOFT_RING
 #define	POLL_RING_INTERVAL	1
-#define	RING_THRESHOLD		5
+#define	RING_THRESHOLD		3
+#define	NORING_THRESHOLD	50
 #define	DAA_RING_REGISTER	0x05
 #endif
 
@@ -87,6 +88,7 @@
 	int				blinking[NUM_LEDS][CHANNELS_PERXPD];
 #ifdef SOFT_RING
 	ushort				ring_thresh[CHANNELS_PERXPD];
+	ushort				noring_thresh[CHANNELS_PERXPD];
 #endif
 };
 
@@ -722,13 +724,17 @@
 		int		i;
 
 		for_each_line(xpd, i) {
-			if(IS_SET(lines, i)) {
-				if(ringit) {
-					if(priv->ring_thresh[i]++ > RING_THRESHOLD) {
-						mark_ring(xpd, i, 1);
-					}
-				} else {
+			if(!IS_SET(lines, i))
+				continue;
+			if(ringit) {
+				if(priv->ring_thresh[i]++ > RING_THRESHOLD) {
+					mark_ring(xpd, i, 1);
+					priv->noring_thresh[i] = 0;
+				}
+			} else {
+				if(priv->noring_thresh[i]++ > NORING_THRESHOLD) {
 					mark_ring(xpd, i, 0);
+					priv->ring_thresh[i] = 0;
 				}
 			}
 		}



More information about the svn-commits mailing list