From cad4147a8238eb17cf7d5a8936c13b1cbe70debd Mon Sep 17 00:00:00 2001 From: markster Date: Fri, 25 Jul 2003 15:23:15 +0000 Subject: Don't run in on-hook mode until the device is actually opened git-svn-id: http://svn.digium.com/svn/zaptel/trunk@222 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wcfxs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'wcfxs.c') diff --git a/wcfxs.c b/wcfxs.c index 8608f1d..9bdd053 100755 --- a/wcfxs.c +++ b/wcfxs.c @@ -679,8 +679,8 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card) unsigned short tmp[5]; int x; - /* By default, always send on hook */ - wc->idletxhookstate [card] = 2; + /* By default, don't send on hook */ + wc->idletxhookstate [card] = 1; /* Sanity check the ProSLIC */ if (wcfxs_proslic_insane(wc, card)) @@ -904,11 +904,14 @@ static int wcfxs_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat static int wcfxs_open(struct zt_chan *chan) { struct wcfxs *wc = chan->pvt; + int x; if (!(wc->cardflag & (1 << (chan->chanpos - 1)))) return -ENODEV; if (wc->dead) return -ENODEV; wc->usecount++; + for (x=0;xcards;x++) + wc->idletxhookstate[x] = 2; MOD_INC_USE_COUNT; return 0; } @@ -923,8 +926,11 @@ static int wcfxs_watchdog(struct zt_span *span, int event) static int wcfxs_close(struct zt_chan *chan) { struct wcfxs *wc = chan->pvt; + int x; wc->usecount--; MOD_DEC_USE_COUNT; + for (x=0;xcards;x++) + wc->idletxhookstate[x] = 1; /* If we're dead, release us now */ if (!wc->usecount && wc->dead) wcfxs_release(wc); -- cgit v1.2.3