func_callerid: Warn about invalid redirecting reason.

Currently, if a user attempts to set a Caller ID related
function to an invalid value, a warning is emitted,
except for when setting the redirecting reason.
We now emit a warning if we were unable to successfully
parse the user-provided reason.

ASTERISK-30332 #close

Change-Id: Ic341f5d5f7303b6f1115549be64db58a85944f5a
This commit is contained in:
Naveen Albert 2022-11-26 00:03:57 +00:00 committed by Friendly Automation
parent d141f3a821
commit 914c8e28c1
1 changed files with 1 additions and 0 deletions

View File

@ -1611,6 +1611,7 @@ static int redirecting_write(struct ast_channel *chan, const char *cmd, char *da
* reason, so we can just set the reason string to what was given and set the
* code to be unknown
*/
ast_log(LOG_WARNING, "Unknown redirecting reason '%s', defaulting to unknown\n", val);
redirecting.orig_reason.code = AST_REDIRECTING_REASON_UNKNOWN;
redirecting.orig_reason.str = val;
set_it(chan, &redirecting, NULL);