mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
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/branches/1.4@87262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user