Home » Posts tagged 'tts'

Tag Archives: tts

The Most Versatile VoIP Provider: FREE PORTING

Incredible ChatGPT: Artificial Intelligence For Your Phone



Unless you’ve been sleeping under a rock, you already know that Artificial Intelligence (AI) has the potential to transform every aspect of our lives. The reasons are fairly obvious. AI can process and analyze massive amounts of data in seconds that humans could spend months and years collecting. AI is being used to develop new drugs and treatments, diagnose diseases, and provide personalized care to patients. It’s being used to develop self-driving cars and trucks, optimize traffic flows, and improve public transportation. It can be used in manufacturing to automate tasks, improve quality control, and reduce costs. And AI can be used in the financial world to detect fraud, assess risk, and make investment decisions. Because of AI’s encyclopedic prowess, it can also write a mean term paper with human-like prose. That’s the good news. The bad news is that not everything AI regurgitates is accurate so be extremely careful relying upon AI exclusively to make decisions. See if you can spot the problem in this ChatGPT response:
 


ChatGPT is a large language model chatbot developed by OpenAI, a company backed by Microsoft®. Within two months after launch, ChatGPT had over 100 million subscribers. It is trained on a massive dataset of text and code and is able to generate human-like text, translate languages, write different kinds of creative content, and answer your questions in an informative way. The knowledge cutoff date for the gpt-3.5-turbo version of ChatGPT is September 2021. For users of Incredible PBX, today we’re pleased to bring that ChatGPT model to a telephone near you.

To get started, you’ll need three components. First, you’ll need an Incredible PBX 2027 platform with Debian 11 or Ubuntu 22.04 running on Windows, a Mac, or Linux. Turnkey versions are available for dozens of virtual machine and cloud-based platforms. If you’re using Incredible PBX 2027 on the Rocky 8 platform, you will also need to install the gTTS text-to-speech engine from here. Second, you’ll need to obtain a free OpenAI_KEY here using your Google, Apple, or Microsoft email account. And, third, you’ll need to obtain a free Speech-to-Text API_KEY and API_URL from IBM. Once you have the three pieces in hand, you’re ready to proceed with the installation for your Incredible PBX platform. After installation, you can make ChatGPT queries using any telephone connected to your PBX. Simply dial 2428 (C-H-A-T) and speak your query.

Installing the ChatGPT Telephone Interface

Not every ChatGPT response is suitable for use with a telephone. You wouldn’t want ChatGPT reading you a term paper or spouting out some Asterisk® dialplan code. Nor can most telephones display photos. So our deployment for Incredible PBX today provides two ChatGPT solutions: (1) a command-line interface that is accessible from a terminal or via SSH: chatgpt -p "your query". (2) The telephone interface is accessible by dialing 2428. For the telephone interface, be careful what you ask. You don’t want a 10,000-word response. For example, a good query might be "What are the five best Atlantic coast beaches in the United States." A not-so-good query would be "What are the best restaurants in the world."

To get started after installing Incredible PBX using one of the numerous tutorials available here, log into your server as root and issue the following commands:

cd /
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/ChatGPT/incredible-chat.tar.gz
tar zxvf incredible-chat.tar.gz
cd /root

Once the components have been downloaded and installed, navigate to the /root folder.
Enter your ChatGPT and IBM STT credentials in the following files:

  • Edit chat and insert your OPENAI_KEY in line 6
  • Edit chatgpt and insert your OPENAI_KEY in line 15
  • Edit chatgpt.sh and insert your OPENAI_KEY in line 12
  •  Also insert your IBM STT API_KEY in line 16 of chatgpt.sh
  •  Also insert your IBM STT API_URL in line 17 of chatgpt.sh

Complete the install by issuing the following commands:

cd /root
sed -i '/\[from-internal-custom\]/r chat.code' /etc/asterisk/extensions_custom.conf
chmod +x chat*
mv chat /usr/local/sbin
mv chatgpt /usr/local/bin
mv chatgpt.sh /var/lib/asterisk/agi-bin
asterisk -rx "dialplan reload"

NOTE: The chatgpt command-line tool does not work on the Rocky 8 platform because of a bug in their fold implementation. However, both our chat command-line tool and the 2428 telephony interface work fine once the gTTS text-to-speech engine is installed for Rocky 8.

Making a Test Call with ChatGPT

Now that all the pieces are in place, let’s make a test call. From a phone connected to your Incredible PBX server, dial 2428. At the prompt, enter the following query: What Are the Five Best Gulf Coast Beach Resorts in the United States? Within a minute or so, ChatGPT will provide the answer using the gTTS text-to-speech engine included in Incredible PBX. Enjoy!

A Cautionary Note About ChatGPT

We’ll close today with this cautionary note about ChatGPT… from ChatGPT:

Originally published: Friday, October 20, 2023



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.
 



Adding Incredible PBX Goodies & More to VitalPBX 4



As continued use of FreePBX® becomes more and more precarious because of deprecated components and looming incompatibility with Asterisk® 21, the appeal of 3CX and VitalPBX as a VoIP platform becomes increasingly compelling. Whether you’re a home user, a small business, or a call center, VitalPBX provides a solution to meet your requirements. To make the transition a bit less painful, today we introduce a number of popular Incredible PBX applications for VitalPBX 4. And, as always, all of the Incredible PBX additions are free, open source, and GPL code.


If you’re unfamiliar with the VitalPBX VoIP platform, here are some features that may be of interest. First, it runs on the latest Debian 11 platform and is Asterisk-based freeware with optional commercial components. Most GPL applications designed for FreePBX will run equally well under VitalPBX without modification. Second, VitalPBX provides multi-tenant functionality with the purchase of a commercial module. Third, VitalPBX supports Asterisk High Availability (HA) failover at no cost using an open source script provided by the VitalPBX developers. Complete tutorial here. Compare this to the FreePBX HA offering which retails for $1,500. Commercial modules offer Microsoft Teams integration as well as the full complement of Sonata Suite Call Center offerings: Billing, Switchboard, Stats, Dialer, and Recordings. Faxing, Paging, Queues Callback, and Phone Provisioning modules are also available at modest cost. Keep reading if any of these are of interest to you.


Getting Started with VitalPBX

Before you can install VitalPBX applications, you’ll obviously need a VitalPBX server. You can build the platform with on-premise hardware, or in the cloud using one of our recommended providers, or on a Raspberry Pi. We recommend at least 4GB of RAM and at least a 30GB disk. Two gigs of RAM will suffice with a 2GB swap file. VitalPBX can be deployed using the VitalPBX ISO, or you can start with a fresh Debian 11 platform and then run the VitalPBX install script:

wget https://repo.vitalpbx.com/vitalpbx/v4/apt/debian_vpbx_installer.sh
chmod +x debian_vpbx_installer.sh
apt install sudo
./debian_vpbx_installer.sh

For Raspberry Pi deployments, here are the steps using a 32GB microSD card:

Begin by downloading Raspberry Pi Imager for PC, MAC, or Ubuntu desktop. Run the Imager from your desktop computer with the following settings after inserting your 32GB microSD card into your desktop machine (see the sidebar for an inexpensive microSD/USB device):

OS: Raspberry Pi OS (other) -> Raspberry Pi OS Lite (64-bit)
Storage: Select your microSD card (32GB Type 10 recommended)
Click WRITE

Remove the microSD card from your desktop computer. Insert it into your Raspberry Pi and power on the device. The initial Raspberry Pi OS setup for the United States follows. For users elsewhere, follow your nose.

Choose keyboard layout: (Other, English (US) for USA users)
Keyboard Layout: English (US)
username: nerd
password: make it secure, type it twice
login: nerd with new password
sudo passwd root
create new secure root password
logout: exit
login: root with new root password
userdel nerd
nano -w /etc/ssh/sshd_config
  edit and uncomment: PermitRootLogin yes
  uncomment PasswordAuthentication yes
  save: Ctrl-X, Y, then ENTER key
run: raspi-config
  Settings Apply to: pi
  Localization: WLAN Country: US
  System Options: Wireless LAN: Enter your SSID and SSID passphrase
  System Options: Hostname: debian
  System Options: Power LED: YES
  Interface Options: SSH: YES
  Localization: Locale: Disable en_GB.UTF-8 and Enable en_US.UTF-8
  Localization: TimeZone: America, NewYork
  FINISH and Reboot

Once your Raspberry Pi has restarted, login as root with your root password and run the debian_vpbx_installer.sh script from above.

Adding a Whitelist & Hardening Your Firewall

