alphacep / vosk-asterisk

Speech Recognition in Asterisk with Vosk Server
GNU General Public License v2.0
102 stars 40 forks source link

Issues with installing on FreePBX - Could not find asterisk.h #36

Closed milutin-b closed 1 year ago

milutin-b commented 1 year ago

Hi there.

I have a FPBX server installed from ISO image downloaded from official site working just fine. But have issues following steps outlined in Readme though with ./configure command spitting out Could not find asterisk.h, make sure Asterisk development package is installed error.

I've installed dev package with yum install asterisk18-devel and now can find asterisk.h in /usr/include directory but still get the same error.

My guess is I'm using ./configure command with wrong parameters but I'm unsure what those should be.

I'm confused with provided example - --with-asterisk=<path_to_asterisk_source> --prefix=<path_to_install>. What should those represent? Found few pages like this one but it's still unclear what the actual parametrs should be. I tried few directories as parameters, like: /usr/src/freepbx, /var/lib/asterisk, etc... but now it's just pushing buttons randomly.

Anyone has any idea what am I doing wrong?

nshmyrev commented 1 year ago

./configure --with-asterisk=/usr --prefix=/usr

should work for you

milutin-b commented 1 year ago

Hi Nickolay thanks for answering.

That worked thank you so much.

I have a different problem now. After running the ./configure one of the three modules isn't working. ERROR[24515] loader.c: Error loading module 'res_speech_vosk.so': /usr/lib64/asterisk/modules/res_speech_vosk.so: cannot open shared object file: No such file or directory When running asterisk -rx "module show like res_speech.so" and asterisk -rx "module show like res_http_websocket.so" both of them seem operational.

I am installing Vosk on the same machine FreePBX is running on.

Should I open another issue and close this one?

nshmyrev commented 1 year ago

You need to open file manager or just a terminal and find that so file. It is probably installed in some other location, not /usr/lib64/asterisk/modules, most likely /usr/lib without 64

milutin-b commented 1 year ago

It really was in /usr/lib/asterisk/modules/ copied it, reloaded and it works. Thank you.

I have one more question if you would.

I can't seem to pick up conversation using config code from Readme file. I edited extension_custom.conf to be:

[from-internal-custom]
exten => 100,1,Answer
same => n,Wait(1)
same => n,Dial(PJSIP/${EXTEN})
same => n,Noop(Call is answered)
same => n,SpeechCreate
same => n,SpeechBackground(splat)
same => n,Verbose(0,Result was ${SPEECH_TEXT(0)})

and can only see the transcription from sound file I provided in SpeechBackground as an argument.

If I comment out the Dial line in the conf file the transcription works unidirectiona - that is I can, for a short while, read what I as a caller am saying. But then the line just breaks.

Is there some other function I should be calling or some other way to capture the Vosk output via script etc?

Thanks for any help.

nshmyrev commented 1 year ago

SpeechBackground is only useful for IVR. If you want to monitor the call you have to record with MixMonitor and then transcribe with a separate python script.

milutin-b commented 1 year ago

Thank you Nickolay