aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-02 19:07:24 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-02 19:07:24 +0000
commit014bb6cd383d2691487f7bac4c345054e8f1cf6a (patch)
tree7e98ef6e98f26b20da4ba7d114e63839858c9ff3 /channels
parent3e967af0b5e94f37e4c5fbf5e72077dc2247789e (diff)
Don't use FXO's with no battery (bug #2359)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3712 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index a061712ed..cafe99e14 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -6289,9 +6289,6 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
return 1;
}
#endif
- if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS) ||
- (p->sig == SIG_FXSGS) || !p->sig)
- return 1;
if (!p->radio)
{
/* Check hook state */
@@ -6304,6 +6301,14 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
}
if (res) {
ast_log(LOG_WARNING, "Unable to check hook state on channel %d\n", p->channel);
+ } else if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS) ||
+ (p->sig == SIG_FXSGS) || !p->sig) {
+ /* When "onhook" that means no battery on the line, and thus
+ it is out of service... */
+ if (par.rxisoffhook)
+ return 1;
+ else
+ return 0;
} else if (par.rxisoffhook) {
ast_log(LOG_DEBUG, "Channel %d off hook, can't use\n", p->channel);
/* Not available when the other end is off hook */