FYI Google Speach Recognition not working on RasPi GVSIP 13-13.7 version

SMTC

Member
Joined
Jan 22, 2009
Messages
190
Reaction score
13
I have installed a known working Google Speech API key, same one from my previous gen 13-12.x using instructions from:

http://nerdvittles.com/?page_id=21210 by @wardmundy

Since I already had the Key I jumped to this step:

11. Log into your Incredible PBX server as root and issue the following command:

nano -w /var/lib/asterisk/agi-bin/speech-recog.agi

12. When the nano editor opens, go to line 70 or so of speech-recog.agi: my $key = "". Insert your API key from Step #9 or #10 between the quotation marks. Save the file: Ctrl-X, Y, then Enter.


Did not work. Any attempts to access its functionality (949) just produces the response "Your call cannot be completed as dialed, please check the number and dial again" Similarly, 411, or Wolfram (4747) fails as it relies on the aforementioned. (and yes the Wolfram key was also installed).

Am I missing something else?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
What does the Asterisk CLI show after you dial??
 

SMTC

Member
Joined
Jan 22, 2009
Messages
190
Reaction score
13
What does the Asterisk CLI show after you dial??

Here is the attempt.


Incredible PBX 13-13.7 for Raspberry Pi 3B

Asterisk: UP Apache: UP MariaDB: UP
SendMail: UP IPtables: UP SSH: UP
LAN port: UP Fail2Ban: UP Webmin: UP
GV OAUTH: UP Chan-SCCP: UP NR VPN: UP
FaxGetty: DN IAX Modem: DN HylaFax: DN

RAM:579484 Raspbian (Jessie) Disk:24G

Asterisk 13.22.0 + GUI ver. 13.0.120.10

Private IP: 192.168.1.xxx

Public IP: x.x.x.x Ph: PH:##########

System Time: Fri Sep 21 21:48:02 EDT 2018

< OK >




