From a59b28483de3bba194fb849df889f1c640b9df76 Mon Sep 17 00:00:00 2001 From: markster Date: Fri, 2 Apr 2004 05:29:37 +0000 Subject: Add onhook transfer mode and experimental "robust" mode... git-svn-id: http://svn.digium.com/svn/zaptel/trunk@337 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wctdm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'wctdm.c') diff --git a/wctdm.c b/wctdm.c index dfaa385..1106bab 100755 --- a/wctdm.c +++ b/wctdm.c @@ -195,6 +195,7 @@ static struct wcfxs *ifaces[WC_MAX_IFACES]; static void wcfxs_release(struct wcfxs *wc); static int debug = 0; +static int robust = 0; static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast , int manual, int sane); @@ -1136,6 +1137,8 @@ static inline void wcfxs_proslic_check_hook(struct wcfxs *wc, int card) #endif printk("wcfxs: Card %d Going off hook\n", card); zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK); + if (robust) + wcfxs_init_proslic(wc, card, 1, 0, 1); wc->oldrxhook[card] = 1; } else if (wc->oldrxhook[card] && !wc->debouncehook[card]) { @@ -1162,6 +1165,19 @@ static int wcfxs_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat struct wcfxs *wc = chan->pvt; int x; switch (cmd) { + case ZT_ONHOOKTRANSFER: + if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS) + return -EINVAL; + if (get_user(x, (int *)data)) + return -EFAULT; + wc->ohttimer[chan->chanpos - 1] = x << 3; + wc->idletxhookstate[chan->chanpos - 1] = 0x2; /* OHT mode when idle */ + if (wc->lasttxhook[chan->chanpos - 1] == 0x1) { + /* Apply the change if appropriate */ + wc->lasttxhook[chan->chanpos - 1] = 0x2; + wcfxs_setreg(wc, x, 64, wc->lasttxhook[chan->chanpos - 1]); + } + break; case WCFXS_GET_STATS: if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS) return -EINVAL; -- cgit v1.2.3