We’ve built firewall whitelist rules for some of our favorite providers: Skyetel, BulkVS, VoIP.ms, Acrobits, SignalWire, Nexmo, Callcentric, and Anveo Direct. Also included are all private LAN, non-routable IP addresses and the default OpenVPN addresses. Issuing the following commands will install this whitelist and overwrite your existing firewall whitelist, if any. WARNING: The existing VitalPBX Firewall exposes all of your SIP ports as well as SSH, HTTP, and HTTPS so deploy VitalPBX behind a hardware-based firewall unless you significantly harden the VitalPBX Firewall ports. If you’re sure you’ve whitelisted the IP addresses of all your remote PCs, extensions, and trunk providers in Admin -> Firewall -> Access Control, then you can harden your firewall and protect your server by deleting the following entries in Admin -> Firewall -> Rules: HTTP, HTTPS, SSH, PJSIP, SIP, and IAX2. Then test all your connections to make certain they still are accessible. For future additions, we strongly recommend using OpenVPN addresses which require no new Firewall additions.

cd /root
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/VitalPBX-4/whitelist.sql
mysql -u root ombutel < whitelist.sql
vitalpbx apply-firewall
iptables -nL

gTTS Text-to-Speech Engine for VitalPBX

We've tested and implemented at least a half dozen text-to-speech engines to support Asterisk applications including Festival, FLITE, Amazon's Polly, IBM's Bluemix TTS, Pico TTS, and more. None are better than Google's free gTTS engine. Here's how to deploy it with VitalPBX to support all of your applications requiring TTS support. Login to your server as root and issue the following commands:

apt-get update
apt-get -y install jq libsox-fmt-all
apt-get -y install python3-pip
pip install --upgrade pip
pip3 install --upgrade pip
ln -s /usr/bin/pip3 /usr/bin/pip
pip install gTTS

Adding Custom Contexts Support to VitalPBX

In addition to the commercial modules, there are a number of free VitalPBX add-ons, one of which is Custom Contexts. We would recommend adding all of the free ones to get started. After logging into the web interface as admin, navigate to Admin -> Add-ons -> Add-ons. Click the Check Online button to load the latest available add-ons. Then click the Install icon for the following add-ons: System API, Authentication Codes, Bulk Extensions, Custom Contexts, Phone Books, and Task Manager. Once these add-ons are installed, you can install the following components.


Adding Incredible PBX Starter Kit to VitalPBX

We've put together a collection of some of our favorite Incredible PBX applications to enhance the VitalPBX platform. These include telephone apps like Yahoo News Headlines (dial 951), NWS Weather Reports by ZIP Code (947), Today in History (86329), and Telephone Reminders (123). In addition, we've reworked the pbxstatus utility (above) which will display whenever you log into your server as root from the Linux command line.

Many of these applications rely upon the gTTS text-to-speech engine so be sure you install it before proceeding.

To install the Incredible PBX collection, log into your server as root and issue the following commands:

cd /etc/asterisk/vitalpbx
cp extensions__80-IncrediblePBX.conf /root/extensions__80-IncrediblePBX.conf.bak
cd /
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/VitalPBX-4/incrediblepbx.tar.gz
tar zxvf incrediblepbx.tar.gz
rm -f incrediblepbx.tar.gz
asterisk -rx "dialplan reload"
echo "0 0 * * * root /var/lib/asterisk/agi-bin/run_recurring >/dev/null 2>&1" >> /etc/crontab
echo "3 0 * * * root /var/lib/asterisk/agi-bin/run_reminders >/dev/null 2>&1" >> /etc/crontab

Using Telephone Reminders with VitalPBX

Nerd Vittles Telephone Reminder System has been reworked for VitalPBX 4 and PHP 8.1. It lets you schedule reminders for future events (at least 4 minutes in the future) by telephone by dialing 123. When the appointed date and time arrives, Asterisk swings into action and places a call to the number you designate to deliver a customized reminder message. Recurring reminders also are supported. You can set up reminders that place calls daily or on weekdays as well as weekly, monthly, and annually. This means it can be used to wake you up in the morning, or to remind Granny to take her medicine every day, or to remind your Little League team of practice times and locations, or to remind you and your customers of scheduled and recurring events. External reminder calls are supported using your default outbound route's dial string, e.g. NXX-NXX-XXXX.

The complete tutorial for Telephone Reminders 4 is available here. The web interface is not yet supported on the VitalPBX platform; however, this Telephone Reminders app adds features that are not available in the *38 offering included in the VitalPBX Feature Code listing. Among these are optional recurring reminders as well as the ability to revise your reminder message before actually scheduling it.

Headline News & Weather Forecasts & Today in History

These three applications are self-explanatory. The best way to learn about them is to dial the three extensions from any phone registered on your VitalPBX server: Headline News (dial 951), Weather Forecasts by ZIP Code (dial 947), and Today in History (dial T-O-D-A-Y)

Adding OpenVPN to VitalPBX

The most secure method for accessing VitalPBX is to place your server behind a hardware-based firewall and use OpenVPN from the client PCs and phones to access the server. VitalPBX includes an OpenVPN add-on that includes both a server and a free 2-client license. For unlimited clients, you can purchase the commercial module for $120. In the alternative, you can deploy your own OpenVPN server and clients using this Nerd Vittles tutorial for Debian.

If you already have an OpenVPN server in operation, create an OpenVPN client for VitalPBX and name it incrediblepbx.ovpn. Copy it into the /etc directory of your VitalPBX server. Then issue the following commands and reboot to activate OpenVPN on your VitalPBX server:

apt-get update
apt-get -y install openvpn unzip
cd /
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/VitalPBX-4/openvpn-vitalpbx.tar.gz
tar zxvf openvpn-vitalpbx.tar.gz
rm -f openvpn-vitalpbx.tar.gz
shutdown -r now

Getting Started with Faxing

If your deployment is for a home or home office, then VitalPBX offers a free faxing component for a single trunk. We've tested this with VoIP.ms, and it works flawlessly. Begin by enabling the Virtual Faxes module. For your Trunk, enable FAX Detection and T.38, if desired. For your Fax Device, provide a Description, Destination Email, and CallerID Name and Number. For your Inbound Route, enable Fax Detection and Fax Destination of Fax Devices selecting the Destination Description you assigned to your Fax Device. Now place a test call to your DID from FaxZero.com. The Fax Sending module worked equally well.

Adding CallerID Names for Incoming Calls

Legal Disclaimer: Most CNAM providers have restrictions regarding caching of CNAM data. The courts consistently have ruled that phonebook data is not copyrightable. And every PBX caches CNAM data. After all, that's what CDR logs are all about. Consult with your own attorney if you have concerns, or simply stop reading here. 🙂

Some providers of DIDs also offer CallerID Name (CNAM) service for incoming calls. With VoIP.ms, it's optional and costs $0.008 per call. With BulkVS, it's mandatory and costs $0.003 per call. With many DID providers, you will only receive the CallerID Number on incoming calls. Thus was born our CallerID Trifecta and later Superfecta add-ons many years ago. Most of the free sources from yesteryear have disappeared, and we've only found two commercial sources that are reasonably priced at $0.003 per call: BulkCNAM (from the BulkVS folks) and EZCNAM at same price with a 25¢ credit to let you try out their service. Both work well.

Once you have installed Custom Context module for VitalPBX as well as the Incredible PBX Starter Kit from above, here are the steps to implement CNAM lookups on your incoming calls. First, sign up for an account with one or both of the providers and obtain a SOAP API Key from BulkCNAM or a traditional API key from EZcnam. Then login to your server as root and create an executable install script using the following template for BulkCNAM:

cd /root
rm -f superfecta-bulkcnam
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/VitalPBX-4/superfecta-bulkcnam
sed -i 's|SOAP-API-KEY|actual-key|' superfecta-bulkcnam
sed -i '\:// BEGIN CallerID Superfecta:,\:// END CallerID Superfecta:d' /etc/asterisk/vitalpbx/extensions__80-IncrediblePBX.conf
cat superfecta-bulkcnam >> /etc/asterisk/vitalpbx/extensions__80-IncrediblePBX.conf
asterisk -rx "dialplan reload"


Or create an executable install script using the following template for EZCNAM:

cd /root
rm -f superfecta-ezcnam
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/VitalPBX-4/superfecta-ezcnam
sed -i 's|=API-KEY|=actual-key|' superfecta-ezcnam
sed -i '\:// BEGIN CallerID Superfecta:,\:// END CallerID Superfecta:d' /etc/asterisk/vitalpbx/extensions__80-IncrediblePBX.conf
cat superfecta-ezcnam >> /etc/asterisk/vitalpbx/extensions__80-IncrediblePBX.conf
asterisk -rx "dialplan reload"


In your install script of choice, replace actual-key with the SOAP API key or API key you obtained from the provider. Make the script executable (chmod +x) and then run it to install the new script in your dialplan. Then reload dialplan: asterisk -rx "dialplan reload"

As deployed, the [superfecta] context assumes you want incoming calls routed to extension 501. You can modify this in /etc/asterisk/vitalpbx/extensions__80-IncrediblePBX.conf and reload your dialplan.

In the VitalPBX GUI, login as admin and navigate to PBX -> Applications -> Custom Contexts and create a new Custom Context and reload the dialplan:

Description: CallerID Superfecta
Context: superfecta
Extension: s
Priority: 1

Destination:

Custom Contexts -> Incredible PBX

