Home » 2012 » August

Monthly Archives: August 2012

The Most Versatile VoIP Provider: FREE PORTING

Introducing Incredible Pi: $35 for Asterisk, FreePBX & Google Voice Utopia

It’s Back-to-School Time in most of the United States, and the Nerd Vittles crew needed a good fall project to distract us from all of this year’s dreadful politicians. We feel like a kid in a candy store with our new $35 Raspberry Pi® Model B. Imagine squeezing a 700 mHz ARM processor with 256MB of RAM, 2 USB ports, a 10/100 Ethernet port,if an HDMI port, composite video, a separate audio jack, an SDHC card slot, and a micro USB port onto a motherboard the size of a credit card with a total weight of 1.6 ounces and a typical power draw of 3.5 watts. Thanks to Gernot and his Asterisk for Raspberry Pi project, a full LAMP stack with Asterisk® and FreePBX® gave us a head start on turning the Raspberry Pi into yet another Incredible PBX™ platform complete with Google Voice™ for free inbound and outbound calling throughout the United States and Canada.

Trust us when we say the performance of this $35 computer is nothing short of amazing. Can it do everything a $200 dual-core Atom PC can do? No. Can it do 90% of everything for someone whose requirements do not exceed a few simultaneous calls at a time but still wants a full-blown PBX for call routing, voicemail, IVRs, music on hold, and text-to-speech and speech-to-text apps for a home, a SOHO office, a Little League team, or a dorm room? Absolutely.

Call our Raspberry Pi at 1-843-284-6844 and check out the Incredible Pi Smörgåsbord for yourself.

Other Incredible Pi Resources: Quick Start Guide for Incredible Pi 3.1 and 35 Free Incredible Pi Apps Tutorial

Incredible PBX for Raspberry Pi: What’s Included

If you’ve never heard of The Incredible PBX, here’s the Top 20 for the Raspberry Pi platform. In addition to the base install with Debian 6, Asterisk 1.8, FreePBX 2.10, Apache, SendMail, MySQL, PHP, and phpMyAdmin, Incredible Pi offers the following built-in PBX components using a wired or wireless network connection:

Ordering Information: What It Takes to Get Started

A complete Incredible PBX build for the Raspberry Pi (Incredible Pi™) is finally finished, and we wanted to give you a head start on ordering the pieces you’ll need to get things going since there is a three to five week delay on some of the components due to huge demand. Nothing is ever just $35, of course. So here’s what you’ll need. The Raspberry Pi itself can be ordered from Newark or MCM. Delivery times and stock vary so check both sites. At the time we ordered, they were quoting 5 weeks. We actually got one from Newark in one week, and as of now MCM has some in stock for immediate shipping. You also need a power adapter. If you have a micro USB power brick for your cellphone, chances are it will work. As long as it’s at least 1 amp and 5 volts, you’re good to go. The recommended 700 mA adapters have reportedly caused issues for some folks so splurge and order a good one. They’re $10 from Amazon while supporting Nerd Vittles.1 If you plan to add the WiFi adapter covered below, you will need at least 1.2 amps to avoid lockups. Next, you’ll need an SDHC card which serves as your hard disk. Be very careful here. The Type 10 cards which arguably would provide the best performance turn out to be a nightmare. Many of them simply don’t work. For a basic system, we’d recommend you start with either the SanDisk 4GB or 16GB SDHC Type 4 card. The 4GB card is available almost everywhere for under $10, or you can order two from Amazon with free Prime shipping for about the same money. If you already have a USB keyboard and a monitor or TV with an available HDMI port or composite video and audio ports, then you’ve got everything you need to get started. Actually, you can do without the monitor and use SSH if you’re either using Incredible Pi 1.3 or if you can decipher the DHCP address of Incredible Pi by reviewing your firewall log. With version 1.3 and beyond, you can plug in a pair of earbuds, and the server will whisper your IP address in your ear after the boot process completes. By the way, you may also want to put your name in the queue for a Pibow case, completely unnecessary but very cute with a long waiting list. It costs almost as much as the computer.

For down the road, suffice it to say, you’re probably not going to want to run Asterisk, FreePBX, and Google Voice on a disk platform of 4 gigabytes although our demo system does exactly that. Between Debian 6.0, Asterisk 1.8, FreePBX 2.10 plus numerous Incredible PBX utilities, well over half of the available 4GB will be consumed by software. For distribution purposes, we’re providing an image that you can write directly to the SDHC card. Unfortunately, the image size determines the amount of space it will actually use on an SDHC card. We will cover below how you can install the 4GB image onto a 16GB card and then expand the size of the main partition to fill the remaining space on the card. But it wouldn’t make sense to distribute a 16GB image because of bandwidth issues. So we’d recommend you purchase a 16GB SanDisk Type 4 SDHC card for production use. Take our advice. Don’t get creative in choosing your SDHC card. Use the one that we’ve already tested and that we know works. If you want to skip the 4GB card completely, that’s perfectly fine, too. The 16GB Type 4 SanDisk card is under $10 from Amazon with free Prime 2-day shipping, or you can pay double and pick one up at your neighborhood Radio Shack store. We’ll also show you how to back up your SDHC card (any size) with your own settings and restore it onto a 16GB card without missing a beat. Unfortunately, once you migrate and expand the main partition on the 16GB card, you’re stuck with that topology. There’s no going back without starting over, and your backups will consume 16GB of storage rather than 4GB. But it sure is convenient… and easy. By the way, here’s a more reasonably priced case and here’s an awesome clear case if you just want something that’s functional.

Finally, you’re going to need an existing Linux server or Mac on which to create your bootable SDHC cards for use with Raspberry Pi. You’ll also need this server to make backups of your existing setup. DD is a wonderful low-level disk copying utility found in Linux, and we’re going to be using it a lot. PBX in a Flash with or without Incredible PBX makes an ideal platform because all of the necessary SDHC disk management utilities already are installed. If you’re not using our recommended Foxconn server, then you’ll need a server with an SDHC card slot, or you can purchase an inexpensive USB-to-SDHC adapter from Amazon for under $2. Without the case, you can build an awesome Asterisk platform for home or SOHO use for under $50, and it can handle 3 simultaneous SIP calls without noticeable degradation.

Here’s a shot of our favorite Incredible Pi setup. You’ll need the LAN cable for the initial boot so that you can SSH into the device to plug in your WiFi SSID name and password. You’ll need the earbuds for the first and second boot to decipher the IP address of the device on your LAN, wired and wireless. No monitor connection is ever required. Just log in with SSH from your Mac or PC. After the first two boots, you can dispense with the CAT5 cable and the earbuds. All of the components are covered in this article.


Creating a Bootable Incredible Pi SDHC Card

SanDisk SDHC Type 4 cards come pre-formatted so all you need to do is insert the card into the SDHC slot of your Asterisk server and reboot it. If you prefer to use a Mac, go here for the tutorial. Before you insert your SDHC card and reboot, log in as root and run the following command: fdisk -l. This will tell you what the existing disk topology of your server is. Write it down. What you don’t want to do is accidentally choose your main Linux drive as the device to copy the Incredible Pi image to, or you end up with a mess. Now insert your SDHC card and reboot your Asterisk server so your SDHC card will be visible. Then run fdisk -l again to decipher the device node of your card. It should be at the bottom of the list and will be something like /dev/sdb. We don’t use /dev/sdb1 in the dd transfer step below, just the base devnode: /dev/sdb or whatever letter your SDHC drive happens to be.

Next, using a web browser, download the latest Incredible Pi image and transfer it to the /root directory of the Linux computer you’ll be using to copy the image to your SDHC card. As we said, we recommend a PBX in a Flash server because it has all of the SDHC utilities already included. Incredible Pi is a free download from SourceForge. The feature sets are described in the SourceForge readme.txt file. Once you’ve copied the desired tarball to your Linux server, decompress it: tar zxvf incrediblepi-1.x.tgz where x is the version you downloaded. Verify the integrity of the image file using md5sum:


1.7: md5sum debian6-incrediblepi-10-09-2012.img => e601ecd890a400de2e03009c034353c2
2.1: md5sum debian7-incrediblepi-16-09-2012.img => 007efb9d2cdf86f054c5cf26c4f5de9a

Finally, run the Linux install script: ./make-sdhc. It takes about 30-60 minutes to copy the image to your SDHC card. If you have a Mac, copy make-sdhc-mac to your Downloads folder and use it.

While you’re waiting, you can read about all the latest changes and additions to Incredible Pi here.

If you’re using our recommended 16GB SanDisk Type 4 SDHC card, then what you have at this juncture is a 16GB card on which only 4GB is being used. Here’s how to expand the main partition to use the other 12GB of space on the card while logged in as root. First, we need to make sure your card’s geometry matches our card setup. From the command prompt, issue the following commands using the proper device node (/dev/sdb) of your card:

parted /dev/sdb
(parted) unit chs
(parted) print

Here’s what you should see:

If the geometry of your card doesn’t match what’s shown above, do NOT use our commands below to adjust your card. Instead, review the original tutorial explaining what needs to be done.

If your geometry matches our geometry above, issue the following commands while still in parted:

move 3 239943,0,0
[press enter to accept default End]
rm 2
mkpart primary 1232,0,0 239942,3,31
print

After entering the above commands, your new card geometry should look like this:

Now type quit. Then complete the resizing by issuing the following commands using your correct device node:

e2fsck -f /dev/sdb2
resize2fs /dev/sdb2
sync

Remove the card from your Linux machine and insert it into the SDHC card slot on the Raspberry Pi.

We’ve also found one 32GB Type 10 card that’s reliable, the Kingston Ultimate X (SD10G2/32gb) which costs about $40 at Amazon. We’ve included the resizing steps below:

fdisk -l
parted /dev/sdb
unit chs
print
move 3 483887,0,0
[press enter to accept End address]
rm 2
mkpart primary 1232,0,0 483886,3,31
print
quit
e2fsck -f /dev/sdb2
resize2fs /dev/sdb2
sync


Preparing the Raspberry Pi for Blastoff

Once the card is in place, there are a few more preliminary steps before you apply power to the device. Plug in a CAT5 LAN cable that is connected to your firewall-protected private network. Make certain that your router is handing out DHCP addresses properly since the Raspberry Pi can’t boot without a network connection to obtain the correct time from an NTP server on the Internet. It has no onboard time clock! Plug in a USB keyboard to one of the two USB ports on the Raspberry Pi. Connect either an HDMI or composite video cable between the Raspberry Pi and a monitor or TV. Finally, plug in a reliable power adapter and insert its micro USB connector into the slot on the Raspberry Pi. You should immediately see a raspberry on your screen with a scrolling list of commands that are executing while the Raspberry Pi is booting. Watch carefully. If you see a bunch of "waiting for hardware interrupt" notices, then you didn’t heed our advice on the type of SDHC card to use. Your card is not compatible for use on the Raspberry Pi so reformat it and use it with your camera. Then go buy the SanDisk card we recommended. The entire boot process should take about 30 seconds. With an incompatible card, that can stretch out to more than an hour. When the boot process completes, the IP address of your Incredible Pi should be displayed with a Linux login prompt. Write down your IP address. You’ll need it in a minute.

Securing Incredible Pi

Congratulations! You’re now ready to begin the Incredible Pi adventure. But, before we get started, first things first. Let’s secure your server. Log in with the username: pi. The password is raspberry. Now change the password to something really secure by issuing the command: passwd. Now do the same thing for the root password of the device: sudo passwd root.

Next, we need to set the default timezone on your machine for both Linux and PHP5. First, switch to the root user account so we don’t have to type sudo before each command: su root. Enter your new root password when prompted. Then run this command to set the default timezone with Debian: dpkg-reconfigure tzdata. For PHP5, you have to manually enter the timezone in the php.ini file: nano -w /etc/php5/apache2/php.ini. Press Ctrl-W to search for timezone. Be sure the line is uncommented and plug in your correct timezone. If you don’t know the magic words to use for your timezone, here’s the list. Save the file: Ctrl-X, Y, and press Enter. Now restart Apache: service apache2 restart.

First, we need to remove the default DUNDI secrets from Asterisk so fresh ones can be automatically generated when you restart Asterisk.

asterisk -rx "database del dundi secret"
asterisk -rx "database del dundi secretexpiry"
amportal restart

Now we need to do the same thing for your SSH keys:

rm /etc/ssh/ssh_host_* && dpkg-reconfigure openssh-server

Now let’s be sure Asterisk is up and running. Then you can continue your adventure using a web browser and the FreePBX GUI. Before we switch, start up the Asterisk CLI: asterisk -rvvvvvvvvvv. Verify that Flite is functioning for TTS: core show application like flite. And make sure the MySQL components are in place to support CDR reporting: module show like mysql. Finally, let’s verify that Jabber is alive and well even though we haven’t set up any Google Voice accounts yet: jabber show connections.

Finally, a few words of warning about security. Incredible Pi is designed to run behind a hardware-based firewall with no Internet exposure to the server itself. Don’t cheat! Prior to the 1.2 release, there are no security mechanisms in place: no IPtables firewall and no Fail2Ban. Beginning with Incredible Pi 1.2, the Linux firewall (iptables) is included, but our recommendation still stands unless you are using the preinstalled Travelin’ Man 3 to enable access of a remote phone connection to your PBX.

All builds do include Suhosin which has been properly configured to facilitate use of phpMyAdmin with MySQL. Within FreePBX, you can secure extensions with strong passwords and IP address filtering, and you need to do that. Exposing Incredible Pi‘s web server to Internet access would be an open invitation to an expensive phone bill. Don’t do it! You’ve been warned.

Securing Incredible Pi with Travelin’ Man 3

Travelin’ Man 3 is a collection of programs that implement firewall whitelists (safe IP addresses) using the Linux firewall, iptables. Before you ever expose your server to any kind of Internet access, read the Nerd Vittles Travelin’ Man 3 article. As delivered with Incredible Pi 1.2 and later, iptables is configured to block all access to your server except from non-routable IP addresses (typically used on LANs sitting behind hardware-based firewalls). The one exception is SIP and IAX access from VoIP Trusted Providers. This allows you to add trunks to your server from these providers without touching your firewall settings.

There are instances in which you may actually need to connect your server from a public Internet site. For example, if you travel for a living and want to use a softphone connected back to your server from a distant hotel room or customer site, you would need access through both your hardware-based firewall and iptables. If one of your children is away at school and needs a free telephone connection, this might also warrant a change in your firewalls. Because of the low cost of a Raspberry Pi, we still believe AND RECOMMEND that you use separate servers to meet remote requirements.

If you still believe remote access is necessary after reading the Travelin’ Man 3 article, then the tools are available by logging into your Incredible Pi server as root and changing to the /root directory. Here are the four apps:

For whiz kids only, Debian manages iptables quite differently than what you may be accustomed to on the CentOS platform. Debian stores iptables rules in /etc/network/iptables. You can reload the iptables rules like this: iptables-restore /etc/network/iptables. And you can display the rules currently in effect like this: iptables-save. Be careful!


Configuring Incredible Pi with FreePBX

Now we’re ready to configure Incredible Pi so that you can start making and receiving calls. We’ll be using the FreePBX web GUI. To begin, using a browser on your desktop, access Incredible Pi by pointing to the IP address of your server (that you wrote down above). Choose FreePBX Administration at the main menu. When prompted for your username and password, enter admin for both.

If you’re new to Asterisk, here’s the one paragraph primer on what needs to happen before you can make free calls with Google Voice. You’ll obviously need a free Google Voice account. This gets you a phone number for people to call you and a vehicle to place calls to plain old telephones throughout the U.S. and Canada at no cost. You’ll also need a softphone or SIP phone to actually place and receive calls. YATE makes a free softphone for PCs, Macs, and Linux machines so download your favorite and install it on your desktop. Phones connect to extensions in FreePBX to work with Incredible Pi. Extensions talk to trunks (like Google Voice) to make and receive calls. FreePBX uses outbound routes to direct outgoing calls from extensions to trunks, and FreePBX uses inbound routes to route incoming calls from trunks to extensions to make your phones ring. In a nutshell, that’s how a PBX works. There are lots of bells and whistles that we will cover later.

Before you do anything else, change your admin password to access FreePBX. From the main FreePBX GUI, choose Admin => Administrators. Next, set your default email address at the bottom of Settings -> General Settings.

So here’s our 7-Step Checklist to set things up. After you complete these steps, you can start making free calls throughout the U.S. and Canada. And people can call you using your new Google Voice number.

1. Create a free Google Voice account
2. Set up Extension to connect to softphone
3. Create a Google Voice Trunk using GV credentials
4. Create an Inbound Route from Google Voice to Extension
5. Create an Outbound Route from Extension to Google Voice
6. Download and Configure YATE softphone
7. Make Your First Call

Creating a Free Google Voice Account

You’ll need a dedicated Google Voice account to support Incredible Pi. 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 Pi. 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. Don’t use funky characters in your Google password! If you’re living on another continent, see MisterQ’s posting for some setup tips.

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 Incredible Pi 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 with Incredible Pi.

Configuring an Extension to Use with a SIP Phone

As mentioned, an Extension is the component in FreePBX that actually interfaces with a telephone. Whether to use a hardware-based phone or a softphone is your choice. Without an adapter, POTS phones won’t work with Incredible Pi. You’ll need a SIP phone. We’ll set up a softphone today to get you started, but first we need to configure an extension in FreePBX. We’ve actually made one for you to use, extension 701. So, rather than create a new one, let’s just modify the one that’s already in place. You can add additional extensions later to support additional phones.

From the main FreePBX GUI, choose Applications -> Extensions. Then click on 701 in the Extension List on the right side of your display. You’ll see a form that looks like this:

For now, we only need to make a few changes. First, you need a very secure password for both the extension itself and your voicemail account for this extension. The extension secret needs to be a combination of letters and numbers. The Voicemail Password needs to be all numbers, preferably six or more. Replace the existing 1234secret and 1234 with your own (very secure) entries. You also need to lock down this extension so that it is only accessible from devices on your private LAN. You do that with the deny and permit entries which currently are filled with zeroes. Leave the deny entry the way it is which tells Incredible Pi to block everybody except those allowed in the permit entry below. For the permit, we need the first three octets of your private LAN address, e.g. if your LAN is 192.168.0.something then the permit entry will be 192.168.0.0/255.255.255.0.

