make 'show hints' CLI command show context name for each hint
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 28 Mar 2006 22:09:38 +0000 (22:09 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 28 Mar 2006 22:09:38 +0000 (22:09 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15815 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/pbx.h
pbx.c

index eccae45..e56819c 100644 (file)
@@ -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 296e54c..640b9e6 100644 (file)
--- 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;