[Asterisk-cvs] zaptel zaptel.c,1.106,1.107 zconfig.h,1.15,1.16

jim at lists.digium.com jim at lists.digium.com
Wed Jun 8 18:33:25 CDT 2005


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

Modified Files:
	zaptel.c zconfig.h 
Log Message:
Added functionality so that e&m trunks can "flash" after going offhook
added the #define EMFLASH to zconfig.h to enable this feature


Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- zaptel.c	18 May 2005 05:17:22 -0000	1.106
+++ zaptel.c	8 Jun 2005 22:35:37 -0000	1.107
@@ -645,6 +645,7 @@
 /* enqueue an event on a channel */
 static void __qevent(struct zt_chan *chan, int event)
 {
+printk("@@@@@@@@ sending event %d on %s\n",event,chan->name);
 	  /* if full, ignore */
 	if ((chan->eventoutidx == 0) && (chan->eventinidx == (ZT_MAX_EVENTSIZE - 1))) 
 		return;
@@ -4970,6 +4971,15 @@
 		__qevent(chan,ZT_EVENT_ONHOOK);
 		chan->gotgs = 0; 
 		break;
+#ifdef	EMFLASH
+	    case ZT_SIG_EM:
+	    case ZT_SIG_EM_E1:
+		if (chan->rxhooksig == ZT_RXSIG_ONHOOK) {
+			__qevent(chan,ZT_EVENT_ONHOOK); 
+			break;
+		}
+		/* intentionally fall thru */
+#endif
 	    default:  /* otherwise, its definitely off hook */
 		__qevent(chan,ZT_EVENT_RINGOFFHOOK); 
 		break;
@@ -5126,6 +5136,14 @@
 		switch(rxsig) {
 		    case ZT_RXSIG_OFFHOOK: /* went off hook */
 			/* The interface is going off hook */
+#ifdef	EMFLASH
+			if (chan->itimer)
+			{
+				__qevent(chan,ZT_EVENT_WINKFLASH); 
+				chan->itimerset = chan->itimer = 0;
+				break;				
+			}
+#endif
 			/* set wink timer */
 			chan->itimerset = chan->itimer = chan->rxwinktime * 8;
 			break;
@@ -5134,10 +5152,18 @@
 			   Check for WINK, etc */
 			if (chan->itimer)
 				__qevent(chan,ZT_EVENT_WINKFLASH); 
+#ifdef	EMFLASH
+			else {
+				chan->itimerset = chan->itimer = chan->rxflashtime * 8;
+				chan->gotgs = 0;
+				break;				
+			}
+#else
 			else {
 				__qevent(chan,ZT_EVENT_ONHOOK); 
 				chan->gotgs = 0;
 			}
+#endif
 			chan->itimerset = chan->itimer = 0;
 			break;
 		    default:

Index: zconfig.h
===================================================================
RCS file: /usr/cvsroot/zaptel/zconfig.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- zconfig.h	6 May 2005 06:16:51 -0000	1.15
+++ zconfig.h	8 Jun 2005 22:35:38 -0000	1.16
@@ -38,7 +38,7 @@
  * processors and can cause system instability!
  * 
  */
-/* #define CONFIG_ZAPTEL_MMX */
+#define CONFIG_ZAPTEL_MMX
 
 /*
  * Pick your echo canceller: MARK2, MARK3, STEVE, or STEVE2 :)
@@ -127,4 +127,10 @@
  */
 /* #define TDM_REVH_MATCHALL */
 
+/* 
+ * Uncomment the following if you want to support E&M trunks being
+ * able to "flash" after going off-hook (dont ask why, just nod :-) ).
+ */
+/* #define EMFLASH */
+
 #endif




More information about the svn-commits mailing list