Finally, you need to plug in your actual email address in the Voicemail section so that voicemails can be delivered to you when someone leaves a message. You can also include a pager email address if you want a text message alert with incoming voicemails. If you want the voicemails to automatically be deleted from the server after they are emailed to you (a good idea considering the disk storage limitations of an SDHC card), change the Delete Voicemail option from No to Yes. That’s it. Now save your settings by clicking the Submit button. Then reload the dialplan by clicking on the red prompt when it appears.

In case you’re curious, unless you’ve chosen to automatically delete voicemails after emailing them, you can retrieve your voicemails by dialing *98701 from any extension on your phone system. You’ll be prompted to enter the voicemail password you set up. In addition to managing your voicemails, you’ll also be given the opportunity to either return the call to the number of the person that called or to transfer the voicemail to another extension’s voicemail box. And you can always leave a voicemail for someone by dialing their extension number preceded by an asterisk, e.g. *701 would let someone leave you a voicemail without actually calling you.

Activating a Google Voice Trunk in FreePBX

To create a Trunk in FreePBX to handle calls to and from Google Voice, you’ll need three pieces of information for the Google Voice account you set up above: the 10-digit Google Voice phone number, your Google Voice account name, and your Google Voice password. Once you have these in hand, choose Other -> Google Voice from the FreePBX GUI. The following blank form will appear:

Fill in the blanks with your information and check all 3 boxes. If your Google Voice account name ends in @gmail.com, you can leave that out. Otherwise, include the full email address. Then click Submit Changes and reload your dialplan when prompted.

There’s one more step or your Google Voice account won’t work reliably with Incredible Pi! From the Linux command prompt while logged into your server as root, restart Asterisk: amportal restart

Creating an Inbound Route for Your Google Voice Trunk

Now that you’ve created your Google Voice Trunk, we need to tell FreePBX how to process the call when someone dials your Google Voice number. There are any number of choices. You could simply ring an extension. Or you could ring multiple extensions by first creating a Ring Group which is just a list of extension numbers. Or you could direct incoming calls to an Interactive Voice Response (IVR) system (we’ve actually set one up for you to play with). For the time being and since you only have one extension at the moment, let’s just route incoming Google Voice calls to extension 701.

To do this, you create an Inbound Route based upon the DID (phone number) of the Google Voice trunk. In FreePBX, choose Connectivity -> Inbound Routes. Fill in the form so that it looks like the example below using your own 10-digit Google Voice description and number instead of Atlanta GV and 6781234567. Be sure to set the Destination.

Then click Submit. But, before you reload the dialplan, make one change to the form. Click on the CID Lookup Source pull-down menu and choose CallerID Superfecta. This tells FreePBX to actually add names to phone numbers when someone calls. Now click Submit again and reload the dialplan when prompted.

Creating an Outbound Route for Google Voice Calls

FreePBX is actually smart enough to create an outbound route for your new Google Voice trunk so that you can place calls from any extension by dialing either a 10-digit number or 1 plus a 10-digit number to call anyone in the U.S. or Canada. If that’s all you care about, you can skip to the next section. But there’s more.

You can have more than one Google Voice trunk with Incredible Pi, and each one could be in a different area code. For example, you may do business in many different places and would like a local number for folks to call. Or Grandma may live in a distant city, and you’d like her to be able to call you without paying long distance charges. Then there are the kids. If you have three, you might want to give each of them their own Google Voice number which would ring just their phone. And, for outbound calls, you’d like each of them to use their own Google Voice trunk. All of these options are possible with Incredible Pi.

For outbound calls with multiple Google Voice trunks, you need a way to tell the system which trunk to use. We recommend dial prefixes that identify the city of the trunk, e.g. ATL, NYC, MIA. Or, for the kids, a dial prefix made up of initials, e.g. KHM, RWM, JSM. These dial prefixes get stripped off before the call is actually placed so the prefix is only used to determine the trunk used for placing the call.

To implement dial prefixes, you’ll need to adjust the default entries for your Google Voice Outbound Routes by adding the prefix option as an additional Dial Pattern. Here’s an example using an Atlanta Google Voice trunk where we want to allow a prefix of ATL-XXX-XXX-XXXX to force a call to go out on the Atlanta Google Voice trunk:

Another option may be appealing if you happen to make a lot of international calls and don’t want to pay for them. First, you can read all about iNum calling in this Nerd Vittles article. Another hidden feature in Google Voice is the ability to place iNum calls worldwide at no cost. To implement this, you’ll need to add another Dial Pattern to your Google Voice trunk. Prepend: 8835100 with Match Pattern: XXXXXXXX. Now you can dial iNum DIDs by dialing just the last 8 digits using any phone on your server. For example, try out the Nerd Vittles’ Dictionary Demo by calling 09901997. There also are a huge number of iNum Access Numbers that will let you call back to your server or any other iNum DID from almost anywhere in the world at no cost. These are covered in the Nerd Vittles article as well.

Configuring a YATE Softphone

As we mentioned, the easiest way to get started with Incredible Pi is to set up a YATE softphone on your Desktop computer. Versions are available at no cost for Macs, PCs, and Linux machines. Just download the appropriate one and install it from this link. Once installed, it’s a simple matter to plug in your extension 701 credentials and start making calls. Run the application and choose Settings -> Accounts and click the New button. Fill in the blanks using the IP address of Incredible Pi, 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 your first call. It’s that easy!

Configuring Email Messaging

Incredible Pi comes preconfigured with SendMail to provide reliable delivery of outbound email messages. You can test it by logging in and issuing the following command using your own email address instead of yourname@gmail.com:

echo "test" | mail -s testmessage yourname@gmail.com

If you don’t receive the message, chances are that your Internet Service Provider blocks downstream mail servers from sending email to reduce spam. To fix it, the simplest way is to configure SendMail to use your ISP as the smart relay host for outbound mail, e.g. with Comcast, it’s smtp.comcast.net. It takes about 10 seconds to configure. After logging in as root, edit /etc/mail/sendmail.cf. Change line 116 from DS to DSsmtp.comcast.net using the SMTP gateway domain of your ISP. Save your change and restart SendMail: service sendmail restart. Then send another test message to make sure it works. If that fails, you can use Gmail as the mail relay. Here’s how. Now voicemail messages delivered directly to any email account by inserting your email address in the Voicemail section of the extension accepting your voicemail messages.

Configuring SMS Messaging

Incredible Pi also allows you to dictate messages and deliver them to any phone which accepts SMS messages. Just dial S-M-S (767) from any extension on your server. In addition, you can use Incredible Pi’s Message Blaster to send SMS messages to a group of individuals, e.g. a Little League team. In order to use SMS messaging, you must have at least one Google Voice account configured on your server. Then it’s a simple matter of inserting your Google Voice account name and password in two files. First, edit extensions_custom.conf in /etc/asterisk. On the second line of the 767 extension, replace acctname with your Google Voice account name (without @gmail.com). On the third line, replace acctpass with your Google Voice password for this account. Reload your dialplan to activate the new settings:

asterisk -rx "dialplan reload"

For the message blasting service, change to the /root directory. Insert the numbers to be dialed in the smslist.txt file following the example in the file. Enter the SMS message to be sent in smsmsg.txt keeping in mind that many phone providers limit SMS messages to 140 characters or less. Finally, insert your Google Voice account name (with @gmail.com) and password in smsblast. To kick off an SMS message blast, just issue the command: ./smsblast.

Configuring SAMBA for Windows Networking Support

Beginning with Incredible Pi 1.4, SAMBA is included in the distribution for transparent access using the Windows Networking Protocol from PCs, Macs, and other Linux machines. As delivered, SAMBA is deactivated. For obvious reasons, we recommend you never activate root login access to SAMBA. If you wish to enable SAMBA on your server, here are the steps while logged in as root:

  • 1. Set SAMBA password for user pi: smbpasswd -a pi
  • 2. Change Windows workgroup from WORKGROUP, if needed: nano -w /etc/samba/smb.conf
  • 3. Manually start SAMBA from command prompt: service samba start
  • 4. Set SAMBA to start on boot: rcconf and activate SAMBA option with space bar
  • 5. reboot

