aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_realtime.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_realtime.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_realtime.c')
-rw-r--r--funcs/func_realtime.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/funcs/func_realtime.c b/funcs/func_realtime.c
index 6f52d6b78..c9e730bc1 100644
--- a/funcs/func_realtime.c
+++ b/funcs/func_realtime.c
@@ -74,10 +74,15 @@ static int function_realtime_read(struct ast_channel *chan, char *cmd, char *dat
if (!args.delim2)
args.delim2 = "=";
+ if (chan)
+ ast_autoservice_start(chan);
+
head = ast_load_realtime(args.family, args.fieldmatch, args.value, NULL);
if (!head) {
ast_module_user_remove(u);
+ if (chan)
+ ast_autoservice_stop(chan);
return -1;
}
for (var = head; var; var = var->next)
@@ -90,6 +95,9 @@ static int function_realtime_read(struct ast_channel *chan, char *cmd, char *dat
ast_module_user_remove(u);
+ if (chan)
+ ast_autoservice_stop(chan);
+
return 0;
}
@@ -109,7 +117,10 @@ static int function_realtime_write(struct ast_channel *chan, char *cmd, char *da
return -1;
}
- u = ast_module_user_add(chan);
+ if (chan) {
+ ast_autoservice_start(chan);
+ u = ast_module_user_add(chan);
+ }
AST_STANDARD_APP_ARGS(args, data);
@@ -119,7 +130,10 @@ static int function_realtime_write(struct ast_channel *chan, char *cmd, char *da
ast_log(LOG_WARNING, "Failed to update. Check the debug log for possible data repository related entries.\n");
}
- ast_module_user_remove(u);
+ if (chan) {
+ ast_module_user_remove(u);
+ ast_autoservice_stop(chan);
+ }
return 0;
}