]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was...
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 1 Feb 2007 19:13:53 +0000 (19:13 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 1 Feb 2007 19:13:53 +0000 (19:13 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@53069 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_strings.c
pbx.c

index 27c457dd43daa75c1e8934862b1620dd8cce6bf4..6da95b54c2cc5e8b9ab2f287ed0236c596c6621f 100644 (file)
 
 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 b126c3ddb76b041ffb2ca30e1c0612a0740651f4..7a8f9979d29d35531b468be5ded1345b90c40e55 100644 (file)
--- 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)
 {