func_logic: Don't emit warning if both IF branches are empty.

The IF function currently emits warnings if both IF branches
are empty. However, there is no actual necessity that either
branch be non-empty as, unlike other conditional applications/
functions, nothing is inherently done with IF, and both
sides could legitimately be empty. The warning is thus turned
into a debug message.

ASTERISK-30243 #close

Change-Id: I5250625dd720f95e1859b5dfb933905d7e7a730e
This commit is contained in:
Naveen Albert 2022-09-21 23:17:13 +00:00 committed by Friendly Automation
parent a2e418e495
commit 6d8308ad75
1 changed files with 1 additions and 2 deletions

View File

@ -187,8 +187,7 @@ static int acf_if(struct ast_channel *chan, const char *cmd, char *data, char *b
AST_NONSTANDARD_APP_ARGS(args2, args1.remainder, ':');
if (ast_strlen_zero(args1.expr) || !(args2.iftrue || args2.iffalse)) {
ast_log(LOG_WARNING, "Syntax IF(<expr>?[<true>][:<false>]) (expr must be non-null, and either <true> or <false> must be non-null)\n");
ast_log(LOG_WARNING, " In this case, <expr>='%s', <true>='%s', and <false>='%s'\n", args1.expr, args2.iftrue, args2.iffalse);
ast_debug(1, "<expr>='%s', <true>='%s', and <false>='%s'\n", args1.expr, args2.iftrue, args2.iffalse);
return -1;
}