It’s been a bumpy road for Speech-to-Text solutions with Asterisk® since Google pulled the rug out from under their (formerly) free offering. We found a partial solution with IBM’s offering which now provides 500 free minutes a month on their LITE plan, or you can choose their Standard Pricing Plan and pay 2¢ a minute for all you can eat. Be advised that the IBM offerings have changed three times in the last year. But we’ve been searching for turnkey voicemail transcription and voice dialer offerings that could be incorporated into Incredible PBX 2020 at no cost. And now we’ve found one thanks to Mozilla Machine Learning Group’s DeepSpeech project. Details here. We also want to thank @Stepan Novotill and @jerrm on the PIAF Forum for their work in bringing this project to fruition for the Asterisk community.
The instructions which follow should work fine with existing Incredible PBX 2020, Incredible PBX 16-15, and Incredible PBX 13-13 platforms running on CentOS 7. We haven’t tested on other platforms, but @jerrm has offered some tips for those using Debian/Raspbian.
Deploying Voicemail Transcription with DeepSpeech
Log into your server as root and issue these commands to install DeepSpeech components:
(NOTE: Lines 4, 5, and 6 below are actually part of a single line of code)
cd /usr/local/sbin yum -y install python3-pip wget pip3 install deepspeech wget -O - https://github.com/mozilla/DeepSpeech/releases/download/v0.6.1/deepspeech-0.6.1-models.tar.gz | tar xzv --no-same-owner chown -R asterisk:asterisk deepspeech-0.6.1-models wget http://incrediblepbx.com/sendmail-deepspeech.tar.gz tar zxvf sendmail-deepspeech.tar.gz rm -f sendmail-deepspeech.tar.gz cp -p sendmailmp3.deepspeech sendmailmp3
In the FreePBX GUI, edit your extensions and enable voicemail with settings like these:
For delivery of transcribed voicemail messages to arrive in your email, you obviously must have outbound email working on your PBX. You can test this using the following command with your actual email address:
echo "test" | mail -s testmessage yourname@gmail.com
If the email never arrives, first check your spam folder. If it’s not there, then chances are you have not configured an FQDN for your PBX properly. Try the following tips.
hostname noreply.incrediblepbx.com nano -w /etc/hosts
Make certain the 127.0.0.1 line in /etc/hosts begins like this:
127.0.0.1 noreply.incrediblepbx.com pbx.local
Deploying a Free Voice Dialer with DeepSpeech
Once you complete the steps above, it’s easy to deploy a free Voice Dialer for Asterisk on any Incredible PBX platform. This allows you to pick up a phone connected to your PBX, dial 411, and call any individual or company listed in your AsteriDex database by saying their name.
Issue the following commands to replace the default Incredible PBX Voice Dialer setup:
(NOTE: Lines 6 and 7 below are actually part of a single line of code)
cd /usr/local/sbin mv deepspeech-411.txt /var/lib/asterisk/agi-bin mv getnumber2.sh /var/lib/asterisk/agi-bin cd /etc/asterisk sed -i '\:// BEGIN Call by Name:,\:// END Call by Name:d' extensions_custom.conf sed -i '/\[from-internal-custom\]/r /var/lib/asterisk/agi-bin/deepspeech-411.txt' extensions_custom.conf asterisk -rx "dialplan reload"
Now pick up a phone on your PBX and dial 411. When prompted, say "American Airlines" and then press the pound (#) key. You’ll be connected to American Airlines reservations. Enjoy!
Originally published: Monday, January 20, 2020
Need help with Asterisk? Visit the VoIP-info Forum.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Well that was fun. But unfortunately running deepspeech command generates an "Illegal instruction" error. This is on an Incredible PBX 2020 system.
[wm: Try running the two commands below. This should tell you what came unglued. Are you sure no errors were shown as you executed the install commands (including combining the three lines as noted)?
The install worked fine. I did it again just to be sure. The command and it’s output below:
root@localhost:/usr/local/sbin $ deepspeech –model /usr/local/sbin/deepspeech-0.6.1-models/output_graph.pbmm –lm /usr/local/sbin/deepspeech-0.6.1-models/lm.binary –trie /usr/local/sbin/deepspeech-0.6.1-models/trie –audio /var/lib/asterisk/sounds/en/no-valid-responce-pls-try-again.wav
Illegal instruction
There appears to be a problem with CPUs that do not support AVX, which in many cases virtualized PBXes do not. Searching around I haven’t found a suitable fix (yet).