aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-31 16:21:34 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-31 16:21:34 +0000
commita6e0cf8675ef4f51a2cfc7a4b77339cb3c2464a1 (patch)
tree25073008e73e1ee42d502d6d4eb12b60cc81f97c
parent90284124ca36972d0c3b9636b10a158318321a91 (diff)
Merged revisions 77831 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77831 | file | 2007-07-31 13:17:09 -0300 (Tue, 31 Jul 2007) | 2 lines Add a flag to the speech API that allows an engine to set whether it received results or not. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77833 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--include/asterisk/speech.h5
-rw-r--r--res/res_speech.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/include/asterisk/speech.h b/include/asterisk/speech.h
index 02d056f33..e040629d4 100644
--- a/include/asterisk/speech.h
+++ b/include/asterisk/speech.h
@@ -29,8 +29,9 @@ extern "C" {
/* Speech structure flags */
enum ast_speech_flags {
- AST_SPEECH_QUIET = (1 << 0), /* Quiet down output... they are talking */
- AST_SPEECH_SPOKE = (1 << 1), /* Speaker spoke! */
+ AST_SPEECH_QUIET = (1 << 0), /* Quiet down output... they are talking */
+ AST_SPEECH_SPOKE = (1 << 1), /* Speaker spoke! */
+ AST_SPEECH_HAVE_RESULTS = (1 << 2), /* Results are present */
};
/* Speech structure states - in order of expected change */
diff --git a/res/res_speech.c b/res/res_speech.c
index cf830344f..ed815b6ec 100644
--- a/res/res_speech.c
+++ b/res/res_speech.c
@@ -92,7 +92,7 @@ int ast_speech_grammar_unload(struct ast_speech *speech, char *grammar_name)
/*! \brief Return the results of a recognition from the speech structure */
struct ast_speech_result *ast_speech_results_get(struct ast_speech *speech)
{
- return (speech->engine->get ? speech->engine->get(speech) : NULL);
+ return ((speech->engine->get && ast_test_flag(speech, AST_SPEECH_HAVE_RESULTS)) ? speech->engine->get(speech) : NULL);
}
/*! \brief Free a list of results */
@@ -128,6 +128,7 @@ void ast_speech_start(struct ast_speech *speech)
/* Clear any flags that may affect things */
ast_clear_flag(speech, AST_SPEECH_SPOKE);
ast_clear_flag(speech, AST_SPEECH_QUIET);
+ ast_clear_flag(speech, AST_SPEECH_HAVE_RESULTS);
/* If results are on the structure, free them since we are starting again */
if (speech->results) {