Resource icon

TUTORIAL Asterisk Speech Recognition

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
wardmundy submitted a new resource:

Speech Recognition for Asterisk - This tutorial walks you through activating Speech Recognition for Asterisk applications.

NOTE: Google's Terms of Service Limit Your Use of Speech Recognition Services to "personal and development use" only.

Obtaining a Google API Key for Speech Recognition Services

Before you can take advantage of Google's speech-to-text engine, you first must obtain an API Key to use in the Speech Recognition AGI script for Asterisk. Here are the steps.

Step 0. Using an existing Google/Gmail account,...

Read more about this resource...
 

rjm

Guru
Joined
Oct 21, 2007
Messages
475
Reaction score
21
I am looking for a high quality speech to text IVR implementation that I can use in a commercial setting. I see Schmoozecom has depreciated it's implementation. Has anyone played around with LumenVox or Nuance with FreePBX? Are there any other solutions that do not require personal or development as criteria for use?

Thanks!
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Trying your How-to and in my list Speech API is not there. How do I get at it?

I have a long list of APIs ant the first four on your screenshot are on but Speech API is missing. Did Google drop this on us again, or where can I locate it?
 

steve54301

Guru
Joined
Jun 7, 2008
Messages
135
Reaction score
18
Does anyone know what the maximum length flac file you can submit is with this v2?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Trying your How-to and in my list Speech API is not there. How do I get at it?

I have a long list of APIs ant the first four on your screenshot are on but Speech API is missing. Did Google drop this on us again, or where can I locate it?


Did you forget Step 0??
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
No, I don't think so, as in your tutorial I clicked on your links and followed your screen shots. I will try Step 0 again though.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Thanks, Ward -- That was it. Evidently it jumped to creating a project and bypassed the group (Or I got stupid and forgot to click it :smile5: ) either way the Speech API shows up now. Continuing the process now. Thanks again.
 
Joined
May 22, 2013
Messages
301
Reaction score
44
I'm struggling with this unfortunately wardmundy - using Raspberry Pi all the steps work fine up until wget. This says a TLS packet with unexpected length was received. The link gives either a no connection or a http 400 error if I paste it into a browser, so I have got the code searching github and then used your command to get nano with speech-recog.agi document and pasted the code in there. I added the speech recog API key and I have chown'd and set the permissions correctly.

The voicemail is still not transcribing and when I am in google developers it says I have used 0 of 50 times. I use speech recognition exclusively for voicemail - is there any other settings I need to change for voicemail? Also I have left my API key in quotation marks, I tried it without but this did not seem to make a difference.

Any help please?

