diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-28 22:52:40 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-28 22:52:40 +0000 |
commit | 6c1f07a58520634be47bf15c45dc127bf5dce275 (patch) | |
tree | 87da0bb0e9f2aaff0ac88702f341a936d5268b25 /pbx.c | |
parent | 67a7efd711b3a0eefab958a962def86d33802191 (diff) |
Fix pbx.c to be able to display hints (bug #3074)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4575 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 35 |
1 files changed, 25 insertions, 10 deletions
@@ -2869,6 +2869,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 && @@ -2897,11 +2898,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)); @@ -2915,11 +2923,18 @@ static int handle_show_dialplan(int fd, int argc, char *argv[]) bzero((void *)buf, sizeof(buf)); if (ast_get_extension_label(p)) snprintf(buf, sizeof(buf), " [%s]", ast_get_extension_label(p)); - 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", buf, buf2, |