aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_strings.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-28 13:46:55 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-28 13:46:55 +0000
commitf59eb98821f88a4108c78b2853b0cca75ad8caf2 (patch)
treeb387b8fef99bd9ef3a2f0e3facf58071ce44d1ef /funcs/func_strings.c
parentff0fcde5c61c9f9cb0315bc47ecff200b27db505 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@87262 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r--funcs/func_strings.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index 3c8ead803..c5849c0fc 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -53,6 +53,9 @@ static int function_fieldqty(struct ast_channel *chan, char *cmd,
AST_APP_ARG(delim);
);
+ if (chan)
+ ast_autoservice_start(chan);
+
AST_STANDARD_APP_ARGS(args, parse);
if (args.delim) {
varsubst = alloca(strlen(args.varname) + 4);
@@ -70,6 +73,9 @@ static int function_fieldqty(struct ast_channel *chan, char *cmd,
}
snprintf(buf, len, "%d", fieldcount);
+ if (chan)
+ ast_autoservice_stop(chan);
+
return 0;
}
@@ -178,6 +184,9 @@ static int array(struct ast_channel *chan, char *cmd, char *var,
if (!var || !value2)
return -1;
+ if (chan)
+ ast_autoservice_start(chan);
+
/* The functions this will generally be used with are SORT and ODBC_*, which
* both return comma-delimited lists. However, if somebody uses literal lists,
* their commas will be translated to vertical bars by the load, and I don't
@@ -209,6 +218,9 @@ static int array(struct ast_channel *chan, char *cmd, char *var,
}
}
+ if (chan)
+ ast_autoservice_stop(chan);
+
return 0;
}
@@ -517,7 +529,11 @@ static int function_eval(struct ast_channel *chan, 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;
}