mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
Revert flushing stale AsyncAGI commands from -r313615.
It looks like it was intentional to leave any commands or in-flight commands in the queue in case Async AGI is run again on the call. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1225,19 +1225,16 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], i
|
|||||||
return AGI_RESULT_FAILURE;
|
return AGI_RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush any stale commands. */
|
|
||||||
while ((cmd = get_agi_cmd(chan))) {
|
|
||||||
free_agi_cmd(cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this pipe allows us to create a "fake" AGI struct to use
|
/* this pipe allows us to create a "fake" AGI struct to use
|
||||||
the AGI commands */
|
the AGI commands */
|
||||||
res = pipe(fds);
|
res = pipe(fds);
|
||||||
if (res) {
|
if (res) {
|
||||||
ast_log(LOG_ERROR, "Failed to create Async AGI pipe\n");
|
ast_log(LOG_ERROR, "Failed to create Async AGI pipe\n");
|
||||||
/* intentionally do not remove datastore, added with
|
/*
|
||||||
add_to_agi(), from channel. It will be removed when
|
* Intentionally do not remove the datastore added with
|
||||||
the channel is hung up anyways */
|
* add_to_agi() the from channel. It will be removed when the
|
||||||
|
* channel is hung up anyway.
|
||||||
|
*/
|
||||||
return AGI_RESULT_FAILURE;
|
return AGI_RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1341,9 +1338,13 @@ quit:
|
|||||||
close(fds[0]);
|
close(fds[0]);
|
||||||
close(fds[1]);
|
close(fds[1]);
|
||||||
|
|
||||||
/* intentionally don't get rid of the datastore. So commands can be
|
/*
|
||||||
still in the queue in case AsyncAGI gets called again.
|
* Intentionally do not remove the datastore added with
|
||||||
Datastore destructor will be called on channel destroy anyway */
|
* add_to_agi() the from channel. There might be commands still
|
||||||
|
* in the queue or in-flight to us and AsyncAGI may get called
|
||||||
|
* again. The datastore destructor will be called on channel
|
||||||
|
* destruction anyway.
|
||||||
|
*/
|
||||||
|
|
||||||
return returnstatus;
|
return returnstatus;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user