Why my AGI file is not reacting during call?

Hello there,

Before I start, I explain my agi file

It is Speech recognition script for Asterisk that uses Cloud Speech API by Google. This AGI script makes use of Google’s Cloud Speech API in order to render speech to text and return it back to the dialplan as an asterisk channel variable.

Official link of that repo: asterisk-speech-recog

So let’s come to our point
I pulled one of them agi file from GitHub and paste in /var/lib/asterisk/agi-bin/ and I calling in dialplan just like below,

[Long-Distance]
;Simple speech recognition
exten => _11XX,1,Answer()
exten => _11XX,n,dial(pjsip/${EXTEN})
exten => _11XX,n,agi(speech-recog.agi,en-US)
exten => _11XX,n,Verbose(1,The text you just said is: ${utterance})
exten => _11XX,n,Verbose(1,The probability to be right is: ${confidence})
exten => _11XX,n,Hangup()

Did I write in right sequence?

If yes then let’s continue,
Now I make a simple call, e.g. 1101 to 1103, and I can attempt that call but no error, warning or notice or any kind of activity is not reflecting on my cli.
So what’s wrong in this case?
Without any output, I can’t debug.

For your reference, I provide that AGI file here so you no need to visit and download that file.
As per community standard, I can paste only txt, jpg, png file so I just change extension from .agi to .txt of file so I can upload
speech-recog.txt (8.6 KB)

----------------------------------------------------------------Edit 1-----------------------------------------------------
Ok I enabled my agi debugger and then make call and got this,

<PJSIP/1101-00000002>AGI Tx >> agi_request: speech-recog.agi
<PJSIP/1101-00000002>AGI Tx >> agi_channel: PJSIP/1101-00000002
<PJSIP/1101-00000002>AGI Tx >> agi_language: en
<PJSIP/1101-00000002>AGI Tx >> agi_type: PJSIP
<PJSIP/1101-00000002>AGI Tx >> agi_uniqueid: 1611150554.4
<PJSIP/1101-00000002>AGI Tx >> agi_version: 16.15.1
<PJSIP/1101-00000002>AGI Tx >> agi_callerid: 1101
<PJSIP/1101-00000002>AGI Tx >> agi_calleridname: Maria Berny
<PJSIP/1101-00000002>AGI Tx >> agi_callingpres: 0
<PJSIP/1101-00000002>AGI Tx >> agi_callingani2: 0
<PJSIP/1101-00000002>AGI Tx >> agi_callington: 0
<PJSIP/1101-00000002>AGI Tx >> agi_callingtns: 0
<PJSIP/1101-00000002>AGI Tx >> agi_dnid: 1103
<PJSIP/1101-00000002>AGI Tx >> agi_rdnis: unknown
<PJSIP/1101-00000002>AGI Tx >> agi_context: Long-Distance
<PJSIP/1101-00000002>AGI Tx >> agi_extension: 1103
<PJSIP/1101-00000002>AGI Tx >> agi_priority: 2
<PJSIP/1101-00000002>AGI Tx >> agi_enhanced: 0.0
<PJSIP/1101-00000002>AGI Tx >> agi_accountcode: 
<PJSIP/1101-00000002>AGI Tx >> agi_threadid: 140662754117376
<PJSIP/1101-00000002>AGI Tx >> agi_arg_1: en-US
<PJSIP/1101-00000002>AGI Tx >> 
<PJSIP/1101-00000002>AGI Rx << SET VARIABLE "confidence" "-1"
<PJSIP/1101-00000002>AGI Tx >> 200 result=1
<PJSIP/1101-00000002>AGI Rx << SET VARIABLE "utterance" "-1"
<PJSIP/1101-00000002>AGI Tx >> 200 result=1
<PJSIP/1101-00000002>AGI Rx << VERBOSE "API key is missing. Aborting." 3
<PJSIP/1101-00000002>AGI Tx >> 200 result=1

As I can see this there is 200 status code which means something goes right and problem in agi file.

Right???

One more thing I should ask if I use agi file then should I change anything in my asterisk.conf file?

One doubt whenever I comment or modify my code like this then only I got logs.

[Long-Distance]
;Simple speech recognition
exten => _11XX,1,Answer()
;exten => _11XX,n,dial(pjsip/${EXTEN})
exten => _11XX,n,agi(speech-recog.agi,en-US)
exten => _11XX,n,Verbose(1,The text you just said is: ${utterance})
exten => _11XX,n,Verbose(1,The probability to be right is: ${confidence})
exten => _11XX,n,Hangup()

And if I do not comment that then just I can make call nothing more.
Also when I do this obviously I can’t make a call so what should I do.

As I said on your other thread, Dial is not just dialing, it is the whole outgoing leg of the call until it fails, or one side hangs up.

Sorry david, I can assume you read my previous thread reply so I can skip those parts.
Here in this, question is simple, just look at my 3rd reply in my thread

If I comment 2nd exten line then only my agi file call but without dial function I can’t make a call or established bridge between to party.

Sorry again

Please see your other thread for a post that may help your understanding.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.