From d1cbba26808852d22f9e2a4077a7286167d5654b Mon Sep 17 00:00:00 2001 From: tilghman Date: Thu, 1 Feb 2007 19:13:53 +0000 Subject: No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was wrong git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@53069 f38db490-d61c-443f-a65b-d21fe96a405b --- funcs/func_strings.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'funcs/func_strings.c') diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 27c457dd4..6da95b54c 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -41,13 +41,15 @@ static char *function_fieldqty(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) { - char *varname, *varval, workspace[256]; + char *varname, *varval; char *delim = ast_strdupa(data); int fieldcount = 0; if (delim) { varname = strsep(&delim, "|"); - pbx_retrieve_variable(chan, varname, &varval, workspace, sizeof(workspace), NULL); + varval = pbx_builtin_getvar_helper(chan, varname); + if (varval) + varval = ast_strdupa(varval); if (delim) { while (strsep(&varval, delim)) fieldcount++; -- cgit v1.2.3