summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-07-25 15:23:15 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-07-25 15:23:15 +0000
commitcad4147a8238eb17cf7d5a8936c13b1cbe70debd (patch)
treead63afd3cc655096d591fe69889ad196f113f052 /wcfxs.c
parente2ea9bbcd29b5a6fb07be6191f512c9059836e8f (diff)
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
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c10
1 files changed, 8 insertions, 2 deletions
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;x<wc->cards;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;x<wc->cards;x++)
+ wc->idletxhookstate[x] = 1;
/* If we're dead, release us now */
if (!wc->usecount && wc->dead)
wcfxs_release(wc);