In PBX -> Calls Routing -> Inbound Routes, edit your existing Inbound Route for your incoming DID and set the Inbound Destination to: Custom Contexts -> CallerID Superfecta. Then reload your dialplan.

How It Works: When an incoming call from a new caller is detected, the Superfecta script will greet the caller and ask the caller to press 7. Once the caller presses 7, the Superfecta script will look up the CNAM entry matching the CallerID Number and then route the call to extension 501. Successful callers are whitelisted and logged in the Asterisk database: database show cidname. When the same caller calls again, the call will be routed to extension 501 without prompting to press 7. Additional routing options are available by editing the [superfecta] context.

Configuring Gmail as SMTP Relay Host

The VitalPBX Portal includes the option to configure either a self-hosted email server (which may or may not work depending upon your upstream provider) as well as an SMTP relay host such as Gmail. You'll find it under Admin -> System Settings. In the alternative, you may prefer to do it yourself. Here's how.

1. Log into your server as root and issue the following command:

dpkg-reconfigure postfix

Click OK on the first dialog. Choose Internet Site as your Type of Mail Configuration. Accept the defaults for the System Mail Name, Root and Postmaster Recipient, and Other Destinations. Choose Yes for Forced Synchronous updates. Accept the defaults for the Local Networks, Default Mailbox Size, and Local Address Extension Character. Choose IPv4 for the Internet Protocol.

2. Once Postfix is reconfigured, edit /etc/postfix/main.cf. In the second section of code beginning with relayhost =, replace the relayhost= line with the following block of commands:

relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_fallback_relay =

3. Create the following new file using your Gmail account name and password.

nano -w /etc/postfix/sasl_passwd:

[smtp.gmail.com]:587 yourname@gmail.com:yourpassword

5. Change the permissions on the sasl_passwd file:

chmod 600 /etc/postfix/sasl_passwd

6. Use postmap to compile and hash the sasl_passwd file:

postmap /etc/postfix/sasl_passwd

7. Restart Postfix: systemctl restart postfix

8. apt -y install mailutils

9. Send yourself a test email: echo "test" | mail -s "Test Mail" somebody@gmail.com

Free Voicemail Transcription of Messages

For many years, Incredible PBX has included documentation to deploy IBM's Speech-to-Text (STT) engine to transcribe voicemail messages and deliver them by email for missed calls. Today we are pleased to bring that same functionality to VitalPBX 4. To get started, make certain that you have outbound email functioning on your server using the steps in the previous section. Then open an account with IBM and sign up for their LITE Speech-to-Text service. This provides you with 500 minutes a month of free STT transcription; however, you must use it at least once every 30 days or risk having your STT account terminated. So you may wish to setup up a recurring weekly reminder at a time when your extension will not otherwise be answered. Set up a short message to assure that voicemail transcription will be triggered. This will keep your LITE plan active without using many of your allocated minutes.

Once you have signed up for the STT-LITE service, navigate to Resources:AI/Machine Learning:STT in the LITE Tier and obtain or create an API Key and URL. Copy both the API Key and URL to your desktop. You'll need them as part of the VitalPBX component install below.


Next, login to your VitalPBX server as root and issue the following commands:

cd /root
apt -y install dos2unix lame
wget https://filedn.com/lBgbGypMOdDm8PWOoOiBR7j/VitalPBX-4/sendmailibm.tar.gz
tar zxvf sendmailibm.tar.gz
rm -f sendmailibm.tar.gz
nano -w sendmailibm
# insert your API Key and URL and Save file: Ctrl-X, Y, ENTER
cp -p sendmailibm /usr/local/sbin/.
cp -p voicemail__60-1-transcript.conf /etc/asterisk/vitalpbx/.
asterisk -rx "dialplan reload"

When the nano editor opens in step 6 above, insert your API Key and URL in the spaces provided. Then save the file: Ctrl-X, Y, then ENTER. Continue with the remaining steps above to complete the install.

By default, this setup assumes that incoming calls are delivered to an extension on your PBX. Assuming that is extension 501, open the VitalPBX GUI and edit your Extension's settings by adding your email address in General Settings and in the Voicemail tab specify Enable Voicemail and Attach Voicemail YES. If you wish to delete the messages from your server after sending the email, specify Delete YES. Then save your settings and reload your dialplan.


Finally, make a test call to that extension and don't answer. Leave a brief message and hang up. The transcribed voicemail together with an MP3 recording of the message should arrive within a minute or two.

You Snooze, You Lose

Sorry to say our supply of free licenses to one of our favorite add-ons, the $100 Starter Kit, has been exhausted. If we get additional ones to hand out, we'll post an update here. Here's what's included in the VitalPBX Starter Kit:


Originally published: Monday, August 7, 2023    Updated: September 13, 2023



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.
 



SpeechGen.io: A Near Perfect TTS Offering for Asterisk



Over the years, we’ve covered numerous commercial and free text-to-speech (TTS) offerings for Asterisk® including gTTS, PicoTTS, Amazon’s Polly TTS, IBM TTS, Google TTS, FLITE, and Festival. But SpeechGen’s commercial offering sets it apart both in terms of quality and cost. At a $9.99 price point for 100,000 characters with an easy-to-deploy AGI interface, SpeechGen is almost a perfect fit for Asterisk TTS applications. If you decide to deploy SpeechGen after trying out our demo, we hope you’ll consider using our referral link which helps offset the cost of providing today’s Weather by ZIP Code demo for everyone:

For those who have deployed Incredible PBX, we have a one-minute install script which will put all the pieces in place to use SpeechGen with our News Headlines and Weather by ZIP Code applications. Simply issue the commands below after logging into your server as root. Next, edit speechgen.php and insert your SpeechGen API token and your email address. Then dial 951 or 947 from any extension connected to your PBX to retrieve today’s news headlines or weather forecast for any U.S. zip code.

cd /var/lib/asterisk/agi-bin
wget http://incrediblepbx.com/speechgen.tar.gz
tar zxvf speechgen.tar.gz
rm -f speechgen.tar.gz
./install-speechgen-dialplan.sh
nano -w speechgen.php

Send us your own TTS applications for Asterisk. We’d love to publish them.

Originally published: Monday, October 31, 2022



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.
 




 

Today in History Returns to Incredible PBX with gTTS



If you’re a history buff and want a convenient way to find out everything that ever happened Today in History, then this week’s upgraded text to speech (TTS) application for Asterisk® should be just what you need. Pick up any phone connected to your Asterisk system and dial T-O-D-A-Y (86329 for the spelling-impaired). The script will retrieve today’s historical events of interest from HistoryOrb.com and play the results back to you over the phone using last week’s gTTS engine update. To speed up the retrieval process, you can also set this up as a cron job to download the latest events each day while you’re sleeping. Thereafter, when you dial T-O-D-A-Y, the results are played back instantaneously.

Prerequisites. If you’re using Incredible PBX®, then all of the tools you’ll need are already in place with the exception of gTTS. So start there if you have not previously installed gTTS. Then return here and download the script that installs Today in History 3.0 in a few seconds.

Overview. If you’ve previously installed other Nerd Vittles text to speech applications, then the drill this time around is quite similar. There’s a new PHP/AGI script which gets updated in /var/lib/asterisk/agi-bin. This new script (nv-today.php) uses the new gTTS engine. If you want to compare the quality of the old Flite TTS engine, then begin by dialing 86329 now from a phone connected to Incredible PBX. The dialplan snippet is already in place.

How It Works. The PHP/AGI script only does real work once a day. It always checks to see if there is an existing /tmp/today.txt file with today’s file stamp. If there is, it exits gracefully. If today’s file doesn’t exist or if the file’s time stamp is earlier than midnight, then the script downloads the latest information for today in history and creates a text file of the data. Then the gTTS engine is used to convert the text file into /tmp/today.wav. The dial plan code answers calls to extension 86329. Then it runs the PHP/AGI script, and finally it plays back /tmp/today.wav. Note: The PHP/AGI script, if run as a cron job or from the command prompt, should never be run as the root user, but only as the asterisk user. Otherwise, the today.txt and today.wav files cannot be replaced by the script when it subsequently is run.

Script Installation. Log into your Incredible PBX server as root and issue the following commands:

cd /var/lib/asterisk/agi-bin
wget http://incrediblepbx.com/today3.tar.gz
tar zxvf today3.tar.gz
rm -f today3.tar.gz

Automatic Updates Using crontab. If you’d like to automatically generate the Today in History files each day, add the following entry to the bottom of /etc/crontab:

01 0 * * * asterisk /var/lib/asterisk/agi-bin/nv-today.php

Running the Application. Now you’re ready for a test run. Pick up any phone connected to your Asterisk system and dial T-O-D-A-Y. After a brief pause to download the data, today’s events in history will be played back over your phone. To eliminate the pause the first time the application is run each day, simply add the crontab entry as outlined above. Enjoy!

Originally published: Monday, August 22, 2022



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.
 



gTTS: The Ultimate (free) Text-to-Speech Engine for Asterisk


