summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-03-28 22:09:38 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-03-28 22:09:38 +0000
commit4bf8e92c1dbc085fba56092ef238483a97a981b3 (patch)
treee59d96140926f5e58025dc2e3a25879e53786a9e
parente9b7424737daa75628dfc485376a3448e5b6fb95 (diff)
make 'show hints' CLI command show context name for each hint
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--include/asterisk/pbx.h1
-rw-r--r--pbx.c11
2 files changed, 10 insertions, 2 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index eccae45db..e56819cb0 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -723,6 +723,7 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout,
/* Functions for returning values from structures */
const char *ast_get_context_name(struct ast_context *con);
const char *ast_get_extension_name(struct ast_exten *exten);
+struct ast_context *ast_get_extension_context(struct ast_exten *exten);
const char *ast_get_include_name(struct ast_include *include);
const char *ast_get_ignorepat_name(struct ast_ignorepat *ip);
const char *ast_get_switch_name(struct ast_sw *sw);
diff --git a/pbx.c b/pbx.c
index 296e54c21..640b9e6c9 100644
--- a/pbx.c
+++ b/pbx.c
@@ -2974,8 +2974,10 @@ static int handle_show_hints(int fd, int argc, char *argv[])
watchers = 0;
for (watcher = hint->callbacks; watcher; watcher = watcher->next)
watchers++;
- ast_cli(fd, " %-20.20s: %-20.20s State:%-15.15s Watchers %2d\n",
- ast_get_extension_name(hint->exten), ast_get_extension_app(hint->exten),
+ ast_cli(fd, " %-20.20s@%20s: %-20.20s State:%-15.15s Watchers %2d\n",
+ ast_get_extension_name(hint->exten),
+ ast_get_context_name(ast_get_extension_context(hint->exten)),
+ ast_get_extension_app(hint->exten),
ast_extension_state2str(hint->laststate), watchers);
num++;
}
@@ -5893,6 +5895,11 @@ const char *ast_get_context_name(struct ast_context *con)
return con ? con->name : NULL;
}
+struct ast_context *ast_get_extension_context(struct ast_exten *exten)
+{
+ return exten ? exten->parent : NULL;
+}
+
const char *ast_get_extension_name(struct ast_exten *exten)
{
return exten ? exten->exten : NULL;