[asterisk-commits] file: branch 1.4 r79207 - in /branches/1.4: apps/ include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 13 09:51:10 CDT 2007


Author: file
Date: Mon Aug 13 09:51:09 2007
New Revision: 79207

URL: http://svn.digium.com/view/asterisk?view=rev&rev=79207
Log:
Add an API call to allow the engine to know that DTMF was received.

Modified:
    branches/1.4/apps/app_speech_utils.c
    branches/1.4/include/asterisk/speech.h
    branches/1.4/res/res_speech.c

Modified: branches/1.4/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_speech_utils.c?view=diff&rev=79207&r1=79206&r2=79207
==============================================================================
--- branches/1.4/apps/app_speech_utils.c (original)
+++ branches/1.4/apps/app_speech_utils.c Mon Aug 13 09:51:09 2007
@@ -722,6 +722,7 @@
                         /* 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 {

Modified: branches/1.4/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/speech.h?view=diff&rev=79207&r1=79206&r2=79207
==============================================================================
--- branches/1.4/include/asterisk/speech.h (original)
+++ branches/1.4/include/asterisk/speech.h Mon Aug 13 09:51:09 2007
@@ -83,6 +83,8 @@
 	int (*deactivate)(struct ast_speech *speech, char *grammar_name);
 	/*! 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);
 	/*! Prepare engine to accept audio */
 	int (*start)(struct ast_speech *speech);
 	/*! Change an engine specific setting */
@@ -130,6 +132,8 @@
 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);
 /*! \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 */

Modified: branches/1.4/res/res_speech.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_speech.c?view=diff&rev=79207&r1=79206&r2=79207
==============================================================================
--- branches/1.4/res/res_speech.c (original)
+++ branches/1.4/res/res_speech.c Mon Aug 13 09:51:09 2007
@@ -193,6 +193,21 @@
 	return res;
 }
 
+/*! \brief Signal to the engine that DTMF was received */
+int ast_speech_dtmf(struct ast_speech *speech, char dtmf)
+{
+	int res = 0;
+
+	if (speech->state != AST_SPEECH_STATE_READY)
+		return -1;
+
+	if (speech->engine->dtmf != NULL) {
+		res = speech->engine->dtmf(speech, dtmf);
+	}
+
+	return res;
+}
+
 /*! \brief Change an engine specific attribute */
 int ast_speech_change(struct ast_speech *speech, char *name, const char *value)
 {




More information about the asterisk-commits mailing list