Telephony is all about person-to-person communications. But much of what we do in the real world involves gathering information from non-human sources. These include books, magazines, and newspapers as well as sources that provide real-time news, weather, sports scores, stock quotes, inventory and personnel data, reservation systems, and historical data from countless other sources. No modern phone system would be complete without providing an interface to this data and for that you’ll need a text-to-speech engine (TTS). We previously have covered some free voice synthesis offerings including Google TTS, FLITE and Festival, and PicoTTS as well as commercial products like Amazon’s Polly TTS and IBM TTS.

With our special tip of the hat to Dick Ollett (@dicko), we are delighted to present what may very well be the best, free TTS offering out there, gTTS. To simplify the install on Incredible PBX platforms, we’ve developed scripts for Rocky8, Debian/Raspbian 10, and Ubuntu 20.04 that install gTTS and also update the Weather Forecasts (947) and News Headlines (951) applications.

Begin by logging into your server as root. On the Rocky 8 platform, here are the steps:

cd /var/lib/asterisk/agi-bin
dnf install python39 -y
pip3 install --upgrade pip
dnf install jq -y
pip3 install gTTS
wget http://incrediblepbx.com/gtts.tar.gz
tar zxvf gtts.tar.gz
rm -f gtts.tar.gz
./install-gtts-dialplan.sh

On the Debian, Raspbian, and Ubuntu platforms, issue the following commands:

cd /var/lib/asterisk/agi-bin
apt-get update
apt-get -y install jq libsox-fmt-all
apt-get -y install python3-pip
pip install --upgrade pip
pip3 install --upgrade pip
ln -s /usr/bin/pip3 /usr/bin/pip
pip install gTTS
wget http://incrediblepbx.com/gtts.tar.gz
tar zxvf gtts.tar.gz
rm -f gtts.tar.gz
./install-gtts-dialplan.sh

For those wishing to develop your own TTS applications for Asterisk, carefully review the dialplan code for News Headlines (951) in /etc/asterisk/extensions_custom.conf and the accompanying AGI script in /var/lib/asterisk/agi-bin: nv-news-yahoo.php. Enjoy!

Originally published: Monday, August 15, 2022



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.
 



Move Over Alexa: Meet Wolfram Alpha for Incredible PBX

Ever wished your Asterisk® server could harness the power of a 10,000 CPU Supercomputer to answer virtually any question you can dream up about the world we live in? Well, so long as it’s for non-commercial use, today’s your lucky day. Apple’s Siri™ and Amazon’s Alexa™ demonstrated just how amazing this technology can be. It began by coupling Wolfram Alpha® to a speech-to-text engine on the iPhone 4S. And now, thanks to IBM’s new speech transcription engine and Wolfram Alpha’s API, you can do much the same thing with Incredible PBX. Today, we’ll show you how.

We had such a good name for this project, Iris, which is Siri spelled backwards. You know the backwards sister and all of that. Unfortunately, the new (similar) product for Android phones was also named Iris. And we didn’t want to be like Larry on Newhart with two brothers named Darryl. So… we give you 4747. You can figure it out from there.

When people ask what exactly Wolfram Alpha is, our favorite answer was provided by Ed Borasky.

It’s an almanac driven by a supercomputer.

That’s an understatement. It’s a bit like calling Google Search a topic index. Unlike Google which provides links to web sites that can provide answers to queries, Wolfram Alpha provides specific and detailed answers to almost any question. Here are a few examples (with descriptions of the functionality) to help you wrap your head around the breadth of information. For a list of what’s available, visit Wolfram Alpha’s Examples by Topic.

Weather forecast for Washington D.C.
Next solar eclipse
Otis Redding
Define politician
Who won the 1969 Superbowl? (Broadway Joe)
What planes are flying overhead? (flying over your server’s location)
Ham and cheese sandwich (nutritional information)
Holidays 2012 (summary of all holidays for 2012 with dates and DOW)
Medical University of South Carolina (history of MUSC)
Star Trek (show history, air dates, number of episodes, and more)
Apollo 11 (everything you ever wanted to know)
Cheapest Toaster (brand and price)
Battle of Gettysburg
Daylight Savings Time 2012 (date ranges and how to set your clocks)
Tablets by Motorola (pricing, models, and specs from Best Buy)
Doughnut (you don’t wanna know)
Snickers bar (ditto)
Weather (local weather at your server’s location)

Best Question of the Day Award: "How much wood could a woodchuck chuck if a woodchuck could chuck wood?" And the answer: "A woodchuck would chuck all the wood he could chuck if a woodchuck could chuck wood. According to the tongue twister, although the paper ‘The Ability of Woodchucks to Chuck Cellulose Fibers’ by P.A. Paskevich and T.B. Shea in Annals of Improbable Research vol. 1, no. 4, pp. 4-9, July/August 1995, concluded that a woodchuck can chuck 361.9237001 cubic centimeters of wood per day."

Implementation Overview. Today what we’re going to demonstrate is how to configure your Asterisk server so that you can pick up any phone on your system, dial 4-7-4-7, speak a question, and we’ll show you how to send it to IBM to convert your spoken words into text. Then we’ll pass that text translation to Wolfram Alpha which will provide a plain text answer to your question. Finally, we’ll take that plain text and use a TTS engine to deliver the results.

Legal Disclaimer. What we’re demonstrating today is how to use two publicly accessible web resources to harness the power of a supercomputer to respond to your queries using a phone connected to an Asterisk server. We’re assuming that both Google and Wolfram Alpha have their legal bases covered and have a right to provide the public services they are offering. We are not vouching for them or the services they are offering in any way. By using our scripts, YOU AGREE TO ASSUME ALL RISKS, LEGAL AND OTHERWISE, ASSOCIATED WITH USE OF THESE FREELY ACCESSIBLE WEB TOOLS. NO WARRANTY EXPRESS OR IMPLIED IS BEING PROVIDED BY US INCLUDING ANY IMPLIED WARRANTY OF FITNESS FOR USE OR MERCHANTABILITY. You, of course, have an absolute right not to use our code if you have reservations of any kind or are unwilling to assume all risks associated with such use. Sorry for legalese, but it’s the time in which we live I’m afraid. Don’t Shoot the Messenger!

Getting an IBM STT LITE Account. You first will need to set up an IBM account, choose your Pricing Plan, and generate your Speech-to-Text credentials. Under IBM’s current LITE Plan, you get 500 free minutes of voice recognition a month with no rounding up of actual recording times. The only gotcha with the free tier is that, once you’ve used up your 500 minutes for the month, you’re done until the next month rolls around. If you only use this for Call By Name and Wolfram Alpha queries, you should be good to go. So begin by following our existing tutorial to set up your account and choose your pricing plan. Please note that credentials for Speech-to-Text and Text-to-Speech are different. For today, you want STT credentials. Once you’ve navigated to Speech-to-Text LITE, click on Service Credentials in the task bar and then click the blue New Credential button. Accept the defaults and IBM will generate the new credentials for you. Click on the Down Arrow beside your new credentials to display your apikey (top line) and url (bottom line) for future queries. Copy both entries to a safe place and log out of the IBM site.


Getting a Wolfram Alpha Account. You’ll also need a free Wolfram Alpha account. As you can imagine, there have to be some rules when you’re using someone else’s supercomputer for free. So here’s the deal. It’s free for non-commercial, personal use once you sign up for an account. But you’re limited to 2,000 queries a month which works out to almost 70 queries a day. Every query requires your personal application ID, and that’s how Wolfram Alpha keeps track of your queries. Considering the price, we think you’ll find the query limitation pretty generous compared to other web resources.

To get started, sign up for a free Wolfram Alpha API account. Just provide your email address and set up a password. It takes less than a minute. Log into your account and click on Get An App ID. Make up a name for your application and write down (and keep secret) your APP-ID code. That’s all there is to getting set up with Wolfram Alpha. If you want to explore costs for commercial use, there are links to let you get more information.

UPDATING YOUR WOLFRAM ALPHA SOFTWARE. On most Incredible PBX platforms, a version of the Wolfram Alpha software already is in place. But it won’t work with IBM’s new Speech-to-Text API. Here’s how to bring it up to current specs. Log into your server as root and issue these commands:

cd /var/lib/asterisk/agi-bin
wget http://incrediblepbx.com/wolfram2022.tar.gz
tar zxvf wolfram2022.tar.gz
rm -rf wolfram2022.tar.gz
nano -w wolfram.sh 

When the editor opens, scroll down to the following section of the code:

# please insert your Wolfram Alpha APPID below
APPID="your-app-id"

# please insert your IBM Watson STT credentials below
API_USERNAME="apikey"
API_KEY="XXXXXXXXXXXXXXXXXXXX"
API_URL="https://api.somewhere.stt.watson.cloud.ibm.com/instances/1-2-3-4-5"

Insert your Wolfram Alpha APPID in the space provided (between the quotes). Leave the API_USERNAME the way it is. Replace the API_KEY entry with your actual Google STT API key (between the quotes). Replace the API_URL entry (between the quotes) with the actual URL you copied down in the previous section. Now save the file: Ctrl-X, then Y, then ENTER.

