From 39e622f7cfb5e860451e11b3cf6813f4981a8592 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 23 Aug 2006 16:05:26 +0000 Subject: [PATCH] Revert last change - breaks retrieval of builtin variables git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@40901 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_agi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/res/res_agi.c b/res/res_agi.c index 935e4f1d60..e9b275ed0b 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1161,17 +1161,18 @@ static int handle_setvariable(struct ast_channel *chan, AGI *agi, int argc, char static int handle_getvariable(struct ast_channel *chan, AGI *agi, int argc, char **argv) { - const char *ret; + 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 - ret = pbx_builtin_getvar_helper(chan, argv[2]); + } else { + pbx_retrieve_variable(chan, argv[2], &ret, tempstr, sizeof(tempstr), NULL); + } if (ret) fdprintf(agi->fd, "200 result=1 (%s)\n", ret);