summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zaptel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/zaptel.c b/zaptel.c
index 814cb30..d696fae 100644
--- a/zaptel.c
+++ b/zaptel.c
@@ -2994,12 +2994,14 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
j = zt_q_sig(chan);
if (j >= 0) { /* if returned with success */
stack.param.rxisoffhook = ((chan->rxsig & (j >> 8)) != (j & 0xff));
- }
- else {
+ } else {
stack.param.rxisoffhook = ((chan->rxhooksig != ZT_RXSIG_ONHOOK) &&
(chan->rxhooksig != ZT_RXSIG_INITIAL));
}
- } else stack.param.rxisoffhook = 0;
+ } else if ((chan->txstate == ZT_TXSTATE_KEWL) || (chan->txstate == ZT_TXSTATE_AFTERKEWL))
+ stack.param.rxisoffhook = 1;
+ else
+ stack.param.rxisoffhook = 0;
if (chan->span && chan->span->rbsbits && !(chan->sig & ZT_SIG_CLEAR)) {
stack.param.rxbits = chan->rxsig;
stack.param.txbits = chan->txsig;