Page Nav

HIDE

Grid

GRID_STYLE

Installing Incredible PBX on Raspberry Pi 2

Introduction The motto of "Better, Faster, Cheaper" never meant more than the intersection of VoIP and the Raspberry Pi 2. W...

Image result for Installing Incredible PBX on Raspberry Pi 2

Introduction

The motto of "Better, Faster, Cheaper" never meant more than the intersection of VoIP and the Raspberry Pi 2. When Microsoft announced that Windows 10 would run on the RPi2, I bought one for a development project that will be detailed at a later date. I had the device up and running to 'burn in the hardware', and a VoIP need came up. Previously, we've used small VoIP setups with great success, and I've documented it in a How-To shown in the references below. I thought I'd give Asterisk a whirl on the Pi2.

I was pleasantly surprised to see that Ward Mundy had already documented a setup at Nerd Vittles, and I've included a link to his detailed setup in the references below, so this should be fun.

Steps (6 total)

1

Create OS Boot Image

The Nerd Vittles link provides all of the details, however, in this first step the goal is to download a .img file that contains a Linux image that we'll need to copy to a SD-RAM card. These Raspberry Pi devices typically use the SD-RAM as their 'main hard drive', so this image provides the disk structure and programs to run the machine.
I unzipped the image file, and used the Windows Win32DiskImager to copy write the .img to the SD-RAM card. Remember to properly eject the SD-RAM card from the Windows machine so the file system doesn't get scrambled by simply pulling out the SD-RAM card.
2

Assemble the Hardware

Once you have the boot image created, you'll need to slip that SD-RAM card into the Raspberry Pi 2, and connect a USB keyboard, HDMI monitor, network cable (with connection to the Internet), and a power supply to the device. Add the power supply last, because the unit will boot right away!
3

Run through the First Boot

Your first boot will allow you to properly configure your Linux installation for this device, and the PBX software to come. As you boot, you'll be presented with 9 different customizations, and you should make three different changes.
1. Expand the File System to fill your SD card. The image file we downloaded and loaded to the SD-RAM card was built as small as it could to allow for different size cards. This option resizes the partition to take advantage of your larger card size. No options, it's all automatic.
3. Enable Boot to Desktop Text (top selection). This sets the video output that Linux will boot to. For this small device, we'll only want to support a text based interface. No options, just select this item.
8. Change your Hostname using the A2 selection to incrediblepi2. This will allow you to find the machine on your network a bit easier.
Finish, and reboot the machine.
Watch your boot screen, and towards the end you'll see the IP address assigned to this Raspberry Pi 2. You can use this to connect from your desktop/laptop.
4

Load up Incredible PBX to the device

Log onto the machine, using the username of pi, and the password of raspberry. First things first, change the root password to something strong, using the Linux command:
sudo passwd root
Reboot the machine, using the command:
sudo shutdown -r now
Log back in as username root, and use your new secure password. There's a big warning that says to make sure you have at least an 80 x 27 character setting, so maximize your SSH connection, or log in to the device directly.
You'll next need to issue the following five commands. The first one puts you in the /root directory, the second one pulls down the installation script (about 22k, so it goes quickly). The third one expands the installation script for you to execute. The fourth one deletes the zipped file you downloaded, and the last one runs the installation. This script downloads, compiles and configures the Incredible PBX setup.
cd /root
wget http://incrediblepbx.com/incrediblepbx11guiPi.tar.gz
tar zxvf incrediblepbx11guiPi.tar.gz
rm -f incrediblepbx11guiPi.tar.gz
./IncrediblePBX11Pi-GUI.sh
For me, this took over an hour, as the entire system is compiled on your tiny system. Once this completed, I performed another reboot, and then logged in using putty, from my laptop. Note that this install sets up the firewalls for the network you're currently on.
5

Lock Down the Asterisk Setup

Log back in using username root, and your secure password. During this first login process, you'll get a message that you'll want to update the software, and that you'll make a connection to the remote system to make this happen. I pressed the enter key and the process continued on.
Ward Mundy suggests a list of hardening commands that I will list here from his document:
Set your correct time zone:
./timezone-setup
Restart Asterisk:
asterisk-restart
Create admin password for web apps:
htpasswd -b /etc/pbx/wwwpasswd admin newpassword
Make a copy of your other passwords (copy/paste from SSH/Putty):
cat passwords.FAQ
Make a copy of your Knock codes (copy/paste from SSH/Putty):
cat knock.FAQ
Next you'll need to log into the Incredible PBX server as username admin, using the password of password, from a web browser, using your server’s IP address.
6

Setup the Asterisk Trunks and Extensions

From here on out, this Incredible PBX system is a typical VoIP setup, using trunks and users. I was able to connect an existing trunk and extension just as if this was one of our 'large installations'.
As you can see from the photo, we had cake, and pi, 2!!!

Conclusion

This will end up with a case on the box, and then will serve as a home phone system for a new house that's under construction. The final setup will have a single POTS line to handle some incoming calls, and to service the elevator emergency call system. There will be a half dozen phones, with a set of SIP trunks to provide outbound long distance, and international calls.
Total cost for the server hardware should be $35 for the RPi2, $10 for the SD RAM card, and a free leftover micro-USB power supply from a long lost Nokia cell phone. So, $45 for the goodies in the closet, and about $100 per phone device.
This should be more than adequate for any home/small business setup. The most intensive application we ever see with VoIP is the teleconference option. The Nerd Vittles article says that they have successfully tested this setup with 9 simultaneous callers on a conference call.

No comments