mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 15:08:53 +00:00
Merged revisions 53070 via svnmerge from
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
This commit is contained in:
@@ -48,7 +48,8 @@ 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)
|
||||||
{
|
{
|
||||||
char *varval;
|
const char *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);
|
||||||
@@ -57,7 +58,6 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
|
|||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
if (args.delim) {
|
if (args.delim) {
|
||||||
pbx_retrieve_variable(chan, args.varname, &varval, buf, len, NULL);
|
|
||||||
if (args.delim[0] == '\\') {
|
if (args.delim[0] == '\\') {
|
||||||
if (args.delim[1] == 'n')
|
if (args.delim[1] == 'n')
|
||||||
ast_copy_string(args.delim, "\n", 2);
|
ast_copy_string(args.delim, "\n", 2);
|
||||||
@@ -68,7 +68,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);
|
||||||
}
|
}
|
||||||
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++;
|
fieldcount++;
|
||||||
} else {
|
} else {
|
||||||
fieldcount = 1;
|
fieldcount = 1;
|
||||||
|
@@ -1097,7 +1097,7 @@ static char *substring(const char *value, int offset, int length, char *workspac
|
|||||||
return ret;
|
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
|
\note See also
|
||||||
- \ref AstVar Channel variables
|
- \ref AstVar Channel variables
|
||||||
|
Reference in New Issue
Block a user