Meet Ubuntu: An Exciting New Frontier for Asterisk and the VoIP Community

Flash back to your preschool days for a moment. Remember how excited you were when you first learned to ride a bike? And you may also recall the neighborhood bullies whizzing by to remind you that they’d been riding bigger and better bikes for years. Imagine our surprise when we got to relive that scenario last week because of our enthusiasm in attempting to bring Ubuntu and text-to-speech VoIP applications to an entirely new audience of Asterisk pioneers. A few folks apparently were miffed because they had discovered Ubuntu first and their double-top-secret sandbox was being invaded by the new kid on the block. Who would have thought Cinderella could stir such emotions? Of course, all of the condescending tweets have long since disappeared. Perhaps, in a moment of reflection, The Ubuntu Club remembered that collaboration in the open source community is what it’s all about. We hope so.


Usually by the time you celebrate your sixth birthday you’ve learned that there will always be somebody eager to jump at the opportunity to put you down for doing something they never thought of. That attitude motivated many of us to learn how to do new things like riding a bike on one wheel. So thank you for that.

Introducing Incredible PBX for Ubuntu 14

Let’s begin our Ubuntu adventure today on that positive note. The plan is to build an Incredible PBX server with Ubuntu 14 that mimics the functionality of our previous builds with literally dozens of turnkey applications that show off the very best features of Asterisk. The Wish List for today’s project is shown in the tweet above. You can count on one hand the number of these that were functioning a week ago. Now they all work seamlessly. So hang on to your handlebars!

Two weeks ago, we could barely spell Ubuntu. Then an enterprising young programmer named Eric Teeter shot us a script to install Ubuntu with Asterisk® and FreePBX® and encouraged us to embellish it and to share the results with our Nerd Vittles audience. Having rarely met an operating system we didn’t like, we jumped at the opportunity knowing full well that Billy Chia at Digium and Tony Lewis at Schmooze Com had reported impressive results with Ubuntu years ago. It seemed like a good fit for Incredible PBX as well. Unlike CentOS, Ubuntu also was a platform that was easily transferable to the new $50 BeagleBone Black. We’ll take a second look at that platform later this summer. A word of caution before we begin. Like Fedora 20, Ubuntu 14 includes PHP 5.5 which still has a few incompatibilities with prior releases. The one that bit us in the butt was the previous ability to begin a PHP script with <?, but not any more. The only legal syntax now is <?php. Go figure. Suffice it to say, FreePBX 2.11 was written for PHP 5.3 so keep your eyes open and report any glitches you discover so that they can be addressed. In the meantime, these two commands will clean up all of the old AGI scripts you might have lying around.

For the short term, there were other issues. First, Debian and Ubuntu don’t use RPMs or yum, the two tools that are the lynchpin of PBX in a Flash installers and all of the other popular Asterisk aggregations. That meant learning an entirely new way of managing applications. Fortunately, we’d already crossed that bridge with the Raspberry Pi. Second, there was Eric’s methodology. He opted for package installs while we prefer building Asterisk from source because of the added flexibility. And finally, we discovered text-to-speech (TTS) applications such as Flite and GoogleTTS didn’t work at all on the Ubuntu platform. Since dozens of Incredible PBX applications depend upon TTS, there was no reason to proceed if we couldn’t get the TTS piece working with Asterisk. There are hundreds of Asterisk implementations out there. Our niche is full-featured applications that rival the commercial phone systems. Without TTS, we weren’t much interested in YAAB (Yet Another Asterisk Build).

A quick email to our friend, Lefteris Zafiris, was all it took. Within minutes from the other side of the world, Lefteris had logged into our Ubuntu Server in the Cloud and tamed the TTS beast. If ever there was an unsung hero in the Asterisk community, it’s Lefteris Zafiris. He has single-handedly kept all of the speech applications humming along through countless versions of Asterisk. We would have quit long ago without his untiring assistance. Thank you (again), Lefteris, for coming to the rescue.

