Dialplan functions: Fix some channel autoservice misuse.

* Fix off nominal paths leaving the channel in autoservice.
* Remove unnecessary start/stop channel autoservice.
* Fix channel locking around a channel datastore search.

Change-Id: I7ff2e42388064fe3149034ecae57604040b8b540
This commit is contained in:
Richard Mudgett
2018-06-18 16:07:47 -05:00
parent bb0ce22b2b
commit a6edbc9be1
3 changed files with 23 additions and 19 deletions

View File

@@ -227,6 +227,9 @@ static int function_realtime_read(struct ast_channel *chan, const char *cmd, cha
if (resultslen > len) {
ast_log(LOG_WARNING, "Failed to fetch. Realtime data is too large: need %zu, have %zu.\n", resultslen, len);
if (chan) {
ast_autoservice_stop(chan);
}
return -1;
}
@@ -460,6 +463,9 @@ static int function_realtime_readdestroy(struct ast_channel *chan, const char *c
* someones data without giving him the chance to look
* at it. */
ast_log(LOG_WARNING, "Failed to fetch/destroy. Realtime data is too large: need %zu, have %zu.\n", resultslen, len);
if (chan) {
ast_autoservice_stop(chan);
}
return -1;
}