From 3fde2e56b8445f8af0df43b60d14f9bce1cd51dd Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 23 Dec 2004 02:47:01 +0000 Subject: Fix AGI to know about "builtin" variables, too (bug #2737) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4538 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_agi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'res') diff --git a/res/res_agi.c b/res/res_agi.c index e7bced29a..0572f0bd4 100755 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -983,11 +983,13 @@ 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) { - char *tempstr; + char *ret; + char tempstr[1024]; if (argc != 3) return RESULT_SHOWUSAGE; - if ((tempstr = pbx_builtin_getvar_helper(chan, argv[2]))) - fdprintf(agi->fd, "200 result=1 (%s)\n", tempstr); + pbx_retrieve_variable(chan, argv[2], &ret, tempstr, sizeof(tempstr), NULL); + if (ret) + fdprintf(agi->fd, "200 result=1 (%s)\n", ret); else fdprintf(agi->fd, "200 result=0\n"); -- cgit v1.2.3