From 6f3b1c60409793ddb17804110beab59d94c49866 Mon Sep 17 00:00:00 2001 From: murf Date: Tue, 5 Jun 2007 21:30:18 +0000 Subject: this fixes bug 9883, wherein macros were not allowing the includes construct. fixed and tested, looks OK. Now includes can serve as an adjunct to catch. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67526 f38db490-d61c-443f-a65b-d21fe96a405b --- pbx/pbx_ael.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'pbx/pbx_ael.c') diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c index eda306261..7ccc5e82d 100644 --- a/pbx/pbx_ael.c +++ b/pbx/pbx_ael.c @@ -3780,7 +3780,29 @@ void ast_compile_ael2(struct ast_context **local_contexts, struct pval *root) np2->appargs = strdup(buf); linkprio(exten, np2); } - + /* add any includes */ + for (p2=p->u3.macro_statements; p2; p2=p2->next) { + pval *p3; + + switch (p2->type) { + case PV_INCLUDES: + for (p3 = p2->u1.list; p3 ;p3=p3->next) { + if ( p3->u2.arglist ) { + snprintf(buf,sizeof(buf), "%s|%s|%s|%s|%s", + p3->u1.str, + p3->u2.arglist->u1.str, + p3->u2.arglist->next->u1.str, + p3->u2.arglist->next->next->u1.str, + p3->u2.arglist->next->next->next->u1.str); + ast_context_add_include2(context, buf, registrar); + } else + ast_context_add_include2(context, p3->u1.str, registrar); + } + break; + default: + break; + } + } /* CONTAINS APPCALLS, CATCH, just like extensions... */ gen_prios(exten, p->u1.str, p->u3.macro_statements, 0, context ); if (exten->return_needed) { -- cgit v1.2.3