[asterisk-speech-rec] Problem wiht Speech Score and Threshold value when using GotoIf

jforde0518 at gmail.com jforde0518 at gmail.com
Thu Oct 30 17:03:15 CDT 2008


Here is a portion of the code I'm having a problem with. The problem is  
this: whenever I make a test call to the IVR and I use speech the code  
works as intended. If I deliberately mumble so that the score is below the  
threshold the GotoIf correctly evaluates as false and jumps to the named  
priority to repeat the voice prompt. If I speak clearly and the speech  
score is above the threshold but lower than 1000 the GotoIf evaluates as  
true and jumps to the priority set for true and continues in the dialplan  
correctly but when I use DTMF the Speech Score returns 1000 and the correct  
keypress is showing in the Verbose statement for Speech Text however the  
GotoIf evaluates this to false everytime. If I don't use a GotoIf in my  
code to reenter the context at a lower priority to reexecute the voice  
prompt and SpeechBackground again then it works fine although that defeats  
the purpose of using the GotoIf for error checking. I based this code on  
the code in the sample pizza demo. Has anyone else encountered this? I've  
already thought of a workaround where I add a GotoIf before the existing  
GotoIf and have that evaluate for Speech Score equals 1000 rather than  
Speech Score is greater than Threshold and if true skip over the next line  
and if false continue on the next line but that in my opinion is 1 extra  
line of code that shouldn't be necessary. If anyone knows of a particular  
bug or configuration issue that would cause this I'd appreciate a reply.

[ivr-main]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,SpeechCreate
exten => s,n,NoOp(${ERROR})
exten => s,n,Set(THRESHOLD=750)
exten => s,n,NoOp(${THRESHOLD})
exten => s,n,SpeechLoadGrammar(zooivr_main| 
/etc/asterisk/grammars/zooivr_main.gram)
exten => s,n,Playback(maingreet_f)
exten => s,n,Goto(ivr-main,s,activate)
exten => s,n(repeat),NoOp(re-entry point)
exten => s,n,Macro(reprompt)
exten => s,n(activate),NoOp(activate grammar)
exten => s,n,SpeechActivateGrammar(zooivr_main)
exten => s,n,SpeechBackground(ivrmain)
exten => s,n,Verbose(1|Result was ${SPEECH_TEXT(0)})
exten => s,n,Verbose(1|Confidence was ${SPEECH_SCORE(0)})
exten => s,n,Gotoif($[ "${SPEECH_SCORE(0)}" > "${THRESHOLD}"  
]?proceed:repeat) <<--------- THIS IS THE LINE I'M HAVING A PROBLEM WITH.
exten => s,n(proceed),SpeechDeactivateGrammar(zooivr_main)
exten => s,n,NoOp(${SPEECH_TEXT(0)})
exten => s,n,Goto(ivr-sub1,${SPEECH_TEXT(0)},1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-speech-rec/attachments/20081030/baf8b0af/attachment.htm 


More information about the asterisk-speech-rec mailing list