From 43f7956422c34afd1996d1ed4738874e5d4470ff Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 7 Dec 2005 20:46:55 +0000 Subject: [PATCH] ensure that hints are allowed to use global variable references git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7382 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pbx.c b/pbx.c index 606ca06331..e89e7e6af4 100644 --- a/pbx.c +++ b/pbx.c @@ -4652,6 +4652,16 @@ int ast_add_extension2(struct ast_context *con, int res; int length; char *p; + char expand_buf[VAR_BUF_SIZE]; + + /* if we are adding a hint, and there are global variables, and the hint + contains variable references, then expand them + */ + if ((priority == PRIORITY_HINT) && AST_LIST_FIRST(&globals) && strstr(application, "${")) { + pbx_substitute_variables_varshead(&globals, application, expand_buf, sizeof(expand_buf)); + application = expand_buf; + } + length = sizeof(struct ast_exten); length += strlen(extension) + 1; length += strlen(application) + 1;