From: Joshua Colp Date: Wed, 28 Feb 2007 17:45:50 +0000 (+0000) Subject: Better handle timeouts when the individual speaks after everything has been played... X-Git-Tag: 1.4.1~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d92e56ac8902beee8d5323b8c983897d1b39709e;p=thirdparty%2Fasterisk.git 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 --- diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c index a2a0757676..5e236ddc64 100644 --- a/apps/app_speech_utils.c +++ b/apps/app_speech_utils.c @@ -587,7 +587,7 @@ static int speech_background(struct ast_channel *chan, void *data) } /* Do timeout check (shared between audio/dtmf) */ - if (started == 1) { + if (!quieted && started == 1) { time(¤t); if ((current-start) >= timeout) { 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 */ ast_mutex_lock(&speech->lock); - if (ast_test_flag(speech, AST_SPEECH_QUIET) && chan->stream != NULL) { - ast_stopstream(chan); + if (ast_test_flag(speech, AST_SPEECH_QUIET)) { + if (chan->stream) + ast_stopstream(chan); ast_clear_flag(speech, AST_SPEECH_QUIET); quieted = 1; }