Revert "pbx_ael: Global variables are not expanded." master
authorSean Bright <sean@seanbright.com>
Sun, 19 Mar 2023 21:30:50 +0000 (16:30 -0500)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Fri, 24 Mar 2023 12:15:12 +0000 (07:15 -0500)
This reverts commit c448dcd2f0e67acf527662574193994559ae853a.

Reason for revert: Behavior change that breaks existing dialplan.

ASTERISK-30472 #close

Change-Id: I20e44b4081d6ee0fe54cde44ac71dcf2d146f909

res/ael/pval.c

index 8596d66..10af159 100644 (file)
@@ -4414,11 +4414,7 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo
 {
        pval *p,*p2;
        struct ast_context *context;
-#ifdef LOW_MEMORY
        char buf[2000];
-#else
-       char buf[8192];
-#endif
        struct ael_extension *exten;
        struct ael_extension *exten_list = 0;
 
@@ -4431,13 +4427,9 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo
                case PV_GLOBALS:
                        /* just VARDEC elements */
                        for (p2=p->u1.list; p2; p2=p2->next) {
-#ifdef STANDALONE
-                               snprintf(buf, sizeof(buf), "%s=%s", p2->u1.str, p2->u2.val);
-                               pbx_builtin_setvar(NULL, buf);
-#else
-                               pbx_substitute_variables_helper(NULL, p2->u2.val, buf, sizeof(buf) - 1);
-                               pbx_builtin_setvar_helper(NULL, p2->u1.str, buf);
-#endif
+                               char buf2[2000];
+                               snprintf(buf2,sizeof(buf2),"%s=%s", p2->u1.str, p2->u2.val);
+                               pbx_builtin_setvar(NULL, buf2);
                        }
                        break;
                default: