From: Naveen Albert Date: Wed, 21 Sep 2022 23:17:13 +0000 (+0000) Subject: func_logic: Don't emit warning if both IF branches are empty. X-Git-Tag: 16.30.0-rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07a4a9b8ec25e00db3bb81925f8659fc836e2b49;p=thirdparty%2Fasterisk.git 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 --- diff --git a/funcs/func_logic.c b/funcs/func_logic.c index e62ae54c5b..b1411f2f19 100644 --- a/funcs/func_logic.c +++ b/funcs/func_logic.c @@ -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 must be non-null, and either or must be non-null)\n"); - ast_log(LOG_WARNING, " In this case, ='%s', ='%s', and ='%s'\n", args1.expr, args2.iftrue, args2.iffalse); + ast_debug(1, "='%s', ='%s', and ='%s'\n", args1.expr, args2.iftrue, args2.iffalse); return -1; }