[asterisk-commits] file: trunk r69559 - in /trunk: ./ apps/app_speech_utils.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 15 14:25:12 CDT 2007
Author: file
Date: Fri Jun 15 14:25:11 2007
New Revision: 69559
URL: http://svn.digium.com/view/asterisk?view=rev&rev=69559
Log:
Merged revisions 69558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r69558 | file | 2007-06-15 15:23:45 -0400 (Fri, 15 Jun 2007) | 10 lines
Merged revisions 69127 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r69127 | file | 2007-06-13 14:12:48 -0400 (Wed, 13 Jun 2007) | 2 lines
Return group counting to previous behavior where you could only have one group per category. (issue #9711 reported by irroot)
........
................
Modified:
trunk/ (props changed)
trunk/apps/app_speech_utils.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_speech_utils.c?view=diff&rev=69559&r1=69558&r2=69559
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Fri Jun 15 14:25:11 2007
@@ -543,7 +543,7 @@
static int speech_background(struct ast_channel *chan, void *data)
{
unsigned int timeout = 0;
- int res = 0, done = 0, argc = 0, started = 0, quieted = 0;
+ int res = 0, done = 0, argc = 0, started = 0, quieted = 0, max_dtmf_len = 0;
struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
struct ast_frame *f = NULL;
@@ -552,6 +552,7 @@
time_t start, current;
struct ast_datastore *datastore = NULL;
char *argv[2], *args = NULL, *filename_tmp = NULL, *filename = NULL, tmp[2] = "";
+ const char *tmp2 = NULL;
args = ast_strdupa(data);
@@ -588,6 +589,10 @@
} else
timeout = 0;
}
+
+ /* See if the maximum DTMF length variable is set... we use a variable in case they want to carry it through their entire dialplan */
+ if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_MAXLEN")) && !ast_strlen_zero(tmp2))
+ max_dtmf_len = atoi(tmp2);
/* Before we go into waiting for stuff... make sure the structure is ready, if not - start it again */
if (speech->state == AST_SPEECH_STATE_NOT_READY || speech->state == AST_SPEECH_STATE_DONE) {
@@ -724,6 +729,9 @@
time(&start);
snprintf(tmp, sizeof(tmp), "%c", f->subclass);
strncat(dtmf, tmp, sizeof(dtmf));
+ /* If the maximum length of the DTMF has been reached, stop now */
+ if (max_dtmf_len && strlen(dtmf) == max_dtmf_len)
+ done = 1;
}
break;
case AST_FRAME_CONTROL:
More information about the asterisk-commits
mailing list