Merged revisions 79334 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 13 Aug 2007 21:59:15 +0000 (21:59 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 13 Aug 2007 21:59:15 +0000 (21:59 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79334 | file | 2007-08-13 18:57:20 -0300 (Mon, 13 Aug 2007) | 2 lines

Instead of accepting a single DTMF character accept a full string.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79335 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_speech_utils.c
include/asterisk/speech.h
res/res_speech.c

index df2fe46..0402194 100644 (file)
@@ -662,7 +662,6 @@ static int speech_background(struct ast_channel *chan, void *data)
                        /* Free the frame we received */
                        switch (f->frametype) {
                        case AST_FRAME_DTMF:
-                               ast_speech_dtmf(speech, f->subclass);
                                if (dtmf_terminator != '\0' && f->subclass == dtmf_terminator) {
                                        done = 1;
                                } else {
@@ -702,6 +701,7 @@ static int speech_background(struct ast_channel *chan, void *data)
                /* We sort of make a results entry */
                speech->results = ast_calloc(1, sizeof(*speech->results));
                if (speech->results != NULL) {
+                       ast_speech_dtmf(speech, dtmf);
                        speech->results->score = 1000;
                        speech->results->text = ast_strdup(dtmf);
                        speech->results->grammar = ast_strdup("dtmf");
index e4d0c76..54e9c69 100644 (file)
@@ -88,7 +88,7 @@ struct ast_speech_engine {
        /*! Write audio to the speech engine */
        int (*write)(struct ast_speech *speech, void *data, int len);
        /*! Signal DTMF was received */
-       int (*dtmf)(struct ast_speech *speech, char dtmf);
+       int (*dtmf)(struct ast_speech *speech, const char *dtmf);
        /*! Prepare engine to accept audio */
        int (*start)(struct ast_speech *speech);
        /*! Change an engine specific setting */
@@ -137,7 +137,7 @@ int ast_speech_destroy(struct ast_speech *speech);
 /*! \brief Write audio to the speech engine */
 int ast_speech_write(struct ast_speech *speech, void *data, int len);
 /*! \brief Signal to the engine that DTMF was received */
-int ast_speech_dtmf(struct ast_speech *speech, char dtmf);
+int ast_speech_dtmf(struct ast_speech *speech, const char *dtmf);
 /*! \brief Change an engine specific attribute */
 int ast_speech_change(struct ast_speech *speech, char *name, const char *value);
 /*! \brief Change the type of results we want */
index 82614a5..497c721 100644 (file)
@@ -154,7 +154,7 @@ int ast_speech_write(struct ast_speech *speech, void *data, int len)
 }
 
 /*! \brief Signal to the engine that DTMF was received */
-int ast_speech_dtmf(struct ast_speech *speech, char dtmf)
+int ast_speech_dtmf(struct ast_speech *speech, const char *dtmf)
 {
        int res = 0;