diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c index cf559c453b..e45459166c 100644 --- a/apps/app_speech_utils.c +++ b/apps/app_speech_utils.c @@ -722,7 +722,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 { @@ -762,6 +761,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 = strdup(dtmf); speech->results->grammar = strdup("dtmf"); diff --git a/include/asterisk/speech.h b/include/asterisk/speech.h index 85a3514851..6e6432342b 100644 --- a/include/asterisk/speech.h +++ b/include/asterisk/speech.h @@ -84,7 +84,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 */ @@ -133,7 +133,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 */ diff --git a/res/res_speech.c b/res/res_speech.c index 5b8f3569c2..bab784f161 100644 --- a/res/res_speech.c +++ b/res/res_speech.c @@ -194,7 +194,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;