Tweaking the Abbreviations List. Translating abbreviations into speech is a tricky business, and various TTS engines can only do so much. We’ve started the beginnings of an abbreviation list which you will find in the function section of 4747.php which is stored in /var/lib/asterisk/agi-bin. It’s easy to add additional entries. Just clone one of the entries that’s already there. For example, here’s the line that translates Jr. into Junior. HINT: Be careful to surround most unpunctuated abbreviations with spaces, or you may get unexpected results when a word actually begins or ends with the same letters.

$response = str_replace("Jr.","junior",$response);

Deploying PicoTTS on ARM64 Platforms. If you’re using Incredible PBX in the Oracle Cloud with its ARM64 architecture, you’ll need to install the ARM64 version of PicoTTS to use Wolfram Alpha. Here’s how:

cd /root
rm -f libttspico*
wget http://incrediblepbx.com/picotts-arm64.tar.gz
tar zxvf picotts-arm64.tar.gz
rm -f picotts-arm64.tar.gz
dpkg -i libttspico*

TAKING WOLFRAM ALPHA FOR A TEST DRIVE. To test things out, pick up a phone connected to your PBX and dial 4747. When prompted for your query, say "What planes are flying overhead now" and press #. You will be connected to Wolfram Alpha for the answer.

Originally published: Monday, August 1, 2022



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.
 



Amazon’s Polly TTS Returns for Incredible PBX 2021




In a word, WOW! If you’ve previously used text-to-speech (TTS) applications with Incredible PBX™ or any other PBX, you fully appreciate the challenges of getting excellent voice quality from a synthesized voice. In addition to operating system quirks, you also had to scramble to find TTS software that had acceptable voice quality without breaking the bank. Well, it’s a new day with Incredible PBX 2021. Shortly after Amazon’s introduction of Polly TTS, we integrated it into the Wazo platform with Incredible PBX. However, because of Debian dependencies, we were unable to migrate it to CentOS. With RedHat’s recent decision regarding CentOS, we introduced Incredible PBX 2021 for Debian. And now is a perfect time to bring back Polly TTS as well. Polly TTS provides not only incredible voice quality but it comes at an unbelievable price point. Your first year is free for the first 5 million characters each month. After that and in subsequent years, it’s $4 for every million characters of TTS translation, and you only pay for the characters used. But, don’t take our word for it. Listen to this sample. The clip’s introduction uses the free Pico TTS voice. The Yahoo News headlines were generated with Polly. Can you say Night and Day?

[soundcloud url="https://api.soundcloud.com/tracks/319736570″ params="auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true" width="80%" height="414″ iframe="true" /]

 
The beauty of Nerd Vittles projects is it’s all about the freedom to choose rather than making do with choices selected by others. Today’s addition of the Polly TTS engine brings the number of TTS options supported with Incredible PBX 2021 to four. In addition to the free options of Festival and PICO, you now have two dirt cheap commercial alternatives that rival the voice quality of any available TTS application on the market. There’s IBM’s Watson which we are using for voicemail transcription. And now you have Amazon’s Polly TTS as well.




Stewart Nelson was kind enough to share his audio clip comparing the Top Four commercial TTS applications. You can judge them for yourself. The clips are played in the following order: Amazon Polly TTS, Google Translate, IBM Watson TTS, and Microsoft.

[soundcloud url="https://api.soundcloud.com/tracks/320177552″ params="auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true" width="100%" height="450″ iframe="true" /]

 
How New TTS Apps Will Work in Incredible PBX 2021. That’s only half of our story today. We also are introducing our proven TTS methodology that makes it easy to roll your own TTS applications and take advantage of the voice platforms already installed on your Incredible PBX 2021 server. In our new TTS design, there are three components. First, there’s a chunk of dialplan code that answers calls, prompts for input (if required), and then passes the call off for processing and generation of the TTS results using the desired TTS platform.

The processing and TTS components consist of two PHP/AGI scripts on Asterisk® servers. The results processing script actually obtains the data to feed to the TTS processing engine. For example, this could be news headlines or a local weather forecast. This script generates plain text suitable for processing by any TTS engine. Finally, a TTS script stores your user credentials (if required) and handles translation of the text results into an audio file using the TTS platform of your choice. It also plays the audio "results" to the caller. As you add new applications, all that is necessary is a short dialplan snippet and a results processing script to obtain the necessary text to feed the TTS processing script.

Here’s a sample Asterisk dialplan snippet for our Yahoo News Headlines application. Note that you need only change the pollytts line of code to switch TTS engines. Simple design!

;# // BEGIN nv-news-yahoo
exten => 951,1,Answer
exten => 951,n,Wait(1)
exten => 951,n,Set(TIMEOUT(digit)=7)
exten => 951,n,Set(TIMEOUT(response)=10)
exten => 951,n,AGI(picotts.agi,"Please hold while we get the headlines.",en-US)
exten => 951,n,AGI(nv-news-yahoo.php,10) ;  obtain latest 10 Yahoo NEWS Headlines
exten => 951,n,NoOp(News: ${NEWS}) ;  display NEWS in text format on Asterisk CLI
exten => 951,n,AGI(pollytts.php,"${NEWS}") ; pass NEWS to TTS engine for playback
exten => 951,n,Hangup
;# // END nv-news-yahoo

The picotts line (above) shows the syntax to use the Pico TTS engine instead of pollytts. The new line would look like the following. Doesn’t get much easier than this:

exten => 951,n,AGI(picotts.agi,"${NEWS}",en-US)

Getting Started. Here are the steps to get everything working with your existing Incredible PBX 2021 platform. First, you’ll need credentials from Amazon Polly after you create or sign in to your an Amazon AWS account. Enter "Polly" in the AWS dialog to add the service. Make note of your Amazon region while here. Then open your Security Credentials by clicking on your name and choosing My Security Credentials. Create a new Access Key ID and Secret. You’ll need these credentials as well as your Amazon region in a minute. Next, you’ll need to put the pieces in place on your Incredible PBX 2021 server to support Polly TTS. We’ve made this easy by bundling everything into a single tarball. Just log into your server as root, download the tarball, untar it, add MP3 support for SOX, run the included script to install the dialplan code, and edit the pollytts.php script to install your Amazon credentials. Install time: under a minute.

cd /var/lib/asterisk/agi-bin
cp -p nv-news-yahoo.php nv-news-yahoo-orig.php
cp -p nv-weather-zip.php nv-weather-zip-orig.php
wget http://incrediblepbx.com/nv-polly-install.tar.gz
tar zxvf nv-polly-install.tar.gz
rm -f nv-polly-install.tar.gz
apt-get -y install libsox-fmt-mp3
./install-polly-dialplan-incrediblepbx.sh
nano -w pollytts.php

 
Once the pieces are in place and the editor opens, insert your Amazon key, secret, and region code. Then save the file: Ctrl-X, Y, then ENTER.

Now you can test things out by picking up a phone connected to your PBX and dialing 951 for News or 947 for Weather by ZIP Code. Enjoy!

NEWS FLASH: This new installer works great on the Incredible PBX 2020 Raspberry Pi platform as well.

 

Originally published: Monday, January 22, 2021



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.
 



Going Public with Incredible PBX 16 and VitalPBX 2.3.8



As part of our ongoing development efforts, we maintain about a dozen honeypot servers across the U.S. and Canada to monitor the latest adventures of the bad guys. Security becomes especially important for those wishing to live on the bleeding edge and deploy a cloud-based, public-facing VoIP server. Today we want to walk you through our latest suggestions to set up and secure a VitalPBX platform using just the built-in FirewallD, IPset, and Fail2Ban components. If you opt to deploy VitalPBX in the Cloud, a KVM-based VPS is absolutely essential in order to take advantage of the security mechanisms we will introduce today.

Here are 6 Key Security Features in today’s public design:

  • SIP Registration Lockdown by FQDN
  • Extension Lockdown by IP Address
  • Trunk Provider Lockdown by IP Address
  • Web Access Lockdown by WhiteList
  • Disguised Ports for SIP and SSH Access
  • 100,000+ VOIP Blacklist for FirewallD

Is it 100% safe? Nothing ever is. That’s what backups are for. 😉

FYI: The CentOS folks reintroduced a previous FirewallD bug on October 22 which (again) broke new VitalPBX installs. On October 23, the VitalPBX developers fixed the bug (again). There should be no problems with new installs. For previous installs, see this thread on the PIAF Forum for the fix.

Taking Incredible PBX with VitalPBX to the Cloud

Because Incredible PBX with VitalPBX 2.3.8 was originally distributed as an ISO, getting it installed in the cloud was a challenge. A few cloud providers let you bring your own ISO to install on their VPS platforms, but it was still a tedious process. So today we’re pleased to introduce a new install script that can be run on any CentOS 7 platform.

