aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-12 19:57:21 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-12 19:57:21 +0000
commita8d5975f06fb71be8f20e46b08482be8630a35c8 (patch)
tree070f7484f3b800f4eabf5d14a9ab0e2fdc184d22
parent5fb6f99060f92f51fc78610412e09d37b4fdc594 (diff)
Add ability to see if the person calling said anything or not.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@19512 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_speech_utils.c2
-rw-r--r--doc/speechrec.txt2
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 0c5c32373..264f56ba1 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -368,6 +368,7 @@ static int speech_background(struct ast_channel *chan, void *data)
} else {
time(&current);
if ((current-start) >= timeout) {
+ pbx_builtin_setvar_helper(chan, "SILENCE", "1");
done = 1;
break;
}
@@ -398,6 +399,7 @@ static int speech_background(struct ast_channel *chan, void *data)
case AST_SPEECH_STATE_DONE:
/* Assume there will be no results by default */
pbx_builtin_setvar_helper(chan, "RESULTS", "0");
+ pbx_builtin_setvar_helper(chan, "SILENCE", "0");
/* Decoding is done and over... see if we have results */
results = ast_speech_results_get(speech);
if (results != NULL) {
diff --git a/doc/speechrec.txt b/doc/speechrec.txt
index 08892dd33..9f4f40ca7 100644
--- a/doc/speechrec.txt
+++ b/doc/speechrec.txt
@@ -20,7 +20,7 @@ Tell the speech recognition engine that it should start trying to get results fr
SpeechBackground(Sound File|Timeout):
-This application plays a sound file and waits for the person to speak. Once they start speaking playback of the file stops, and silence is heard. Once they stop talking the processing sound is played to indicate the speech recognition engine is working. Once results are available the application returns and results (score and text) are available as dialplan variables. The first text and score are ${TEXT0} AND ${SCORE0} while the second are ${TEXT1} and ${SCORE1}. This may change in the future, however, to use a dialplan function instead of dialplan variables. Note it is possible to have more then one result. The first argument is the sound file and the second is the timeout. Note the timeout will only start once the sound file has stopped playing.
+This application plays a sound file and waits for the person to speak. Once they start speaking playback of the file stops, and silence is heard. Once they stop talking the processing sound is played to indicate the speech recognition engine is working. Once results are available the application returns and results (score and text) are available as dialplan variables. The first text and score are ${TEXT0} AND ${SCORE0} while the second are ${TEXT1} and ${SCORE1}. This may change in the future, however, to use a dialplan function instead of dialplan variables. Note it is possible to have more then one result. The first argument is the sound file and the second is the timeout. Note the timeout will only start once the sound file has stopped playing. If the timeout is reached, then the variable SILENCE is set to 1 so that you will know that the person did not speak anything.
SpeechDeactivateGrammar(Grammar Name):