diff options
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 45 |
1 files changed, 31 insertions, 14 deletions
@@ -481,7 +481,7 @@ int pbx_exec(struct ast_channel *c, /* Channel */ /* Go no deeper than this through includes (not counting loops) */ -#define AST_PBX_MAX_STACK 64 +#define AST_PBX_MAX_STACK 128 #define HELPER_EXISTS 0 #define HELPER_SPAWN 1 @@ -577,6 +577,7 @@ static void pbx_destroy(struct ast_pbx *p) match=1;\ pattern++;\ while(match && *data && *pattern && (*pattern != '/')) {\ + while (*data == '-' && (*(data+1) != '\0')) data++;\ switch(toupper(*pattern)) {\ case '[': \ {\ @@ -1258,7 +1259,7 @@ static int pbx_extension_helper(struct ast_channel *c, char *context, char *exte pbx_substitute_variables(passdata, sizeof(passdata), c, e); if (option_debug) ast_log(LOG_DEBUG, "Launching '%s'\n", app->name); - else if (option_verbose > 2) + if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\") %s\n", term_color(tmp, app->name, COLOR_BRCYAN, 0, sizeof(tmp)), term_color(tmp2, c->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)), @@ -2760,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 && @@ -2786,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)); @@ -2800,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, @@ -4381,7 +4397,8 @@ static int pbx_builtin_answer(struct ast_channel *chan, void *data) static int pbx_builtin_setlanguage(struct ast_channel *chan, void *data) { /* Copy the language as specified */ - strncpy(chan->language, (char *)data, sizeof(chan->language)-1); + if (data) + strncpy(chan->language, (char *)data, sizeof(chan->language)-1); return 0; } @@ -4567,7 +4584,7 @@ static int pbx_builtin_background(struct ast_channel *chan, void *data) res = ast_waitstream(chan, AST_DIGIT_ANY); ast_stopstream(chan); } else { - ast_log(LOG_WARNING, "ast_streamfile failed on %s fro %s\n", chan->name, (char*)data); + ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char*)data); res = 0; } } |