We have a few cloud providers that we recommend without reservation. Both Vultr and Digital Ocean provide referral credits to Nerd Vittles to support our VoIP project development efforts. We’ve used both of them for many years with no problems. Either of the platforms works well using the $5 a month option in your choice of cities. Just be sure to choose the CentOS 7 platform, not CentOS 8. For an extra buck, you can add automatic backups.

Our favorite bargain is now CrownCloud in Los Angeles. For $25 a year, they offer a KVM VPS that is ideal as a VoIP platform. And the offering includes a free snapshot image as well. As you might imagine, it’s very popular and goes Out of Stock from time to time so check back often. For our international friends, CrownCloud offers similar platforms at the same price point in both Germany and the Netherlands.

Installing Incredible PBX with VitalPBX on CentOS 7

Once your CentOS 7 platform is up and running, here’s how to install Incredible PBX for VitalPBX. Log into your server as root using SSH or Putty. Then issue these commands:

cd /root
passwd
yum -y install net-tools wget nano tar
wget http://incrediblepbx.com/incrediblepbx.sh
chmod +x incrediblepbx.sh
./incrediblepbx.sh

Incredible PBX Cloud Setup Recipe for VitalPBX

We think the easiest way to configure your new VitalPBX platform is to follow the simple steps outlined below. This will avoid your having to jump back and forth between tutorials to get all the pieces in place. When you’re finished, you’ll have a secure VitalPBX cloud platform. Don’t be intimidated by the number of steps. If you can handle slice-and-bake cookies, you can do this!

1. Point your browser to the IP address of your server. You’ll be prompted to set a password for admin access to the GUI. Fill in the blanks to proceed. Should you ever forget your admin password, here’s how as root user to force a reset on your next login from a browser:

mysql ombutel -e 'update ombu_settings set value = "yes" where name = "reset_pwd"'


2. Register your server when prompted. The VitalPBX Dashboard will appear.

3. Decipher the public IP address of your desktop machine and any other PCs that will be used to manage your server.

4. From the VitalPBX Dashboard, navigate to Admin:Security:Firewall:WhiteList. Enter each of your IP addresses from step #3 and click Save button.

5. From the VitalPBX Dashboard, navigate to Admin:Security:Intrusion Detection:WhiteList. Enter each of your IP addresses from step #3 and click Save button.

6. Modify the default SSH port by logging in to your server as root and issuing the following commands using the year you were born in the first line replacing 2000:

sed -i 's|#Port 22|Port 2000|' /etc/ssh/sshd_config
systemctl restart sshd

 
7. From the VitalPBX Dashboard, navigate to Admin:Security:Firewall:Services. Change the SIP port to 5080 or some other port number not in the 5060-5065 range. Change the SSH port to a 4-digit number matching the year you were born. Click Save button. Monitor your SSH log for attempted breaches and change your port if necessary:

cat /var/log/secure | grep password

 
8. Verify that you can log back into your server with SSH using the new SSH port number you assigned in step #6: ssh -p 2000 root@server-IP-address

9. From the VitalPBX Dashboard, navigate to Admin:Security:Firewall:Rules. Delete the HTTP and HTTPS items by clicking the Trash icon beside each entry. In the GENERAL tab, set Block ICMP Requests to YES. Click Save button. This blocks web access to everyone except those you’ve whitelisted in step #4 above. If you ever lock yourself out of web access, login to your server as shown in step #8 and temporarily whitelist the public IP address desired. This gets removed automatically the next time you save your Firewall settings from within the VitalPBX GUI.

iptables -A vpbx_white_list -s 12.34.56.78 -j ACCEPT

10. Before we get too far along, let’s put another layer of security in place for your new server. We’re going to add the VoIP Blacklist which blocks about 100,000 bad guys from around the globe. We’ll also add a cron job to update the blacklist every night. Log back into your server as root and issue these commands to put the pieces in place and enable the VoIP Blacklist.

TIP: The cron job below is scheduled to run at 20 minutes after 3 a.m. Change the time to something else so we don’t all bombard the VoIP Blacklist site for downloads at exactly the same time every night.

cd /etc
wget http://incrediblepbx.com/voipbl-firewalld.tar.gz
tar zxvf voipbl-firewalld.tar.gz
rm -f voipbl-firewalld.tar.gz
echo "20 3 * * * root /etc/update-voipbl.sh >/dev/null 2>&1" >> /etc/crontab
/etc/update-voipbl.sh

11. From the VitalPBX Dashboard, navigate to Admin:Add-Ons:Add-Ons. Click Check Online button. Click Install button beside Custom Contexts. Click Install button beside Phonebooks. Click Install button beside Domotic.

12. From the VitalPBX Dashboard, navigate to Settings:Tech Settings:SIP Settings.

  a. In the GENERAL tab, set the Bind Address port to 5080 or whatever port you chose in step #7 above. This is the port number together with the FQDN of your PBX (set in the next step) that any SIP phone will need to successfully register to an extension.

  b. In the SECURITY tab, set Allow Guest to NO, set Auto-Domain to NO, set Allow External Domains to NO, and enter a fully-qualified domain name (FQDN) pointing to the IP address of your server in the Domain field. We cannot stress enough how important this FQDN is to the security of your cloud-based server. It limits SIP registrations to this FQDN only, and all SIP registration attempts by IP address are automatically blocked. Don’t skip this step!

  c. In the NETWORK tab, enter the IP address of your server in External Address. Click the ADD button in the Local Networks section and enter the private IP addresses associated with your LAN and VPN, e.g. 192.168.0.0/255.255.0.0 and 10.0.0.0/255.240.0.0. Change NAT to Force,Comedia if your server is behind a NAT-based router.

  d. In the CODECS tab, enable ULAW, ALAW, G722, and G729.

  e. In the OTHERS tab, set SRV LOOKUPS to Yes. Click SAVE button.

13. From the VitalPBX Dashboard, navigate to Settings:Tech Settings:Profiles. Click Show All Profiles bar and choose Default PJSIP Profile. In the GENERAL tab, set the following entries to YES: Force rport, Rewrite Contact, Direct Media, RTP Symmetric, and Send Diversion Header. Click UPDATE button.

14. From the VitalPBX Dashboard, navigate to PBX:Applications:Parking. Click Show All Parking Profiles bar and choose Default. Change Code from 700 to 7000 and click Update button. This changes your Parking Lot extensions to the 7000 range so that 700 range can be used for Extensions, just like other versions of Incredible PBX.

15. Log out of your Dashboard and then log back in so that the menus get refreshed with the Custom Contexts addition.

16. From the VitalPBX Dashboard, navigate to PBX:Applications:Custom Contexts. Create the new sample IVR context with the following entries. Then click Save button.

  • Description: IncrediblePBX
  • Context: incrediblepbx
  • Extension: s
  • Priority: 1
  • Destination: Terminate Call -> Hangup

17. From the VitalPBX Dashboard, navigate to PBX:Applications:Custom Applications. Create the custom application for the sample IVR and Save it.

  • Code: 3366
  • Name: DEMO
  • Enabled: YES
  • Destination: Custom Contexts -> IncrediblePBX

18. From the VitalPBX Dashboard, navigate to PBX:Applications:Conferences. Create the new sample conference application and Save it.

  • Code: 2663
  • Description: CONF
  • Music on Hold When Empty: YES
  • User Count: YES
  • Announce Join/Leave: YES
  • Announce Only User: YES
  • User PIN: 1234
  • Leader PIN: 4321
  • Drop Silence: YES

19. If you didn’t read last week’s article on Custom Contexts, now would be a good time to do so. Here are the commands to put all those pieces in place on your new cloud-based server:

cd /
yum -y install dialog wget nano tar mailx
cp -p /etc/crontab /etc/crontab.bak
wget http://incrediblepbx.com/incrediblepbx-vitalpbx.tar.gz
tar zxvf incrediblepbx-vitalpbx.tar.gz
rm -f incrediblepbx-vitalpbx.tar.gz
chown asterisk:asterisk /var/lib/asterisk
cd /etc/asterisk/ombutel
echo "[cos-all-custom](+)" >> extensions__80-custom.conf
echo "exten => 412,1,NoOp(Voice Dialer)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,1,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 951,1,NoOp(News)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,5,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 947,1,NoOp(Weather by ZIP)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,6,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 3172,1,NoOp(DISA Voice Dialer)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,9,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 4747,1,NoOp(Wolfram Alpha)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,3,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 8463,1,NoOp(Time of Day)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,*,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 53669,1,NoOp(Lenny)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,53669,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
echo "exten => 86329,1,NoOp(Today in History)" >> extensions__80-custom.conf
echo " same => n,Answer" >> extensions__80-custom.conf
echo " same => n,Goto(incrediblepbx,7,1)" >> extensions__80-custom.conf
echo " same => n,Hangup()" >> extensions__80-custom.conf
echo "" >> extensions__80-custom.conf
systemctl restart asterisk
chown asterisk:asterisk /var/lib/asterisk
chown asterisk:apache /var/lib/asterisk/agi-bin

