From: Scott Griepentrog Date: Wed, 11 Jun 2014 20:22:23 +0000 (+0000) Subject: CLI: correct presence information on core show hints X-Git-Tag: 13.0.0-beta1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5298f2a1bef3c648f43387970ad1a6694aa4390;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/pbx.c b/main/pbx.c index d6b11c71d0..67108f65d0 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);