Building an Ubuntu 14 Platform for Incredible PBX

As a result of the trademark and copyright morass, we’ve steered away from the bundled operating system in favor of a methodology that relies upon you to put in place the operating system platform on which to run PBX in a Flash or Incredible PBX. The good news is it’s easy! With many cloud-based providers1, you can simply click a button to choose your favorite OS flavor and within minutes, you’re ready to go. With many virtual machine platforms such as VirtualBox, it’s equally simple to find a pre-built Ubuntu 14 image or roll your own. For today, we’ll walk you through building your own stand-alone server using the Ubuntu 14.04 mini.iso. To get started, download the 32-bit or 64-bit Ubuntu 14.04 “Trusty Tahr” Minimal ISO from here. Then burn it to a CD/DVD or thumb drive and boot your dedicated server from the image. Remember, you’ll be reformatting the drive in your server so pick a machine you don’t need for other purposes.

For those that would prefer to build your Ubuntu 14 Wonder Machine using VirtualBox on any Windows, Mac, or existing Linux Desktop, here are the simple steps. Create a new virtual machine specifying either the 32-bit or 64-bit version of Ubuntu. Allocate 1024MB of RAM (512MB also works fine!) and at least 20GB of disk space using the default hard drive setup in all three steps. In Settings, click System and check Enable I/O APIC and uncheck Hardware Clock in UTC Time. Click Audio and Specify then Enable your sound card. Click Network and Enable Network Adapter for Adapter 1 and choose Bridged Adapter. Finally, in Storage, add the Ubuntu 14 mini.iso to your VirtualBox Storage Tree as shown below. Then click OK and start up your new virtual machine. Simple!

Here are the steps to get Ubuntu 14 humming on your new server or virtual machine once you’ve booted up. If you can bake cookies from a recipe, you can do this:

UBUNTU mini.iso install:
Choose language
Choose timezone
Detect keyboard
Hostname: incrediblepbx < continue >
Choose mirror for downloads
Confirm archive mirror
Leave proxy blank unless you need it
< continue >
** couple minutes of whirring as initial components are loaded **
New user name: incredible
< continue >
Account username: incredible
< continue >
Account password: makeitsecure
< continue >
Encrypt home directory < no >
Confirm time zone < yes >
Partition disks: Guided - use entire disk and set up LVM
Confirm disk to partition
Write changes to disks and configure LVM
Whole volume? < continue>
Write changes to disks < yes> < -- last chance to preserve your disk drive!
** about 15 minutes of whirring during base system install ** < no touchy anything>
** another 5 minutes of whirring during base software install ** < no touchy anything>
Upgrades? Install security updates automatically
** another 5 minutes of whirring during more software installs ** < no touchy anything>
Software selection: *Basic Ubuntu server (only!)
** another couple minutes of whirring during software installs ** < no touchy anything>
Grub boot loader: < yes>
UTC for system clock: < no>
Installation complete: < continue> after removing installation media
** on VirtualBox, PowerOff after reboot and remove [-] mini.iso from Storage Tree & restart VM
login as user: incredible
** enter user incredible's password **
sudo passwd
** enter incredible password again and then create secure root user password **
su root
** enter root password **
apt-get update
apt-get upgrade -y
apt-get install ssh -y
sed -i 's|without-password|yes|' /etc/ssh/sshd_config
sed -i 's|yes"|without-password"|' /etc/ssh/sshd_config
ifconfig
** write down the IP address of your server from ifconfig results
reboot
** login via SSH to continue **

Installing Incredible PBX on Your Ubuntu 14 Server

Adding Incredible PBX to a running Ubuntu 14 server is a walk in the park. To restate the obvious, your server needs a reliable Internet connection to proceed. Using SSH (or Putty on a Windows machine), log into your new server as root at the IP address you deciphered in the ifconfig step at the end of the Ubuntu install procedure above. First, make sure to run the update and upgrade steps for Ubuntu before you begin the install. This is especially important if using a cloud-based Ubuntu 14 server.

