Merged revisions 53070 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 1 Feb 2007 19:27:22 +0000 (19:27 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 1 Feb 2007 19:27:22 +0000 (19:27 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53070 | tilghman | 2007-02-01 13:21:20 -0600 (Thu, 01 Feb 2007) | 10 lines

Merged revisions 53069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53069 | tilghman | 2007-02-01 13:13:53 -0600 (Thu, 01 Feb 2007) | 2 lines

No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was wrong

........

................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53071 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_strings.c
main/pbx.c

index 8088f4d..c7fc485 100644 (file)
@@ -48,7 +48,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 static int function_fieldqty(struct ast_channel *chan, const char *cmd,
                             char *parse, char *buf, size_t len)
 {
-       char *varval;
+       const char *varval;
+       char *varval2 = NULL;
        int fieldcount = 0;
        AST_DECLARE_APP_ARGS(args,
                             AST_APP_ARG(varname);
@@ -57,7 +58,6 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
 
        AST_STANDARD_APP_ARGS(args, parse);
        if (args.delim) {
-               pbx_retrieve_variable(chan, args.varname, &varval, buf, len, NULL);
                if (args.delim[0] == '\\') {
                        if (args.delim[1] == 'n')
                                ast_copy_string(args.delim, "\n", 2);
@@ -68,7 +68,10 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
                        else
                                ast_copy_string(args.delim, "-", 2);
                }
-               while (strsep(&varval, args.delim))
+               varval = pbx_builtin_getvar_helper(chan, args.varname);
+               if (varval)
+                       varval2 = ast_strdupa(varval);
+               while (strsep(&varval2, args.delim))
                        fieldcount++;
        } else {
                fieldcount = 1;
index f60b2b2..e31d842 100644 (file)
@@ -1097,7 +1097,7 @@ static char *substring(const char *value, int offset, int length, char *workspac
        return ret;
 }
 
-/*! \brief  Support for Asterisk built-in variables and functions in the dialplan
+/*! \brief  Support for Asterisk built-in variables in the dialplan
 
 \note  See also
        - \ref AstVar   Channel variables