diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-15 22:49:41 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-15 22:49:41 +0000 |
commit | 50d1f3b97243af5ae0d32564ca04ff6827103b7f (patch) | |
tree | c2a3d5fdb5ca28305fa47a7741b0934b09fe6ebe /res | |
parent | 0e410ba417475d2d3b59bc6cc8b8e93f58b2ec70 (diff) |
use pbx_builtin_getvar_helper() so that GET VARIABLE can retrieve global
variables (issue #7609)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@39935 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index e9b275ed0..935e4f1d6 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1161,18 +1161,17 @@ 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 *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); |