NOTE: The system referenced in this article is no longer supported by Nerd Vittles as this version of Asterisk® has been phased out. For the latest and greatest, please consider our new PBX in a Flash offering.
Perhaps the most requested new article by Nerd Vittles' readers has been a HOW-TO for configuring a Linux-based TrixBox system to do everything our VMware TrixBox build for Windows can do. So today we decided to tackle it. If you read nothing else, read the following cautionary note: This application only works with a clean build of TrixBox 1.2.3 using the TrixBox .iso install on a dedicated PC. If you've already installed TrixBox 1.2.3 and made any configuration changes either to Linux or Asterisk with or without using freePBX, do not use this program. It will overwrite (aka erase) all of your existing settings! Just consider it the last critical step in an initial TrixBox 1.2.3 install, and you should be fine. There, you've been warned.
Overview. If you can cook French Toast without burning yourself or setting your kitchen on fire, then PBX-in-a-Flash™ will be a piece of cake for you. The good news is that, with a clean TrixBox 1.2.3 .iso install, this may just be the greatest thing since sliced bread. Why? Because it builds you a turnkey Asterisk PBX with all of the security patches, and freePBX and WebMin updates, and Nerd Vittles apps in just a few minutes with no user intervention. You'll still need to secure your passwords and walk through the freePBX module updates process, but you'll be ready to roll with 8 extensions and 2 phone lines in less than 30 minutes... and that includes installation of TrixBox from the boot disk. You really don't need to know much of anything about Linux or Asterisk for that matter. And, as much as we love freePBX, the number of menus and options can be intimidating until you get your feet wet. PBX-in-a-Flash solves that by preconfiguring virtually everything on your new system. For ease of reference, portions of our previous tutorials on TrixBox 1.2.3 and the VMware build for TrixBox 1.2.3 are also repeated here so that everything is easy to follow. And, when you're finished, phones ring, voicemail works, voicemail messages get emailed to you without any further tweaking of Linux and SendMail, callers get a welcoming message and music on hold before your phones start to ring, and those (like you) with the secret password can do all sorts of other tricks while the AutoAttendant plays... such as getting dial tone to make an outbound call using your (almost) free VoIP international calling plan.
Here are the basic steps:
Step 1. Download and install the TrixBox 1.2.3 .iso on a dedicated PC ... and, yes, VMware installs should also work.
Step 2. Download and run the Nerd Vittles pbx-in-a-flash script to get everything loaded, configured, and up to date.
Step 3. Reboot your system and be sure all your passwords are secure.
Step 4. Load and activate all of the new freePBX modules. We've preconfigured the rest of freePBX for you.
Step 5. Sign up and then enter your usernames and passwords for your VoIP hosting providers.
Step 6. Plug in and set up your phones.
Step 7. Enjoy!
Step 1. Installing TrixBox 1.2.3. Begin by downloading the TrixBox 1.2.3 ISO image from here and burn a CD (click here if you need a refresher course). Using your dedicated PC, insert the CD you made, plug your machine into the Internet, and turn it on. Then watch while TrixBox loads CentOS/4.4 (with an older Linux kernel that doesn't break voice applications!) and all the Asterisk and Linux goodies imaginable: Apache, SendMail, Asterisk Mail, SugarCRM, MySQL, PHP, phpMyAdmin, SSH, Bluetooth, freePBX, the Flash Operator Panel, Call Detail Reporting, and on and on. This install will reformat (aka ERASE) your hard disk before it begins, but it will warn you first. You'll be prompted to choose your keyboard language, then your time zone, and then your root user password. Make up a password that you can remember but others can't ... and write it down! About 5 or 10 minutes after the installation begins (depending on the speed of your machine), the boot disk will eject. Be sure to remove it before the system reboots to continue the install, or it'll just start over by rebooting from the CD again. When the installation is finished, you should see a login prompt.
So You Need a $100 Computer? TrixBox runs best on a dedicated machine. And, unless you have an old clunker sitting around, here's a deal you shouldn't pass up. It's a used Dell OptiPlex GX150 for $47.91. Bump up the RAM to 256MB for $12.95 (recommended) and add $32 for shipping, and it still comes in at under $100. If you're feeling downright wealthy, add another $10 for a one year parts and labor warranty including shipping fees (recommended). You can also bump up the processor to 1 Ghz for $30 more, and the box still comes in at under $140.
Step 2. Installing PBX-in-a-Flash. Now for the fun part. Don't do anything on your system yet except to login as root with the password you wrote down. At the command prompt, type these commands in order:
chmod +x pbx-in-a-flash
Read the warning and then press the Enter key to proceed with the pbx-in-a-flash update. When it finishes, you'll be prompted to press the Enter key again to reboot your system. Just do it!
Step 3. Securing Your Passwords.When the install is finished and reboots again, log in as root with the password you assigned. Type help-trixbox for a listing of the other passwords that need to be changed. Change them all NOW! Keep it simple and use the same password for everything. You're not going to expose this web server to the Internet anyway... if you're smart.
Securing AsteriDex. Because of a security vulnerability in our very own AsteriDex, you'll need to download and install this simple patch. Log into your Asterisk server as root and issue the following commands:
rm -f callboth.php
rm -f callboth.zip
chown asterisk:asterisk callboth.php
chmod 775 callboth.php
Securing and Activating A2Billing. This web-based application allows you to generate and issue calling cards to individuals so that they can place calls remotely through your Asterisk server. If you've always wanted to be just like Ma Bell, here's your Big Chance! There's very little that you can do with an AT&T calling card that can't be done as well or better using A2Billing. And, it won't take an M.B.A. to undercut AT&T's calling card rates and still make buckets of money. All you need now are a few customers. But first, a word of caution. Assuming your Asterisk server has web exposure on the Internet, you need to secure the admin and root passwords in this application whether you use it or not. To access the application, go to http://192.168.0.104/a2billing/ using the actual internal IP address of your Asterisk server. Log in as root with a password of myroot. Click on the ADMINISTRATOR tab in the left column and then click Show Administrator. Now click on the Edit button beside each of the two administrator accounts and change the passwords to something secure. If you really would like to learn more about it, documentation for the application is available here. And, if you decide to use the application, you'll need to uncomment six actual dialplan lines in /etc/asterisk/extensions_trixbox.conf and reload Asterisk. Be sure to use a separate DID for this application and point it to custom-callingcard,s,1. We'll have a terrific new VoIP provider with dirt cheap DID rates to tell you about shortly so stay tuned!
;exten => s,1,Answer
;exten => s,2,Wait,2
;exten => s,3,DeadAGI,a2billing.php
;exten => s,4,Wait,2
;exten => s,5,Hangup
Securing SugarCRM Contact Management. TrixBox includes the best open source contact management application on the planet, SugarCRM. You access the application with a web browser: http://192.168.0.104/crm/ substituting the private IP address of your Asterisk box, of course. We're going to stop repeating the substitution tip from here on. Whenever you see a reference to 192.168.something, just substitute the private IP address of your TrixBox server. Once the SugarCRM login screen appears, specify admin for your username and password for your password. Whether you use the application or not, change the admin password. It's easy. Just click the Administrator link under Welcome admin. Then click the Change Password button. Complete documentation for the application is available here. If contact management is your thing, knock yourself out, and we'll talk to you next spring when you finish getting everything set up to run your business. It's a great product, but be prepared to invest lots of time in the project if you expect to use it productively. If all you need is a phone dialer and a database that can display CallerID info for your friends and business associates, our AsteriDex product will be a better fit, and it takes about 2 seconds to enter each new person into the AsteriDex database.
Step 4. Load and Activate freePBX Modules. freePBX is the web GUI which manages your Asterisk system. You access it with a web browser by going to the IP address of your Asterisk server. If you don't know the IP address, log in as root, and it will tell you. Then go to that IP address with your browser, e.g. http://192.168.0.142/. At the main TrixBox menu, choose System Administration. When prompted for your username, type maint with the password you assigned above for passwd-maint. Now choose FreePBX and then Tools and then Module Admin. Put a check mark beside each of the Modules (shown in green) and then click Submit. After the modules are enabled, click the Red Bar at the top of your screen to reload the settings into Asterisk.
Next, select the Online Modules Repository. Put a check mark beside each of the Modules (shown in orange) and then click Submit. After the modules are installed and enabled, click the Red Bar at the top of your screen to reload the settings into Asterisk.
Before the extensions will actually ring (instead of going directly to voicemail), you'll need to click on Setup->Extensions. Then choose each extension and at least click the Submit button followed by the Red Bar. This is a security feature to encourage you to change the password for each extension including its voicemail password.
If you'd prefer that callers hear Music on Hold rather than ring tones after the AutoAttendant plays, then click Setup-> General Settings and change the entry for Asterisk Dial Command Options from tr to tm. To enable recording of incoming calls by pressing *1, add a lowercase w to the string. Then click Submit and the Red Bar when you're finished.
Step 5. Setting Up Your VoIP Providers. Before you can place calls to real phone numbers, you'll need at least one outbound VoIP provider. Before you can receive calls from real phone numbers, you'll need at least one inbound DID trunk (aka "phone number") from a VoIP provider. These can be the same provider or different ones. Unlike with Ma Bell, more is better in the VoIP world because it gives you some redundancy... and stuff does break from time to time.
You add hosting providers in freePBX by adding Trunks in the Setup menu. We've preconfigured your system for two providers, VoipDiscount and Stanaphone, so that all you have to do is click on each of those trunks, plug in your account names/numbers and passwords, save your updates, click the Red Bar, and you're off to the races. You may want to choose your own providers which is perfectly fine. But, for $15 which works out to $5 a month, our two picks will get you started for three months with free incoming calls, a free phone number, and 300 minutes a week of free outbound calls to dozens of countries including the U.S., most of Europe and Asia, and Australia. During that three months, you can start your VoIP Provider Education here and then you can read our reviews and HOW-TO's for setting up dozens of different providers with Asterisk here.
DISA Security. Getting remote dialtone can be a dangerous thing in the wrong hands so let's put your own password (of any length) on the DISA function that is triggered by pressing 8 when your AutoAttendant answers your incoming calls. In freePBX, choose Setup. Then click DISA in the left column of freePBX and then DialTone in the right column. Now enter a PIN that will let you sleep well at night ... knowing that you are paying for all outbound DISA calls. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk.
Step 6. Setting Up Your Phones. Before your new PBX will be of much use, you're going to need something to make and receive calls, i.e. a telephone. For today, you've got three choices. Option #1 and the best home solution is to use a Plain Old Telephone or your favorite cordless phone set (with 8-10 extensions) if you purchase a little device (the size of a pack of cigs) known as a Sipura SPA-1001. It's under $60. Be sure you specify that you want an unlocked device, meaning it doesn't force you to use a particular service provider. Once you get it, plug the SPA-1001 into your LAN, and then plug your phone instrument into the SPA-1001. Your router will hand out a private IP address for the SPA-1001 to talk on your network. You'll need the IP address of the SPA-1001 in order to configure it to work with Asterisk. After you connect the device to your network and a phone to the device, pick up the phone and dial ****. At the voice prompt, dial 110#. The Sipura will tell you its DHCP-assigned IP address. Write it down and then access the configuration utility by pointing your web browser to that IP address.
Once the configuration utility displays in your web browser, click Admin Login and then Advanced in the upper right corner of the web page. When the page reloads, click the Line1 tab. Scroll down the screen to the Proxy field in the Proxy and Registration section of the form. Type in the private IP address of your Asterisk system which you wrote down previously. Be sure the Register field is set to Yes and then move to the Subscriber Information section of the form. The preconfigured extensions are set up as 500 through 508 with voicemail activated for extension 500 and 501 presently. To keep things simple, enter House Phone as the Display Name. Enter 500 as the User ID. Enter 1234 as the Password, and set Use Auth ID to No. Click the Submit All Changes button and wait for your Sipura to reset. In the Line 1 Status section of the Info tab, your device should show that it's Registered. You're done. Pick up the phone and dial 611 to get a current weather report or dial 511 to get today's news headlines.
If you're like us, you've gone to all this trouble downloading your fancy new PBX, and you sure as hell don't want to wait a week for your Sipura 1001 to arrive before trying it out. So here's the quick and dirty solution. There's software that will run on your Windows, Mac, or Linux desktop that acts like a telephone. You obviously need speakers and a microphone on your system for this to work. Assuming you have those, go to CounterPath's web site and download X-Lite for your favorite OS. There's a manual there, too, but you probably won't need it. Once the download completes, click on it to start the install. Accept the obnoxious license agreement and install the software in the default directory. Unless you want X-Lite to load every time you restart your machine, uncheck the Launch on Startup checkbox. Reboot your system and, if it's also running your TrixBox system, restart it first. Then run the X-Lite application. Click No to turn off X-Lite's spyware. When the "SIP Accounts" window opens, click the Add button and fill in the following data:
Display Name ... House Phone
User name ... 500
Password ... 1234
Auth. User Name ... 500
Domain ... the IP address of your TrixBox system
Leave the other defaults and click on the Check Voicemail tab. For the Number to Dial to Check Voicemail, enter *97. Then click OK and Close. If your Windows Firewall is doing what it's supposed to, it will probably block the connection to your Asterisk system. When prompted, tell it to allow future connections. If this happens and X-Lite does not register with your Asterisk system, click the Down Arrow at the top of the softphone (Show Menu). Click SIP Account Settings, Properties, OK, and Close again. You now should be registered. Dial 611 and get your first weather report. To exit from X-Lite, click the Down Arrow and then Exit.
Step 7. Enjoy! We saved the best for last. All you have to do now is learn about all the great freebies that have just fallen into your lap. Here's a little info to get you started.
Linux 101. If you're new to Linux and/or Asterisk, here are a few commands you'll need from time to time. And, if you didn't already know, you don't just pull the plug on a Linux system ... even if it's running in a window on your Windows Desktop. Linux caches lots of stuff to speed up processing. So always shut things down gracefully if your data matters.
df -h ... Free disk space remaining on your Linux system. Be sure you always have the required 6GB of Windows space for this app!
logout ... Logs you out of the Linux system.
Ctrl-Alt ... Gives your Windows cursor back and lets you run other Windows apps until you click again in the nv-TrixBox window.
asterisk -r ... Runs the Asterisk Command Line Interface (CLI) after you've logged in as root.
quit ... Exits gracefully from the Asterisk CLI
amportal restart ... Restarts Asterisk.
/etc/webmin/start ... Starts up WebMin, the Swiss Army Knife of Linux. Access it with a web browser: https://TrixBoxIPaddress:10000/
shutdown -h now ... Shut down your Linux system right now. Wait for VMware Player window to close!
shutdown -r now ... Reboot your Linux system right now.
nano -w filename ... Edit any file in your Linux system. Ctrl-X, Y, then Enter saves your changes.
cd dirname ... Changes to another directory below current directory.
cd /dirname ... Changes to another directory below the root directory.
ls ... The Linux equivalent of dir to get a directory listing.
cd /var/www/html ... Home of the TrixBox web server files accessed at http://TrixBoxIPaddress/ or https://TrixBoxIPaddress/
cd /var/lib/asterisk/agi-bin ... Home of the TrixBox and Asterisk scripts for Asterisk apps.
cd /var/lib/asterisk/sounds ... Home of Allison and all the voices prompts that make up the Asterisk system.
cd /etc/asterisk ... Home of all the Asterisk, TrixBox, and freePBX configuration files.
The Nerd Vittles Collection. Below are links to tutorials for the Nerd Vittles applications that are preloaded in the PBX-in-a-Flash install. AsteriDex and MailCall require some quick configuration so take a look at the tutorials. You also may want to change the Telephone Reminders default password of 123 in line 28 of /etc/asterisk/extensions_trixbox.conf. If you do, remember to restart Asterisk for the change to take effect.
AsteriDex - The Poor Man's Rolodex (http://TrixBoxIPaddress/asteridex/)
NewsClips for Asterisk - Get the News By Telephone (Dial 511)
MailCall for Asterisk - Get Your Email By Telephone (Dial 555)
Weather Reports by Airport Code - Get the Latest Weather Forecasts for 1,000 U.S. Cities (Dial 611)
Telephone Reminders for Asterisk - Appointment Reminders By Telephone (Dial 123)
GabCast Studio for Asterisk - Create and Play PodCasts Using Your Phone (Dial *422 and 422)
TeleYapper Message Broadcasting System - Deliver Appointment Reminders and Important Info to Any Custom Calling List (Dial 674)
What To Do Next. Once your new PBX is humming away, here are the next steps. First, you'll want to upgrade freePBX to version 2.2.x. The tutorial to walk you through the drill can be found here. Last but not least, you'll want to apply the latest Asterisk security patches to prevent a denial of service attack on your system. The tutorial for that can be found here.
Where To Go From There. If you're new to the Asterisk world, you have lots of fun (and learning) ahead of you. Start with the comments to this article for late-breaking news. Then take a look at our Newbie's Tutorial. We've already done most of the work for you here so you'll get to see how much fun you missed. Seriously, it's an easy read and covers many topics that we didn't get to here. So start there. If you want to review what actually got installed with the PBX-in-a-Flash script, take a look at our article on the VMware build of TrixBox 1.2.3. You'll also want to get plugged into the TrixBox Forums. That's the place to ask questions after you do some reading. Posting support questions on Nerd Vittles just doesn't work because of the cumbersome blog format. Don't email us questions either! About 20,000 pages of our tutorials get downloaded each day so we hope you'll understand why free, individualized tech support is not possible. We do accept thank you notes with or without donations to the site. Finally, take a look at our catalog of articles, projects, and Asterisk resource links. You'll find just about everything you'll ever need there. Enjoy!
Nerds' Corner. The trick to building the backup image which makes PBX-in-a-Flash tick lies in the backup script which we use to back up critical pieces of our TrixBox system to a redundant server. Before you can use it to backup your own TrixBox system, you'll need another TrixBox server or any Linux system. Then you'll need to run through the SSH autologin trick which is outlined in our TrixBox 1.2.3 tutorial. This sets up your system so that you can log into other Linux machines with ssh or scp without having to type your password. Finally, you'll need to modify the last line of the backup script so that it points to the correct IP address of your remote Linux server. If you want more detail on the backup process, read our article: Backups and Redundancy with Asterisk. The only remaining piece to make all of this portable was to create a compressed archive of the backup folder on the backup server and make it available to you using the new pbx-in-a-flash script. This command did the trick:
tar cfvz /tmp/backup.tar.gz /backup