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
This commit is contained in:
Tilghman Lesher
2007-02-01 19:13:53 +00:00
parent f9db7779f0
commit bc926d7f33
2 changed files with 5 additions and 4 deletions

View File

@@ -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++;