]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix show dialplan for hints (bug #3074)
authorRussell Bryant <russell@russellbryant.com>
Thu, 30 Dec 2004 20:57:41 +0000 (20:57 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 30 Dec 2004 20:57:41 +0000 (20:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4609 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index 5479c943a5307aa1467b2f5da64a1908786792f7..b648ded89649fbedf2443a8dd2e5c1ef7876c9dc 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -2761,6 +2761,7 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
                                e = ast_walk_context_extensions(c, NULL);
                                while (e) {
                                        struct ast_exten *p;
+                                       int prio;
 
                                        /* looking for extension? is this our extension? */
                                        if (exten &&
@@ -2787,11 +2788,18 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
                                        snprintf(buf, sizeof(buf), "'%s' =>",
                                                ast_get_extension_name(e));
 
-                                       snprintf(buf2, sizeof(buf2),
-                                               "%d. %s(%s)",
-                                               ast_get_extension_priority(e),
-                                               ast_get_extension_app(e),
-                                               (char *)ast_get_extension_app_data(e));
+                                       prio = ast_get_extension_priority(e);
+                                       if (prio == PRIORITY_HINT) {
+                                               snprintf(buf2, sizeof(buf2),
+                                                       "hint: %s",
+                                                       ast_get_extension_app(e));
+                                       } else {
+                                               snprintf(buf2, sizeof(buf2),
+                                                       "%d. %s(%s)",
+                                                       prio,
+                                                       ast_get_extension_app(e),
+                                                       (char *)ast_get_extension_app_data(e));
+                                       }
 
                                        ast_cli(fd, "  %-17s %-45s [%s]\n", buf, buf2,
                                                ast_get_extension_registrar(e));
@@ -2801,11 +2809,18 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
                                        while (p) {
                                                bzero((void *)buf2, sizeof(buf2));
 
-                                               snprintf(buf2, sizeof(buf2),
-                                                       "%d. %s(%s)",
-                                                       ast_get_extension_priority(p),
-                                                       ast_get_extension_app(p),
-                                                       (char *)ast_get_extension_app_data(p));
+                                               prio = ast_get_extension_priority(p);
+                                               if (prio == PRIORITY_HINT) {
+                                                       snprintf(buf2, sizeof(buf2),
+                                                               "hint: %s",
+                                                               ast_get_extension_app(p));
+                                               } else {
+                                                       snprintf(buf2, sizeof(buf2),
+                                                               "%d. %s(%s)",
+                                                               prio,
+                                                               ast_get_extension_app(p),
+                                                               (char *)ast_get_extension_app_data(p));
+                                               }
 
                                                ast_cli(fd,"  %-17s %-45s [%s]\n",
                                                        "", buf2,