From: Sean Bright Date: Thu, 26 Jan 2023 20:18:08 +0000 (-0500) Subject: pbx_ael: Global variables are not expanded. X-Git-Tag: 18.17.0-rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f67258d17283f245b0d8a34c2288ca290fe679bf;p=thirdparty%2Fasterisk.git pbx_ael: Global variables are not expanded. Variable references within global variable assignments are now expanded rather than being included literally. ASTERISK-30406 #close Change-Id: I136e8d6395e90a4c92d9777a46a7bc3edb08d05d --- diff --git a/res/ael/pval.c b/res/ael/pval.c index 10af1597e8..8596d66373 100644 --- a/res/ael/pval.c +++ b/res/ael/pval.c @@ -4414,7 +4414,11 @@ 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; @@ -4427,9 +4431,13 @@ 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) { - char buf2[2000]; - snprintf(buf2,sizeof(buf2),"%s=%s", p2->u1.str, p2->u2.val); - pbx_builtin_setvar(NULL, buf2); +#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 } break; default: