summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authorjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-06-08 22:35:38 +0000
committerjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-06-08 22:35:38 +0000
commit9fa18f88e43786a803286c8189c80d18b242eada (patch)
treea90eec335c40205188ed4bac16ac58a2779412e0 /zaptel.c
parentfc86f5c437daa269ba6e7d4621b3365a90f5a05d (diff)
Added functionality so that e&m trunks can "flash" after going offhook
added the #define EMFLASH to zconfig.h to enable this feature git-svn-id: http://svn.digium.com/svn/zaptel/trunk@666 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/zaptel.c b/zaptel.c
index 77d1eea..25809df 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -645,6 +645,7 @@ static void zt_check_conf(int x)
/* 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 @@ static inline void rbs_itimer_expire(struct zt_chan *chan)
__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 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
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 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
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: