summaryrefslogtreecommitdiff
path: root/main/pbx.c
diff options
context:
space:
mode:
authorScott Griepentrog <sgriepentrog@digium.com>2014-06-10 22:31:04 +0000
committerScott Griepentrog <sgriepentrog@digium.com>2014-06-10 22:31:04 +0000
commitd7ed0a1ece9484aa05da3549a1ca3b0a20866c3f (patch)
treede25788f061cfef93266d68ad26f261713929652 /main/pbx.c
parent2bd6a010a6d7e43f21aa089662c56c00ff17541e (diff)
CLI: add presence information to core show hints
Adds presence state value to output of core show hints. Also reformats the output slightly so it doesn't use as much space as it would otherwise. Was: 1000@demo : SIP/1000 State:Unavailable Watchers 0 Now: 1000@demo : SIP/1000 State:Unavailable Presence:Idle Watchers 0 AFS-53 #close Review: https://reviewboard.asterisk.org/r/3604/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/main/pbx.c b/main/pbx.c
index ba985199f..d6b11c71d 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7367,6 +7367,7 @@ static char *handle_show_hints(struct ast_cli_entry *e, int cmd, struct ast_cli_
int num = 0;
int watchers;
struct ao2_iterator i;
+ char buf[AST_MAX_EXTENSION+AST_MAX_CONTEXT+2];
switch (cmd) {
case CLI_INIT:
@@ -7395,11 +7396,17 @@ static char *handle_show_hints(struct ast_cli_entry *e, int cmd, struct ast_cli_
continue;
}
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_extension_state2str(hint->last_presence_state),
+ watchers);
+
ao2_unlock(hint);
num++;
}