[asterisk-commits] file: trunk r79208 - in /trunk: ./ apps/ include/asterisk/ res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 13 09:55:18 CDT 2007
Author: file
Date: Mon Aug 13 09:55:17 2007
New Revision: 79208
URL: http://svn.digium.com/view/asterisk?view=rev&rev=79208
Log:
Merged revisions 79207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79207 | file | 2007-08-13 11:51:09 -0300 (Mon, 13 Aug 2007) | 2 lines
Add an API call to allow the engine to know that DTMF was received.
........
Modified:
trunk/ (props changed)
trunk/apps/app_speech_utils.c
trunk/include/asterisk/speech.h
trunk/res/res_speech.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=79208&r1=79207&r2=79208
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Mon Aug 13 09:55:17 2007
@@ -662,6 +662,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: trunk/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/speech.h?view=diff&rev=79208&r1=79207&r2=79208
==============================================================================
--- trunk/include/asterisk/speech.h (original)
+++ trunk/include/asterisk/speech.h Mon Aug 13 09:55:17 2007
@@ -87,6 +87,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 */
@@ -134,6 +136,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: trunk/res/res_speech.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_speech.c?view=diff&rev=79208&r1=79207&r2=79208
==============================================================================
--- trunk/res/res_speech.c (original)
+++ trunk/res/res_speech.c Mon Aug 13 09:55:17 2007
@@ -153,6 +153,21 @@
return speech->engine->write(speech, data, len);
}
+/*! \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