Better handle timeouts when the individual speaks after everything has been played but before the timeout ends.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-02-28 17:45:50 +00:00
parent 96622ddd26
commit d92e56ac89

View File

@@ -587,7 +587,7 @@ static int speech_background(struct ast_channel *chan, void *data)
} }
/* Do timeout check (shared between audio/dtmf) */ /* Do timeout check (shared between audio/dtmf) */
if (started == 1) { if (!quieted && started == 1) {
time(&current); time(&current);
if ((current-start) >= timeout) { if ((current-start) >= timeout) {
done = 1; done = 1;
@@ -599,8 +599,9 @@ static int speech_background(struct ast_channel *chan, void *data)
/* Do checks on speech structure to see if it's changed */ /* Do checks on speech structure to see if it's changed */
ast_mutex_lock(&speech->lock); ast_mutex_lock(&speech->lock);
if (ast_test_flag(speech, AST_SPEECH_QUIET) && chan->stream != NULL) { if (ast_test_flag(speech, AST_SPEECH_QUIET)) {
ast_stopstream(chan); if (chan->stream)
ast_stopstream(chan);
ast_clear_flag(speech, AST_SPEECH_QUIET); ast_clear_flag(speech, AST_SPEECH_QUIET);
quieted = 1; quieted = 1;
} }