[asterisk-speech-rec] SpeechBackground + DTMF yielding stuck key-like behavior
Trevor Benson
tbenson at a-1networks.com
Tue Jun 10 18:47:41 CDT 2008
Each time you create a 'SpeechBackground' you are resetting the variables as you are grabbing speech again.
Try this:
[lumenvox-test]
exten => s,1,SpeechCreate
exten => s,n,SpeechActivateGrammar(yesno)
exten => s,n,SpeechActivateGrammar(digits)
exten => s,n,Wait(2)
exten => s,n,SpeechBackground(beep|3)
exten => s,n,Noop,${SPEECH_SCORE(0)}
exten => s,n,Noop,${SPEECH_TEXT(0)}
exten => s,n,Set(SCORE1=${SPEECH_SCORE(0)})
exten => s,n,Set(TEXT1=${SPEECH_TEXT(0)})
exten => s,n,SpeechBackground(beep|3)
exten => s,n,Noop,${SPEECH_SCORE(0)}
exten => s,n,Noop,${SPEECH_TEXT(0)}
exten => s,n,Set(SCORE2=${SPEECH_SCORE(0)})
exten => s,n,Set(TEXT2=${SPEECH_TEXT(0)})
exten => s,n,SpeechBackground(beep|3)
exten => s,n,Noop,${SPEECH_SCORE(0)}
exten => s,n,Noop,${SPEECH_TEXT(0)}
exten => s,n,Set(SCORE3=${SPEECH_SCORE(0)})
exten => s,n,Set(TEXT3=${SPEECH_TEXT(0)})
exten => s,n,SpeechDeactivateGrammar(yesno)
exten => s,n,SpeechDeactivateGrammar(digits)
exten => s,n,SpeechDestroy
exten => s,n,Verbose(1, First time was Result: ${SCORE1} Text: ${TEXT1})
exten => s,n,Verbose(1, Second time was Result: ${SCORE2} Text: ${TEXT2})
exten => s,n,Verbose(1, Third time was Result: ${SCORE3} Text: ${TEXT3})
exten => s,h,Hangup
Here you are storing the result score and text for each prompt to a new channel variable, after this you can run another speechbackground to get new scores and text's, just make sure to store them elsewhere before going for another speech interaction. This should point out to you how to store them, and probably give you the missing part where you see why you are rewriting the variables each time you get speech.
Trevor
More information about the asterisk-speech-rec
mailing list