From c51a9ce1f20e32c41ce7beefc67c204cd6bc0468 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Fri, 30 Sep 2005 20:41:21 +0000 Subject: support minimum time for FXS flash git-svn-id: http://svn.digium.com/svn/zaptel/trunk@788 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.c | 8 ++++++-- zaptel.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zaptel.c b/zaptel.c index 2f717e4..1a79860 100755 --- a/zaptel.c +++ b/zaptel.c @@ -5242,10 +5242,14 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig) if (chan->txstate != ZT_TXSTATE_OFFHOOK) break; #ifdef FXSFLASH if (rxsig == ZT_RXSIG_ONHOOK) { - chan->itimer = ZT_FXSFLASHTIME * ZT_CHUNKSIZE; + chan->itimer = ZT_FXSFLASHMAXTIME * ZT_CHUNKSIZE; break; } else if (rxsig == ZT_RXSIG_OFFHOOK) { - if (chan->itimer) __qevent(chan, ZT_EVENT_WINKFLASH); + if (chan->itimer) { + /* did the offhook occur in the window? if not, ignore both events */ + if (chan->itimer <= ((ZT_FXSFLASHMAXTIME - ZTFXSFLASHMINTIME) * ZT_CHUNKSIZE)) + __qevent(chan, ZT_EVENT_WINKFLASH); + } chan->itimer = 0; break; } diff --git a/zaptel.h b/zaptel.h index 1d39be6..ace69e5 100755 --- a/zaptel.h +++ b/zaptel.h @@ -906,7 +906,8 @@ struct zt_tone_def { /* Structure for zone programming */ #define ZT_MAX_CONF 1024 /* Max, 1024 conferences */ #ifdef FXSFLASH -#define ZT_FXSFLASHTIME 550 /* max 550ms */ +#define ZT_FXSFLASHMINTIME 450 /* min 450ms */ +#define ZT_FXSFLASHMAXTIME 550 /* max 550ms */ #endif #ifdef __KERNEL__ -- cgit v1.2.3