Add ability to see if the person calling said anything or not.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp 2006-04-12 19:57:21 +00:00
parent b24bc86fc2
commit 416cd5d8a0
2 changed files with 3 additions and 1 deletions

View 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) {

View 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):