I’m new to Asterisk and FreePbx and what I’m trying to do is to automatically listen into the call when it’s picked up/answered.
I found this code
https: //gist. github. com /lgaetz/78c4e114952e79596c1ed4123559d3d3 (sorry for link formating - this forum won’t let me create them in a post for some reason)
that does half of the work - the heavy lifting of actually listening to the call in the background. But it requires you to manually dial a number and the number of extension that is currently in a call in order to spy on it. Also, ending the ‘call’ sesion which was active requires a click.
Is there a way for this process to be automated?
Flow would be something along the lines of:
Call to any valid custom extension comes in
Call is answered
[targeted-chanspy] context is fired up with the number of active call extension
Call is completed and so is the spy session along with it
What exactly do you mean by ‘calling the extension that is going to listen in’?
I would like to run EAGI script in the background as soon as the call is answered so no actual listening of the conversation is performed.
Spy has to be run on a channel. The normal intent of that is a manager calls in on that channel. If you are automating, you will have to call the manager before setting up the spy request.
You would need to originate to local channel to run the script and also to the spy application.
In practice, you would need to run the originate either from an answer subroutine for the Dial (I’m not sure of the fine details of doing this on FreePBX), or by using AMI to monitor for the answer.
Uhm, then why are you wanting to use ChanSpy? The whole point is for someone(s) to listen in on the call. What is the actual goal you’re trying to achieve here?
The ‘listening’ wil be performed by this library https ://github .com/andrewyang17/goEagi and the convo is to be sent to Google Speech to text API for transcription. I said listen as in context of having access to which I understand you need a third extension to join in to do so.
I want to know if I can somehow mimic that scenario automatically so I dont have to dial in manualy as I have to do with the code I linked to in the original post.
Why do you need to do this in near real time. In principle you would get a better transcription if you recorded the call and transcribed it after it finished. I’m not sure to what extent Google speech recognition looks ahead, or backtracks, but if it isn’t doing it much now, I imagine that the trend will be to do it in the near future.
Thanks for answering. Vosk seems promising but I have issues installing it on my FPBX machine.
I’ve tried installing Vosk following steps in the repository you linked to but failed to do so. Error I’m having jumps out when i try ./configure step and it says Could not find asterisk.h, make sure Asterisk development package is installed
After some googling I tried running yum install asterisk18-devel and got nothing. Afterwards, I tried all of the steps from https:// wiki.freepbx .org/pages/viewpage.action?pageId=216175450.
Problem is there is an asterisk.h file in /usr/include directory after I went thru with all of the steps but the ./configure won’t pick it up.
Ok so I have installed devel package as I said using steps mentioned here and now I have asterisk.h file in /usr/include directory.
FreePBX is installed from ISO file downloaded from https://www.freepbx.org/downloads/
What I’m guessing is wrong here is my ./configure command…
Example command form vosk github page says: ./configure --with-asterisk=<path_to_asterisk_source> --prefix=<path_to_install> but I’m not sure what path_to_asterisk_source and path_to_install would be after I installed devel package.
Do you maybe have any clue what could those paths be?