20. Create new Extensions for your PBX by navigating to PBX:Extensions:Extensions. You only need to fill in the Extension, Name, and Email Address fields. We recommend extension numbers beginning with 701. If the extension will be used from a phone behind a NAT-based router, change the NAT entry to Force,Comedia. If the phone associated with the extension has a static IP address, enter it in the Permit field for an extra layer of security. In the VOICEMAIL tab, you will note that voicemail is enabled by default with a password matching the extension number. This forces the user to set the voicemail password the first time they access voicemail with their phone. We recommend the YES setting for Attach Voicemail, Ask Password, Say CID, Say Duration, and Envelope. Then press SAVE.

21. Once you have created your extensions, you can create Ring Groups to assign multiple extensions and external numbers to a designated number which will ring all of the extensions and external numbers in the ring group either simultaneously or serially. Navigate to PBX:Call Center:Ring Groups to set this up.

22. Trunk Setup. While we don’t recommend it, if you just want to play around with some toll-free calls using option 1 in the DEMO IVR to see how everything works, here’s a simple trunk setup to get you started. First, navigate to Settings:Telephony:Channel Groups and save a group named Default with no entries. Then navigate to PBX:External:Trunks:CUSTOM. Create TollFree trunk with this Dial String: SIP/1${EXTEN}@ovh.starcompartners.com. No other entries are required. Click SAVE and reload your dialplan. Finally, create an Outbound Route for these calls in PBX:External:Outbound Routes like this:

  • Description: TollFree
  • Trunks: TollFree
  • Dial Pattern: Pattern=NXXNXXXXXX

Save your settings and reload the dialplan. You now can skip down to step #25. NOTE: You will not be able to receive outside calls or make calls to numbers other than toll-free ones.

Our preference is that you use our Platinum Provider, Skyetel, for your default trunk and DID because they offer quadruple redundancy so you never miss a call. Sign up for Skyetel service and take advantage of the Nerd Vittles specials which include a $10 credit to kick the tires. First, complete the Prequalification Form here. You then will be provided a link to the Skyetel site to complete your registration. Once you have registered on the Skyetel site and your account has been activated, open a support ticket and request the $10 credit for your account by referencing the Nerd Vittles special offer. Once you are satisfied with the service, fund your account as desired, and Skyetel will match your deposit of up to $250 simply by opening another ticket. That gets you up to $500 of half-price calling. You can also port in your DIDs at no cost for 60 days after funding your account. Credit is limited to one per person/company/address/location. Effective 10/1/2023, $25/month minimum spend required.

We don’t recommend trunk registrations with a publicly exposed server because it creates a potential attack vector for intruders and any intrusion would be undetectable from the PBX since the attacker could make unauthorized calls after registering directly with your SIP provider. For this reason, Skyetel does not use SIP registrations to make connections to your PBX. Instead, Skyetel utilizes Endpoint Groups to identify which servers can communicate with the Skyetel service. An Endpoint Group consists of a Name, an IP address, a UDP or TCP port for the connection, and a numerical Priority for the group. For incoming calls destined to your PBX, DIDs are associated with an Endpoint Group to route the calls to your PBX. For outgoing calls from your PBX, a matching Endpoint Group is required to authorize outbound calls through the Skyetel network. Thus, the first step in configuring the Skyetel side for use with your PBX is to set up an Endpoint Group. Here’s a typical setup for Incredible PBX 16 for VitalPBX:

  • Name: IncrediblePBX
  • Priority: 1
  • IP Address: IncrediblePBX-Public-IP-Address
  • Port: 5062
  • Protocol: UDP
  • Description: my.incrediblepbx.com

To receive incoming PSTN calls, you’ll need at least one DID. On the Skyetel site, you acquire DIDs under the Phone Numbers tab. You have the option of Porting in Existing Numbers (free for the first 60 days after you sign up for service and fund your account) or purchasing new ones under the Buy Phone Numbers menu option.

Once you have acquired one or more DIDs, navigate to the Local Numbers or Toll Free Numbers tab and specify the desired SIP Format and Endpoint Group for each DID. Add SMS/MMS and E911 support, if desired. Call Forwarding and Failover are also supported. That completes the VoIP setup on the Skyetel side. System Status is always available here.

If you’d like additional details on why we recommend Skyetel, see this Nerd Vittles article.

On the VitalPBX side, we need to add a new Skyetel trunk. Navigate to PBX:External:Trunks:PJSIP. The VitalPBX Trunk setup should look like the following for Skyetel. If you’d like to cut-and-paste the entries for the Match field, here you go:

52.41.52.34,52.8.201.128,52.60.138.31,50.17.48.216,35.156.192.164


[popup url="https://pbs.twimg.com/media/EGDhgsXWsAIbmw1?format=jpg&name=medium" width="1200″ height="700″][/popup]

In Admin:Security:Firewall:WHITELIST, you’ll need to individually Add the five Skyetel IP addresses used in the Match field above and then SAVE your firewall settings.

Finally in PBX:Incoming Calls:CID Modifiers, add a new entry for Skyetel with Skip/Length = 2/10 and Save your settings.

23. Before your PBX can receive calls, you’ll need at least one Inbound Route. This tells the PBX how to route calls from one or more phone numbers (DIDs) that you own to a destination on your PBX, e.g. an extension, a ring group, an IVR, or custom context. Navigate to PBX:External:Inbound Routes to get started. Let’s set up a default inbound route for all the DIDs you have acquired from Skyetel in step #22. Fill in the fields shown below. Then SAVE.

  • Routing Method: Default
  • Description: Default Skyetel
  • DID Pattern: [leave blank for ALL DIDs]
  • CallerID Modifier: Skyetel
  • Inbound Destination: Custom Contexts -> IncrediblePBX

24. Before you can make outbound calls from extensions on your PBX, you’ll need at least one Outbound Route. This tells the PBX which provider to use to complete calls dialed with a certain sequence of numbers. For example, you probably would want 10-digit numbers routed to Skyetel. And, if users dial 1 and then a 10-digit number, you’d probably want those calls routed to Skyetel as well. To create this outbound route, navigate to PBX:External:Outbound Routes. Fill in the fields shown below. Click ADD to add a second Dial Pattern. Click SAVE and Reload Dialplan when finished.

NOTE: While you can "spoof" any CallerID number here, it is only legal to assign CallerID numbers that you actually own. Most carriers do not forward CallerID names to destinations regardless of what you enter here. The CallerID name and number will be shown in your CDR logs: Reports:CDR Reports:CDR.

  • Description: Skyetel-OUT
  • Trunks: Skyetel
  • Outbound CID: [Your Name and CallerID Number]
  • Overwrite CID: YES
  • Dial Pattern: Prepend=1 Pattern=NXXNXXXXXX
  • Dial Pattern: Pattern=1NXXNXXXXXX

25. For the time being, we strongly recommend disabling IPv6 simply because we don’t have the necessary confidence that all of the security mechanisms are in place for IPv6. Here’s how on the CentOS 7 platform:

echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -p
sed -i 's|#AddressFamily any|AddressFamily inet|' /etc/ssh/sshd_config
systemctl restart sshd
sed -i 's|inet_protocols = all|inet_protocols = ipv4|' /etc/postfix/main.cf
systemctl restart postfix

 
26. Outbound email functionality is essential on your PBX. You’ll need it to be alerted to potential issues with VitalPBX, and you’ll need it for delivery of voicemail messages to users. There are a couple ways to implement it, and both are easy. If you want to use the native capabilities of Postfix to send the emails assuming your provider is not blocking outbound SMTP mail from downstream servers, then follow these steps:

  • Insert your FQDN from step #12b into /etc/hosts immediately after 127.0.0.1
  • Replace the contents of /etc/hostname with the same FQDN
  • Issue the following command using your actual FQDN: hostname FQDN
  • Sending yourself an email: echo "test" | mail -s test you@your-domain.com

If you don’t receive the test email message, then the easiest solution is to configure PostFix as an SMTP Relay using a Gmail account. You can do this easily from within the VitalPBX GUI. Navigate to Admin:System Settings:Email Settings and click the External Mail Server tab. Be sure that Gmail is selected and enter your Gmail name and password in the fields provided. Save your settings and send yourself an email using the field provided.

27. Once you get outbound email flowing, jump down to the next section and obtain IBM TTS and STT passwords. Now set up Voicemail Transcription with Email Message Delivery:

  a. After logging into your VitalPBX server as root using SSH/Putty:

cd /tmp
mkdir sendmail
cd sendmail
wget http://incrediblepbx.com/sendmailibm-vitalpbx.tar.gz
tar zxvf sendmailibm-vitalpbx.tar.gz
rm -f sendmailibm-vitalpbx.tar.gz
mv usr/sbin/sendmailibm /usr/sbin
cd /etc/asterisk/ombutel
echo "[general](+)" > voicemail__60-1-transcript.conf 
echo "; format=wav|wav49|gsm" >> voicemail__60-1-transcript.conf
echo "mailcmd=/usr/sbin/sendmailibm" >> voicemail__60-1-transcript.conf
chown apache:apache voicemail__60-1-transcript.conf
rm -rf /tmp/sendmail

 
  b. Restart Asterisk core services: asterisk -rx "core reload"

  c. Edit /usr/sbin/sendmailibm and insert your IBM Watson STT APIkey on line 23. Change the language on line 31 if you don’t want en-US. Then save the file.

  d. Log back into the VitalPBX GUI and configure the extensions desired for email delivery of voicemail. For each extension in PBX:Extensions:General, enter an Email Address for delivery of voicemails. In PBX:Extensions:Voicemail, verify the VM settings from step #20.

