Merged revisions 87262 via svnmerge from

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

........
r87262 | tilghman | 2007-10-28 08:46:55 -0500 (Sun, 28 Oct 2007) | 7 lines

Add autoservice to several more functions which might delay in their responses.
Also, make sure that func_odbc functions have a channel on which to set
variables.
Reported by russell
Fixed by tilghman
Closes issue #11099

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-10-28 14:11:01 +00:00
parent 0706014b1b
commit 64a0a9aa2c
4 changed files with 92 additions and 4 deletions

View File

@@ -57,6 +57,9 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
char delim[2] = "";
size_t delim_used;
if (chan)
ast_autoservice_start(chan);
AST_STANDARD_APP_ARGS(args, parse);
if (args.delim) {
ast_get_encoded_char(args.delim, delim, &delim_used);
@@ -76,6 +79,9 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
}
snprintf(buf, len, "%d", fieldcount);
if (chan)
ast_autoservice_stop(chan);
return 0;
}
@@ -255,13 +261,19 @@ static int array(struct ast_channel *chan, const char *cmd, char *var,
if (!var || !value2)
return -1;
if (chan)
ast_autoservice_start(chan);
if (!strcmp(cmd, "HASH")) {
const char *var2 = pbx_builtin_getvar_helper(chan, "~ODBCFIELDS~");
origvar = var;
if (var2)
var = ast_strdupa(var2);
else
else {
if (chan)
ast_autoservice_stop(chan);
return -1;
}
ishash = 1;
}
@@ -298,6 +310,9 @@ static int array(struct ast_channel *chan, const char *cmd, char *var,
}
}
if (chan)
ast_autoservice_stop(chan);
return 0;
}
@@ -726,7 +741,11 @@ static int function_eval(struct ast_channel *chan, const char *cmd, char *data,
return -1;
}
if (chan)
ast_autoservice_start(chan);
pbx_substitute_variables_helper(chan, data, buf, len - 1);
if (chan)
ast_autoservice_stop(chan);
return 0;
}