apt-get update
apt-get upgrade -y
reboot

Now you’re ready to kick off the Incredible PBX install. Just issue the following commands:

cd /root
wget http://incrediblepbx.com/incrediblepbx11.4.ubuntu14
chmod +x incredible*
./incredible*

Once you have agreed to the license agreement and terms of use, press Enter and go have a long cup of coffee. The Incredible PBX installer runs unattended so find something to do for the next 30 minutes unless you just like watching code compile. When you see “Have a nice day”, your installation is complete. Log out and back into your server as root and you should be greeted by something like this:

You can access the Asterisk CLI by typing: asterisk -rvvvvvvvvvv

You can access the FreePBX GUI using your favorite web browser to configure your server. Just enter the IP address shown in the status display. The default username and password are admin:admin. Change them immediately in FreePBX Administration by clicking Admin -> Administrators -> admin. Enter a new password and click Submit Changes then Apply Config. Now edit extension 701 so you can figure out (or change) the randomized passwords that were set up for your 701 extension and voicemail account: Applications -> Extensions -> 701.

Setting Up a Soft Phone to Use with Incredible PBX

Now you’re ready to set up a telephone so that you can play with Incredible PBX. We recommend YateClient which is free. Download it from here. Run YateClient once you’ve installed it and enter the credentials for the 701 extension on Incredible PBX. You’ll need the IP address of your server plus your extension 701 password. Choose Settings -> Accounts and click the New button. Fill in the blanks using the IP address of your server, 701 for your account name, and whatever password you created for the extension. Click OK.

Once you are registered to extension 701, close the Account window. Then click on YATE’s Telephony Tab and place some test calls to the numerous apps that are preconfigured on Incredible PBX. Dial a few of these to get started:

123 - Reminders
947 - Weather by ZIP Code
951 - Yahoo News
*61 - Time of Day
*68 - Wakeup Call
TODAY - Today in History

Now you’re ready to connect to the telephones in the rest of the world. If you live in the U.S., the easiest way (at least for now) is to set up a free Google Voice account. Google has threatened to shut this down but as this is written, it still works. The more desirable long-term solution is to choose several SIP providers and set up redundant trunks for your incoming and outbound calls. The PIAF Forum includes dozens of recommendations to get you started.

Configuring Google Voice

If you want to use Google Voice, you’ll need a dedicated Google Voice account to support Incredible PBX. If you want to use the inbound fax capabilities of Incredible Fax 11, then you’ll need an additional Google Voice line that can be routed to the FAX custom destination using FreePBX. The more obscure the username (with some embedded numbers), the better off you will be. This will keep folks from bombarding you with unsolicited Gtalk chat messages, and who knows what nefarious scheme will be discovered using Google messaging six months from now. So keep this account a secret!

We’ve tested this extensively using an existing Gmail account, and inbound calling is just not reliable. The reason seems to be that Google always chooses Gmail chat as the inbound call destination if there are multiple registrations from the same IP address. So, be reasonable. Do it our way! Set up a dedicated Gmail and Google Voice account, and use it exclusively with Incredible PBX 11. It’s free at least through 2013. Google Voice no longer is by invitation only so, if you’re in the U.S. or have a friend that is, head over to the Google Voice site and register.

You must choose a telephone number (aka DID) for your new account, or Google Voice calling will not work… in either direction. Google used to permit outbound Gtalk calls using a fake CallerID, but that obviously led to abuse so it’s over! You also have to tie your Google Voice account to at least one working phone number as part of the initial setup process. Your cellphone number will work just fine. Don’t skip this step either. Just enter the provided 2-digit confirmation code when you tell Google to place the test call to the phone number you entered. Once the number is registered, you can disable it if you’d like in Settings, Voice Setting, Phones. But…

