summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-04-02 05:29:37 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-04-02 05:29:37 +0000
commita59b28483de3bba194fb849df889f1c640b9df76 (patch)
tree6ec86124d6ff817c898f1d5276473ab69f4e2fa9 /wcfxs.c
parent6b02a94804912a552c9febcfd0ccb3adde2395c7 (diff)
Add onhook transfer mode and experimental "robust" mode...
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@337 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/wcfxs.c b/wcfxs.c
index dfaa385..1106bab 100755
--- a/wcfxs.c
+++ b/wcfxs.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;