]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
func_logic: Don't emit warning if both IF branches are empty.
authorNaveen Albert <asterisk@phreaknet.org>
Wed, 21 Sep 2022 23:17:13 +0000 (23:17 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 26 Sep 2022 17:33:02 +0000 (12:33 -0500)
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

funcs/func_logic.c

index e62ae54c5bac6311e9cd2138aef1b54c471eb4bf..b1411f2f19b566d7007da37b4db2de9d08570de3 100644 (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;
        }