From: Tilghman Lesher Date: Thu, 1 Feb 2007 19:13:53 +0000 (+0000) Subject: No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was... X-Git-Tag: 1.2.15~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc926d7f33855cbe6c2568f2b0ae660059a69ac6;p=thirdparty%2Fasterisk.git No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was wrong git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@53069 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 27c457dd43..6da95b54c2 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++; diff --git a/pbx.c b/pbx.c index b126c3ddb7..7a8f9979d2 100644 --- a/pbx.c +++ b/pbx.c @@ -974,8 +974,7 @@ static char *substring(const char *value, int offset, int length, char *workspac return ret; } -/*! \brief pbx_retrieve_variable: Support for Asterisk built-in variables and - functions in the dialplan +/*! \brief pbx_retrieve_variable: Support for Asterisk built-in variables ---*/ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp) {