mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Fix pbx.c to be able to display hints (bug #3074)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
35
pbx.c
35
pbx.c
@@ -2869,6 +2869,7 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
|
|||||||
e = ast_walk_context_extensions(c, NULL);
|
e = ast_walk_context_extensions(c, NULL);
|
||||||
while (e) {
|
while (e) {
|
||||||
struct ast_exten *p;
|
struct ast_exten *p;
|
||||||
|
int prio;
|
||||||
|
|
||||||
/* looking for extension? is this our extension? */
|
/* looking for extension? is this our extension? */
|
||||||
if (exten &&
|
if (exten &&
|
||||||
@@ -2897,11 +2898,18 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
|
|||||||
snprintf(buf, sizeof(buf), "'%s' =>",
|
snprintf(buf, sizeof(buf), "'%s' =>",
|
||||||
ast_get_extension_name(e));
|
ast_get_extension_name(e));
|
||||||
|
|
||||||
snprintf(buf2, sizeof(buf2),
|
prio = ast_get_extension_priority(e);
|
||||||
"%d. %s(%s)",
|
if (prio == PRIORITY_HINT) {
|
||||||
ast_get_extension_priority(e),
|
snprintf(buf2, sizeof(buf2),
|
||||||
ast_get_extension_app(e),
|
"hint: %s",
|
||||||
(char *)ast_get_extension_app_data(e));
|
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_cli(fd, " %-17s %-45s [%s]\n", buf, buf2,
|
||||||
ast_get_extension_registrar(e));
|
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));
|
bzero((void *)buf, sizeof(buf));
|
||||||
if (ast_get_extension_label(p))
|
if (ast_get_extension_label(p))
|
||||||
snprintf(buf, sizeof(buf), " [%s]", ast_get_extension_label(p));
|
snprintf(buf, sizeof(buf), " [%s]", ast_get_extension_label(p));
|
||||||
snprintf(buf2, sizeof(buf2),
|
prio = ast_get_extension_priority(p);
|
||||||
"%d. %s(%s)",
|
if (prio == PRIORITY_HINT) {
|
||||||
ast_get_extension_priority(p),
|
snprintf(buf2, sizeof(buf2),
|
||||||
ast_get_extension_app(p),
|
"hint: %s",
|
||||||
(char *)ast_get_extension_app_data(p));
|
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",
|
ast_cli(fd," %-17s %-45s [%s]\n",
|
||||||
buf, buf2,
|
buf, buf2,
|
||||||
|
Reference in New Issue
Block a user