[asterisk-commits] branch 1.2 - r7382 /branches/1.2/pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Dec 7 14:46:55 CST 2005


Author: kpfleming
Date: Wed Dec  7 14:46:55 2005
New Revision: 7382

URL: http://svn.digium.com/view/asterisk?rev=7382&view=rev
Log:
ensure that hints are allowed to use global variable references

Modified:
    branches/1.2/pbx.c

Modified: branches/1.2/pbx.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/pbx.c?rev=7382&r1=7381&r2=7382&view=diff
==============================================================================
--- branches/1.2/pbx.c (original)
+++ branches/1.2/pbx.c Wed Dec  7 14:46:55 2005
@@ -4652,6 +4652,16 @@
 	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;



More information about the asterisk-commits mailing list