aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_speech_utils.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-03 19:40:59 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-03 19:40:59 +0000
commit7c0fd1732c40376496c730528229c25bcdb67398 (patch)
tree0a1908e8e26335a862f012feb149bd598198d3d9 /apps/app_speech_utils.c
parentb4d47a7200f9429e92688ce4c854dc1112b40b5d (diff)
Don't clash when a person both speaks and uses DTMF.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59963 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_speech_utils.c')
-rw-r--r--apps/app_speech_utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 92b3dcd45..0dfc07642 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -590,7 +590,7 @@ static int speech_background(struct ast_channel *chan, void *data)
}
/* Do timeout check (shared between audio/dtmf) */
- if (!quieted && started == 1) {
+ if ((!quieted || strlen(dtmf)) && started == 1) {
time(&current);
if ((current-start) >= timeout) {
done = 1;
@@ -677,11 +677,13 @@ static int speech_background(struct ast_channel *chan, void *data)
} else {
if (chan->stream != NULL) {
ast_stopstream(chan);
+ }
+ if (!started) {
/* Change timeout to be 5 seconds for DTMF input */
timeout = (chan->pbx && chan->pbx->dtimeout) ? chan->pbx->dtimeout : 5;
- time(&start);
started = 1;
}
+ time(&start);
snprintf(tmp, sizeof(tmp), "%c", f->subclass);
strncat(dtmf, tmp, sizeof(dtmf));
}