(Edit - my voicemail to mp3 is set up by using this guide http://pbxinaflash.com/community/in...il-to-email-on-raspberry-pi.13142/#post-83241 so I'm guessing there's more to this for me).
 
Joined
May 22, 2013
Messages
301
Reaction score
44
This is what happens when I try Ward's link on Raspberry Pi:

Code:
root@incrediblepbx:~# cd /var/lib/asterisk/agi-bin
root@incrediblepbx:/var/lib/asterisk/agi-bin# wget https://raw.githubusercontent.com/zaf/asterisk-speech-recog/master/speech-recog.agi
--2014-07-05 23:43:16--  https://raw.githubusercontent.com/zaf/asterisk-speech-recog/master/speech-recog.agi
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 62.252.172.241
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|62.252.172.241|:443... connected.
GnuTLS: A TLS packet with unexpected length was received.
Unable to establish SSL connection.
root@incrediblepbx:/var/lib/asterisk/agi-bin#

When I try your link:

Code:
root@incrediblepbx:/var/lib/asterisk/agi-bin# wget --no-check-certificate https://github.com/zaf/asterisk-speech-recog/raw/master/speech-recog.agi
--2014-07-05 23:45:35--  https://github.com/zaf/asterisk-speech-recog/raw/master/speech-recog.agi
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/zaf/asterisk-speech-recog/master/speech-recog.agi [following]
--2014-07-05 23:45:41--  https://raw.githubusercontent.com/zaf/asterisk-speech-recog/master/speech-recog.agi
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 62.252.172.241
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|62.252.172.241|:443... connected.
GnuTLS: A TLS packet with unexpected length was received.
Unable to establish SSL connection.

How I have created the speech-recog.agi so far is by running the command nano -w speech-recog.api and when it brings up a blank file I then paste the whole agi file I can find online using a browser, then chown and chmod to ensure the permissions are set correctly.
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Tried again this morning and still getting the same error about the TLS packet on both links :(
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
I'm afraid it's a problem on your end. Works fine for me. Have you tried from a different computer? If so, it's either your router or your upstream provider. If you cut-and-paste, don't forget to run dos2unix on the file to convert it to Linux format.
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Thanks Ward, I am still at a brick wall unfortunately. I didn't run dos2unix but I have done this and also chown and chmod after I did this once I sftp'd the file back to the Raspi. I can run the script which gets me as far as:

Code:
Use of uninitialized value $AGI{"request"} in concatenation (.) or string at ./speech-recog.agi line 131, <STDIN> line 1.
SET VARIABLE "utterance" "-1"

 -- : Unexpected result: 
SET VARIABLE "confidence" "-1"

 -- : Unexpected result: 
CHANNEL STATUS

 -- : Unexpected result: 
GET FULL VARIABLE ${CHANNEL(audionativeformat)}

 -- : Unexpected result: 
RECORD FILE /tmp/stt_plE5X2 sln "#" "-1" BEEP "s=2"

 -- : Unexpected result: 
 -- : Failed to record file, aborting...
And I am assuming this is because there is no call in progress. I'm still getting an error on wget and have turned off the firewall, can't understand why I am getting this problem though as even after copy and pasting and running dos2unix I would have anticipated this was fine.

Could this be a pi specific issue?
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
I was going to ask yesterday and backed off as I don't use RasPi but in step 1 you need to install perl-JSON but the RasPi uses apt-get command to do this rather than a wget.

Is it possible you may have installed it with wget and so the RasPi can't handle that version? Then the following shows a wget to acquire the speech-recog.agi files (which is why I backed off -- can RasPi even use a wget or should you try to redo the command for the file as an apt-get?

Also did you do the STEP 0 as Ward had asked me which I must have skipped because once I did join the group I did see the speech api in my list and it does work for me now.

Just a thought check how you cquired perl-JSON.

Good Luck
 
Joined
May 22, 2013
Messages
301
Reaction score
44
Thanks for the suggestion. I followed Ward's guide to the letter, copy-pasting the details.

I am running Incredible Pi 3.11 with Asterisk 11.3.0 if this makes a difference.

I have tried re-installing perl-JSON but it tells me I am already up to date so that installed fine. The wget command still causes the problem so I have copy-pasted all commands up to wget, then I run nano -w speech-recog.agi and paste in the raw script from a web browser. I then enter my API key within quotation marks so it appears like my $key = "AAAABBBBCCCCDDDDEEEE"; on line 70.

Because of the TLS error message on wget I tried placing my PBX in the DMZ of the router but that made no difference, however I have read certain versions of wget are problematic with this error and perhaps this is linked to it? Saying that I've basically overcome the error because I have copy-pasted the script in the file using nano.

Then I run dos2unix on speech-recog.agi, then the chown and chmod commands which all run without errors.

I finish with an amportal restart.

The speech api shows up on my developer console as being on and using 0 of 50 requests.

Is there anything I can run to give a better idea what might be going on?
 
Joined
May 22, 2013
Messages
301
Reaction score
44
I have a further update.

It does appear to be working, I have dialled 949 and had cities/states recognised for weather (this isn't something I would use as I am in the UK) but it works. Voicemail is the problem I am having.

I suspect from this, voicemail is entirely different but links into the speech recognition service. It is http://pbxinaflash.com/community/in...il-to-email-on-raspberry-pi.13142/#post-83241 which is the imstallmp3stt.sh script. I have reinstalled it to be on the safe side but it still doesn't work.

So I suppose my real problem is not voice recognition as I have this working, but it is the voicemail transcription service. Is there an updated version of the script that would work?
 
Joined
May 22, 2013
Messages
301
Reaction score
44
I copied that file and put in my key, chmod and chown, it has changed something as the email would say something like 'here is the openning transcript' as I remember it always bugging me how opening was spelled, that now doesn't appear but neither does any transcript.

I have put in my key in exactly the same format as the speech-recog.agi file. I think we're a step closer but this particular module definitely needs updating.
 

pilovis

New Member
Joined
Feb 5, 2014
Messages
12
Reaction score
2
Starting from today it seems that Speech Recognition for Asterisk (Google API) doesn't work again :(
 

Members online

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top