[zaptel-commits] trunk - r876 in /trunk: zaptel.c zconfig.h

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Mon Dec 26 11:40:39 CST 2005


Author: jdixon
Date: Mon Dec 26 11:40:37 2005
New Revision: 876

URL: http://svn.digium.com/view/zaptel?rev=876&view=rev
Log:
Added support for Dial Pulse recognition on E&M trunks

Modified:
    trunk/zaptel.c
    trunk/zconfig.h

Modified: trunk/zaptel.c
URL: http://svn.digium.com/view/zaptel/trunk/zaptel.c?rev=876&r1=875&r2=876&view=diff
==============================================================================
--- trunk/zaptel.c (original)
+++ trunk/zaptel.c Mon Dec 26 11:40:37 2005
@@ -713,6 +713,7 @@
 /* enqueue an event on a channel */
 static void __qevent(struct zt_chan *chan, int event)
 {
+
 	  /* if full, ignore */
 	if ((chan->eventoutidx == 0) && (chan->eventinidx == (ZT_MAX_EVENTSIZE - 1))) 
 		return;
@@ -5078,7 +5079,7 @@
 		__qevent(chan,ZT_EVENT_ONHOOK);
 		chan->gotgs = 0; 
 		break;
-#ifdef	EMFLASH
+#if defined(EMFLASH) || defined(EMPULSE)
 	    case ZT_SIG_EM:
 	    case ZT_SIG_EM_E1:
 		if (chan->rxhooksig == ZT_RXSIG_ONHOOK) {
@@ -5264,6 +5265,25 @@
 				break;				
 			}
 #endif
+#ifdef EMPULSE
+			if (chan->itimer) /* if timer still running */
+			{
+			    int plen = chan->itimerset - chan->itimer;
+			    if (plen <= ZT_MAXPULSETIME)
+			    {
+					if (plen >= ZT_MINPULSETIME)
+					{
+						chan->pulsecount++;
+
+						chan->pulsetimer = ZT_PULSETIMEOUT;
+                                                chan->itimerset = chan->itimer = 0;
+						if (chan->pulsecount == 1)
+							__qevent(chan,ZT_EVENT_PULSE_START); 
+					} 
+			    } 
+			    break;
+			}
+#endif
 			/* set wink timer */
 			chan->itimerset = chan->itimer = chan->rxwinktime * ZT_CHUNKSIZE;
 			break;
@@ -5272,13 +5292,19 @@
 			   Check for WINK, etc */
 			if (chan->itimer)
 				__qevent(chan,ZT_EVENT_WINKFLASH); 
-#ifdef	EMFLASH
+#if defined(EMFLASH) || defined(EMPULSE)
 			else {
+#ifdef EMFLASH
 				chan->itimerset = chan->itimer = chan->rxflashtime * ZT_CHUNKSIZE;
+
+#else /* EMFLASH */
+				chan->itimerset = chan->itimer = chan->rxwinktime * ZT_CHUNKSIZE;
+
+#endif /* EMFLASH */
 				chan->gotgs = 0;
 				break;				
 			}
-#else
+#else /* EMFLASH || EMPULSE */
 			else {
 				__qevent(chan,ZT_EVENT_ONHOOK); 
 				chan->gotgs = 0;

Modified: trunk/zconfig.h
URL: http://svn.digium.com/view/zaptel/trunk/zconfig.h?rev=876&r1=875&r2=876&view=diff
==============================================================================
--- trunk/zconfig.h (original)
+++ trunk/zconfig.h Mon Dec 26 11:40:37 2005
@@ -136,8 +136,23 @@
 /* 
  * Uncomment the following if you want to support E&M trunks being
  * able to "flash" after going off-hook (dont ask why, just nod :-) ).
+ *
+ * NOTE: *DO NOT* Enable "EMFLASH" and "EMPULSE" at the same time!!
+ *
  */
 /* #define EMFLASH */
+
+/* 
+ * Uncomment the following if you want to support E&M trunks being
+ * able to recognize Dial Pulse digits. This can validly be enabled
+ * so that either Dial Pulse or DTMF/MF tones will be recognized, but
+ * the drawback is that the ONHOOK will take an extra {rxwinktime}
+ * to be recognized.
+ *
+ * NOTE: *DO NOT* Enable "EMFLASH" and "EMPULSE" at the same time!!
+ *
+ */
+/* #define EMPULSE */
 
 /* 
  * Comment out the following if you dont want events to indicate the



More information about the zaptel-commits mailing list