Log execution stack if option_debug is enabled (bug #3177)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
9fd51d4ef6
commit
ccead56701
8
pbx.c
8
pbx.c
|
@ -1220,6 +1220,8 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
|
||||||
char tmp[80];
|
char tmp[80];
|
||||||
char tmp2[80];
|
char tmp2[80];
|
||||||
char tmp3[EXT_DATA_SIZE];
|
char tmp3[EXT_DATA_SIZE];
|
||||||
|
char atmp[80];
|
||||||
|
char atmp2[EXT_DATA_SIZE+100];
|
||||||
|
|
||||||
if (ast_mutex_lock(&conlock)) {
|
if (ast_mutex_lock(&conlock)) {
|
||||||
ast_log(LOG_WARNING, "Unable to obtain lock\n");
|
ast_log(LOG_WARNING, "Unable to obtain lock\n");
|
||||||
|
@ -1257,8 +1259,12 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
|
||||||
strncpy(c->exten, exten, sizeof(c->exten)-1);
|
strncpy(c->exten, exten, sizeof(c->exten)-1);
|
||||||
c->priority = priority;
|
c->priority = priority;
|
||||||
pbx_substitute_variables(passdata, sizeof(passdata), c, e);
|
pbx_substitute_variables(passdata, sizeof(passdata), c, e);
|
||||||
if (option_debug)
|
if (option_debug) {
|
||||||
ast_log(LOG_DEBUG, "Launching '%s'\n", app->name);
|
ast_log(LOG_DEBUG, "Launching '%s'\n", app->name);
|
||||||
|
snprintf(atmp, 80, "STACK-%s-%s-%d", context, exten, priority);
|
||||||
|
snprintf(atmp2, EXT_DATA_SIZE+100, "%s(\"%s\", \"%s\") %s", app->name, c->name, (!ast_strlen_zero(passdata) ? (char *)passdata : ""), (newstack ? "in new stack" : "in same stack"));
|
||||||
|
pbx_builtin_setvar_helper(c, atmp, atmp2);
|
||||||
|
}
|
||||||
if (option_verbose > 2)
|
if (option_verbose > 2)
|
||||||
ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\") %s\n",
|
ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\") %s\n",
|
||||||
term_color(tmp, app->name, COLOR_BRCYAN, 0, sizeof(tmp)),
|
term_color(tmp, app->name, COLOR_BRCYAN, 0, sizeof(tmp)),
|
||||||
|
|
Loading…
Reference in New Issue