Skip to content
Snippets Groups Projects
Commit 444d30b4 authored by Stefan Schmidt's avatar Stefan Schmidt
Browse files

Report what extension called a failed macro

Add the extension and context of the calling channel to the log output if a macro could not be found.

(closes issue #18112)
Reported by: prado
Patches: 
	app_macro-info.diff uploaded by prado (license 510)
Tested by: schmidts



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 67a3486f
No related branches found
No related tags found
No related merge requests found
...@@ -301,7 +301,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive ...@@ -301,7 +301,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive
if (!ast_exists_extension(chan, fullmacro, "s", 1, if (!ast_exists_extension(chan, fullmacro, "s", 1,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
if (!ast_context_find(fullmacro)) if (!ast_context_find(fullmacro))
ast_log(LOG_WARNING, "No such context '%s' for macro '%s'\n", fullmacro, macro); ast_log(LOG_WARNING, "No such context '%s' for macro '%s'. Was called by %s@%s\n", fullmacro, macro, chan->exten, chan->context);
else else
ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro); ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro);
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment