diff options
author | Jeff Peeler <jpeeler@digium.com> | 2009-07-21 22:02:25 +0000 |
---|---|---|
committer | Jeff Peeler <jpeeler@digium.com> | 2009-07-21 22:02:25 +0000 |
commit | 7466e006638f4d461c120038c6fd590d50fb4f50 (patch) | |
tree | a1f37741e9c5a71a9564c261b04ce5a406616f1f /channels/chan_dahdi.c | |
parent | 6ac23c3eca28cb21184042844aa4c10efa9081fd (diff) |
Fix my_is_off_hook to check rxbits only for FXS signaling
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index b8ca4807a..a69f95f92 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -2381,7 +2381,14 @@ static int my_is_off_hook(void *pvt) ast_log(LOG_WARNING, "Unable to check hook state on channel %d: %s\n", p->channel, strerror(errno)); } - return (par.rxbits > -1) || par.rxisoffhook; + if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSGS)) { + /* When "onhook" that means no battery on the line, and thus + it is out of service..., if it's on a TDM card... If it's a channel + bank, there is no telling... */ + return (par.rxbits > -1) || par.rxisoffhook; + } + + return par.rxisoffhook; } static void dahdi_enable_ec(struct dahdi_pvt *p); |