diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-28 14:11:01 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-28 14:11:01 +0000 |
commit | 01a542af5a455ef9383cfdf6d13cb1896649452b (patch) | |
tree | febd3ec84ac74e88878a3bb8ad213a0d79d261de /funcs/func_realtime.c | |
parent | 878edbcba66891d91c9eb2c7d0fd5dad8eee521e (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@87263 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_realtime.c')
-rw-r--r-- | funcs/func_realtime.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/funcs/func_realtime.c b/funcs/func_realtime.c index 1f67fcb46..bc9063fe9 100644 --- a/funcs/func_realtime.c +++ b/funcs/func_realtime.c @@ -71,9 +71,14 @@ static int function_realtime_read(struct ast_channel *chan, const char *cmd, cha if (!args.delim2) args.delim2 = "="; + if (chan) + ast_autoservice_start(chan); + head = ast_load_realtime_all(args.family, args.fieldmatch, args.value, NULL); if (!head) + if (chan) + ast_autoservice_stop(chan); return -1; resultslen = 0; @@ -88,6 +93,9 @@ static int function_realtime_read(struct ast_channel *chan, const char *cmd, cha ast_str_append(&out, 0, "%s%s%s%s", var->name, args.delim2, var->value, args.delim1); ast_copy_string(buf, out->str, len); + if (chan) + ast_autoservice_stop(chan); + return 0; } @@ -106,6 +114,9 @@ static int function_realtime_write(struct ast_channel *chan, const char *cmd, ch return -1; } + if (chan) + ast_autoservice_start(chan); + AST_STANDARD_APP_ARGS(args, data); res = ast_update_realtime(args.family, args.fieldmatch, args.value, args.field, (char *)value, NULL); @@ -114,6 +125,9 @@ static int function_realtime_write(struct ast_channel *chan, const char *cmd, ch ast_log(LOG_WARNING, "Failed to update. Check the debug log for possible data repository related entries.\n"); } + if (chan) + ast_autoservice_stop(chan); + return 0; } |