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
This commit is contained in:
Mark Spencer
2004-12-23 02:47:01 +00:00
parent 55a24aecad
commit 3fde2e56b8
3 changed files with 9 additions and 6 deletions

View File

@@ -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");