[svn-commits] russell: branch 1.2 r39935 - /branches/1.2/res/res_agi.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Aug 15 15:49:41 MST 2006


Author: russell
Date: Tue Aug 15 17:49:41 2006
New Revision: 39935

URL: http://svn.digium.com/view/asterisk?rev=39935&view=rev
Log:
use pbx_builtin_getvar_helper() so that GET VARIABLE can retrieve global
variables (issue #7609)

Modified:
    branches/1.2/res/res_agi.c

Modified: branches/1.2/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_agi.c?rev=39935&r1=39934&r2=39935&view=diff
==============================================================================
--- branches/1.2/res/res_agi.c (original)
+++ branches/1.2/res/res_agi.c Tue Aug 15 17:49:41 2006
@@ -1161,18 +1161,17 @@
 
 static int handle_getvariable(struct ast_channel *chan, AGI *agi, int argc, char **argv)
 {
-	char *ret;
+	const char *ret;
 	char tempstr[1024];
 
 	if (argc != 3)
 		return RESULT_SHOWUSAGE;
 
 	/* check if we want to execute an ast_custom_function */
-	if (!ast_strlen_zero(argv[2]) && (argv[2][strlen(argv[2]) - 1] == ')')) {
+	if (!ast_strlen_zero(argv[2]) && (argv[2][strlen(argv[2]) - 1] == ')'))
 		ret = ast_func_read(chan, argv[2], tempstr, sizeof(tempstr));
-	} else {
-		pbx_retrieve_variable(chan, argv[2], &ret, tempstr, sizeof(tempstr), NULL);
-	}
+	else
+		ret = pbx_builtin_getvar_helper(chan, argv[2]);
 
 	if (ret)
 		fdprintf(agi->fd, "200 result=1 (%s)\n", ret);



More information about the svn-commits mailing list