28. We hesitate to even mention (free) Festival TTS as a text-to-speech alternative because it is so bad compared to IBM TTS. But for those that like always free, here’s how to install it. Once installed, you can issue Festival commands in your dialplan using the keyword Festival followed by the text to be spoken in parentheses.

yum -y install festival
echo "[general]" > /etc/asterisk/festival.conf
asterisk -rx "dialplan reload"
festival_server &
systemctl restart asterisk
echo "/usr/bin/festival_server &" >> /etc/rc.d/rc.local

 

29. If you’d like to test the performance of your cloud-based server, here’s how to deploy and run SpeedTest:

cd /root
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
/root/speedtest-cli

 
30. Associating CallerID Names (CNAM) with inbound calls for display on SIP phones and in the CDR logs is an often-requested PBX feature. There are a few ways to do it. First, for less than a penny a call, you can activate the feature with your DIDs in the Skyetel Dashboard. Or, for about half the cost, you can acquire an OpenCNAM account and activate it in VitalPBX by navigating to PBX:Incoming Calls:CID Lookup. Choose OpenCNAM as the Source and enter your credentials. Then SAVE your settings and reload the dialplan. Then, for each of your Inbound Routes, add OpenCNAM as the CID Lookup source and Update your configuration.

31. Unless you want a full-time job monitoring the size of your logs, remove the fail2ban Asterisk log which grows every 5 seconds. Navigate to Settings:PBX Settings:Log Files and click the Trash icon beside fail2ban. It’s probably a good idea to turn OFF the Notice option for the full log while you’re at it. Then SAVE your changes.

32. Before you do anything else, navigate to Admin:Admin:Backup & Restore, configure and run a Full Backup, and then download the file and keep it in a safe place. Be advised that Backup/Restore doesn’t restore Add-Ons, /var/lib/asterisk/agi-bin, custom contexts (extensions__80*.conf) in /etc/asterisk/ombutel, custom MySQL databases (mysqldump -u root yourDB > yourDB.sql), custom and lenny sound directories in /var/lib/asterisk/sounds, phpMyAdmin, /usr/local/sbin, and /etc/crontab.

Obtaining IBM Watson TTS and STT Credentials

Incredible PBX uses IBM Watson® for TTS and STT support. This Nerd Vittles tutorial will walk you through getting your IBM account set up and obtaining both your TTS and STT credentials. Be sure to write down BOTH sets of credentials which you’ll need in a minute. For home and SOHO use, IBM access and services generally is FREE even though you must provide a credit card when signing up. Details are provided when you sign up. If you ever forget your passwords, you can retrieve them by navigating to Resource List:Services:TTS or STT:View Full Details:Show Credentials.

Obtaining Wolfram Alpha Credentials

When people ask what exactly Wolfram Alpha is, our favorite answer was provided by Ed Borasky.

It’s an almanac driven by a supercomputer.

That’s an understatement. It’s a bit like calling Google Search a topic index. Unlike Google which provides links to web sites that can provide answers to queries, Wolfram Alpha provides specific and detailed answers to almost any question. Here are a few examples (with descriptions of the functionality) to help you wrap your head around the breadth of information. For a complete list of what’s available, visit Wolfram Alpha’s Examples by Topic. Type a sample query here. Some of our favorites include:

Weather in Charleston South Carolina
Weather forecast for Washington D.C.
Next solar eclipse
Otis Redding
Define politician
Who won the 1969 Superbowl? (Broadway Joe)
What planes are flying overhead now? (flying over your server’s location)
Ham and cheese sandwich (nutritional information)
Holidays 2012 (summary of all holidays for 2012 with dates and DOW)
Medical University of South Carolina (history of MUSC)
Star Trek (show history, air dates, number of episodes, and more)
Apollo 11 (everything you ever wanted to know)
Cheapest Toaster (brand and price)
Battle of Gettysburg (sad day 🙂 )
Daylight Savings Time 2012 (date ranges and how to set your clocks)
Tablets by Motorola (pricing, models, and specs from Best Buy)
Doughnut (you don’t wanna know)
Snickers bar (ditto)
Weather (local weather at your server’s location)

Before you can actually use our TTS implementation of Wolfram Alpha, you’ll need to obtain a free Wolfram Alpha account. As you can imagine, there have to be some rules when you’re using someone else’s supercomputer for free. So here’s the deal. It’s free for non-commercial, personal use once you sign up for an account. But you’re limited to 2,000 queries a month which works out to almost 70 queries a day. Every query requires your personal application ID, and that’s how Wolfram Alpha keeps track of your queries. Considering the price, we think you’ll find the query limitation generous compared to other web resources.

To get started, sign up for a free Wolfram Alpha API account. Just provide your email address and set up a password. It takes less than a minute. Log into your account and click on Get An App ID. Make up a name for your application and write down (and keep secret) your APP-ID code. That’s all there is to getting set up with Wolfram Alpha. If you want to explore costs for commercial use, there are links to let you get more information.

Configuring Your Incredible PBX Credentials

In addition to your Wolfram Alpha APPID, there are two sets of IBM credentials to plug into the Asterisk AGI scripts. Keep in mind that there are different passwords for the IBM Watson TTS and STT services. The TTS credentials will look like the following: $IBM_password. The STT credentials look like this: $API_PASSWORD. Don’t mix them up. The username for both TTS and STT is now the single word: apikey

All of the scripts requiring credentials are located in /var/lib/asterisk/agi-bin so switch to that directory after logging into your server as root. Edit each of the following files and insert your TTS credentials in the variables already provided: nv-today2.php, ibmtts.php, and ibmtts2.php. Edit each of the following files and insert your STT credentials in the variables already provided: getquery.sh, getnumber.sh, and getnumber2.sh. Finally, edit 4747 and insert your Wolfram Alpha APPID.

If you ever want to learn how to develop applications for Asterisk, these scripts coupled with the dialplan code included in /etc/asterisk/ombutel/extensions__80-1-incrediblepbx.conf will point you in the right direction with easy to follow examples.

Managing the AsteriDex SQLite3 Database

We’ve alluded to the AsteriDex database in a couple of VitalPBX articles but never mentioned how to access it. Using a browser, point it to http://server-ip/asteridex4. You can add, edit, display, and delete entries from there. Before you can make changes in the database, issue the following command after logging into your server as root:

chown asterisk:apache /var/lib/asterisk/agi-bin

Taking Incredible PBX for a Test Drive

You can take Incredible PBX for VitalPBX on a test drive in two ways. You can call our server, and then you can try things out on your own server and compare the results. Call our IVR by dialing 1-843-606-0555. For our international friends, you can use the following SIP URI for a free call: 10159591015959@atlanta.voip.ms. For tips on setting up your own secure, hybrid SIP URI with VitalPBX, see our original tutorial. The FreePBX® setup is virtually identical except for the location of the custom SIP setting for match_auth_username=yes. On a VitalPBX server, you will enter it here: Settings:Technology Settings:SIP Settings:CUSTOM.

With Allison’s Demo IVR, you can choose from the following options:

  • 0. Chat with Operator — connects to extension 701
  • 1. AsteriDex Voice Dialer (412) – say "Delta Airlines" or "American Airlines" to connect
  • 2. Conferencing (2663) – log in using 1234 as the conference PIN
  • 3. Wolfram Alpha Almanac (4747) – say "What planes are flying overhead now?"
  • 4. Lenny (53669) – The Telemarketer’s Worst Nightmare
  • 5. Today’s News Headlines (951) — courtesy of Yahoo! News
  • 6. Weather by ZIP Code (947) – enter any 5-digit ZIP code for today’s weather
  • 7. Today in History (86329) — courtesy of OnThisDay.com
  • 8. Call Extension 701 — on your local PBX
  • 9. DISA Voice Dialer (3172) — say any 10-digit number to be connected
  • *. Current TIME and Date (8463) — courtesy of VitalPBX

CAUTION: We have intentionally disabled outbound calls using Option #9 and redirected callers to Lenny. The reason is that an unscrupulous caller could easily run up your phone bill by entering a number with expensive destination charges. If you wish to enable the feature, despite the risks, you can edit extensions__80-1-incrediblepbx.conf and make the change.

You can call your own IVR in a few ways. From an internal VitalPBX phone, dial D-E-M-O (2663) to be connected. Or simply dial the number of the DID you routed to the Incredible PBX Custom Context. Local users can also dial the individual feature codes shown in parentheses above. Be sure that you heed AND test the CAUTION documented above.

Originally published: Monday, October 21, 2019





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.