zaf / asterisk-speech-recog

Speech recognition script for Asterisk that uses google's speech engine.
GNU General Public License v2.0
247 stars 133 forks source link

the API is not working, it is not waiting for the voice to be recorded #43

Closed guyjerby closed 6 years ago

guyjerby commented 6 years ago

Hi, I am using the implantation sample from the installation steps:

exten => 1,n,agi(speech-recog.agi,en-US,5) exten => 1,n,Verbose(1,The text you just said is: ${utterance}) exten => 1,n,Verbose(1,The probability to be right is: ${confidence}) exten => 1,n,Hangup()

the AGI is not waiting for voice, it is exiting immediately.

here is the log from the CLI: -- Executing [1@call-routing:29] AGI("PJSIP/Cellcom_SIP_Trunk-00000007", "speech-recog.agi,en-US,5") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/speech-recog.agi <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_request: speech-recog.agi <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_channel: PJSIP/Cellcom_SIP_Trunk-00000007 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_language: en <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_type: PJSIP <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_uniqueid: 1514877104.7 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_version: 13.14.0 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_callerid: 39269834 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_calleridname: 39269834 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_callingpres: 0 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_callingani2: 0 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_callington: 0 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_callingtns: 0 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_dnid: unknown <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_rdnis: 547779947 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_context: call-routing <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_extension: 1 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_priority: 29 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_enhanced: 0.0 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_accountcode: <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_threadid: 140621460821760 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_arg_1: en-US <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> agi_arg_2: 5 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Rx << SET VARIABLE "confidence" "-1" <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> 200 result=1 <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Rx << SET VARIABLE "utterance" "-1" <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Tx >> 200 result=1 -- <PJSIP/Cellcom_SIP_Trunk-00000007>AGI Script speech-recog.agi completed, returning 0 -- Executing [1@call-routing:30] Verbose("PJSIP/Cellcom_SIP_Trunk-00000007", "1,The text you just said is: -1") in new stack The text you just said is: -1 -- Executing [1@call-routing:31] Verbose("PJSIP/Cellcom_SIP_Trunk-00000007", "1,The probability to be right is: -1") in new stack The probability to be right is: -1 -- Executing [1@call-routing:32] Hangup("PJSIP/Cellcom_SIP_Trunk-00000007", "") in new stack == Spawn extension (call-routing, 1, 32) exited non-zero on 'PJSIP/Cellcom_SIP_Trunk-00000007'

how can I debug it to see where it is failed?

Thanks, Guy