summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Griepentrog <sgriepentrog@digium.com>2014-06-11 20:22:23 +0000
committerScott Griepentrog <sgriepentrog@digium.com>2014-06-11 20:22:23 +0000
commitd5298f2a1bef3c648f43387970ad1a6694aa4390 (patch)
tree03790e3c86e207cb47d21ffd133e679fa86d0ab3
parentd7ed0a1ece9484aa05da3549a1ca3b0a20866c3f (diff)
CLI: correct presence information on core show hints
Adds presence to core show hint and changes presence string conversion to use the correct function. ASTERISK-23858 #close Review: https://reviewboard.asterisk.org/r/3611/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/pbx.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/main/pbx.c b/main/pbx.c
index d6b11c71d..67108f65d 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7404,7 +7404,7 @@ static char *handle_show_hints(struct ast_cli_entry *e, int cmd, struct ast_cli_
buf,
ast_get_extension_app(hint->exten),
ast_extension_state2str(hint->laststate),
- ast_extension_state2str(hint->last_presence_state),
+ ast_presence_state2str(hint->last_presence_state),
watchers);
ao2_unlock(hint);
@@ -7460,6 +7460,7 @@ static char *handle_show_hint(struct ast_cli_entry *e, int cmd, struct ast_cli_a
int watchers;
int num = 0, extenlen;
struct ao2_iterator i;
+ char buf[AST_MAX_EXTENSION+AST_MAX_CONTEXT+2];
switch (cmd) {
case CLI_INIT:
@@ -7491,11 +7492,15 @@ static char *handle_show_hint(struct ast_cli_entry *e, int cmd, struct ast_cli_a
}
if (!strncasecmp(ast_get_extension_name(hint->exten), a->argv[3], extenlen)) {
watchers = ao2_container_count(hint->callbacks);
- ast_cli(a->fd, " %20s@%-20.20s: %-20.20s State:%-15.15s Watchers %2d\n",
+ sprintf(buf, "%s@%s",
ast_get_extension_name(hint->exten),
- ast_get_context_name(ast_get_extension_context(hint->exten)),
+ ast_get_context_name(ast_get_extension_context(hint->exten)));
+ ast_cli(a->fd, "%-20.20s: %-20.20s State:%-15.15s Presence:%-15.15s Watchers %2d\n",
+ buf,
ast_get_extension_app(hint->exten),
- ast_extension_state2str(hint->laststate), watchers);
+ ast_extension_state2str(hint->laststate),
+ ast_presence_state2str(hint->last_presence_state),
+ watchers);
num++;
}
ao2_unlock(hint);