Skip to content
Snippets Groups Projects
Commit 0e209d5e authored by Tilghman Lesher's avatar Tilghman Lesher
Browse files

Merged revisions 53075 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53075 | tilghman | 2007-02-01 14:09:52 -0600 (Thu, 01 Feb 2007) | 10 lines

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

........
r53074 | tilghman | 2007-02-01 14:07:35 -0600 (Thu, 01 Feb 2007) | 2 lines

Bug 8965 - Allow FIELDQTY to work with both variables and dialplan functions

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 721c7b33
No related branches found
No related tags found
No related merge requests found
...@@ -48,8 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") ...@@ -48,8 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static int function_fieldqty(struct ast_channel *chan, const char *cmd, static int function_fieldqty(struct ast_channel *chan, const char *cmd,
char *parse, char *buf, size_t len) char *parse, char *buf, size_t len)
{ {
const char *varval; char *varname, *varsubst, varval[8192] = "", *varval2 = varval;
char *varval2 = NULL;
int fieldcount = 0; int fieldcount = 0;
AST_DECLARE_APP_ARGS(args, AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(varname); AST_APP_ARG(varname);
...@@ -68,9 +67,10 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd, ...@@ -68,9 +67,10 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
else else
ast_copy_string(args.delim, "-", 2); ast_copy_string(args.delim, "-", 2);
} }
varval = pbx_builtin_getvar_helper(chan, args.varname); varsubst = alloca(strlen(varname) + 4);
if (varval)
varval2 = ast_strdupa(varval); sprintf(varsubst, "${%s}", varname);
pbx_substitute_variables_helper(chan, varsubst, varval, sizeof(varval) - 1);
while (strsep(&varval2, args.delim)) while (strsep(&varval2, args.delim))
fieldcount++; fieldcount++;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment