diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-26 19:35:24 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-26 19:35:24 +0000 |
commit | 01e2d46c580db6fbefe2ce50bbc44178e4ebaa4a (patch) | |
tree | 8949169fde6326eb36ea012452b4ff057b47523f /apps/app_speech_utils.c | |
parent | 4727ec607e86998dcd15106df41f75f539e7cff8 (diff) |
Merged revisions 59223 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r59223 | file | 2007-03-26 16:34:14 -0300 (Mon, 26 Mar 2007) | 2 lines
Add ability to specify no timeout. This means as soon as the prompt is done playing it moves on to the next priority.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@59224 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_speech_utils.c')
-rw-r--r-- | apps/app_speech_utils.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c index 3342d4c31..b430a4094 100644 --- a/apps/app_speech_utils.c +++ b/apps/app_speech_utils.c @@ -544,8 +544,11 @@ static int speech_background(struct ast_channel *chan, void *data) if (argc > 0) { /* Yay sound file */ filename_tmp = ast_strdupa(argv[0]); - if (argv[1] != NULL) - timeout = atoi(argv[1]); + if (!ast_strlen_zero(argv[1])) { + if ((timeout = atoi(argv[1])) == 0) + timeout = -1; + } else + timeout = 0; } /* Before we go into waiting for stuff... make sure the structure is ready, if not - start it again */ @@ -611,7 +614,13 @@ static int speech_background(struct ast_channel *chan, void *data) /* If audio playback has stopped do a check for timeout purposes */ if (chan->streamid == -1 && chan->timingfunc == NULL) ast_stopstream(chan); - if (!quieted && chan->stream == NULL && timeout > 0 && started == 0 && !filename_tmp) { + if (!quieted && chan->stream == NULL && timeout && started == 0 && !filename_tmp) { + if (timeout == -1) { + done = 1; + if (f) + ast_frfree(f); + break; + } time(&start); started = 1; } |