IMPORTANT: Be sure to enable the Google Chat option as one of your phone destinations in Settings, Voice Setting, Phones. That’s the destination we need for The Incredible PBX to work its magic! Otherwise, all inbound and outbound calls will fail. If you don’t see this option, you may need to call up Gmail and enable Google Chat there first. Then go back to the Google Voice Settings.

While you’re still in Google Voice Settings, click on the Calls tab. Make sure your settings match these:

  • Call ScreeningOFF
  • Call PresentationOFF
  • Caller ID (In)Display Caller’s Number
  • Caller ID (Out)Don’t Change Anything
  • Do Not DisturbOFF
  • Call Options (Enable Recording)OFF
  • Global Spam FilteringON

Click Save Changes once you adjust your settings. Under the Voicemail tab, plug in your email address so you get notified of new voicemails. Down the road, receipt of a Google Voice voicemail will be a big hint that something has come unglued on your PBX.

One final word of caution is in order regardless of your choice of providers: Do NOT use special characters in any provider passwords, or nothing will work!

Now you’re ready to set up your Google Voice trunk in FreePBX. After logging into FreePBX with your browser, click the Connectivity tab and choose Google Voice/Motif. To Add a new Google Voice account, just fill out the form. Do NOT check the third box or incoming calls will never ring!

IMPORTANT LAST STEP: Google Voice will not work unless you restart Asterisk from the Linux command line at this juncture. Using SSH, log into your server as root and issue the following command: amportal restart.

If you have trouble getting Google Voice to work (especially if you have previously used your Google Voice account from a different IP address), try this Google Voice Reset Procedure. It usually fixes connectivity problems.

Troubleshooting Audio and DTMF Problems

You can avoid one-way audio on calls and touchtones that don’t work with these simple settings in FreePBX: Settings -> Asterisk SIP Settings. Just plug in your public IP address and your private IP subnet. Then set ULAW as the only Audio Codec.

Adding Speech Recognition to Incredible PBX

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

1. Using an existing Google/Gmail account to join the Chrome-Dev Group.

2. Using the same account, create a new Speech Recognition Project.

3. Click on your newly created project and choose APIs & auth.

4. Turn ON Speech API by clicking on its Status button in the far right margin.

5. Click on Credentials in APIs & auth and choose Create New Key -> Server key. Leave the IP address restriction blank!

6. Write down your new API key or copy it to the clipboard.

7. Log into your server as root and issue the following commands:

# for Ubuntu and Debian platforms
apt-get clean
apt-get install libjson-perl flac -y
# for RedHat and CentOS platforms
yum -y install perl-JSON
# for all Linux platforms
cd /var/lib/asterisk/agi-bin
mv speech-recog.agi speech-recog.last.agi
wget --no-check-certificate https://raw.githubusercontent.com/zaf/asterisk-speech-recog/master/speech-recog.agi
chown asterisk:asterisk speech*
chmod 775 speech*
nano -w speech-recog.agi

8. When the nano editor opens, go to line 70 of speech-recog.agi: my $key = "". Insert your API key from Step #6 above between the quotation marks and save the file: Ctrl-X, Y, then Enter.

Now you’re ready to try out the speech recognition apps. Dial 949 and say the name of a city and state/province/country to get a current weather forecast from Yahoo. Dial 411 and say “American Airlines” to be connected to American.

To use Wolfram Alpha by phone, you first must install it. Obtain your free Wolfram Alpha APP-ID here. Then run the one-click installer: /root/wolfram/wolframalpha-oneclick.sh. Insert your APP-ID when prompted. Now dial 4747 to access Wolfram Alpha by phone and enter your query, e.g. “What planes are overhead.” Read the Nerd Vittles tutorial for additional examples and tips.

A Few Words about the Incredible PBX Security Model for Ubuntu