Always run Incredible PBX behind a hardware-based firewall.
root@incrediblepbx:~# asterisk -r -vvv
Asterisk 13.22.0, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for detail s.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 13.22.0 currently running on incrediblepbx (pid = 1589)
-- Registered SIP '701' at 192.168.1.110:5060
[2018-09-21 21:51:03] NOTICE[1702]: chan_sip.c:24653 handle_response_peerpoke: P eer '701' is now Reachable. (5ms / 2000ms)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [949@from-internal:1] ResetCDR("SIP/701-00000000", "") in new s tack
-- Executing [949@from-internal:2] NoCDR("SIP/701-00000000", "") in new stac k
-- Executing [949@from-internal:3] Progress("SIP/701-00000000", "") in new s tack
-- Executing [949@from-internal:4] Wait("SIP/701-00000000", "1") in new stac k
-- Executing [949@from-internal:5] Playback("SIP/701-00000000", "silence/1&c annot-complete-as-dialed&check-number-dial-again,noanswer") in new stack
-- <SIP/701-00000000> Playing 'silence/1.ulaw' (language 'en')
-- <SIP/701-00000000> Playing 'cannot-complete-as-dialed.ulaw' (language 'en ')
-- <SIP/701-00000000> Playing 'check-number-dial-again.ulaw' (language 'en')
-- Executing [949@from-internal:6] Wait("SIP/701-00000000", "1") in new stac k
-- Executing [949@from-internal:7] Congestion("SIP/701-00000000", "20") in n ew stack
[2018-09-21 21:51:33] WARNING[7635][C-00000000]: channel.c:5080 ast_prod: Proddi ng channel 'SIP/701-00000000' failed
== Spawn extension (from-internal, 949, 7) exited non-zero on 'SIP/701-0000000 0'
-- Executing [h@from-internal:1] Macro("SIP/701-00000000", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/701-00000000", "1?theend") i n new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("SIP/701-00000000", "0?Set(CDR(re cordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("SIP/701-00000000", "") in new st ack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/701-000000 00' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/701-00000000'
incrediblepbx*CLI>
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
Quick check to see which contexts 949 has a match

rasterisk -x "dialplan show 949@"
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
Where did the 949 come from?? It's not mentioned in the article you referenced.

That number typically is reserved for Worldwide Weather Reports with ApiXU which may or may not be on your server. That app doesn't use voice recognition at all. It's pure TTS.
 
Last edited:

SMTC

Member
Joined
Jan 22, 2009
Messages
190
Reaction score
13
Where did the 949 come from?? It's not mentioned in the article you referenced.

That number typically is reserved for Worldwide Weather Reports with ApiXU which may or may not be on your server. That app doesn't use voice recognition at all. It's pure TTS.

Here is where I got the "949" from -- See http://nerdvittles.com/?p=21255:
Speech Recognition with Incredible PBX

To support many of our applications, Incredible PBX has included Google’s speech recognition service for years. These applications include Weather Reports by City (949), AsteriDex Voice Dialing by Name (411), and Wolfram Alpha for Asterisk (4747), all of which use Lefteris Zafiris’ terrific speech-recog AGI script. Unfortunately (for some), Google now has tightened up the terms of use for their free speech recognition service. Now you can only use it for "personal and development use." If you meet those criteria, keep reading. Here’s how to activate speech recognition on Incredible PBX. Don’t skip any steps!

Here is another dump of me dialling "4747 and saying "doughnut" at the beep. It does not seem to have gotten my diction and dumped a spew of junk info.


=========================================================================
Connected to Asterisk 13.22.0 currently running on incrediblepbx (pid = 1589)
[2018-09-22 21:28:20] WARNING[1661]: pjproject:0 <?>: SSL 6 [SSL_ERROR_ZERO_RETURN] (Read) ret: 0 len: 32000
[2018-09-22 21:28:20] DEBUG[1661]: res_pjsip_outbound_registration.c:625 stateless_send_resolver_callback: Registration using newly created transport 0x75d6afac
[2018-09-22 21:28:21] DEBUG[27800]: res_pjsip_outbound_registration.c:1098 save_response_fields_to_client_state: Stored service-route: <sip:ACAH5NZ7EDYI7UB4PSURTL2HCIAPMK3RPYLJ34I3WJIUR2W5O2UGIV4WWAJJGII:5060;uri-econt=H2S43YK24KMBF4WO5YDHKXKDCO3RQSTA23FJBILGZMXKFIVYFCJA7ITDFSECIQUVSIOG7KJV5JZRLL4M3QAR2UMZKRCZVYK3JZLA7OOXUAAS4CFF3HYMPQKTESEXDMCNGH72O237IYVUFCNGVJGAXRMGJSW7KLTA;lr>Service-Route
QIôvìv,
[2018-09-22 21:28:21] DEBUG[27800]: res_pjsip_outbound_registration.c:1098 save_response_fields_to_client_state: Stored service-route: <sip:ABZSS4S47A6XLMFJGPC7GVTJFXJGRZSYTJCGTJGG7DSECGO2ME2RLRLQVD43ZYQ:5060;transport=udp;lr;uri-econt=GYQ56UEXT>4Service-Route1p74vv
[2018-09-22 21:28:21] DEBUG[27800]: res_pjsip_outbound_registration.c:1104 save_response_fields_to_client_state: Stored associated uri: <sip:BIJWO5RRGEZTCNJQGQZTINZYGU2TONRVGMJBIMBXGI3DOMBYGA2TQNRUGIZDMNZXGI2TO===@obihai.sip.google.com>P-Associated-URIDvèv
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [4747@from-internal:1] Answer("SIP/701-00000001", "") in new stack
-- Executing [4747@from-internal:2] Wait("SIP/701-00000001", "1") in new stack
-- Executing [4747@from-internal:3] Flite("SIP/701-00000001", ""After the beep, Say your command, then Press the pound key."") in new stack
-- <SIP/701-00000001> Playing '/tmp/flite_89847549.slin' (language 'en')
-- Executing [4747@from-internal:4] AGI("SIP/701-00000001", "speech-recog.agi,en-US") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/speech-recog.agi
-- <SIP/701-00000001>AGI Script speech-recog.agi completed, returning 0
-- Executing [4747@from-internal:5] NoOp("SIP/701-00000001", "= Script returned: , , , =") in new stack
-- Executing [4747@from-internal:6] Flite("SIP/701-00000001", """") in new stack
[2018-09-22 21:28:56] WARNING[27842][C-00000001]: app_flite.c:148 flite_exec: Flite: No text passed for synthesis.
-- Executing [4747@from-internal:7] BackGround("SIP/701-00000001", "vm-star-cancel") in new stack
-- <SIP/701-00000001> Playing 'vm-star-cancel.ulaw' (language 'en')
-- Executing [4747@from-internal:8] BackGround("SIP/701-00000001", "continue-english-press") in new stack
-- <SIP/701-00000001> Playing 'continue-english-press.ulaw' (language 'en')
-- Executing [4747@from-internal:9] BackGround("SIP/701-00000001", "digits/1") in new stack
-- <SIP/701-00000001> Playing 'digits/1.ulaw' (language 'en')
-- Executing [4747@from-internal:10] Read("SIP/701-00000001", "PROCEED,beep,1") in new stack
-- Accepting a maximum of 1 digits.
-- <SIP/701-00000001> Playing 'beep.ulaw' (language 'en')
-- User entered nothing.
-- Executing [4747@from-internal:11] GotoIf("SIP/701-00000001", "0?12:14") in new stack
-- Goto (from-internal,4747,14)
-- Executing [4747@from-internal:14] System("SIP/701-00000001", "/var/lib/asterisk/agi-bin/4747") in new stack
-- Executing [4747@from-internal:15] Set("SIP/701-00000001", "foo=inch.
-- 1 in , 1000 mils, , 2.54 cm (centimeters), , 25.4 mm (millimeters), , 0.254 dm (decimeters), , 0.0254 meters, , 6 picas, , 72 pt (desktop publishing points).
-- 1 mil , 0.001 in,1 cm , 0.3937 in,1 mm , 0.03937 in,1 dm , 3.937 in,1 m , 39.37 in,1 p , 0.1667 in,1 pt , 0.01389 in.
-- length.
-- width.
-- height.
-- depth.
-- thickness.
-- radius.
-- diameter.
-- distance.
-- precipitation.
-- path length.
-- circumference.
-- angular wavelength.
-- wavelength.
-- microinch.
-- UK imperial , UK nautical , United States Customary System (United StatesCS) , United States nautical , Canadian.
-- Light travel time t in vacuum from t = x/c:, , 85 ps (picoseconds).
-- Light travel time t in an optical fiber t = 1.48x/c:, , 125 ps (picoseconds).
-- Point size from 72 points = 1 inch:, , 72 pt (desktop publishing points).
-- Wavelength λ from λ = 2ÏÆeters.
-- Frequency ν of a photon in a vacuum from ν = 2Ïc/ÆHz (gigahertz).
-- Spectroscopic wavenumber ν^~ from ν^~ = 2Ï/Æ^(-1) (reciprocal meters).
-- Wavenumber k from k = 1/Æ^(-1) (reciprocal meters).
-- Angular wavelength Ærom Æ»/(2Ï):, , 0.004043 meters.
-- Frequency ν of a photon in a vacuum from ν = c/λ:, , 12 GHz (gigahertz).
-- Spectroscopic wavenumber ν^~ from ν^~ = 1/λ:, , 39.37 m^(-1) (reciprocal meters).
-- Wavenumber k from k = 2Ï/λ:, , 247.4 m^(-1) (reciprocal meters).
-- Frequency ν of sound from ν = v/λ:, , 13 kHz (kilohertz), , (assuming speed of sound â 340.27 m/s).
-- â ( 0.031 â 1/32 ) Ã average human step length ( 69 to 97 cm ).
-- â 0.5 Ã length of a AA battery (â 51 mm ).
-- â 0.57 Ã rack unit ( 1.75 in ).
-- â (0.1 to 0.2) Ã stair riser height ( 4 to 7 in ).
-- â 2.5 Ã width of a CD case ( 1 cm ).
-- â 2.6 Ã height of a standard Lego brick ( 9.6 mm ).
-- â 0.11 Ã inner radius of an NBA basketball rim ( 9 in ).
-- â 1.1 Ã lens radius of Harry Potter's glasses ( 0.5 lens diameters of Harry Potter's glasses ).
-- â 2.9 Ã Schwarzschild radius of Earth (â 0.0089 m ).
-- â 0.38 Ã diameter of a Nobel Prize medal ( 66 mm ).
-- â (1 to 2) Ã inside diameter of a ring ( 0.3183 inside circumferences of a ring ).
-- â 6.8 Ã total key travel distance on a computer keyboard ( 3 to 4 mm ).
-- â ( 0.3 â 1/4 ) Ã smallest microwave wavelength (â 0.1 m ).
-- â 3 Ã minimal wavelength of the SHF band (â 10 mm ).
-- â 30 Ã wavelength limit of radio waves (â 0.001 m ).
-- â (0.00149 to 1.5) Ã wavelength of an audible sound to a human ( 4Ã10^-5 to 0.05 speed of sound/Hz ).
-- â 0.59 à sound wavelength at 8000 Hz (eighth octave) in air at 21 °C (â 0.043 m ).
--
-- ") in new stack
-- Executing [4747@from-internal:16] Flite("SIP/701-00000001", ""inch.
-- 1 in , 1000 mils, , 2.54 cm (centimeters), , 25.4 mm (millimeters), , 0.254 dm (decimeters), , 0.0254 meters, , 6 picas, , 72 pt (desktop publishing points).
-- 1 mil , 0.001 in,1 cm , 0.3937 in,1 mm , 0.03937 in,1 dm , 3.937 in,1 m , 39.37 in,1 p , 0.1667 in,1 pt ,
......

--
-- "") in new stack
-- <SIP/701-00000001> Playing '/tmp/flite_22920901.slin' (language 'en')
== Spawn extension (from-internal, 4747, 16) exited non-zero on 'SIP/701-00000001'
-- Executing [h@from-internal:1] Macro("SIP/701-00000001", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/701-00000001", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("SIP/701-00000001", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("SIP/701-00000001", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/701-00000001' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/701-00000001'
incrediblepbx*CLI>
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
Google's speech recognition engine no longer works. You'll need to switch to IBM. See Nerd Vittles for tutorials.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
Is there a tutorial on using IBM STT with Wolfram Alpha?

Once you have IBM STT installed following this NV tutorial, do the following:
Code:
cd /var/lib/asterisk/agi-bin
wget http://incrediblepbx.com/wolframalpha-ibm.tar.gz
tar zxvf wolframalpha-ibm.tar.gz
rm -f wolframalpha-ibm.tar.gz
./install-wolfram4747-dialplan.sh

Then insert your Wolfram Alpha APPID and IBM credentials in wolfram.sh. For newer installs, you'll only have a Speech-to-Text APIkey so the API_USERNAME should be apikey, and the API_PASSWORD should be your actual STT APIkey. Do NOT mistakenly use your TTS APIkey!
 

mark847

Member
Joined
Oct 16, 2009
Messages
37
Reaction score
3
I already have the IBM STT APIkey. Clarification, the API_USERNAME and API_PASSWORD are both the IBM SST APIkey?
 

mark847

Member
Joined
Oct 16, 2009
Messages
37
Reaction score
3
Ok, I have gotten further. I still don't know if the API_USERNAME and API_PASSWORD are both the IBM SST APIkey. However, no matter what I say, the /tmp/results.txt file is always: . (character).
Wolfram Alpha responds "character".
How can I debug further? IBM SST or Wolfram Alpha?
here is the agi set debug on:
AGI Tx >> agi_request: wolfram.sh
AGI Tx >> agi_channel: SIP/165-00000001
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1543637305.1
AGI Tx >> agi_version: 13.22.0
AGI Tx >> agi_callerid: 165
AGI Tx >> agi_calleridname: New-Pi
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 4747
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: from-internal
AGI Tx >> agi_extension: 4747
AGI Tx >> agi_priority: 12
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >> agi_threadid: 1946039328
AGI Tx >> agi_arg_1: 8235
AGI Tx >>
AGI Rx << . (character).
AGI Tx >> 510 Invalid or unknown command
AGI Rx <<
AGI Tx >> 510 Invalid or unknown command
AGI Rx <<
AGI Tx >> 510 Invalid or unknown command
AGI Rx <<
 

mark847

Member
Joined
Oct 16, 2009
Messages
37
Reaction score
3
I ran the command:
bluemix-test
we are now transferring you out of the company directory please hold on for further assistance

However I don't know if the 4747 extension is calling the right script. It repeats my voice input,then says hold for contacting Wolfram Alpha, and then says character, which is what is in the /tmp/results.txt file.
 

mark847

Member
Joined
Oct 16, 2009
Messages
37
Reaction score
3
I modified the wolfram.sh:

# IBM no longer issues USERNAME AND PASSWORD credentials
#API_USERNAME="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
#API_PASSWORD="XXXXXXXXXXXX"

API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXX"
URL="https://stream.watsonplatform.net/speech-to-text/api"

I had to replace the string in the curl command
curl -k -u $API_USERNAME:$API_PASSWORD ..........
with
curl -k -u "apikey:$API_KEY" .....

So now IBM SST returns the proper text.
However Wolfram does not know the Capital of Illinois? what question should I ask to test?
 

mark847

Member
Joined
Oct 16, 2009
Messages
37
Reaction score
3
So 4747 is now working with IBM Speech to Text!

Is there a test for the IBM Text To Speech?
Is there a tutorial to change 4747 flite Text to Speech to the IBM TTS ?

Thanks
 

mark847

Member
Joined
Oct 16, 2009
Messages
37
Reaction score
3
Ward, there is nothing that I can find about using IBM TTS in the original Nerd Vittles tutorial.
What am I missing?
 

Members online

No members online now.

Forum statistics

Threads
25,810
Messages
167,754
Members
19,240
Latest member
nikko
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