]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add ability to see if the person calling said anything or not.
authorJoshua Colp <jcolp@digium.com>
Wed, 12 Apr 2006 19:57:21 +0000 (19:57 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 12 Apr 2006 19:57:21 +0000 (19:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19512 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_speech_utils.c
doc/speechrec.txt

index 0c5c32373bf32377dfa029e3ef490f570e4d7df2..264f56ba132911adc89c730042da2cb7c3585e85 100644 (file)
@@ -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) {
index 08892dd3351b0c26889c761d713aa629d45744dd..9f4f40ca7929d89f50062785329e63b7fd058f15 100644 (file)
@@ -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):