Incredible PBX for Ubuntu 14 is our most secure turnkey PBX implementation, ever. As configured, it is protected by both Fail2Ban and a hardened configuration of the IPtables Linux firewall. The latest release also includes Port Knocker for simple, secure access from any remote computer or smartphone. You can get up to speed on how the technology works by reading the Nerd Vittles tutorial. The NeoRouter VPN client also is included for rock-solid, secure connectivity to remote users. Read our previous tutorial for setup instructions. As configured, nobody can access your PBX without your credentials AND an IP address that is either on your private network or that matches the IP address of your server or the PC from which you installed Incredible PBX. You can whitelist additional IP addresses by running the command-line utility /root/add-ip. You can remove whitelisted IP addresses by running /root/del-acct. Incredible PBX is preconfigured to let you connect to many of the leading SIP hosting providers without additional firewall tweaking. We always recommend you also add an extra layer of protection by running your server behind a hardware-based firewall with no Internet port exposure, but that’s your call. And it’s your phone bill. :wink:

The IPtables firewall is a complex piece of software. If you need assistance with configuring it, visit the PIAF Forum for some friendly assistance.

Incredible PBX Automatic Update Utility

Every time you log into your server as root, Incredible PBX will ping the IncrediblePBX.com web site to determine whether one or more updates are available to bring your server up to current specs. We recommend you log in at least once a week just in case some new security vulnerability should come along.

In the meantime, we encourage you to sign up for an account on the PIAF Forum and join the discussion. In addition to providing first-class, free support, we think you’ll enjoy the camaraderie. Come join us!

Originally published: Monday, June 30, 2014


Support Issues. With any application as sophisticated as this one, you’re bound to have questions. Blog comments are a terrible place to handle support issues although we welcome general comments about our articles and software. If you have particular support issues, we encourage you to get actively involved in the PBX in a Flash Forums. It’s the best Asterisk tech support site in the business, and it’s all free! Please have a look and post your support questions there. Unlike some forums, ours is extremely friendly and is supported by literally hundreds of Asterisk gurus and thousands of users just like you. You won’t have to wait long for an answer to your question.



Need help with Asterisk? Visit the PBX in a Flash Forum.


 
New Vitelity Special. Vitelity has generously offered a new discount for PBX in a Flash users. You now can get an almost half-price DID from our special Vitelity sign-up link. If you’re seeking the best flexibility in choosing an area code and phone number plus the lowest entry level pricing plus high quality calls, then Vitelity is the hands-down winner. Vitelity provides Tier A DID inbound service in over 3,000 rate centers throughout the US and Canada. And, when you use our special link to sign up, the Nerd Vittles and PBX in a Flash projects get a few shekels down the road while you get an incredible signup deal as well. The going rate for Vitelity’s DID service is $7.95 a month which includes up to 4,000 incoming minutes on two simultaneous channels with terminations priced at 1.45¢ per minute. Not any more! For PBX in a Flash users, here’s a deal you can’t (and shouldn’t) refuse! Sign up now, and you can purchase a Tier A DID with unlimited incoming calls for just $3.99 a month. To check availability of local numbers and tiers of service from Vitelity, click here. Do not use this link to order your DIDs, or you won’t get the special pricing! Vitelity’s rate is just 1.44¢ per minute for outbound calls in the U.S. There is a $35 prepay when you sign up. This covers future usage and any balance is fully refundable if you decide to discontinue service with Vitelity.
 


Some Recent Nerd Vittles Articles of Interest…

Be Sociable, Share!

  1. With some providers including ones linked in this article, Nerd Vittles receives referral fees which assist in keeping the Nerd Vittles lights burning brightly. []

