zaf / asterisk-speech-recog

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

Code not working #17

Closed anujitbhu closed 9 years ago

anujitbhu commented 9 years ago

Hi,

When I execute the script it returns 0 but doesnt return the utterance and confidence . Cant figure out the error . The AGI Debug shows the following

<DAHDI/1-1>AGI Rx << EXEC AGI asterisk-speech-recog/speech-recog.agi,key=AIzaSyARee_mzuaaMJyw8xgUpjEPRMaiM -- AGI Script Executing Application: (AGI) Options: (asterisk-speech-recog/speech-recog.agi,key=AIzaSyARee_mzuaaMJyw8xgUpjEPRMaiM) -- Launched AGI Script /var/lib/asterisk/agi-bin/asterisk-speech-recog/speech-recog.agi <DAHDI/1-1>AGI Tx >> agi_request: asterisk-speech-recog/speech-recog.agi <DAHDI/1-1>AGI Tx >> agi_channel: DAHDI/1-1 <DAHDI/1-1>AGI Tx >> agi_language: en <DAHDI/1-1>AGI Tx >> agi_type: DAHDI <DAHDI/1-1>AGI Tx >> agi_uniqueid: 1423073509.44 <DAHDI/1-1>AGI Tx >> agi_version: 1.8.21.0 <DAHDI/1-1>AGI Tx >> agi_callerid: 9910044314 <DAHDI/1-1>AGI Tx >> agi_calleridname: unknown <DAHDI/1-1>AGI Tx >> agi_callingpres: 0 <DAHDI/1-1>AGI Tx >> agi_callingani2: 0 <DAHDI/1-1>AGI Tx >> agi_callington: 0 <DAHDI/1-1>AGI Tx >> agi_callingtns: 0 <DAHDI/1-1>AGI Tx >> agi_dnid: unknown <DAHDI/1-1>AGI Tx >> agi_rdnis: unknown DAHDI/1-1>AGI Tx >> agi_context: from-zaptel <DAHDI/1-1>AGI Tx >> agi_extension: s <DAHDI/1-1>AGI Tx >> agi_priority: 2 <DAHDI/1-1>AGI Tx >> agi_enhanced: 0.0 <DAHDI/1-1>AGI Tx >> agi_accountcode: <DAHDI/1-1>AGI Tx >> agi_threadid: 140492011169536 <DAHDI/1-1>AGI Tx >> agi_arg_1: key=AIzaSyARee_mzuaaMJyw8xgUpjEPRMaiM <DAHDI/1-1>AGI Tx >> -- <DAHDI/1-1>AGI Script asterisk-speech-recog/speech-recog.agi completed, returning 0 <DAHDI/1-1>AGI Tx >> 200 result=0 <DAHDI/1-1>AGI Rx << GET VARIABLE utterance <DAHDI/1-1>AGI Tx >> 200 result=0 <DAHDI/1-1>AGI Rx << VERBOSE "The entered digit is " 1 dtmf1.php: The entered digit is <DAHDI/1-1>AGI Tx >> 200 result=1 <DAHDI/1-1>AGI Rx << HANGUP

zaf commented 9 years ago

You pass the key as an AGI argument which is not correct. Key should be set in the 'User defined parameters' section of the script. Please check the documentation.

anujitbhu commented 9 years ago

Hi ,

Even after removing the key as parameter also it remains the same .

<DAHDI/1-1>AGI Rx << EXEC AGI asterisk-speech-recog/speech-recog.agi -- AGI Script Executing Application: (AGI) Options: (asterisk-speech-recog/speech-recog.agi) -- Launched AGI Script /var/lib/asterisk/agi-bin/asterisk-speech-recog/speech-recog.agi <DAHDI/1-1>AGI Tx >> agi_request: asterisk-speech-recog/speech-recog.agi <DAHDI/1-1>AGI Tx >> agi_channel: DAHDI/1-1 <DAHDI/1-1>AGI Tx >> agi_language: en <DAHDI/1-1>AGI Tx >> agi_type: DAHDI <DAHDI/1-1>AGI Tx >> agi_uniqueid: 1423158032.6 <DAHDI/1-1>AGI Tx >> agi_version: 1.8.21.0 <DAHDI/1-1>AGI Tx >> agi_callerid: 9910044314 <DAHDI/1-1>AGI Tx >> agi_calleridname: unknown <DAHDI/1-1>AGI Tx >> agi_callingpres: 0 <DAHDI/1-1>AGI Tx >> agi_callingani2: 0 <DAHDI/1-1>AGI Tx >> agi_callington: 0 <DAHDI/1-1>AGI Tx >> agi_callingtns: 0 <DAHDI/1-1>AGI Tx >> agi_dnid: unknown <DAHDI/1-1>AGI Tx >> agi_rdnis: unknown <DAHDI/1-1>AGI Tx >> agi_context: from-zaptel <DAHDI/1-1>AGI Tx >> agi_extension: s <DAHDI/1-1>AGI Tx >> agi_priority: 2 <DAHDI/1-1>AGI Tx >> agi_enhanced: 0.0 <DAHDI/1-1>AGI Tx >> agi_accountcode: <DAHDI/1-1>AGI Tx >> agi_threadid: 140155001227008 <DAHDI/1-1>AGI Tx >> -- <DAHDI/1-1>AGI Script asterisk-speech-recog/speech-recog.agi completed, returning 0 <DAHDI/1-1>AGI Tx >> 200 result=0 <DAHDI/1-1>AGI Rx << GET VARIABLE utterance <DAHDI/1-1>AGI Tx >> 200 result=0 <DAHDI/1-1>AGI Rx << VERBOSE "The entered digit is " 1 dtmf1.php: The entered digit is <DAHDI/1-1>AGI Tx >> 200 result=1 <DAHDI/1-1>AGI Rx << HANGUP <DAHDI/1-1>AGI Tx >> 200 result=1

Is there a way to trace the error ? How can I check if the key is valid ?

Plz suggest .