A Word of Warning: We’ve apparently reached the end of Memory Lane with SAMBA. Only activate it permanently (#4) after thoroughly testing it (#3) in your environment. We have found TTS IVRs in particular to be less than stable with SAMBA running.

Troubleshooting Audio Problems with Phone Calls

For most good routers/firewalls, there should be no problems connecting calls with Google Voice or SIP calls inbound or outbound. If you place a call and the audio is missing in one or both directions or your end of the call continues to ring even after the other person has answered, these are telltale signs of NAT and RTP connection issues. The quick fix is to plug in your public IP address and private LAN information under Settings -> Asterisk SIP Settings -> NAT Settings in FreePBX. If you continue to have connectivity issues, post the symptoms of your problem on the PIAF Forum and one of our helpful gurus will offer additional suggestions. Be sure to include the make and model of your router/firewall.

Using AsteriDex

Incredible Pi includes a robust phonebook application that uses MySQL for storage. You can access it with a browser by pointing to the following link using the IP address of your own server: http://192.168.0.185/asteridex4. Some entries for your favorite airlines are included to get you started. You can add, change, and delete entries under the Admin panel.

By dialing 411 from any phone on your system, you can speak the name of any entry in your AsteriDex database, and Incredible Pi will look up the name and dial the number. Try American Airlines just for fun.

Managing CallerID Superfecta

What began with our first release of CallerID Trifecta many years ago now has grown into one of the best examples of collaborative computing in the open source community. Maintained by the PBX Open Source Software Alliance, CallerID Superfecta now performs a number of functions in addition to matching names against phone numbers. Today you can display incoming call alerts and pop-ups on all sorts of devices in your home or office including XBMC, SqueezeBox, Winunciator, and many more. You can tailor CallerID Superfecta to meet your own local needs by opening the Default Superfecta tab under Other -> CallerID Superfecta in FreePBX. As with all database lookups, they take time. So keep in mind that you are trying to find the best match for inbound calls that takes the least time to retrieve corresponding CNAM information for the caller. To facilitate your search for the perfect combination, CallerID Superfecta includes a testing facility which will report the time required for each lookup. Then you can sort your lookup sources accordingly. To follow the latest developments, visit this thread on the PIAF Forums.

Adding Wireless Network Support

Particularly with a device the size of the Raspberry Pi, you may find it more convenient to place the unit on a bookshelf where a wired network connection is not feasible. This setup already is included in Incredible Pi 1.1 and later. For those using the 1.0 release, here’s how to use your Raspberry Pi wirelessly. First, order a TP-Link TL-WN722N USB 802.11n WiFi Adapter from Amazon for under $20. You won’t need a USB extender cable. This device can easily be plugged into one of the two USB slots without jeopardizing your ability to also connect a USB keyboard. Be sure your 5V power adapter is rated at 1.2 amps or greater to avoid lockups!2

We recommend the 1.3 Incredible Pi release or later if you plan to go the wireless route. All of the wireless networking components already are in place. Log into Incredible Pi as root (or su root for purists) and edit /etc/wpa.conf. Insert the SSID name and password for your wireless access point. Then reboot your server and wireless networking "just works."

Beginning with the 1.3 release, support has been added for the ultra-tiny AirLink 101 Wireless N adapter (AWLL5088). The setup process is identical to the 1.1 setup above. Just edit /etc/wpa.conf and insert the SSID name and password for your wireless access point. We strongly recommend disabling network connections that you aren’t using, e.g. eth0 and wlan0 if you go the AirLink 101 route. Just edit /etc/network/interfaces and comment out the eth0 line as well as the block of commands pertaining to wlan0. Then reboot, a process that now will be much quicker. If you plug in earbuds when you reboot, Incredible Pi 1.3 or later will read you the DHCP-assigned IP address when the boot process finishes so you no longer need a monitor. SSH can be used to connect to your server from any desktop PC or Mac.

Adding a PPTP VPN Client to Incredible Pi

If you’ve followed the Nerd Vittles tutorial and previously set up a PPTP VPN Server for your devices, then it’s pretty simple to add Incredible Pi to the mix by activating a PPTP VPN client. It’s only a few steps. You’ll need the FQDN or public IP address of your VPN server as well as a username and password for VPN access to your VPN server. Once you have those in hand, log into Incredible Pi as root.

Lest we forget to mention, you cannot log into your PPTP server from an IP address on the same private LAN so you’ll need to take your Incredible Pi device to a neighbor’s house to test this.

If you’re using Incredible Pi 1.5 or later, all of the PPTP VPN client software already is in place. Edit the connection template: nano -w /etc/ppp/peers/my-pptp-server. Insert the following text and replace myfqdn.org with the FQDN of your PPTP server, replace myname with your PPTP username, and replace mypassword with your PPTP password. Then save the file: Ctrl-X, Y, then Enter.

Now activate the PPTP VPN client. On your Incredible Pi server, run rcconf. If you’re using a release prior to 1.4, you’ll need to install rcconf first with the command: apt-get install rcconf. Scroll to the bottom of the list until you’ve highlighted pptp. Press the space bar to select it for automatic startup when you boot your server. Then tab to OK and press Enter.

To test it, issue the following command: /etc/init.d/pptp start. When you run ifconfig, you should now see a ppp0 entry:

ppp0 Link encap:Point-to-Point Protocol
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Remember, it won’t show an IP address if the Raspberry Pi and your PPTP VPN Server are on the same subnet (like ours). Once you install your Raspberry Pi in a remote location, you now can access it at the first IP address in your reserved PPTP IP address pool.

Power Adapters: The Hidden Gotcha

We’ve learned a lot about power adapters since acquiring the Raspberry Pi. First, not all adapters are created equal. Second, the type adapter you require depends upon what you’ve plugged into those USB ports. If one of the residents is a WiFi adapter, then the power draw of the WiFi adapter can add an additional wrinkle.

Here’s what we’ve found. If you decide to use the TP-Link TL-WN722N adapter, you’ll need a power adapter rated for at least 5V, 1.2 amps. These are few and far between and many adapters rated at even higher amperages (and not U/L approved) still won’t keep your RasPi from crashing regularly. We have had good results with $9.99 RND Power Solutions 2.1A Dual USB AC Adapter so long as you use the USB port closest to the red light and leave the second USB unoccupied.

If you use the AirLink 101 WiFi adapter or no WiFi adapter, then a less expensive 5V, 1A adapter may suffice. They’re typically about half the price, but some users have reported issues. For testing results and details, see this thread.

We’ve tested these adapters, and they both work. We can also count on both hands the number of adapters we tested that fail to keep the Raspberry Pi functioning. If you have a 1.2+ amp adapter from a reputable tablet computer, that will probably work as well. These replacement adapters tend to cost $25 or more. So the choice is yours. If your Raspberry Pi experiences frequent lockups, then an underperforming power adapter is the likely culprit, not the Raspberry Pi itself.

VoIP Redundancy: Use It to Your Advantage

As much as we love Google Voice, things do go wrong from time to time. The real beauty of VoIP telephony is there’s absolutely no reason to put all of your eggs in one basket. Multiple providers don’t cost you much particularly if you don’t use them regularly. And, when things go wrong, you won’t have to scramble to continue making phone calls. Vitelity has been a generous, long-term supporter of Nerd Vittles and our projects. You’ll find a compelling offer below, and we encourage you to consider them. Here’s the Incredible PBX Top 20 Trunk List with some reasons why these providers made our short list:

  • AxVoice ($14.99/mo. Business Plan; $16.58/mo. Unlimited Calls to 45 Countries)
  • CallCentric (Good International Calling Rates; Free iNum DID)
  • DIDforSale (20 channels per DID; unlimited DID calls for $8.99/mo.)
  • ENUM
  • FlowRoute (Good International Calling Rates)
  • FreeNum
  • Future-Nine (Supports CallerID Spoofing)
  • Google Voice (Free DIDs and free U.S./Canada calling)
  • IPkall (Free SIP/IAX DIDs)
  • Les.net (Supports CallerID Spoofing; very low rates)
  • LocalPhone (Dirt-cheap DIDs and calling rates worldwide; Free iNum DID)
  • Simon Telephonics (Free SIP-to-GoogleVoice Gateway)
  • SIPgate (Free residential DIDs sometimes)
  • Skype (Free Skype-to-Skype calls worldwide)
  • Teliax (Unlimited inbound DID $5/mo.)
  • Vitelity (Our supporter and the Best in the Business!)
  • VoIPms (CallerID spoofing; Free iNum calling; Very low rates)
  • VoIPMyWay (Residential Unlimited: $15.50/mo. Business Unlimited: $40/mo.)
  • VoIPStreet (Free DID)

Making Backups of Incredible Pi

Last, but not least, you’ll need to make periodic backups of your Incredible Pi system unless you don’t mind starting over when disaster strikes. It’s easy using almost any Linux server, and it’s especially easy with a PBX in a Flash server.

To begin, shutdown your Incredible Pi server gracefully: sudo shutdown -h now. Once the display shows that the system has halted, unplug it and remove the SDHC card. Then insert the SDHC card into the slot or reader on your PIAF system and reboot the server. Log into your server as root and issue the fdisk -l command to decipher the devname of your SDHC disk, e.g. /dev/sdb. To make a backup of your SDHC card, issue the following commands using today’s date and the proper devname for your SDHC drive:

dd if=/dev/sdb of=/root/incrediblepi-08-20-2012.img
sync
gzip /root/incrediblepi-08-20-2012.img

When the process is finished, you’ll have a compressed image roughly one-third the size of your SDHC card.

Firmware and Kernel Updates

Only after making a backup, you may find it helpful to upgrade your Raspberry Pi firmware and kernel from time to time. Releases of Incredible Pi below 1.4 do not have the firmware updating tool in place. So you’ll first have to install it. Log into your server as root and issue these commands:

wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
chmod +x /usr/bin/rpi-update

You can decipher the kernel currently running on your Raspberry Pi by issuing the command: uname -a

To determine GPU’s firmware version, issue the command: /opt/vc/bin/vcgencmd version

Once the updater has been installed (and after you’ve made a backup!), you can update your Raspberry Pi’s kernel and firmware to the latest and greatest by issuing the following commands while logged in as root. The latest kernel addresses some issues with the USB ports and is worth installing: raspberrypi 3.2.27+ #66 PREEMPT Fri Aug 24 with GPU firmware version 332937.
rpi-update
reboot


Don’t forget to List Yourself in Directory Assistance so everyone can find you by dialing 411. And add your new number to the Do Not Call Registry to block telemarketing calls. Or just call 888-382-1222 from your new number.

Originally published: Monday, August 20, 2012

Continue Reading… Incredible PBX for Raspberry Pi Turns 21


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! In fact, there is a thread dedicated to support of Incredible Pi. 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 ordinary users just like you. You won’t have to wait long for an answer to your question.

Bug Fixes. A few bugs are to be expected. If you’re using Incredible Pi, please review these on the PIAF Forum. A serious problem with IPtables has now been fixed in Incredible Pi 1.5. A patch for previous versions is on the forum.


Astricon 2012. Astricon 2012 will be in Atlanta at the Sheraton beginning October 23 through October 25. We hope to see many of you there. We called Atlanta home for over 25 years so we’d love to show you around. Be sure to tug on my sleeve and mention you’d like a free PIAF Thumb Drive. We’ll have a bunch of them to pass out to our loyal supporters. Nerd Vittles readers also can save 20% on your registration by using coupon code: AC12VIT.



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


whos.amung.us If you’re wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what’s happening. It’s a terrific resource both for us and for you.


 

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.
 



Some Recent Nerd Vittles Articles of Interest…

  1. DISCLOSURE: Most Amazon referral links include a Nerd Vittles referral code so that Amazon can send us a boatload of money each month. It costs you nothing while keeping the Nerd Vittles lights burning brightly. We never recommend Amazon unless their prices or products are the best we could find at the time of publication. []
  2. The TP-Link adapter is no longer recommended due to it substantial USB power requirements. We recommend the AirLink 101 which can coexist with a 5V, 1A power supply. You must use Incredible Pi 1.3 or later. []

The Asterisk Mother Lode: Introducing Incredible PBX 4.0 with FreePBX 2.10

We thought we’d start your summer off with a bang by introducing an all-new Incredible PBX™. So what’s new? 50 Asterisk® Apps. 9-Layer Security. 20 Preconfigured VoIP Provider Trunks. 1-Click Installers for Asterisk.everything. FreePBX® 2.10. Certified Asterisk support. And what’s the same? It’s all still FREE!

Coming January 19: Incredible PBX 11 & Incredible Fax for Asterisk 11 and FreePBX 2.11

Coming February 11: Incredible PBX 10 & Incredible Fax for 64-bit Asterisk 1.8 and FreePBX 2.10

We heard you. Yes, we needed Incredible PBX™ support for FreePBX 2.10 with Asterisk 1.8. And today it’s finally here. Incredible PBX 4.0 brings all of the original Asterisk applications plus more than a dozen new turnkey applications released in 2012 and an all-new level of security to protect your phone bill. The installation process is so simple a monkey could do it. You still can add Incredible Fax 2.0™ to deliver free faxing with HylaFax™ and AvantFax® in a setup process that’s as simple as pressing the Enter key. When you’re finished, you’ll have one of the open source wonders of the world with free phone calls and faxing throughout the U.S. and Canada together with almost every Asterisk application ever developed. There’s more good news. You don’t have to be smarter than a fifth grader to get any of it installed and working reliably with Asterisk. Just run the simple install script, and presto.

July Update: Incredible in the Cloud. For those that would prefer to run Incredible PBX 4.0 in the Cloud, RentPBX now is offering a pre-built image with PIAF-Brown and FreePBX 2.10 that is ready to go using servers all around the world. On your first order, Incredible in the Cloud is just $15/month using coupon code PIAF2012. Sign up at this link.

August 15 Update: Incredible Pi. We needed a back-to-school project, and this year we’ve chosen to port most of the Incredible PBX feature set to the new $35 Raspberry Pi. Thanks to the pioneering work of Gernot, this was fairly straight-forward. We’re still aiming for an early September release but, if you’d like to get a head start, you can order your device and follow our progress on the PIAF Forum.

If you’re curious why we no longer are supporting Asterisk 10, read all about it in last week’s Nerd Vittles article. Suffice it to say, if Digium is unwilling to fully support the platform, then we think it is a dead-end product. Unfortunately, this further splinters Asterisk development. In addition to long-term support (LTS) releases, "certified" (SLA) releases, and "other" releases, we now have a new category for Digium-supported modules and "community modules." To us, this signals the death knell for modules which Digium is no longer willing to actively support. Consequently, we will no longer recommend Asterisk 10 for production use. And we continue to be nervous about what the future holds for Google Voice support in Asterisk 1.8 and Asterisk 11 as well. The good news is, if you read last week’s article, you already know we have a rock-solid alternative waiting in the wings. YATE rocks! And FreeSentral is no slouch either.

The Incredible PBX 4 Inventory. For those that have never heard of The Incredible PBX, here’s the current 4.0 feature set in addition to the base install of PBX in a Flash with the CentOS 6.2, Asterisk 1.8 or Certified Asterisk 1.8, FreePBX 2.10, and Apache, SendMail, MySQL, PHP, phpMyAdmin, IPtables Linux firewall, Fail2Ban, and WebMin. Cepstral TTS, Incredible Fax, Skype, NeoRouter and PPTP VPNs, and all sorts of backup solutions are still just one command away and may be installed using the scripts included with Incredible PBX 4 and PBX in a Flash. Type help-pbx and browse /root and /root/nv for dozens of one-click install scripts.

And then there’s the Incredible Freebie! As they say, "Never look a gift horse in the mouth." What began as a kludgey, dual-call, dual-provider Google Voice implementation to take advantage of Google’s free PSTN calling in the U.S. and Canada with Asterisk 1.4 and 1.6 is now a zippy-quick, Gtalk-based calling platform that rivals the best SIP-to-SIP calls on the planet. The Incredible PBX Google Voice implementation provides virtually instantaneous PSTN connections to almost anybody, anywhere. Trust us! Except for the price which is still free, you’ll never know you weren’t connected via Ma Bell’s overpriced long-distance lines and neither will the Little Mrs. And, yes, our recommended $50 Nortel SIP videophone is plug-and-play.

To get started, download the latest 32-bit PBX in a Flash 2.0.6.2 ISO from SourceForge, burn to then boot from the PIAF2 CD, choose the PIAF-Purple option to load Asterisk 1.8 or PIAF-Brown to load Certified Asterisk, and pick FreePBX 2.10 when prompted. Once the PIAF2 install is completed, just run the new Incredible PBX 4.0 installer. In less than an hour, you’ll have a turnkey PBX with a local phone number and free calling in the U.S. and Canada via your own Google Voice account plus over 50 terrific Asterisk applications to keep you busy exploring for months.

A Few Words About Security. Thanks to its Zero Internet Footprint™ design, Incredible PBX 4 is different. It remains the most secure Asterisk-based PBX around. What this means is The Incredible PBX™ has been engineered to sit safely behind a NAT-based, hardware firewall with no Internet port exposure to your actual server. For those needing remote telephone support, Incredible PBX loads Travelin’ Man 2 and 3 for you so your IPtables Linux Firewall can be either self-managed by end-users or set up with predefined IP addresses and FQDNs for all of your remote sites. If you’ve read about Asterisk’s latest SIP vulnerability published just last week and occurring almost as often as you tie your shoes, then you’ll understand why WhiteList-based server security has become absolutely essential. WhiteList Security means only those devices with a registered IP address in your WhiteList can get to your server’s resources. To everyone else, your server doesn’t even exist. Their only way to connect to you is with a POTS telephone and your published phone number.

For those with multiple servers to interconnect, we’ve provided one-click installers for not one but two VPN solutions: NeoRouter and PPTP. Suffice it to say, Incredible PBX has Security in Spades™: customized IPtables Linux Firewall, Fail2Ban tweaked for Asterisk security monitoring, FreePBX Extension Lockdown by IP address, randomized FreePBX extension passwords, Travelin’ Man 2 and 3 WhiteList Security, multiple VPN solutions for encrypted server-to-server communications, plus a bottom-up design focused on flawless operation behind a hardware-based firewall. You won’t find a more secure Personal Branch Exchange™ at any price.

Here’s the Incredible PBX 9-Layer Security Model:

Prerequisites. Here’s what we recommend to get started properly:

We’ve shifted gears on our recommended Atom platform for PIAF2 after excellent results with both the single-core and dual-core Atom kits manufactured by Foxconn (pictured on the left below). That’s the dLink Gaming Router on the right. Seems kinda silly to spend twice as much for a machine that you can build yourself in under 5 minutes. Basically you remove four screws, insert a Phillips screwdriver in one of the holes and gently pry the cover away from the box. Then you pop off the back by inserting a small flat-blade screwdriver, remove four more screws, slide in a solid-state drive (SSD) and a 4GB stick of notebook computer RAM, and you’re done in a couple minutes. Replace the screws and the cover, and you have a perfect PIAF2 platform with terrific performance and no moving parts for about $200. The link above will take you to the PIAF Forum thread for these machines. They go on sale almost weekly. See the right column of Nerd Vittles (just below our tweets) for this week’s special at Amazon. The dual-core Atom box typically is under $150. It could easily handle an office with 50+ employees sitting on a bookshelf with an Internet connection (wired or wireless!). No noise. Very little heat. Low power requirements. Perfect!

Installing Incredible PBX 4.0. The installation process is simple. Here are the 3 Easy Steps to Free Calling, and The Incredible PBX will be ready to receive and make free U.S./Canada calls immediately:

1. Install PIAF-Purple or PIAF-Brown with FreePBX 2.10 using 32-bit PIAF2 ISO
2. Run Incredible PBX 4 installer
3. Configure Google Voice and a softphone or SIP phone

Installing PBX in a Flash. Here’s a quick tutorial to get PBX in a Flash 2 installed. To use Incredible PBX 4, just install the latest 32-bit version of PBX in a Flash 2. Unlike other Asterisk aggregations, PBX in a Flash utilizes a two-step install process. The ISO only installs the CentOS 6.2 operating system. Once CentOS is installed, the server reboots and downloads a payload file that includes Asterisk, FreePBX, and many other VoIP and Linux utilities including all of the new Google Voice components. Just choose the PIAF-Purple or PIAF-Brown payload. You’ll then be prompted to choose your flavor of FreePBX. Choose FreePBX 2.10. Then set your time zone and set up a password for FreePBX access, and you’re all set. As part of the install, yum now will automatically update your operating system with the latest updates for CentOS 6.2.

You can download the 32-bit PIAF2 from SourceForge. Burn the ISO to a CD. Then boot from the installation CD and press the Enter key to begin. If you’ve chosen a machine without an optical drive such as the Atom boxes we recommend, then this Nerd Vittles article will show you how to make a bootable flash drive from the PIAF2 ISO.

WARNING: This install will completely erase, repartition, and reformat EVERY DISK (including USB flash drives) connected to your system so disable any disk you wish to preserve AND remove any USB flash drives! Press Ctrl-C to cancel.

At the time zone prompt, tab once, highlight your time zone, tab to OK and press Enter. At the password prompt, make up a VERY secure root password. Type it twice. Tab to OK, press Enter. Get a cup of coffee. Come back in about 5 minutes. When the system has installed CentOS 6.2, it will reboot. Remove the CD promptly. After the reboot, choose PIAF-Purple or PIAF-Brown. In less than a minute, you’ll be prompted for the FreePBX version you wish to install. Choose FreePBX 2.10 and fill in your choices for the remaining prompts. Then have a 15-minute cup of coffee. After installation is complete, the machine will reboot a second time. You now have a PBX in a Flash base install. On a stand-alone machine, it takes 30-60 minutes. On a virtual machine, it takes about half that time. Log into your server with your root password and write down the server’s IP address. You’ll need it to access FreePBX with your browser. While you’re logged in, issue the following command to make sure your IPtables firewall loads after your network is enabled:

echo "/etc/init.d/iptables restart" >> /etc/rc.d/rc.local

NOTE: For previous users of PBX in a Flash, be aware that this new version automatically runs update-programs, update-fixes, and passwd-master for you. So your system is relatively secure out of the box if you install it behind a hardware-based firewall as we recommend! See the Proxmox cautionary alert in the footnotes to this article!

Configuring Google Voice. If you plan to use Google Voice, you’ll need a dedicated Google Voice account to support Incredible PBX 4. If you want to use the inbound fax capabilities of Incredible Fax 2, then you’ll need an additional Google Voice line that can be routed to the FAX miscellaneous 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 4. 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. If you’re living on another continent, see MisterQ’s posting for some setup tips.

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.

Incredible PBX 4.0 Installation. Log into your server as root and issue the following commands to run The Incredible PBX 4 installer:

cd /root
wget http://incrediblepbx.com/incrediblepbx4.x
chmod +x incrediblepbx4.x
./incrediblepbx4.x

UPDATE: There are some new releases. Incredible PBX 10 supports 64-bit PIAF-Purple with Asterisk 1.8 and FreePBX 2.10. There also are prebuilt appliances for Amazon EC2 and VirtualBox. Incredible PBX 11 supports 32-bit PIAF-Green with Asterisk 11 and FreePBX 2.11. There also are prebuilt appliances for VirtualBox and VMware. Both Incredible PBX 10 and Incredible PBX 11 support Incredible Fax as well.

When The Incredible PBX install begins, you’ll be prompted for your FreePBX maint password. This is required to properly configure CallerID Superfecta for you. Your credentials never leave your server!

Now have another 15-minute cup of coffee. While you’re waiting just make sure that you’ve heeded our advice and installed your server behind a hardware-based firewall. No ports need to be opened on your firewall to support Incredible PBX. Leave it that way!

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!

FINAL STEPS. Once the Incredible PBX install completes, there are two optional steps for those that will have remote phones or users outside your firewall. Install both Travelin’ Man 2 and 3 for an ultra-secure system. Also be sure to run update-fixes before restarting your machine!

Logging in to FreePBX 2.10. Using a web browser, you access the FreePBX GUI by pointing your browser to the IP address of your Incredible PBX. Click on the Users tab. It will change to Admin. Now click the FreePBX button. When prompted for a username, it’s maint. When prompted for the password, it’s whatever you set up as your maint password when you installed Incredible PBX 4. If you forget it, you can always reset it by logging into your server as root and running passwd-master.

Configuring Google Voice Trunks in FreePBX. All trunk configurations now are managed within FreePBX, including Google Voice. This makes it easy to customize your Incredible PBX to meet your specific needs. If you plan to use Google Voice, here’s how to quickly configure one or more Google Voice trunks within FreePBX. After logging into FreePBX with your browser, click the Other tab and choose Google Voice. To Add a new Google Voice account, just fill out the form:

Phone number is your 10-digit Google Voice number. Username is your Google Voice account name without @gmail.com. Password is your Google Voice password. NOTE: Don’t use 2-stage password protection in this Google Voice account! Be sure to check all three boxes: Add trunk, Add routes, and Agree to TOS. Then click Submit Changes and reload FreePBX. You can add additional Google Voice numbers by clicking Add GoogleVoice Account option in the right margin and repeating the drill.

While you’re still in FreePBX, choose Setup, Extensions, and click on the 701 extension. Write down your extension password which you’ll need to configure a phone in a minute.

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. You’ll note that Incredible PBX 4 now automatically enables the Asterisk Gtalk and Jabber modules for you once you create a Google Voice account.

Incredible Fax 2 Installation. If you want the added convenience of having your Incredible PBX double as a free fax machine, run install-incredfax2 after the Incredible PBX 4 install completes. Plug in your email address for delivery of incoming faxes and enter your home area code when prompted. For every other prompt, just press the Enter key. If you’d like to also add the optional OCR utility, just choose it when prompted. For complete documentation, see this Nerd Vittles article. Don’t forget that a REBOOT OF YOUR SERVER is requiredwhen the install is finished, or faxing won’t work! Then log in through the PIAF GUI using maint:password. Be sure to change your password!

Also be sure to set up a second, dedicated Google Voice number if you want support for inbound faxing. Once the Google Voice credentials are configured in FreePBX for the additional Google Voice line, simply add an Inbound Route for this DID to point to the fax destination. This comes preconfigured with Incredible PBX 4. Just plug in your 10-digit Google Voice number and other entries shown in the form below. Save your entries and reload FreePBX.

Extension Password Discovery. If you’re too lazy to look up your extension 701 password using the FreePBX GUI, you can log into your server as root and issue the following command to obtain the password for extension 701 which we’ll need to configure your softphone or color videophone in the next step:

mysql -uroot -ppassw0rd -e "select id,data from asterisk.sip where id='701' and keyword='secret'"

The result will look something like the following where 701 is the extension and 18016 is the randomly-generated extension password exclusively for your Incredible PBX:

+—–+——-+
id         data
+—–+——-+
701      18016
+—–+——-+

Configuring a SIP Phone. There are hundreds of terrific SIP telephones and softphones for Asterisk-based systems. Once you get things humming along, you’ll want a real SIP telephone such as the $50 Nortel color videophone we’ve recommended above. You’ll also find lots of additional recommendations on Nerd Vittles and in the PBX in a Flash Forum. If you’re like us, we want to make damn sure this stuff works before you shell out any money. So, for today, let’s download a terrific (free) softphone to get you started. We recommend X-Lite because there are versions for Windows, Mac, and Linux. So download your favorite from this link. Install and run X-Lite on your Desktop. At the top of the phone, click on the Down Arrow and choose SIP Account Settings, Add. Enter the following information using your actual password for extension 701 and the actual IP address of your Incredible PBX server instead of 192.168.0.251. Click OK when finished. Your softphone should now show: Available.

Incredible PBX Test Flight. The proof is in the pudding as they say. So let’s try two simple tests. First, let’s place an outbound call. Using the softphone, dial your 10-digit cellphone number. Google Voice should transparently connect you. Answer the call and make sure you can send and receive voice on both phones. Second, from another phone, call the Google Voice number that you’ve dedicated to The Incredible PBX. Your softphone should begin ringing shortly. Answer the call, press 1 to accept the call, and then make sure you can send and receive voice on both phones. Hang up. If everything is working, congratulations!

Here’s a brief video demonstration showing how to set up a softphone to use with your Incredible PBX, and it also walks you through several of the more than 50 Asterisk applications included in your system.



Learn First. Explore Second. Even though the installation process has been completed, we strongly recommend you do some reading before you begin your VoIP adventure. VoIP PBX systems have become a favorite target of the hackers and crackers around the world and, unless you have an unlimited bank account, you need to take some time learning where the minefields are in today’s VoIP world. Start by reading our Primer on Asterisk Security. We’ve secured all of your passwords except your root password and your passwd-master password. We’re assuming you’ve put very secure passwords on those accounts as if your phone bill depended upon it. It does! There’s loads of additional documentation on the PBX in a Flash documentation web site.

Solving One-Way Audio Problems. If you experience one-way audio on some of your phone calls, you may need to adjust your Asterisk SIP settings. These now can be tweaked within FreePBX by choosing Settings, Asterisk SIP Settings. Just plug in your public IP address and replace 192.168.0.0 with the subnet address of your private network. Save settings and reload FreePBX.

Choosing VoIP Providers. Nothing beats free when it comes to long distance calls. But nothing lasts forever. And, in the VoIP World, redundancy is dirt cheap. So we strongly recommend you set up another account with Vitelity using our special link below. This gives your PBX a secondary way to communicate with every telephone in the world, and it also gets you a second real phone number for your new system… so that people can call you. Here’s how it works. You pay Vitelity a deposit for phone service. They then will bill you $3.99 a month for your new phone number. This $3.99 also covers the cost of unlimited inbound calls (two at a time) delivered to your PBX for the month. For outbound calls, you pay by the minute and the cost is determined by where you’re calling. If you’re in the U.S., outbound calls to anywhere in the U.S. are a little over a penny a minute. If you change your mind about Vitelity and want a refund of the balance in your account, all you have to do is ask. The trunks for Vitelity already are preconfigured with The Incredible PBX. Just insert your credentials using FreePBX and uncheck the Disable Trunk checkbox. Then add the Vitelity trunk as the third destination for your default outbound route. That’s it. Congratulations! You now have a totally redundant phone system.

Incredible PBX includes preconfigured trunk setups for all of your favorite trunk providers. Just plug in your credentials and activate the trunks you need. In less than a minute, you’re done. Here’s the Incredible PBX Top 20 Trunk List with some reasons why these providers made our short list:

  • AxVoice ($14.99/mo. Business Plan; $16.58/mo. Unlimited Calls to 45 Countries)
  • CallCentric (Good International Calling Rates)
  • DIDforSale (20 channels per DID; unlimited DID calls for $8.99/mo.)
  • ENUM
  • FlowRoute (Good International Calling Rates)
  • FreeNum
  • Future-Nine (Supports CallerID Spoofing)
  • Google Voice (Free DIDs and free U.S./Canada calling)
  • IPkall (Free SIP/IAX DIDs)
  • Les.net (Supports CallerID Spoofing; very low rates)
  • LocalPhone (Dirt-cheap DIDs and calling rates worldwide; Free iNum DID)
  • Simon Telephonics (Free SIP-to-GoogleVoice Gateway)
  • SIPgate (Free residential DIDs sometimes)
  • Skype (Free Skype-to-Skype calls worldwide)
  • Teliax (Unlimited inbound DID $5/mo.)
  • Vitelity (Our supporter and the Best in the Business!)
  • VoIPms (CallerID spoofing; Free iNum calling; Very low rates)
  • VoIPMyWay (Residential Unlimited: $15.50/mo. Business Unlimited: $40/mo.)
  • VoIPStreet (Free DID)

Stealth AutoAttendant. When incoming calls arrive, the caller is greeted with a welcoming message from Allison which says something like "Thanks for calling. Please hold a moment while I locate someone to take your call." To the caller, it’s merely a greeting. To those "in the know," it’s actually an AutoAttendant (aka IVR system) that gives you the opportunity to press a button during the message to trigger the running of some application on your Incredible PBX. As configured, the only option that works is 0 which fires up the Nerd Vittles Apps IVR. It’s quite easy to add additional features such as voicemail retrieval or DISA for outbound calling. Just edit the MainIVR option in FreePBX under Setup, IVR. Keep in mind that anyone (anywhere in the world) can choose these options. So be extremely careful not to expose your system to security vulnerabilities by making certain that any options you add have very secure passwords! It’s your phone bill. 😉

Configuring Email. You’re going to want to be notified when updates are available for FreePBX, and you may also want notifications when new voicemails arrive. Everything already is set up for you except actually entering your email notification address. Using a web browser, open the FreePBX GUI by pointing your browser to the IP address of your Incredible PBX. Then click Administration and choose FreePBX. To set your email address for FreePBX updates, go to Settings, General Settings and scroll to the bottom of the screen. To configure emails to notify you of incoming voicemails, go to Applications, Extensions, 701 and scroll to the bottom of the screen. Then follow your nose. Be sure to reload FreePBX when prompted after saving your changes.

A Final Word About Security. In case you couldn’t tell, security matters to us, and it should matter to you. Not only is the safety of your system at stake but also your wallet and the safety of other folks’ systems. Our only means of contacting you with security updates is through the RSS Feed that we maintain for the PBX in a Flash project. This feed is prominently displayed in the web GUI which you can access with any browser pointed to the IP address of your server. Check It Daily! Or add our RSS Feed to your favorite RSS Reader. We also recommend you follow @NerdUno on Twitter. We’ll keep you entertained and provide immediate notification of security problems that we hear about. Finally, visit the PIAF Forums regularly. You’ll be surprised what you can learn in 10 minutes of browsing. Be safe!

Kicking the Tires. OK. That’s enough tutorial for today. Let’s play. Using your new softphone, begin your adventure by dialing these extensions:

  • D-E-M-O – Incredible PBX Demo (running on your PBX)
  • 1234*1061 – Nerd Vittles Demo via ISN FreeNum connection to NV
  • Z-I-P – Enter a five digit zip code for any U.S. weather report
  • 6-1-1 – Enter a 3-character airport code for any U.S. weather report
  • 5-1-1 – Get the latest news and sports headlines from Yahoo News
  • T-I-D-E – Get today’s tides and lunar schedule for any U.S. port
  • F-A-X – Send a fax to an email address of your choice
  • 4-1-2 – Phonebook lookup/dialer with AsteriDex
  • M-A-I-L – Record a message and deliver it to any email address
  • C-O-N-F – Set up a MeetMe Conference on the fly
  • 1-2-3 – Schedule regular/recurring reminder (PW: 12345678)
  • 2-2-2 – ODBC/Timeclock Lookup Demo (Empl No: 12345)
  • 2-2-3 – ODBC/AsteriDex Lookup Demo (Code: AME)
  • 3-3-3 – Look up a definition for any word or term
  • 9-4-9 – Weather forecast for any city in the world
  • 9-5-0 – Retrieve stock report by stock symbol
  • 9-5-1 – Latest Google News headlines
  • Dial *68 – Schedule a hotel-style wakeup call from any extension
  • 1-204-666-1001 – PIAF Support Conference Bridge (Conf#: 1091881)
  • 882*1061VoIP Users Conference every Friday at Noon (EST)

PBX in a Flash SQLite Registry. We want to introduce you to the PBX in a Flash Registry which uses SQLite, a zero-configuration SQL-compatible database engine. After logging into your server as root, just type show-registry for a listing of all of the applications, versions, and install dates of everything on your new server. Choosing the A option will generate registry.txt in the /root folder while the other options will let you review the applications by category on the screen. For example, the G option displays all of The Incredible PBX add-ons that have been installed. Here’s the complete list of options:

  • A – Write the contents of the registry to registry.txt
  • B – PBX in a Flash install details
  • C – Extra programs install details
  • D – Update-fixes status and details
  • E – RPM install details
  • F – FreePBX modules install details
  • G – Incredible PBX install details
  • Q – Quit this program

And here’s a sample from an install we recently completed.


Special Thanks. It’s hard to know where to start in expressing our gratitude for all of the participants that made today’s incredibly simple-to-use product possible. To Philippe Sultan and the rest of the Asterisk development team, thank you for making Jabber jabber with Asterisk. Wish you were still involved! To Leif Madsen, thanks for your pioneering work with Gtalk and Jabber which got this ball rolling. To Philippe Lindheimer, Tony Lewis, and the rest of the FreePBX development team, thanks for FreePBX 2.10 which really makes Asterisk shine. To Lefteris Zafiris, thank you for making Flite and all of the Google TTS and STT utilities work with Asterisk 1.8 thereby preserving all of the Nerd Vittles text-to-speech applications while allowing us to add dozens of new ones. To Darren Sessions, thanks for whipping app_swift into shape and restoring Cepstral and commercial TTS applications to the land of the living. The new all-in-one installer is awesome. To all of our pals in the PBX Open Source Software Alliance (POSSA) that develop and maintain some our favorite Asterisk apps, you’re unbelievable! To Andrew Nagy, thanks for all you do and especially for keeping Google Voice humming along in FreePBX. And to our pal, Tom King, we couldn’t have done it without you. You rolled up your sleeves and really made CentOS 6.2 and Asterisk 1.8 sit up and bark. No one will quite understand what an endeavor that is until they try it themselves. CentOS 6 implementations of Asterisk are few and far between, and Tom has made it look incredibly easy. It wasn’t! And, last but not least, to all of our pioneers and beta testers who spent their Independence Day and many other days testing this new release, THANK YOU!

Don’t forget to List Yourself in Directory Assistance so everyone can find you by dialing 411. And add your new number to the Do Not Call Registry to block telemarketing calls. Or just call 888-382-1222 from your new number. Enjoy!

Originally published: Monday, July 9, 2012


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! In fact, there is a thread dedicated to support of Incredible PBX 4.0. 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 ordinary users just like you. You won’t have to wait long for an answer to your question.


Weather Alert. If you’re already using the Nerd Vittles Weather Applications including Weather by ZIP Code and Weather by Airport Code, you may have noticed that the National Weather Service "improved" things over the Fourth of July holiday. Consequently, neither app worked any longer. The fixes now have been posted on the PIAF Forum and can be downloaded at your convenience. Incredible PBX 4.0 already includes the updates.


Astricon 2012. Astricon 2012 will be in Atlanta at the Sheraton beginning October 23 through October 25. We hope to see many of you there. We called Atlanta home for over 25 years so we’d love to show you around. Be sure to tug on my sleeve and mention you’d like a free PIAF Thumb Drive. We’ll have a bunch of them to pass out to our loyal supporters. Nerd Vittles readers also can save 20% on your registration by using coupon code: AC12VIT.



Need help with Asterisk? Visit the PBX in a Flash Forum.
Or Try the New, Free PBX in a Flash Conference Bridge.


whos.amung.us If you’re wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what’s happening. It’s a terrific resource both for us and for you.


 

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.
 



Some Recent Nerd Vittles Articles of Interest…

SMS Dictator 2.0: Send SMS Messages Using Your Phonebook with Google Voice

Here’s an update of a terrific Google™ speech-to-text application for your Asterisk® goody bag. SMS Dictator 2.0 lets you pick up any phone on your Asterisk system, dictate a brief message, have it transcribed by Google, and then delivered as an SMS text message by entering either a 10-digit number of your choosing or by saying any name in your AsteriDex phonebook. The installation process on PBX in a Flash™ systems takes only a minute. And you’ll find Asterisk SMS Messaging to be a welcome addition to your VoIP Swiss Army Knife.

Prerequisites. For the installer to work seamlessly, you’ll need a PBX in a Flash 2 server with the PERL gvoice CLI tool. You can test whether this is working by logging into your server as root and issuing the command: gvoice. When prompted for your Google Voice account name, enter it and include @gmail.com. Then enter your password. If you get a gvoice prompt, all is well. Type quit to exit. If you get errors or the gvoice app doesn’t exist, click on the pygooglevoice link in this paragraph to get things squared away.

You’ll also need a Google Voice™ account that can be used to send the SMS messages. Today’s SMS installer will prompt you for your Google Voice account name in the format: myname@gmail.com. Then you’ll be prompted for your Google Voice password. Once you’ve entered your credentials, the rest is automagic. With a little manual tweaking of the installation script, you can get this working on any Asterisk-based server running under Linux.

As configured, SMS Dictator™ uses extension 767 (S-M-S) to generate SMS messages. If this conflicts with an extension on your server, you can edit the extensions_custom.conf dialplan in /etc/asterisk.

Legal Disclaimer. What we’re demonstrating today is how to use a publicly accessible web resource to respond to dictation requests generated by a phone connected to your Asterisk server. We’re assuming that Google has its legal bases covered and has a right to provide the public service they are offering. We are not vouching for Google or the services being offered in any way. By using our tutorial, YOU AGREE TO ASSUME ALL RISKS, LEGAL AND OTHERWISE, ASSOCIATED WITH USE OF THIS FREELY ACCESSIBLE WEB TOOL. 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 read our articles or implement 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. Plain English: "Don’t Shoot the Messenger!"

Removing Previous SMS Dictator Code. If you installed our earlier version of SMS Dictator, then you have a little housekeeping to do before we begin. Log into your server as root and change to the /etc/asterisk directory. Then edit extensions_custom.conf. Search through the file until you find the lines beginning with exten => 767. Delete all of those lines. If you’re using nano, Ctrl-K will delete a line at a time. Once you’ve deleted all the 767 lines, save the file: Ctrl-X, Y, and press Enter. Now continue on…

Installation. To install SMS Dictator, log into your PBX in a Flash server as root and issue the following commands:

cd /root
wget http://nerdvittles.com/sms-dictator.tgz
tar zxvf sms-dictator.tgz
./sms-dictator.sh

Accept the license agreement and fill in your Google Voice credentials when prompted. In under a minute, you’ll be ready to test things out.

Taking SMS Dictator for a Spin. Now you’re ready to try it. Pick up any phone connected to your Asterisk server. Dial S-M-S (767). When prompted, dictate a brief message and press #. If the transcription played back is correct, press 1. Or hang up and try again. Now press 1 to enter a 10-digit phone number for the SMS recipient or press 2 to speak the name of someone in your AsteriDex database. When prompted, enter the 10-digit number or say the name of the SMS recipient. If the response read back to you is correct, press 1 to send the SMS message. It’s as simple as that.

AsteriDex Integration. If you’re using AsteriDex for your contacts, then it’s pretty simple to look up SMS contact numbers from there instead of having to remember them and manually key them in. The only trick is that you may need to adjust the names slightly if Google has difficulty understanding what you’re saying. For example, Google does not like Ward but is perfectly happy with Uncle Wardy. So are we. Here’s a hint. Multi-syllable words fare better than 3 and 4 letter words.

SMS Message Blasting. The SMS messaging possibilities, of course, are endless. A lively discussion is was underway on the PIAF Forum until The Great Trainwreck of 2013. This could include notifications to Little League teams about schedule changes, or alerts from a school about emergencies, or community alerts about tornados. You can probably think up a dozen more on your own. We’ve now released the first preview of a message blasting utility which you are welcome to download here. Enjoy!

3/2/2017 Update: A patched version of pygooglevoice to support SMS messaging is now available here.

Originally published: Monday, August 13, 2012



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


whos.amung.us If you’re wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what’s happening. It’s a terrific resource both for us and for you.


 

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.
 



Some Recent Nerd Vittles Articles of Interest…

Asterisk TTS: Today in History 2.0 & Yesteryear’s Time of Day

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 Google TTS. 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.

As a bonus, there’s TrimLine’s new Time of Day application for your Asterisk server that works just like it did in yesteryear. You can read all about it and install it from this link.

Prerequisites. If you’re using PBX in a Flash, then all of the tools you’ll need are already in place. And we have a script for you that will install Today in History 2.0 in just a few seconds. For other users, you’ll need an Asterisk server with PHP5 and Flite to handle portions of the text-to-speech. No extras are needed for the Time of Day application.

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 PHP/AGI script which gets stored in /var/lib/asterisk/agi-bin. In this script (nv-today.php), you can change the default Flite TTS engine to Cepstral by changing the $ttspick variable setting from 0 to 1. Then there is a snippet of dialplan code that needs to be added to the [from-internal-custom] context in extensions_custom.conf for FreePBX installations. Once you reload your dialplan, you’re ready to go. For a quick demo, dial 1-650-308-9946.

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 Google’s TTS engine is used to convert the text file into /tmp/today.wav. The dial plan code answer 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 from the dialplan.

Script Installation. If you’re using PBX in a Flash, log into your server as root and issue the following commands:

cd /root
wget http://bestof.nerdvittles.com/applications/today/today2.pbx
chmod +x today2.pbx
./today2.pbx

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

Manual Installation. For those using a different Asterisk aggregation that includes PHP5, FreePBX, and Flite, add this code to /etc/asterisk/extensions_custom.conf in the [from-internal-custom] context:

exten => 86329,1,Answer
exten => 86329,2,Wait(1)
exten => 86329,3,Set(TIMEOUT(digit)=7)
exten => 86329,4,Set(TIMEOUT(response)=10)
exten => 86329,5,Flite(Please stand bye while we retrieve: Today in History.)
exten => 86329,6,AGI(nv-today.php)
exten => 86329,7,Playback(/tmp/today)
exten => 86329,8,Wait(1)
exten => 86329,9,Hangup

Then issue the following commands from the command prompt after logging in as root:


cd /var/lib/asterisk/agi-bin
wget http://bestof.nerdvittles.com/applications/today/today.tgz
tar zxvf today.tgz
rm -f today.tgz
asterisk -rx "dialplan reload"

Upgrading from Today in History 1.0. If you used this script previously, a couple of ugly things have happened to make it stop working. First, Yahoo dropped support for their Today in History RSS feed. And then Cepstral released an upgrade which no longer lets you create .wav files from a text file without paying an additional $200 license fee. So the new release doesn’t use Cepstral. Everything is handled (and handled well) by the Google TTS engine… which is free to use.

If you have an older version of Cepstral that still permits the creation of .wav files, then you can upgrade just the original AGI script. Log into your server as root and issue the following commands:

cd /var/lib/asterisk/agi-bin
rm nv-today.php
wget http://bestof.nerdvittles.com/applications/today/today.zip
unzip today.zip
chown asterisk:asterisk nv-today.php
chmod +x 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 6, 2012


Astricon 2012. Astricon 2012 will be in Atlanta at the Sheraton beginning October 23 through October 25. We hope to see many of you there. We called Atlanta home for over 25 years so we’d love to show you around. Be sure to tug on my sleeve and mention you’d like a free PIAF Thumb Drive. We’ll have a bunch of them to pass out to our loyal supporters. Nerd Vittles readers also can save 20% on your registration by using coupon code: AC12VIT.



Need help with Asterisk? Visit the PBX in a Flash Forum.
Or Try the New, Free PBX in a Flash Conference Bridge.


whos.amung.us If you’re wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what’s happening. It’s a terrific resource both for us and for you.


 

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.
 



Some Recent Nerd Vittles Articles of Interest…