9 Responses to “Meet Ubuntu: An Exciting New Frontier for Asterisk and the VoIP Community”

  1. Eric says:

    See what happens when your (Me) too stupid to say no!
    If you want to completely automate the upgrades go to https://help.ubuntu.com/10.04/serverguide/automatic-updates.html this explains how to do it. It can be set to email when it has installed updates. Sorry I’m lazy and forgetful!

    Glad to see all my efforts go to good use!

  2. Skavoovie says:

    A quick fix to allow PHP5.5+ to accept both the PHP short tag and the long tag ( <? vs. <?php ):

    /etc/php.ini:

    short_open_tag = On

    Restart Apache and done.

  3. AlfaNerd says:

    I tried your installation instructions on a pre-built ubuntu 14 server in the cloud and it does not function. I’m guessing there are some prerequisites to the server instance including php and mysql being installed.

    I cannot run (or even find) the asterisk binary but any attempt to rerun the installation scripts results in a message “Incredible PBX is already installed.”

    Can I recover from this?

    [WM: You didn't mention which cloud provider you were using. Works flawlessly on Digital Ocean. We would need a good bit more information to troubleshoot what went wrong. That's what the PIAF Forum is there for. We install the LAMP stack as part of the Incredible PBX installation procedure so that's not the problem. You can attempt to rerun the installer and see where the install is failing. Just delete /etc/pbx/.incredible, and you're good to go. ]

  4. Bob says:

    So glad to see Ubuntu available for PBX in a Flash! Thanks Ward :)

  5. Steve says:

    I seem to be unable to find Google’s Speech Recognition in the api-list.
    Any ideas, whether it is still available for new users at all?

    [WM: It is still available, but the license has changed a bit. Read the Adding Speech Recognition tutorial in this article. It will walk you through setting it up. Did you skip the first step??

  6. Marcelo says:

    Came to the site to see if PIAF was being supported on CentOS7 and found out the great news that I can now have all Ubuntu VMs on my servers.

    Still don’t understand why setting up and maintaining a ppa repository would not be a better approach. Yes, you mentioned the preference to compiling Asterisk from source but is it really a smart tradeoff to lose all the great work a package manager can offer for free – fast security updates included?

    [WM: Nothing in our build precludes enabling automatic security updates with Ubuntu. And Incredible PBX handles automatic security updates for Asterisk and any other problems we spot.]

  7. Slambers says:

    ‘The Incredible PBX installer runs unattended so find something to do for the next 30 minutes unless you just like watching code compile. When you see “Have a nice day”, your installation is complete.’

    In between the above stages, I get a load of questions I don’t know the answer to:

    ‘Enter your USERNAME to connect to the ‘asterisk’ database:
    Enter your PASSWORD to connect to the ‘asterisk’ database:
    Enter the hostname of the ‘asterisk’ database:
    Enter a USERNAME to connect to the Asterisk Manager interface:
    Enter a PASSWORD to connect to the Asterisk Manager interface:’

    Is this normal behaviour, and if so, what am I supposed to be entering?

    [WM: Sounds like you're either using the wrong version of Ubuntu or you skipped the initial (required) update, upgrade, and reboot steps. Follow the tutorial exactly, and you shouldn't have any problems. Still works as advertised for us.]

  8. Josh says:

    The Google Voice section still mentions FAX capabilities, but I don’t see how I can use Incredible Fax on the Ubuntu installation with the method on this page. Is that just leftover from a copy/paste from other tutorials or am I missing something?

    [WM: Thanks for the heads up, Josh. We'll have a look. Running a little low on people with paddles at the moment, but we'll get it squared away... soon. Ubuntu is still very much a testing platform. If you need a production-ready system, switch to Incredible PBX with PIAF-Green and FreePBX 2.11 on the CentOS 6.5 platform.]

  9. Josh says:

    Thanks so much for the reply! It’s purely experimental for me currently, my production clients use a mix of “real” PIAF or custom asterisk boxes, quite frankly the only reason I am testing this version is that I prefer Apt to Yum :)
    I might see if I can play around with porting over incredfax over the next couple of weekends on my own for kicks.
    Thanks for all your work on this!

    [WM: Thanks, Josh. Wrestling with Incredible Fax would be a huge help. Come join the forum!]

Leave a Reply

Ringbinder theme by Themocracy