MSet doesn't necessarily need chan to be set
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 4 Jun 2008 20:34:52 +0000 (20:34 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 4 Jun 2008 20:34:52 +0000 (20:34 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120477 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 2b0ee76..bc006c9 100644 (file)
@@ -7887,7 +7887,7 @@ int pbx_builtin_setvar_multiple(struct ast_channel *chan, void *vdata)
                AST_APP_ARG(value);
        );
 
-       if (ast_strlen_zero(vdata) || !chan) {
+       if (ast_strlen_zero(vdata)) {
                ast_log(LOG_WARNING, "MSet requires at least one variable name/value pair.\n");
                return 0;
        }
@@ -7901,6 +7901,8 @@ int pbx_builtin_setvar_multiple(struct ast_channel *chan, void *vdata)
                        pbx_builtin_setvar_helper(chan, pair.name, pair.value);
                        if (strchr(pair.name, ' '))
                                ast_log(LOG_WARNING, "Please avoid unnecessary spaces on variables as it may lead to unexpected results ('%s' set to '%s').\n", pair.name, pair.value);
+               } else if (chan) {
+                       ast_log(LOG_WARNING, "MSet: ignoring entry '%s' with no '='\n", pair.name);
                } else {
                        ast_log(LOG_WARNING, "MSet: ignoring entry '%s' with no '=' (in %s@%s:%d\n", pair.name, chan->exten, chan->context, chan->priority);
                }