summaryrefslogtreecommitdiff
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-04-06 15:50:18 +0000
committerMark Spencer <markster@digium.com>2004-04-06 15:50:18 +0000
commit426bf55df230abad8bf83a48a7eddf396d0bc84d (patch)
tree36f1f9d792b40d6ee6a2664a30f884a135f610e6 /channels/chan_zap.c
parent1bbf0d2cf6144c608c2c982bd48299bb7ff1e2c3 (diff)
Print actual hook state in chan_zap
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-xchannels/chan_zap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 3706e1462..7617478f9 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -7056,6 +7056,7 @@ static int zap_show_channel(int fd, int argc, char **argv)
int channel;
struct zt_pvt *tmp = NULL;
ZT_CONFINFO ci;
+ ZT_PARAMS ps;
int x;
if (argc != 4)
@@ -7127,8 +7128,12 @@ static int zap_show_channel(int fd, int argc, char **argv)
ast_cli(fd, "Actual Confmute: %s\n", x ? "Yes" : "No");
}
#endif
- ast_mutex_unlock(&iflock);
- return RESULT_SUCCESS;
+ ps.channo = tmp->channel;
+ if (ioctl(tmp->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps) < 0) {
+ ast_log(LOG_WARNING, "Failed to get parameters on channel %d\n", tmp->channel);
+ } else {
+ ast_cli(fd, "Actual Hookstate: %s\n", ps.rxisoffhook ? "Offhook" : "Onhook");
+ }
}
tmp = tmp->next;
}