Author: file
Date: Wed Jul 25 17:18:56 2007
New Revision: 77182

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77182
Log:
Merged revisions 77176 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77176 | file | 2007-07-25 19:16:10 -0300 (Wed, 25 Jul 2007) | 4 lines

(closes issue #10303)
Reported by: jtodd
Add SPEECH_DTMF_TERMINATOR variable so the user can specify the digit to 
terminate a DTMF string with. If none is specified then no terminator will be 
used.

........

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=77182&r1=77181&r2=77182
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Wed Jul 25 17:18:56 2007
@@ -495,7 +495,7 @@
         char dtmf[AST_MAX_EXTENSION] = "";
         time_t start, current;
         struct ast_datastore *datastore = NULL;
-        char *argv[2], *args = NULL, *filename_tmp = NULL, *filename = NULL, 
tmp[2] = "";
+        char *argv[2], *args = NULL, *filename_tmp = NULL, *filename = NULL, 
tmp[2] = "", dtmf_terminator = '#';
        const char *tmp2 = NULL;
 
         args = ast_strdupa(data);
@@ -529,6 +529,14 @@
        /* 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);
+
+       /* See if a terminator is specified */
+       if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_TERMINATOR"))) 
{
+               if (ast_strlen_zero(tmp2))
+                       dtmf_terminator = '\0';
+               else
+                       dtmf_terminator = tmp2[0];
+       }
 
         /* 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) {
@@ -651,7 +659,7 @@
                         /* Free the frame we received */
                         switch (f->frametype) {
                         case AST_FRAME_DTMF:
-                               if (f->subclass == '#') {
+                               if (dtmf_terminator != '\0' && f->subclass == 
dtmf_terminator) {
                                        done = 1;
                                } else {
                                        if (chan->stream != NULL) {


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to