Home » Technology (Page 88)

Category Archives: Technology

The Most Versatile VoIP Provider: FREE PORTING

Introducing a Complete Podcast Studio for Everyman: Your Telephone

With apologies to the Univ. of Wisc. for this spoofFor those that have been chomping at the bit to play with podcasting, today's your lucky day. We're going to show you how to do anything you've ever wanted to do with podcasts using your plain old telephone. All you need is a shiny new TrixBox server or any Asterisk® server with freePBX installed. If you don't have a TrixBox system, take advantage of our new one that'll run on your Windows Desktop. The free download and 15-minute installation tutorial are both here. Once you get everything installed, you're half way there. As it happens, freePBX (included as part of every TrixBox) has a podcast recording system built right in. It uses a free service called GabCast. To start podcasting, just sign up for a free GabCast account.

GabCast Overview. Out of the box, there are two things you can do with your TrixBox system and GabCast. First, you can create podcasts. And, second you can host conference calls. Today Nerd Vittles adds the third leg to the stool. With the new GabCast Player for Asterisk, you'll be able to listen to any GabCast channel feed using a garden-variety, touchtone phone. So long as you know the channels you want to listen to, you can kiss your iPod and web browser goodbye and listen to these podcasts by telephone from anywhere. We'll show you how.

We're not going to spend much time talking about conference calls today. Suffice it say, with GabCast, the first 30 minutes are free. After that, it's 10¢ a minute. It takes about 30 seconds to set up a conference call and start using it. The steps to create your own podcast are pretty simple as well. You set up a GabCast account. You configure the GabCast module in freePBX. You dial into GabCast from a phone on your Asterisk system or by calling a toll-free number and entering your channel number and password. Then you start recording your podcast. Press the pound key and decide whether to publish your masteripiece. It's that simple. Once you post your new recording on the system, GabCast automatically generates an RSS Feed alerting subscribers that you've added an episode to your channel. The podcasts can be played back either using a web browser, iTunes, or today's addition: a plain old telephone. Before we get started, we've set up a demo system as usual so you can take the new GabCast Player for Asterisk for a spin. Just dial the number in the left margin and enter 1707 when prompted for the channel number. Enjoy the Nerd Vittles (sick) Joke of the Day. We promise not to add any more! Give us a break. It's just a demo site. If you're interested in some good Asterisk podcasts, try Phoneboy's channel 229 or one of the many Asterisk and TrixBox channels: 292, 1327, and 1493 to name a few. Now where were we?

GabCast Signup. Getting set up with GabCast couldn't be any easier. Go to their web site. Click the Sign Up tab. Agree to the Terms of Service and tell 'em you're older than 13. Fill in the blanks on the form including the password you want to use and a valid email address that you'll use to sign in. Wait for your return email, and you're all set. Log in to your account and click Create a new channel. Fill in the form and be sure to assign a numeric password to the channel. Click Submit and you're done. You'll use your channel number and the numeric password assigned for this channel to access your account by phone and record podcasts. Sign out of GabCast for the time being.

freePBX Setup. Setting up your TrixBox system for GabCast is equally simple. Log in to the freePBX administration section of your TrixBox server using a web browser: http://192.168.0.125/admin. Be sure to use your IP address, not ours. Type maint for your username and whatever password you created when you set up your system. Click on the Setup tab, and Gabcast should be in the list of options in the left column if you set up your system using the Nerd Vittles tutorial. If not, click Tools->ModuleAdmin, Connect to On Line Repository, check the Gabcast module, and then Download and Install it. Now reread this paragraph.

By clicking on the Gabcast link under the Setup tab, you can assign a phone number on your system that you dial to record new podcasts. Just enter the gabcast channel, the numeric password for the channel, and the extension number to be assigned to this channel. Save your settings and click the Red Bar to reload Asterisk. The alternative is to dial *422 (which spells G-A-B) to access GabCast. Then you'll be prompted for your channel number and password. Either way works ... unless you happen to be using a Sipura device for POTS phones. In this case you'll have to activate *422 in the Sipura dial plan to use it. Otherwise, you'll get a fast busy when you dial *422.

Sipura SPA-1001 Setup. If you took our recommendation and are using a Sipura device to enable use of plain old telephones in your home or office, then you'll need to modify the Dial Plan slightly. Point a web browser to the IP address of your device and then click Admin Login and then Advanced. Now click on the Line 1 tab and scroll to the bottom of the form. You'll see a field named Dial Plan. Carefully insert *422| after the first vertical bar in the field. So your dial plan entry should now look like this:

(*xx*xxxxxxxxxxx.|*422|*x*xxxxxxxxxxx.|[3469]11|0|00|[2-9]xxxxxx|xxxxxxxxxxxx.)

Click the Submit All Changes button and wait for your Sipura device to restart. Then pick up a phone connected to the device and dial *422, enter your channel number and password, and begin your recording career. Move over Elvis!

Accessing Your GabCasts. The gabcast site explains in detail the available options for listening to gabcasts. Just click on the Listen tab. Then click on a channel, and you can play the feed in your web browser. Or you can Subscribe to a channel and plug the RSS Feed into your favorite RSS Reader/Player including iTunes, Safari, and more than a dozen web portals. You also can insert a Player right into your web site.

Introducing GabCast Player for Asterisk. What was missing from all these features was a simple way to play gabcasts on your plain old telephone. Leave it to Nerd Vittles to close the gap, and today we do by introducing our new Gabcast Player for Asterisk. Once installed, you just pick up a phone and dial 422 for G-A-B. Choose the Channel you want to listen to and select the desired Episode to play. Then just sit back and listen on any phone or speakerphone connected to your Asterisk system. If you really want to get fancy, you can redirect a DID on your system to extension 422, and the whole world can dial into your GabCast Player from anywhere on the planet.

GabCast Player Installation. To get everything working, there are four steps. We'll add a little code to your dialplan in the extensions_trixbox.conf file in the /etc/asterisk folder. Then we'll download the player into /var/lib/asterisk/agi-bin and add a few custom sounds from Allison. And finally we'll add a new Misc Destination using freePBX Setup.

Adding the Dialplan Code. There are a couple of ways to add dialplan code. You can either log in to your server as root and use the nano editor to modify the dialplan (nano -w /etc/asterisk/extensions_trixbox.conf, or you can use the TrixBox web interface pointed to the IP address of your server: http://192.168.0.125/maint. Then choose Config Edit and pick extensions_trixbox.conf to edit. So pick your poison and add the following code into to the [from-internal-trixbox] context (a.k.a. section) of the file. Then save your changes.

exten => 422,1,Answer
exten => 422,2,Wait(1)
exten => 422,3,DigitTimeout(5)
exten => 422,4,ResponseTimeout(7)
exten => 422,5,Read(GABCAST,custom/gabcast-channel,5)
exten => 422,6,NoOp(${GABCAST})
exten => 422,7,AGI(gabcast.php|${GABCAST})
exten => 422,8,Playback(thank-you-for-calling)
exten => 422,9,Playback(custom/gabcast-visit)
exten => 422,10,Playback(goodbye)
exten => 422,11,Hangup

With nano, you save your updates by pressing Ctrl-X, Y, then Enter. With the web editor, you simply click the Update button. Remember that anytime you change your dialplan you'll need to reload your Asterisk settings for the changes to take effect. We're not going to do that just yet because we have to make a change in freePBX which will automatically reload Asterisk when we click the big Red Bar.

Installing the GabCast Player and Sound Files. Custom Asterisk apps such as our Gabcast Player live in /var/lib/asterisk/agi-bin on your Asterisk server. Custom sound bites go in the /var/lib/asterisk/sounds/custom directory. So log in as root and issue the following commands in order:

cd /var/lib/asterisk/agi-bin
wget http://nerdvittles.com/gabcast/player.zip
unzip player.zip
rm -f player.zip
chown asterisk:asterisk gabcast.php
chmod 775 gabcast.php
cd /var/lib/asterisk/sounds/custom
wget http://nerdvittles.com/gabcast/sounds.zip
unzip sounds.zip
rm -f sounds.zip
chown asterisk:asterisk gabcast*
chmod 664 gabcast*

Adding a Miscellaneous Destination to freePBX. One more step and we're finished. Start up freePBX using the IP address of your server: http://192.168.0.125/admin. Click Setup then Misc Destinations. For the Description, type gabcast. For Dial, type 422. Leave the --featurecode-- the way it is and click Submit Changes then the Red Bar. We're done. Just pick up a phone on your system and dial 422. When prompted for the channel, press 1707#. When prompted for the epidsode, just pick one or two and press the pound key... with apologies (in advance) to the ladies and others that are easily offended. You're a gabcast expert now. Enjoy!

Nerds' Corner. Today we introduce a new addition to our free software articles. In Nerds' Corner, we'll provide some insights into the programming hurdles, tips and tricks, and even some feeble insights into the actual code writing to give would-be Asterisk programmers a leg up with future projects. Let us hasten to add a disclaimer. We don't write PHP code that most good PHP programmers would be proud to claim. But our way makes this a one-day project instead of a week or a month. And our code is easy to read and easy to follow, almost self-documenting (which is every programmer's wet dream). It is anything but efficient. But with today's computers and the interactive nature of the applications we are writing, it really doesn't matter. If you'd prefer to study good PHP code writing, study the code for freePBX or a2billing, not ours. Having said that, let us hasten to add that our code works and is usually pretty close to bug-free. Why? Because we can actually read it and find problems before you do. Here's hoping we haven't jinxed ourselves. Be sure to also read the Comments posted below this article just in case.

The difficult issues implementing a player for gabcast all revolved around the MP3 files that actually store the podcasts. First, you need a way to figure out the filenames since they are stored in a hidden directory. Second, you need a way to convert the files into a format that Asterisk can play. And third, of course, you need a player that works with Asterisk and a telephone. Let's tackle them in reverse order. Asterisk includes an MP3Player command which would appear the likely candidate for playing MP3 files. Wrong! It doesn't work on TrixBox systems so we needed a way to convert the MP3 podcasts into a format that a TrixBox system actually could play. As luck would have it, the folks over at the Michigan Telephone Blog already had tackled this issue for podcasts so we started there. The final sticky wicket had to do with actually deciphering the file names of the MP3 files containing the podcasts. Well, the good folks at GabCast.com solved that one for us. It was so obvious it almost bit us. The RSS feed for each channel actually includes an enclosure tag with the MP3 filename in the metadata for each gabcast episode. It was smooth sailing after that. Take the channel number and retrieve the RSS feed for that channel. Then parse the metadata to strip out the MP3 filenames and subjects for each episode. Then prompt the caller for the desired episode, convert the MP3 file (using lame) to an MP3 format that will actually play using the Asterisk AGI playback command. It can play MP3 files if they are in the correct format and if you don't include .mp3 in the filename on the playback command line. Also embedded in the gabcast.php code, you'll find a good example of how to implement IVR technology in an Asterisk PHP script. In this case, we tell the user how many episodes are available and then prompt the user for the desired episode to play after using Flite to play the subjects of the five most recent episodes. If the user enters a number which is outside the appropriate range of existing episodes, then we play the most recent episode whether the user likes it or not. One final gotcha has to do with the numbering of the available episodes. If you look at a few channels on the gabcast site (such as ours), you'll notice that it isn't uncommon for a publisher to delete certain episodes leaving episode numbers which might look like this: 1, 4, 6, 8, 9. This information is available in the RSS feed, but it would complicate the IVR system. So we chose to merely count the episodes in the RSS feed and then number them from 1 to the total number of episodes reserving the highest number for the most recent episode. For most folks, this won't pose a problem because they probably won't be retrieving podcasts with both a web browser and a phone. Thus the mismatched numbering shouldn't matter. If it does, oh well!

One final note of caution. As distributed, the Nerd Vittles Gabcast Player is implemented as a single-user system. Each time someone calls 422, the system erases all existing podcast MP3 files from the previous session. Simultaneous calls would obviously be a problem with this architecture. But we did it so that the code would run efficiently even on a VMware TrixBox implementation. These MP3 files can be quite large depending upon the length of the podcast which can be up to 60 minutes long. The bottom line is that, if you plan to deploy this in a multi-user environment with multiple people simultaneously calling 422, then you'll need to modify the section of the code that deletes the previous MP3 files. You'll find it at line 165 with some commented-out code above it that will work better in a multi-user environment (but will consume more disk space saving prior MP3 podcast sessions).

Finally a special word of thanks to Allison Smith for doing her usual fine job recording voice prompts for this application. One day turnaround would be shocking and downright laughable in most businesses. Not so with Allison. It's her usual way of doing business which makes articles and applications like this one possible. Thanks, Allison!

BroadVoice Strikes Again. The BroadVoice geniuses are burning the midnight oil again. They've finally implemented Basic 911 "Service" for customers in the United States. Here is the important part of last night's customer announcement:

BroadVoice's main concern is customer safety and
satisfaction. For this reason, BroadVoice has made
Basic 911** service available to all U.S Customers.
...
** Basic 911 service is available for all U.S. customers.
Customers who have basic 911 service will receive one (1)
free 911 emergency call per year. Any subsequent calls
within a year will have a fee of $100.00 per call.

[BV goes on to say that "Enhanced" 911 Service calls are free
IF you register your address AND IF you agree to the following:]

YOU ACKNOWLEDGE AND UNDERSTAND THAT BROADVOICE
WILL NOT BE LIABLE FOR ANY SERVICE OUTAGE AND/OR
INABILITY TO DIAL 911 USING THE BROADVOICE SERVICE
OR TO ACCESS EMERGENCY SERVICE PERSONNEL DUE TO
THE CHARACTERISTICS AND LIMITATION OF THE BROADVOICE
SERVICE AS SET FORTH IN THIS DOCUMENT. YOU AGREE TO
DEFEND, INDEMNIFY, AND HOLD HARMLESS BROADVOICE,
ITS OFFICERS, DIRECTORS, EMPLOYEES, AFFILIATES, AND
AGENTS AND ANY OTHER SERVICE PROVIDER WHO FURNISHES
SERVICES TO YOU IN CONNECTION WITH THE SERVICE, FROM
ANY AND ALL CLAIMS, LOSSES, DAMAGES, FINES, PENALTIES,
COSTS, AND EXPENSES (INCLUDING, WITHOUT LIMITATION,
REASONABLE ATTORNEY FEES) BY, OR ON BEHALF OF, YOU OR
ANY THIRD PARTY USER OF THE SERVICE RELATING TO THE
FAILURE OR OUTAGE OF THE SERVICE, INCLUDING THOSE
RELATED TO THE BV 911 SERVICE.


We're guessing that the BroadVoice Bean Counters decided that, if they made the disclaimer obnoxious enough and the fee high enough for this great new service, it might cause all of their customers to have heart attacks which in turn would generate loads of 911 calls. Talk about kicking your customers while they're down. Now read the first sentence again... and then the part in the BIG LETTERS. They really do think the world is full of idiots, don't they? Yikes!


Nerd Vittles Demo Hot Line. You now can take a number of Nerd Vittles projects for a test drive... by phone! The current demos include NewsClips for Asterisk (latest news headlines in dozens of categories), MailCall for Asterisk with password 1111 (retrieve your email by phone), and Nerd Vittles Weather Forecasts by U.S. Airport Code. Just call our number (shown in the left margin) and take any or all of them for a spin. The sound quality may not be perfect due to performance limitations of our ancient Intel 386 demo machine. But the price is right.

Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you can host up to 6 domains with 30GB of disk storage and 750GB of monthly bandwidth. Free domain registration is included for as long as you have an account. That almost doubles last month's deal, and it really doesn't get any better than that. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money.

Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!

Introducing A Plug-And-Play Asterisk PBX for Windows

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.

Well, it's back-to-school time, and today we introduce the first free turnkey (aka preconfigured) Asterisk system. And it runs on the desktop of any Windows XP home or office computer. If you want a state-of-the-art phone system, look no further. Out of the box, it supports eight extensions and two lines with integrated voicemail and immediate email delivery of your incoming voicemail messages. To add additional extensions takes about 5 seconds. This PBX is just the ticket for a small business or a school or even a fraternity or sorority house. It's also perfectly suited for your home. You get every imaginable PBX telephony feature including music on hold, call forwarding, and call transfer as well as a preconfigured AutoAttendant which lets your friends and colleagues direct an incoming call to any of your extensions or even your cellphone. For those with the magic password, you can even dial in and get dialtone to make five hours of free calls each week to dozens of countries around the world including all of the U.S. and Canada, most of Europe, South and Central America, Australia and all your Far East favorites including China, Taiwan, Russia, and Japan. And the total cost: about $12.50 for each three months of service. All incoming calls are free, and you even get your very own area code and phone number to pass out to your friends that are still chained to plain old telephones or cellphones. And, yes, all your favorite Nerd Vittles applications are preinstalled and ready to go including weather forecasts for 1,000 airports, MailCall for Asterisk to read you your email messages, NewsClips for Asterisk to read you the news, and the AsteriDex robodialer complete with a web interface to place your outbound calls and to serve up customized CallerID for your incoming calls. Last but not least, you get all of the bundled TrixBox applications including freePBX, SugarCRM, Samba for Windows networking, FTP and SSH support, WebMin, PHP, MySQL, Perl, Apache, SendMail, integrated fax-to-email support, calling card billing, and more. It slices, it dices ... You get the idea.

Prerequisites. To take advantage of all this magic, there are only three things you really need that aren't provided here. First, you'll want a desktop computer from a reputable manufacturer that is less than two years old. It should be running a fully-patched, current version of Windows XP with at least 384MB of RAM and 3 spare gigs of disk space. The more RAM the better, and 1GB is ideal if you'll be using your Windows desktop for other simultaneous tasks. Second, a broadband Internet connection with a network firewall/switch that hands out internal IP addresses using DHCP is required. Finally, you'll need to set up accounts with two Internet Telephony Hosting Providers (ITHPs). And we recommend you go for three! That's where the $12.50 comes in. Everything else you'll need can be downloaded at no cost using links in this article. So let's get started.

Installing the VMware Player. VMware is virtualization software which lets you run another operating system on your desktop. The TrixBox/Asterisk PBX application runs under CentOS Linux which is a RedHat Linux derivative. Your desktop is Windows XP, hence the need for VMware. The VMware Player software is free, and it lets you "play" today's prebundled Linux application in a window on your Windows Desktop. On a current generation PC with plenty of RAM, this VMware application runs as fast as Asterisk on a dedicated Linux machine so don't worry too much about performance. Based upon our testing, it's a non-issue. We're going to provide the preconfigured application (all 640 megabytes of it!), but you'll first need to download the free VMware Player and install it on your Windows system. Just follow the prompts and accept the defaults. Once the install completes, reboot your Windows machine.

Today's Game Plan. For long-time readers of Nerd Vittles, be advised that today's article is a little different. We're actually going to be eating our own dog food. What we've done is build a TrixBox system from the ground up. Then we loaded all the Linux, TrixBox, and freePBX updates as well as the dozens of enhancements which we write about each week. Then we configured the system so that it's ready to go ... out of the box! Once you secure the system with your own passwords and plug in the account names and passwords provided by your ITHPs, you're all set. We'll walk you through plugging in IP telephones, or regular cordless telephones such as our Vtech favorite (below) using a Sipura SPA-1001 (under $60 on Froogle), or downloading a free IP softphone. And, in about 15 minutes, you're done! Phones ring, voicemail works, voicemail messages get delivered to your email account, and music on hold works. We've even provided a working Stealth AutoAttendant that we'll tell you about shortly. And, for all our Mac fans, not to worry. VMware will have a player for your shiny, new Intel-based Mac shortly. Sign up for the beta here.


While you're enjoying your new phone system, you can read all about TrixBox and Asterisk and freePBX using our Quick Reference Guides, and then you can reconfigure the system to your heart's content. If you happen to break something, simply start over by reinstalling the VMware image (which hopefully you will zip up and burn to a CD for safekeeping). In exchange, you'll avoid the all-day knuckle drill of getting everything set up again from scratch. For those that are already TrixBox addicts, you may want to install this version just to take a look at how we've integrated most of the tips and tricks we've written about this past year. And feel free to share your own enhancements as comments to this article. We'll update the VMware image from time to time to take advantage of everyone's suggestions.

Let me also offer an apology to our foreign friends. This project necessarily required some assumptions in order to preconfigure everything. So here they are. We've assumed that you live in the United States, and that you place calls by dialing a 1 + a 3-digit area code + a 7-digit number or by dialing a 3-digit area code and a 7-digit number. Our out-of-the box configuration can be easily changed to support other telephone systems and dialplans around the world. Ninety per cent of our readers are in the United States so the system was built with that in mind. We've also left international calling out of the dialplan. It, too, can be added easily. The reason we left international calling out was to minimize the risk of abuse and associated financial problems. While many international calls are free or almost free with the providers we are recommending, there are numerous locations (including most countries surrounded by water not to mention cruise ships circling the world) where telephone calls are still VERY expensive. Our recommendation is to adjust your dialplan to accommodate international calls where you know what the cost of the calls will be and you're willing to absorb those costs. One other cautionary note, and we'll get started. As configured, this system does not support 911 calls. Some ITHPs support 911, but the ones we're going to be talking about today do not. So plan accordingly NOW!

Finally, a word about bandwidth. This application is huge. The download weighs in at over 600MB. Don't even try it with a modem! Bandwidth to cover downloads costs money. We've sprung for a terabyte of bandwidth each month just to support downloads of this application ... which is and always will be free. Funding for this bandwidth was provided by some generous readers of our past columns. Thank you! If there are sufficient future donations during the coming months, we'll buy additional bandwidth. Otherwise, the application will vanish when the terabyte of bandwidth is exhausted. It will be available again on the 11th day of the coming month until the terabyte is once again exhausted. So, as they say, the early bird ...

Installing nv-TrixBox. After you have the VMware Player installed, you're ready to download today's application. If you know how to use BitTorrent, please grab the torrent file from here and save our precious bandwidth. Otherwise, our good friends at vmwarez.com have agreed to host this download (and Jim has embellished it a bit from our original creation to include some VMware tools which enhance the performance of the application). So just click here or BubbaPCguy's mirror, and download the file. If, for some reason, those sites are down, you can use our site by clicking here. Then save the zipped file to your Windows Desktop.

Once the download finishes, click on the nv-trixbox.zip file on your Desktop. Choose extract all files. When prompted for the destination to unarchive the files, type C:trixbox and press Enter. Have a cup of coffee while the archive decompresses. When it's finished, run the VMware Player. Accept the license agreement and then browse to the trixbox folder on Drive C and select trixbox.vmx. If you get an error about a missing IDE drive, just tell VMware not to look for it again and continue. When prompted whether to create a new identifier, choose Create and click OK. The Linux Kudzu Configuration Utility will load advising you that it can't find my network card in your computer. Move your cursor to the VMware Player window and click once to give it focus. Then press Enter to run the utility. With Remove Configuration highlighted for the network card, press Enter again. When Configure your network card is highlighted, press Enter again. Finally, when the Configure TCP/IP screen appears, press the Space Bar to select Use Dynamic IP Configuration. Then tab to the OK button and press Enter. Linux will whir away for a minute or two and boot your TrixBox system.

At the Linux login prompt, type root for your username and press Enter. Then type password for your password and press Enter again. We're not going to remind you to press Enter any more. After entering commands in Linux, you press Enter to execute them. Now you're an expert! Once you're logged in, your TrixBox server will tell you the private IP address for your system (to access it with a web browser). Write it down! Now issue the command ifconfig and write down the MAC address of your network card: HWaddr. We'll need them both in a minute.

Securing Your TrixBox System. You don't leave your keys in your car at a shopping center, and you don't run a Linux system with a root password of password. There are numerous passwords on this system. If you're going to be the one and only administrator, we recommend setting them all to the same, secure password. Don't forget it, or you go back to Go! Now enter the following commands to reset the passwords:

passwd
passwd admin
passwd-maint
passwd-amp
passwd-meetme

We don't recommend exposing your Asterisk system to the public Internet unless you are an expert in all things Internet ... especially security. This is even more true with this TrixBox system. There are lots of applications running that crackers love to attack: SendMail, FTP, Windows Networking, Apache Web Server, PHP, and even Asterisk. As delivered, this system includes a Windows share of the entire TrixBox system which is wide open and requires no password to access it. This makes it easy for you to copy stuff to your new system from any Windows, Mac, or Linux machine. It also makes it incredibly easy for an outsider to totally destroy your system. That's why you made a backup CD of the nv-trixbox.zip file. Right?

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 AT&T, 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 by you 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://trixboxIPaddress/a2billing/ using the actual internal IP address of your Asterisk server which you wrote down. 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 extensions_trixbox.conf and reload Asterisk. But we'll save that for another day.

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://trixboxIPaddress/crm/ substituting the private IP address of your Asterisk box, of course. 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.

Reserving An IP Address in Your Router. Your PBX has to consistently boot up with the same IP address or your phones (and calls) won't be able to find the Mother Ship. Since we're using DHCP to initially obtain the IP address, we need to tell your router to always hand out this same address to your TrixBox system. Almost all routers make it easy to preassign DHCP addresses. Use a web browser to access your router's configuration screens. What we're looking for is generally under the tab for LAN IP Setup or DHCP Configuration and is usually called something like Reserved IP table. Just add an entry and call it Asterisk PBX and specify the IP address and MAC address that you wrote down above. Now each time you reboot your Asterisk server, your router will assign it this same IP addreess.

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 3GB 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.

Adding Plain Old 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 if 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 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.

Using an IP Softphone. 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.

Using a SIP Phone with Your System. There's loads of SIP Phone hardware in the marketplace, some better than others. We've written about some of them on Nerd Vittles, and you can use Google or the Asterisk forums to get a good feel for which ones work and which ones are a waste of money. If you want the bleeding edge phone that supports virtually every feature that Asterisk has to offer, then the GrandStream GXP-2000 is the phone for you. We use one and love it. Some of my colleagues think it is better suited for the non-business environment. In any case, it's a great phone to learn about Asterisk. With careful shopping, you can find one for about $80. Don't buy support or an extended warranty. They're both a waste of money. You configure the phone almost identically to softphone shown above. For home use, we still think the SPA-1001 and a good 5.8 GHz cordless phone system with multiple handsets is the way to go.

Adding Internet Telephony Hosting Providers. Just as you need an account with an Internet Service Provider to reach Google or Yahoo or Dreadful AOL, if you want to make phone calls to folks with Plain Old Telephones outside your Asterisk system, then you've got to have telephone trunks to carry conversations from you to them and back again. For the default system today, we've preconfigured it to support an outbound trunk from VoipDiscount.com and an inbound and outbound trunk from StanaPhone.com. Before you sign up for anything, read our two articles about these providers by clicking on the links in this paragraph. In a nutshell, VoipDiscount.com provides incredibly cheap outbound calling to a number of countries. However, you have to cough up about $12.50 every three months to keep your account "current." They're also a little slick in that they frequently change calling rates and calling locations which are free. Having said all that, it's still the best calling deal on the planet. You just need to understand the ground rules and the slippery slope issues so you don't get blind-sided. StanaPhone provides free DID numbers in a New York area code and free incoming calls for those with an account. Even their charges for outbound calls are quite reasonable. To get your system working, you'll need to go to each of these providers' web sites using Internet Explorer on a Windows PC, sign up for an account, and download their softphones. That's the only way you can figure out what your account name and password are. We also recommend you put $10 in your StanaPhone account. Then, based upon reports from lots of users, you'll never have to worry about them disconnecting your free incoming service or your free phone number. Again, read our two articles which will tell you everything you need to know. Don't worry about all the settings, we've taken care of all of that for you. The objective is to get your free phone number and your account names and passwords. Then we'll plug those into your Asterisk system so you can start enjoying free incoming calls and mostly free outbound calls. Once you get your account numbers and passwords, move on to the next step, and we'll show you how to plug them into your Asterisk system and begin making and receiving calls.

There are others who want a local phone number and more reliable service. For them, we continue to recommend TelaSIP. $14.95 a month gets you unlimited calling in the U.S. and a local phone number in your choice of area code. If you want to start out on a pay-as-you-go plan, $5.95 a month gets you a local phone number and 2¢ per minute calls in the U.S. They don't provide a lot of hand-holding, but their service is rock-solid reliable. For a list of all our service provider reviews, go here. Or just read our Internet Telephony Provider Shootout to see why TelaSIP remains our top pick. If you decide to go with TelaSIP, our Newbie's Guide to TrixBox will show you how to configure it.

Configuring Your TrixBox System. This should take you less than five minutes! We've eliminated most of the configuration hassles with your new Asterisk system by preconfiguring almost everything. About all that you'll need to do to get a fully-functioning system is to plug in your account names and passwords for your two ITHPs and enter your email address for delivery of your voicemails and faxes. Here's how.

Using a web browser, point it to the IP address of your new TrixBox system. When the TrixBox Main Menu appears, click System Administration. When prompted for your username, enter maint followed by the password you configured for your system above. When the Configuration and Administration Menu appears, click freePBX. freePBX is another open source project that puts an incredibly simple but complete web interface on your Asterisk PBX. When the freePBX Main Menu displays, click Setup. Now click Trunks in the left column of the display. On the Trunks setup screen in the right column, you'll see that we've preconfigured two trunks: one for voipdiscount and one for stanaphone. Click on SIP/voipdiscoun to display the voipdiscount setup screen. Scroll down to the PEER Details section. Replace yourname with your account name in three places: authuser, fromuser, and username. Replace yourpassword with your password in the line which reads secret=yourpassword. Now scroll to the Registrationsection at the bottom of the screen. Replace yourname:yourpassword@sip.sipdiscount.com with your actual account name and password. Leave everything else as it is. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk.

We're going to make similar changes in the Stanaphone trunk settings. Click on SIP/stanaphone to display the StanaPhone setup screen. In the Outbound Caller ID field, enter the 10-digit phone number you were assigned by Stanaphone. In the Peer Details section, replace youraccountnumber in username=youracctnumber with your assigned account number, not your phone number! Replace yourpassword in secret=yourpassword with your assigned password. Repeat the drill in the User Details section on the form. Then, in the Registration String, carefully plug in your account number, then a colon, then your password, then @sip.stanaphone.com/, then your assigned 10-digit phone number. Leave everything else as it is. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk.

If you want voicemails delivered to you by email, you'll need to plug in your email address. Click on Extensions in the left column of freePBX. Then click Home - 500 in the right column to display the settings for extension 500. Scroll down to the VoiceMail and Directory section of the form, and enter your email address in the email address field. Then change the Email Attachment field to Yes. If you'd like the system to automatically delete your voicemails after emailing them to you (with the message), change the Delete Vmail option to Yes. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk. Your system now is fully operational.

If you'd like to add support for transferring calls to your cellphone, click Misc Destinations in the left column of freePBX, and then click Cellphone in the right column. Enter your 10-digit cellphone number in the Dial field. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk.

If you'd like to add fax support so that incoming faxes to your Stanaphone number get emailed to you, click on General Settings in the left column. Scroll down to Email address to have faxes emailed to and plug in your email address. Do NOT change the origination email address, or you won't receive anything. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk.

Setting the Default Time Zone. Your TrixBox system is set to use Eastern daylight or standard time (depending upon the time of the year) as the default time zone. This matters when you're scheduling reminders and wake up calls. If it's not correct for your location, the easiest way to change the time zone is using WebMin. Log into your server as root and issue the following command to start WebMin: /etc/webmin/start. Then, using a web browser, go to: https://TrixBoxIPaddress:10000/. Log into WebMin with the username root and the password you assigned to your root account. At the WebMin Main Menu, click Hardware then System Time. Scroll down to the TimeZone section and use the pull-down menu to select the desired time zone. Then click the Save button immediately below the Time Zone field. When you restart your TrixBox system, the time zone will be correct, and WebMin will automatically be shut down.

Fixing Our Oversight. If you're going to be using the weather and news apps, you'll need to delete the sound files that are built on the fly each time you use them. The easiest way is to add a cron job that just deletes them each night. Log in as root and edit the main crontab file:

nano -w /etc/crontab

Then move to the bottom of the file and add this line:

01 0 * * * root rm -f /var/lib/asterisk/sounds/tts/tts*

Now save the file: Ctrl-X, Y, then press Enter. You're done.

Taking Your TrixBox For A Spin. For a list of Feature Codes supported by your new system, click on Feature Codes in freePBX and print the list. Pick up a phone and dial any one of them. To make an outgoing call, take a phone off-hook and dial either a 10-digit number in the U.S. or 1+10-digit number. Then, using a cellphone or someone else's POTS phone, dial your Stanaphone number to be sure it's working. You should get a welcome message, and then your phone or softphone will ring.

We call the welcome message a Stealth AutoAttendant. What that means is that, while the message is playing, you can do some other things with your system. For example, by pressing 1, your call will immediately ring extension 500 on your system. Pressing 2 will ring extension 501. Pressing 3 will ring your cellphone. Pressing 8 and entering 56789# will give you dial tone to make a long distance call through your PBX. Pressing nothing will cause all of the extensions on your system to ring two seconds after the message completes.

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 above. 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.

What Time Is It? On some computers (mostly high end ones as it happens), VMware has a hard time keeping the correct time. Since many telephony applications are time sensitive, you'll want to monitor this for a few days and see if your system is having problems. Logging in to your server and typing date will display what time your computer thinks it is. We've added a cron job to this application that updates the time using NTP every 15 minutes. That should resolve the problem. If not, post a comment and let us know.

The Nerd Vittles Collection. We'll wrap it up for this week by pointing you to some tutorials for the Nerd Vittles applications that are preloaded in this TrixBox build. 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. In our next column, we'll cover some setup tips and other neat tricks you can do with TrixBox and freePBX and Asterisk including customization of the AutoAttendant to meet your specific needs.

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 (Dail 611)

Telephone Reminders for Asterisk - Appointment Reminders By Telephone (Dial 123)

Where To Go From Here. If you're new to the Asterisk world, you have lots of fun (and learning) ahead of you. The best place to start is our Newbie's Tutorial. We've already done most of the work for you. It's an easy read which covers many topics that we didn't get to today. So start there. 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 me questions either! We only accept thank you notes. 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!


Nerd Vittles Demo Hot Line. You now can take a number of Nerd Vittles projects for a test drive... by phone! The current demos include NewsClips for Asterisk (latest news headlines in dozens of categories), MailCall for Asterisk with password 1111 (retrieve your email by phone), and Nerd Vittles Weather Forecasts by U.S. Airport Code. Just call our number (shown in the left margin) and take any or all of them for a spin. The sound quality may not be perfect due to performance limitations of our ancient Intel 386 demo machine. But the price is right.

Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you can host up to 6 domains with 30GB of disk storage and 750GB of monthly bandwidth. Free domain registration is included for as long as you have an account. That almost doubles last month's deal, and it really doesn't get any better than that. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money.

Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!


Some Recent Nerd Vittles Articles of Interest...

Introducing AsteriDex III: A Web-Based Robodialer for Asterisk and Trixbox

It's another free software day at Nerd Vittles, and we have the third generation of our Asterisk® database dialer utility for you. The original AsteriDex was a web-based AutoDialer on Steroids. It let you store and manage phone numbers of all your friends and business associates with an easy-to-use MySQL database. Then you could call up the application in your favorite web browser from anywhere and click on the contact you wanted to call, and Presto! AsteriDex first called you at the number you designated for this contact, and then AsteriDex connected you to your contact through an outbound call made using your Asterisk server.

For those lucky enough to have GrandStream's GXP-2000 IP phone with AutoAnswer, you could even configure AsteriDex to automatically activate the speakerphone and then place the call to the contact you selected. In short, the original worked much like Microsoft's TAPI software without the configuration nightmare or your favorite (required) Micro$oft bloatware. Installation and configuration for your Asterisk@Home system was a snap and took less than 10 minutes. It also worked with vanilla Asterisk running the Asterisk Management Panel (AMP) software. AsteriDex was quick to implement and simple to use because it only did one thing, but did it well. The AsteriDex autodialer placed calls to all your favorite callees using a web interface.

Version Two added two new features. First, you could use AsteriDex to automatically look up CallerID Names in your MySQL database for all your incoming calls. And, second, you could dial a person in your database by spelling up to five characters of the person's name using any phone in your home or office, and AsteriDex automatically placed the call for you just as if you'd use the web browser interface. To use this feature, you just dialed 00 plus the one to five-digit code of the person to call. In Version Three, we've cleaned things up a bit more. The web interface now displays contact phone numbers and speed dial numbers regardless of whether you're using Internet Explorer, Firefox, or Safari. The speed dialer now tells you who's being called using the Flite speech synthesis engine built into every new (free) TrixBox server. And, last but not least, we'll show you how to install AsteriDex for multiple people in your home or office.

In case you're wondering, "Can you do the same thing with SugarCRM?" Well, sorta but not really. If you need full-blown contact management, then SugarCRM may be your thing. Just don't expect it to be a weekend project. CRM is really for folks whose lifeblood is contact management. If that's you, great! But for the rest of us that just wanted a phone and web-based autodialer that's simple to set up and easy to use, AsteriDex is just the ticket. You can add a contact to AsteriDex in under 10 seconds. You can delete one faster than that. And making changes to existing entries is a breeze as well. So let's get started.

AsteriDex Overview. Here's a brief overview of how all this works and the installation process. Then we'll install the pieces. How does it work? It's simple. When you call up the web application, you're presented with a tabbed and alphabetized listing of all your friends and business associates. You add the names and phone numbers of friends and business associates to a MySQL database table on your Asterisk machine. We'll show you how, and we've even provided the names and numbers of some of your favorite airlines to get you started. For each entry, you specify not only the phone number of the contact but also your phone number for placing calls to this party. You can also tell it to use a default phone extension for outbound calls. When you click on someone's name in the web application, AsteriDex swings into action and places two calls. First, it calls you at the number you've designated. When you answer or your answering machine does, AsteriDex places a second call to the person or business you selected. It then joins the two calls together, and presto: a phone conversation is born. It works exactly the same way with the phone-initiated speed dialer. Just dial 00 and then up to five characters of your friend's name to place a call. And, in our next column, we'll wrestle with CallerID enhancements for TrixBox and show you how to configure AsteriDex and TrixBox to display a matching CallerID Name out of your customized database.

To install AsteriDex, we'll first download the software. Then, we'll walk you through the two-minute drill to configure the app to meet your own requirements. Next, we'll put the pieces in the right places on your Asterisk server. And finally, we'll crank up AsteriDex and make a test call.

Securing AsteriDex. If AsteriDex came preinstalled on your TrixBox system, there may be a security vulnerability. Just to make sure your system is protected, download and install this simple patch. Log into your Asterisk server as root and issue the following commands:

cd /var/www/html/asteridex
rm -f callboth.php
wget http://nerdvittles.com/trixbox11/callboth.zip
unzip callboth.zip
rm -f callboth.zip
chown asterisk:asterisk callboth.php
chmod 775 callboth.php

AsteriDex Prerequisites. To make all this work, we recommend you install TrixBox using our soup-to-nuts tutorial. It won't cost you a dime if you have an old clunker PC lying around. Otherwise, you'll need to install Flite, freePBX, the Apache web server with PHP, phpMyAdmin, and MySQL support on your Asterisk machine. Also make certain that your Asterisk server is secure before exposing your web server to the Big Bad Internet. You can read all about it here. Finally, we recommend using an SSH client and/or a secure FTP client to load and configure stuff on your Asterisk machine unless you just like sitting in front of your server. SSH comes with every Mac and the syntax is simple: ssh root@AsteriskIPaddress. If you're still chained to Microsoft, download Putty from the Mother Country, and you can do the same thing using any Windows machine.

Downloading AsteriDex. Step 1 is to download the application, and you can do that by clicking here. We've packaged AsteriDex in a ZIP file so save it to your Desktop and unzip the file so you can get to the asteridex folder. If you're upgrading from a previous version of AsteriDex, export your asteridex MySQL database and then import it into your TrixBox system. We'll show you how below.

Installing AsteriDex Into MySQL. If you're using AsteriDex for the first time, here's how to load the MySQL database for AsteriDex. Access your TrixBox system using a web browser and go to Asterisk->System Administration->phpMyAdmin. When the program loads, look in the left pane immediately below the phpMyAdmin logo and click on the SQL icon. When the SQL window opens, click on the Import Files tab and then the Choose File button. Click on Desktop->Asteridex->mysql and choose the asteridex.sql file. The file name now should be displayed in the SQL window pane. Using the default utf-8 character set, click the Go button to load the database into MySQL. You should get a pretty display which says, "Your SQL query has been executed successfully." Just to be sure, click on the user1 table in the left pane, and then click the Browse tab at the top of the right pane. This is one way to make changes to your Asteridex address book: Asterisk->System Administration->phpMyAdmin->Asteridex database->user1 table->Browse. You can click the pencil icon beside an entry you want to modify, or click the red X icon to delete an entry from your table. It's permanent so be careful. To Add new entries to the table, click the Insert tab at the top of the right phpMyAdmin panel. Leave the ID and DialCode fields blank. ID will get filled in automatically, and DialCode is the speed dial entry for this person. Enter a name for the person or business. For people, we recommend Lastname, Firstname. If you leave the asterisk (*) in the IN field, AsteriDex will call you on your default phone before placing the outbound call. We'll get to default calls in a minute. If you'd prefer to always be called at a specific extension, enter the extension number, e.g. 204. Do not enter sip/204! We'll do the heavy lifting for you. Congratulations! You're now a database expert. Just come back and fill up your Little Black Book once we get finished with the installation. Actually, you won't have to use phpMyAdmin, but we wanted you to know it's always an option.

Upgrading AsteriDex Using an Existing AsteriDex MySQL Database. If this is your first time using AsteriDex, you can skip this section. If you've been using AsteriDex with an Asterisk@Home or Asterisk system and want to move your database over to a new TrixBox system, here's how. On your old system, use phpMyAdmin to access MySQL. It's under the Maintenance tab in AMP with Asterisk@Home systems. Once you're in, click on the Export link in the right frame. Click on asteridex in the database column to select it, and then uncheck Use hexadecimal for binary fields. Finally, click the Save As File checkbox and then the Go button to export the database to your desktop. You'll end up with a file named localhost.sql on your Desktop. That completes the export.

To import your MySQL database into your new TrixBox system, point your web browser at the IP address of your machine. Then click System Administration and enter maint for your username and whatever password you assigned when you set up your system. Now click on phpMyAdmin and follow the installation steps above except use localhost.sql from your Desktop when prompted for the name of the database to import.


Configuring TrixBox for AsteriDex. There are a couple configuration steps for the AsteriDex application before we can drop in the web code and try it out. We need to add a dialout context at the bottom of the extensions_trixbox.conf file. A copy of the context is included in the /freePBX subfolder of the asteridex folder on your desktop. Here's the code you'll need, but you can't just drop it in. First, you need to figure out which dialout trunk will be used to place the outbound leg of the AsteriDex calls. Just keep in mind that, using the web interface, AsteriDex actually places two calls, one to you and one to the person you want to talk to. So be sure you have a channel for each of the calls if you opt to use a non-local extension for your incoming call. Anyway, what you need below is the trunk number that you want to use for the outbound calls. You can look these up by going to TrixBox->System Administration->Config Edit->extensions_additional.conf. Then look at the Global variables OUT_0, OUT_1, etc. Identify the number of the one for the VoIP provider you want to use and then replace the bolded 0 in line 3 below with that number. If you want a fallback provider in case your first choice is down, then copy the line 3 code below to the next line, substitute your second choice provider number for 0, and then renumber the lines: 1, 2, 3, 4, and 5. Once you get the code the way you want it, cut and paste just the code snippet below to the end of the extensions_trixbox.conf file and restart Asterisk.

[custom-callboth]
exten => _1NXXNXXXXXX,1,Wait(1)
exten => _1NXXNXXXXXX,2,Background(pls-wait-connect-call)
exten => _1NXXNXXXXXX,3,Macro(dialout-trunk,0,${EXTEN},)
exten => _1NXXNXXXXXX,4,Macro(outisbusy) ; No available circuits

Editing the Caller Location. One more configuration step, and we'll be ready to drop in our web application. Open the asteridex folder on your desktop and then, using your favorite text editor, open callboth.php (nano -w callboth.php). We're going to set four variables (beginning on line 26) to meet your local needs. The variables look like this now.

$INdefault = "SIP/200" ;
$INtrunk="SIP" ;
$LDprefix="1" ;
$CallerID="6781234567" ;

Move to the above lines using your editor, and set $INdefault to the extension you want to ring where you want to take phone calls being placed with AsteriDex. If it's a SIP phone or a PSTN phone connected to an ATA, the sip syntax shown is correct. Just plug in the appropriate extension. If you'd prefer to send the calls to a ring group so multiple phones ring when you place a call, the syntax is local/222@from-internal where 222 is the number of the ring group you want to use. If you're using an IAXy extension, the syntax is IAX2/244. You also have the option of ringing any other telephone or cellphone even though it's not a local extension on your Asterisk PBX. Just make sure you have sufficient outbound trunks to support two simultaneous calls. The syntax for an external phone is SIP/telasip-gw/16785551212. Substitute your VoIP provider for telasip-gw and plug in the phone number with the prefix, if any, required to place calls through this provider. For those lucky enough to have GrandStream's GXP-2000 IP phone with AutoAnswer, you can configure the GrandStream phone to automatically answer and activate the speakerphone for incoming calls on a specified extension. To take advantage of this, just set $INdefault to this extension (SIP/267), and your GrandStream will go off-hook automatically each time you place a call using AsteriDex. Too cool! P.S. Some Aastra/Sayson IP phones can do the same trick.

$INtrunk defines the protocol which will be used to place calls to you (i.e. inbound) assuming you make entries in your database that specify an actual extension rather than using an asterisk (*) to force incoming calls to the $INdefault setting. For SIP phones or PSTN phones through an ATA, use SIP. For IAXy extensions, use IAX2. For PSTN calls using Asterisk cards, use ZAP.

$LDprefix defines the dialing prefix to be used for outbound calls to numbers stored in your database. Our recommendation is to enter all phone numbers in your AsteriDex database as 10-digit numbers. Then control the required dial string for your outbound provider by adding this dialing prefix. If your provider doesn't require a prefix for outbound calls, just delete the 1 above and leave the two double quotes with no space between them.

$CallerID defines the CallerID string for your outbound call. Most VoIP providers (other than TelaSIP) don't let you change this so just enter the 10-digit number associated with your outbound trunk, if any.

When you finish making all the entries above, save the file in ASCII text format.

Loading AsteriDex On Your Apache Web Site. The web site that is served by your Asterisk machine is stored in /var/www/html. For use behind your firewall/router, you can access the site at http://192.168.0.133/ substituting the private IP address of your Asterisk machine, of course. What we want to do now is copy the asteridex folder on your desktop to /var/www/html so that the site can be accessed at http://192.168.0.133/asteridex/. Don't forget the trailing slash mark, or you may see nothing. If you have turned on Internet access to your web server by mapping http and port 80 traffic to the private IP address of your Asterisk server, then keep in mind that ANYONE can run the application by simply going to your public IP address/asteridex with a web browser. This probably isn't a real good idea. There are numerous methods to protect the AsteriDex web site if you decide to go "public." The most secure way is to copy the asteridex folder into /var/www/html/maint. Apps in this folder require your maint username and password for access. So you then could access AsteriDex at this site address: http://192.168.0.133/maint/asteridex/ (substituting the private IP address of your Asterisk machine or your public IP address, of course)


Activating AsteriDex Admin Interface. You didn't really think we'd leave you with nothing but phpMyAdmin to maintain your AsteriDex database, did you? Well, you were right. There is an admin interface for AsteriDex. But, before you can use it, you have to designate the IP address of the desktop machine you'll be using with it. Go to the AsteriDex directory on your Asterisk web site: cd /var/www/html/asteridex. Now carefully edit the admin interface program: nano -w admin.php. On the second line, you'll see the following IP address: 192.168.0.107. Unless this just happens to be the IP address of your desktop machine that you want to use to administer AsteriDex, it needs to be changed to the correct IP adddress. Don't change anything else including the punctuation. Now save your changes: Ctrl-X, Y, then press enter. You now should be able to call up the Admin interface with the following link: http://asteriskboxIPaddress/asteridex/admin.php. That's a big pain in the rear if the only person that will be using this system is you. So here's a shortcut. While you're in the AsteriDex directory, enter the following command: echo 123 > admin and press enter. That will create a file called admin with 123 as the contents. Henceforth, when you run AsteriDex, the admin option will appear as an additional tab. You still have to be using the correct machine to access it, however. Not sure of your machine's IP address? Just access the Admin option once, and it will quietly return you to the ABC tab. But, if you look in your browser's command window, it will have the IP address of your workstation identified following ip= on the command line. That's the IP number you need to insert on the second line of the admin.php file. We're going to gamble that once you see the interface, you'll be able to figure it out on your own. Just a word of warning: the delete entry option does just that. No warnings. No second chances.

Taking AsteriDex For A Test Run. Once you drop the folder in place on your web site and get it named, you should be ready to roll. Use your favorite web browser to call up AsteriDex and click on one of the included airlines to place a test call. Your web browser will display the contact's phone number as you drag the mouse over an entry. Once you click on a link, a separate browser window will pop up momentarily, and then the default phone you designated should start to ring. Pick it up, and your outbound call will be placed. Book a nice trip to Hawaii for your friend, Ward Mundy, and then hang up and send me the ticket. Wasn't that easy!

Activating the RoboDialer. We mentioned at the outset that this updated version of AsteriDex now lets you place calls from any touchtone phone using your AsteriDex phonebook. Here's how. First, as you add new entries, specify a one to five-digit DialCode for the entry. These codes must be numbers that correspond to the numbers on your touchtone phone obviously. You can make them anything you like. We prefer a number that matches the first four characters of our friends' first names, but again that's up to you. Once you get your database loaded up with DialCodes, then we need to drop another little block of code in the top section of the extensions_trixbox.conf file. Here's what the code looks like so just add it to the [from-internal-trixbox] context at the top of the file. This setup will use your default TrixBox dialing rules for the calls:

exten => _00.,1,SayDigits(${EXTEN:2},) ; extensions dialed with 00 prefix get looked up in AsteriDex
exten => _00.,2,EAGI(asteridex.agi|${EXTEN})
exten => _00.,3,GotoIf($["${DIAL:0:2}" = "00"]?97)
exten => _00.,4,NoOp(Number to Dial: ${DIAL})
exten => _00.,5,NoOp(Person to Dial: ${DUDE})
exten => _00.,6,Flite("Connecting to: ${DUDE}. One moment please.")
exten => _00.,7,Goto(outbound-allroutes,${DIAL},1)
exten => _00.,8,Hangup()
exten => _00.,97,Playback(num-not-in-db)
exten => _00.,98,Playback(goodbye)
exten => _00.,99,Hangup()

Finally, we have an AGI script which you'll find in the agi-bin folder of the asteridex code you downloaded to your desktop. The file name is asteridex.agi. Copy this file to the /var/lib/asterisk/agi-bin folder on your TrixBox server and, while logged in as root, change the ownership of the file: chown asterisk:asterisk /var/lib/asterisk/agi-bin/asteridex.agi. And then change the file permissions to make the file executable: chmod 775 /var/lib/asterisk/agi-bin/asteridex.agi. After you reload Asterisk (amportal restart), you should be all set. Pick up a phone on your system and dial 00 plus the DialCode of someone in your database and Shazam!

Configuring AsteriDex for Multiple Sites. The web-based interface of AsteriDex is designed to call you at a specific phone number or ring group when you click on a contact in the database. But suppose you want to use AsteriDex either in multiple locations or with simultaneous users each with a different phone number. The only trick here is to decide up front whether all of the sites and/or users will be sharing the same phone book.

If all of the users or sites will be sharing the same phone book, then it's quite simple to customize AsteriDex for multiple users or locations. Just copy the /var/www/html/asteridex directory to a new location with a new name, e.g. /var/www/html/lakehouse or /var/www/html/janet. Once you've copied all the files, you'll need to adjust the callback number and IP address of this site or user. To adjust the callback number, review the Editing the Caller Location section above. To adjust the IP address, review the Activating AsteriDex Admin Interface section above.

If you want each user or site to have their own phone book, then the project is more complex. You either have to make duplicate copies of the asteridex database (with different names, of course) or you have to make additional user1 tables such as user2, user3, etc. You'll also need to create a duplicate asteridex.agi script with a new name for each user. Then you'd edit the asteridex_lookup subroutine to match your new database or table name. Next you'll need to repeat the steps above to duplicate the asteridex web directory. Once you have the new directory in place, you'll need to edit each of the php files and change all instances of either the database or table name and the agi script name to match your new file names. Finally, you'll need to adjust the dialplan code in Activating the RoboDialer to match your new script name. HINT: As currently written, AsteriDex really wasn't designed to have different databases for different users. In case you haven't caught on yet, it would be just about as easy to start over as to try and rework our code to make the square peg fit in the round hole. Note that the existing database does have a facility to support different call back numbers for different entries in your database. So it's really quite easy to build entries which ring different phones based on the entry. For the Contact Name, you might want to use a prefix such as Lake: Wendy's which would mean ring the lake house phone when I want to call Wendy's. Then, for the Your Extension entry, enter the phone number of the lake house phone instead of an asterisk. Piece o' cake!

AsteriDex for Smartphones. Since this article was originally published, we've added a new piece of code for those that happen to have a smartphone or PDA phone and want access to your AsteriDex database for dialing. You'll need something like a Blackberry, 6700 smartphone, Treo 650 or 700 that includes a real web browser (not WAP!) and web service from your cellphone provider. Install AsteriDex as outlined above. Then open up port 80 on your firewall and point it to the private IP address of your TrixBox system so that you can access the web server running on your TrixBox system. To install the smartphone software, log into your server as root and execute the following commands:

cd /var/www/html
mkdir cellphone
cd cellphone
wget http://nerdvittles.com/wp-content/cellphone.zip
unzip cellphone.zip
rm -f cellphone.zip
chown asterisk:asterisk index.php
chmod 775 index.php

Now you can access your AsteriDex database entries from the web browser on your cellphone by pointing the browser to: http://PublicIPaddress/cellphone/ or http://AsteriskFQDN/cellphone/. If your smartphone is fairly "smart" you can also dial any number in your AsteriDex database by simply clicking on the desired phone number. At least with Sprint cellphones, you also have the option of sending a text message to anyone with a cellphone by clicking on any phone number entry. Please note that these outbound calls will be made directly through your cellphone provider, not through your Asterisk system (as was the case with the original AsteriDex web-dialing project). The reason is pretty simple. Most smartphones don't support simultaneous use of your web browser and phone so there's no way for your Asterisk box to call you without getting your voicemail. Yes, we did try it!

Update for International Calling. The robodialer originally only supported 10-digit phone numbers. That's now been fixed thanks to chandave, our non-resident Perl genius.

Enhancing CallerID with AsteriDex. Once you get AsteriDex up and running, learn how to use it to look up CallerID names for all your incoming calls. Click here (including all the comments) for details. We're going to revisit this project especially for TrixBox in the next week or two.


Nerd Vittles Demo Hot Line. You now can take a number of Nerd Vittles projects for a test drive... by phone! The current demos include NewsClips for Asterisk (latest news headlines in dozens of categories), MailCall for Asterisk with password 1111 (retrieve your email by phone), and Nerd Vittles Weather Forecasts by U.S. Airport Code. Just call our Stanaphone number (shown in the left margin) and take any or all of them for a spin. The sound quality may not be perfect due to performance limitations of our ancient Intel 386 demo machine. But the price is right.

Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you can host up to 6 domains with 30GB of disk storage and 750GB of monthly bandwidth. Free domain registration is included for as long as you have an account. That almost doubles last month's deal, and it really doesn't get any better than that. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money.

Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!

Get Your News By Telephone: Introducing NewsClips for Asterisk

Well, we're on a roll adding new tricks to our TrixBox. In the last month, we've added Weather Reports for 1,000 U.S. Airports. And last week, we taught our TrixBox system to read email over the telephone with MailCall for Asterisk®. Today, we add another 'Speak-And-Spell' application: an RSS newsreader for your phone. With today's free software and any phone that can connect to your Asterisk system, you get access to all of the RSS News Feeds from Yahoo. There are dozens available with more to come. The news feeds include the latest headlines, sports, health, technology, show biz, politics, business, and many more. NewsClips for Asterisk joins dozens of other RSS newsreaders with a couple of important differences. First, of course, our app is FREE! And second, you can use a Plain Old Telephone to get your one-minute news fix whenever you like. And the feeds are always current. Yahoo!

How does it work? It's simple. You pick up a telephone and dial an extension on your TrixBox or Asterisk system. And NewsClips for Asterisk reads you the latest news headlines in your choice of news categories. Can it handle multiple news feeds? Absolutely. Do I need a Yahoo account? Nope. Are there any restrictions on its use? Yep. You have to abide by Yahoo's Terms of Use for their news feeds. After all, it's their news, and they paid the license fees to the Big Boys to access it. In a nutshell, the news feeds are for personal, non-commerical use. Non-profit organizations also can freely use the news feeds. If you happen to be running a current version of TrixBox, then deploying NewsClips for Asterisk will take you about 15 minutes. For other versions of Asterisk, you'll need to install Apache, PHP, and the Flite voice processing system. You can scratch around on Nerd Vittles for most of the tutorials. But the easiest way to get this up and running quickly is to install TrixBox and get the most recent updates using our latest tutorial.

Try It, You'll Like It. At the risk of bringing our clunker TrixBox development server (with a whopping 128MB of RAM) to its knees, we decided to make it easy for you to see how NewsClips for Asterisk works. You can call our Stanaphone number and take it for a spin. Just dial the number shown in the left margin. And understand that the sound quality may not be perfect due to performance limitations of this ancient Intel 386 machine. We'll show you how to set up something similar toward the end of this article... hopefully with better hardware.

Getting Started. Let's take first things first. Before proceeding with the installation, make sure you are running at least TrixBox 1.1.1 by pointing a web browser at the IP address of your TrixBox server. If you're running an earlier version, log into your server as root, and type trixbox-update.sh update twice to get everything current. Then reboot. If you're running pure Asterisk on some other type of Linux box, come back the day after tomorrow when you finish installing and configuring Apache, PHP, SendMail, and the Flite speech synthesis engine. Once you get all of the pieces properly configured and talking to each other, you'll be in the same place as those that used our tutorial last week to install TrixBox 1.1.1 at no cost in about an hour.

Modifying Your TrixBox Dialplan. We need to add a little code to the extensions_trixbox.conf file for each news feed you want to access. The basic code looks like this:

exten => 511,1,Answer
exten => 511,2,Wait(1)
exten => 511,3,AGI(nv-news.php|topstories)
exten => 511,4,Flite("Thank you for calling. Good bye.")
exten => 511,5,Hangup

The only change you need to make is in the extension number (511) on each line and the default news category (topstories) in line 3. The extension number tells Asterisk what number you'll be calling to access your news headlines. If you want to access more than one news feed, then you simply duplicate the above code with different extension numbers and a different news feed category in line 3. Or you can run NewsClips for Asterisk in demo mode and choose from ten different news feeds each time you call. Here are some of the news categories that Yahoo News currently supports. For the complete list of Yahoo RSS News feeds, go here. By the way, there's no error checking for typos so type the category name exactly and carefully.

topstories
world
tech
showbiz
oped
business
politics
elections
iraq
mideast
sept11
sports
nasashuttle
science
health
education
hurricanes
oddlyenough
hotzone
adventures
obits
mostemailed
mostviewed
highestrated
mostblogged

Just be sure that all 5 lines of each code snippet above have the same extension number. Now open up the TrixBox web interface by pointing a web browser at your TrixBox server. Then choose Config Edit on the main Configuration and Administration screen. Once phpconfig opens, click on extensions_trixbox.conf. Add the above code in the [from-internal-trixbox] context (section) of the file. And click the Update button once you've adjusted the extension numbers and news feed category to meet your needs.

Installing NewsClips for Asterisk. Now we're ready to install the actual application. Log into your server as root and issue the following commands in order:

cd /var/lib/asterisk/agi-bin
wget http://nerdvittles.com/trixbox11/newsclips.zip
unzip newsclips.zip
rm -f newsclips.zip
chown asterisk:asterisk nv*.php
chmod 775 nv*.php

The zip file contains the NewsClips application: nv-news.php. Once you install the application, restart Asterisk: amportal restart. Now pick up a phone on your Asterisk system and dial 511. Presto! Your news has arrived ... on your telephone! If you want to play the same news feed each time you call a particular extension instead of the menu giving you a choice of ten different news feeds, then you'll need to make one change in the nv-news.php application file using your favorite editor (nano -w /var/lib/asterisk/agi-bin/nv-news.php). Just edit the line which reads $demomode=1 ; and change it to $demomode=0;. After saving this change (Ctrl-X, Y, then Enter), you won't get the news group options when the NewsClips app swings into action. Instead you can set up multiple extensions to handle different news feeds.

Remote Access to NewsClips for Asterisk. You may or may not want access to NewsClips for Asterisk from phones outside your Asterisk system. If you do, here's a simple way to implement it. In a nutshell, you'll want to set up an account with a provider such as Stanaphone which provides a free DID number and free incoming calls. Or just add an extra DID number to your TelaSIP account. Then add a miscellaneous destination to your system using freePBX and configure it for extension 511 or whatever number you used for NewsClips for Asterisk. Finally, create an Incoming Route in freePBX which sends incoming calls on the Stanaphone or TelaSIP DID number to misc destination: NewsClips. Why not just forward the calls to 511 directly? Until you set up a miscellaneous destination for NewsClips, freePBX doesn't know about the 511 extension since it's embedded in the extensions_trixbox.conf file.

First, add a miscellaneous destination to your system using Setup->Misc Destinations->Add Misc Destination. Name it NewsClips and enter the extension number you assigned to this application, e.g. 511. Next, add a trunk for your StanaPhone number. We covered the Stanaphone setup process in our TrixBox tutorial. Finally, choose Setup->Inbound Routes->Add Incoming Route in freePBX. Add entries that look like this using your new StanaPhone DID number:

DID Number 3473451234
CallerID Number [leave blank]
Zaptel Channel [leave blank]
FAX Extension freePBX default
FAX Email [leave blank]
FAX Detection Type nvfax
Pause After Answer 2
Privacy Manager no
Alert Info [leave blank]
Misc Destinations: NewsClips

Click the Submit button when you finish and then the Red Bar to reload Asterisk. Now you can dial your Stanaphone number from any phone anywhere to access your news. This is exactly how the Nerd Vittles NewsClips demo works.

Adding Additional News Feeds to NewsClips for Asterisk. Here's a refresher on adding an additional news category to your system. Step 1 is to add 5 more lines of dialplan code (as we did above) to your extensions_trixbox.conf file using a new extension number, e.g. 512, and a different news category from the list above. Second, restart Asterisk: amportal restart. Now dial the extension and be sure it works. Reminder: Be sure to turn off demomode if you want to use different news feeds on different extensions.

NewsClips for Asterisk Wish List. This is just version 1 of what we hope will be a helpful addition to your Asterisk applications collection. Your feedback can help us with future versions. If there are news feeds that don't get decoded properly, post a comment and let us know the details. And leave a valid email address so that we can get back to you if we need additional information. Your email address does NOT get published in the comment. We'd also appreciate your posting a comment if you have a suggestion for version two down the road. Enjoy!


Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you can host up to 6 domains with 30GB of disk storage and 750GB of monthly bandwidth. Free domain registration is included for as long as you have an account. That almost doubles last month's deal, and it really doesn't get any better than that. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money.

Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!

Newbie’s Guide to TrixBox 1.1 and freePBX

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.

Today we'll show you how to install the latest and greatest TrixBox 1.1 with freePBX 2.1.1 in just over an hour. As with the earlier release of TrixBox, these new Asterisk products are designed to support the casual home or home office user's PBX needs as well as gigantic call centers processing millions of calls a month. Everything is free except the hardware on which to run your new system. That can be almost any old Pentium PC or a multi-processor RAID box with mainframe horsepower.

What freePBX brings to the table is an incredibly simple yet powerful, upgradeable web-based GUI to totally manage your PBX. And TrixBox adds all of the Asterisk bells and whistles you could ever ask for in an integrated PBX: full-featured database management, simple hooks to high-level application development tools such as PHP and Perl, an Apache web server, integrated voicemail and fax-to-email support, contact management, calling card billing, hardware autoconfiguration for Digium and Cisco phone hardware, Microsoft networking support, an integrated text-to-speech system, and loads of free utility software applications for Asterisk compliments of Nerd Vittles. And, yes, TrixBox 1.1 still fits on a single CD! For those new to Nerd Vittles, be aware that we make slipstream changes to articles as users discover things we've missed. Yes, we're human! So check for Comments before you begin or subscribe to our Comments RSS Feed. And, last but not least, be sure to add yourself to the Nerd Vittles Fan Club Map.

UPDATE: This Guide has been superceded. For the TrixBox 1.2.3 tutorial, click here.

The Game Plan. Because of WordPress article length limitations and our own limited attention span, we're just going to cover the basics in this Guide. We'll leave a lot of the bells and whistles for future articles. So today we'll get your TrixBox 1.1 system running so that you can make your first call. We also want to get TrixBox properly configured to support our next free application: TrixBox MailCall. It'll let you retrieve and play back your email messages using any touchtone telephone and your TrixBox system. And, yes, you'll need TrixBox 1.1 to make everything work. The latest TrixBox 1.1.1 update (covered below) will get any system properly configured for the MailCall for Asterisk application. Thanks, Andrew!

Hardware Setup. You have two choices for hardware to run this new system. The first is to dedicate a machine to TrixBox and download the TrixBox ISO image to burn a bootable CD. Once you create the TrixBox CD, you simply boot your dedicated PC with the new CD. It will erase and reformat your hard disk for use with Linux and the included Linux and Asterisk applications. If you just want to experiment with TrixBox and don't plan to put the system into production other than for one or two simultaneous calls from home, then you may prefer to download the VMware version of TrixBox 1.0 or VMwarez's enhanced version. With this approach, you install VMware on your existing Windows XP or Windows 2000 system. Then you run Linux and the TrixBox application in a window on your Windows PC. It does not require a dedicated machine. We've found the performance to be virtually identical to running TrixBox on a dedicated PC provided your Windows machine has at least 512MB to 1GB of RAM. See our previous article for step-by-step instructions on the VMware installation process. And note that there isn't yet a VMware version of TrixBox 1.1 so follow the Newbie's Guide to TrixBox 1.0 to get everything working if you go the VMware route. TrixBox MailCall will not work with TrixBox 1.0 so, if that's of interest to you, install TrixBox 1.1. Once you run the trixbox-update.sh script twice (covered below), you'll have the 1.1.1 version running under VMware.

For now, however, we're assuming you've opted for the dedicated machine install: pure Linux on a clean machine. So begin by downloading the TrixBox 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.3 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. We've covered how to use most of the Linux products in our Mac HOW-TO's (see sidebar), and they work exactly the same way with TrixBox 1.1 so keep reading. And, yes, this install will reformat (aka ERASE) your hard disk before it begins, but it now warns you first. When you're prompted to create your root user password, type in something you can remember ... and write it down!

Upgrading TrixBox from a Prior Version of Asterisk@Home. In a nutshell, YOU CAN'T. But there is a way to put most of Humpty back together again once you've installed the new system. Before you begin, understand that you are doing this AT YOUR OWN RISK. NO GUARANTEES. If that bothers you, don't do it! The real trick is to do a little printing and copying of your old data before you insert that TrixBox installation disk. Step 1 is to make a full backup of your old system to a different server before you begin. If you don't know how, read our step-by-step instructions on the subject here. Step 2 is to make another copy of some of the critical files in your system. Duplicates of all of these will also be part of your backup. We typically build directories on a separate server which match the ones we'll be copying over from the old Asterisk system. Here are the directories (including all the subdirectories therein) that we always duplicate. Before you just blindly copy our list, stop and think whether there are special things you do on your existing Asterisk system or special apps that you run. Then find those files and make copies of all of them, too. The important piece in making a successful copy of some of these files is to shut down Asterisk (amportal stop) and MySQL (/etc/init.d/mysqld stop) before you begin. NOTE to CRM users: There's a new version of CRM in TrixBox so it's unlikely that you can restore the databases. Check your current version of AAH (help-aah) and see if there is an option (bundle-crm) to pack up CRM to move it to another machine. If so, do it and follow the instructions. We don't use Sugar so we haven't tested this upgrade option. Here are the directories you'll want to back up:

/var/lib/asterisk/agi-bin
/var/www/html
/var/lib/asterisk/sounds/custom
/var/lib/mysql
/root
/etc/asterisk

Then there are a couple of individual files that you'll also want to preserve:

/etc/hosts
/etc/crontab

The third step is to take screenshots of every screen you've built using the Asterisk Management Portal (AMP) or a prior version of freePBX. Start in the Setup tab and go right down the list of features. For each option in which you have multiple entries (e.g. Extensions and Trunks), call up each entry and print out the full page. Be especially careful in printing the Trunks entries and make sure you write down every line in the PEER Details and USER Details because those which are out of view will not get printed using a screen print. You'll need to manually fill in the ones that aren't displayed. The same goes for Registration Strings which often scroll out of view on the screen. Finally, using CLI (asterisk -r), make a copy of all your Asterisk database entries: database show. Now save all this information in a safe place until we finish the new install.

Loading CentOS/4 and TrixBox 1.1. Here's how the install went for us, and we'll walk you through getting everything set up so that it can be used as a production server. Once the install begins, you can expect to eat up about 25 minutes with the CentOS 4.3 install. Just be sure to create your new root user password before you walk away, or it will still be sitting there waiting when you return. Once Linux is installed, the TrixBox CD will eject itself, reboot the system, and begin the Asterisk compile and installation. That takes about 25 more minutes to complete.

Securing Your Passwords. When it's finished and reboots, log in as root with the password you assigned. Type help-trixbox for a listing of the other four passwords that need to be changed. Change them all NOW!

passwd admin
passwd-maint
passwd-amp
passwd-meetme

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 AT&T, 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 by you 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 extensions_trixbox.conf and reload Asterisk. Be sure to use a separate DID for this application and point it to custom-callingcard,s,1.

;[custom-callingcard]
;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. 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.

Getting the Latest TrixBox Updates. Once your system is secure, load all of the TrixBox updates using one simple command. Log into your TrixBox system as root and issue this command: trixbox-update.sh update. If the update script has also been updated, you'll need to run the command twice.

Upgrading TrixBox to Support MailCall. The new TrixBox MailCall application needs POP3 and IMAP support for PHP in order to log into and read email messages from your email account. The latest TrixBox update adds everything you'll need to either TrixBox 1.0 or TrixBox 1.1 installs. Currently, the two libraries to support this aren't included in TrixBox so here's how to install them. Log into your TrixBox system as root and issue the following commands in order:


cd /root
wget http://nerdvittles.com/trixbox11/libc-client-2002e-14.i386.rpm
wget http://nerdvittles.com/trixbox11/php-imap-4.3.9-3.9.i386.rpm
rpm -Uvh libc*
rpm -Uvh php*

cd /var/www/html
wget http://nerdvittles.com/trixbox11/test.zip
unzip test.zip
rm -f test.zip

Reconfiguring Apache to Support PHP. At least on our system, TrixBox 1.1 was misconfigured for PHP applications to function properly with Apache. Note: This may have been fixed in the 1.1.1 update so, after downloading the test.zip file above, test your system by executing this command from a web browser using the actual IP address of your TrixBox system instead of our IP address: http://192.168.0.129/test.php. If you get a pretty PHP display about your system, you can skip the next step. If you just see three lines of code or nothing at all, then do the following while still logged in as root:

cd /etc/httpd/conf
cp httpd.conf httpd.conf.bak
nano -w httpd.conf

Once the editor opens your Apache config file, press Ctrl-W and search for the following: LoadModule access_module. After pressing Enter, move to the left margin of that line, and press Enter to open up a blank line. Insert the following code above the existing LoadModule access_module line:

LoadModule php4_module modules/libphp4.so

Now press Ctrl-W again and search for the following: AddType application/x-tar. After pressing Enter, open up a blank line below the existing entry and insert the following:

AddType application/x-httpd-php-source phps
AddType application/x-httpd-php php

Finally press Ctrl-W a third time and search for the following: #AddHandler cgi-script. After pressing Enter, add the following code below the existing entry:

AddHandler php-script php

Save your changes by pressing Ctrl-X, then Y, then Enter. Restart Apache to activate the changes: /etc/init.d/httpd restart. Now run the test.php script from your web browser again, and you should be all set.

Activating Bluetooth Support. Once the updates are completed, activate Bluetooth support if you plan to use it with our Follow-Me Phoning proximity detection application. Run setup, down arrow to System Services, press ENTER, down arrow to bluetooth and press the space bar, tab to OK, press ENTER, tab twice to Quit and press ENTER.

Activating Apache HTTPS Support. If you want secure Internet web access to your server, log into your system as root and issue these commands. Once https support is installed, you can access freePBX securely: https://AsteriskServerIPaddress.

yum -y install mod_ssl
shutdown -r now

Asterisk Info Application Is Back. One of the nice applications that previously was bundled in Asterisk@Home was Asterisk Info. It gave a detailed summary of many critical components in Asterisk including a listing of active SIP and IAX peers and registry entries. This is especially helpful when you're setting up new providers and want to see whether you're getting connected successfully. The application vanished in TrixBox 1.0, but it's back in TrixBox 1.1. You can run the application using a web browser pointed to the correct IP address of your server: http://192.168.0.129/. Then choose Asterisk Info from the TrixBox Configuration and Administration page.

Simplifying SSH Access. If you're going to be connecting to other servers from your new TrixBox system using SSH or SCP, then build your new RSA key pair now. This lets you use SSH and SCP (secure copy) without having to enter a password each time. You can also automate backups and proximity detection scripts as we've explained previously here. Log in to your new TrixBox server as root. From the command prompt, issue the following command: ssh-keygen -t rsa. Press the enter key three times. You should see something similar to the following. The file name and location in bold below is the information we need:

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
1d:3c:14:23:d8:7b:57:d2:cd:18:70:80:0f:9b:b5:92 root@asterisk1.local

Now copy the file in bold above to your other Asterisk servers, Linux machines, and Macs. There's probably a way on PCs as well, but we've all but given up on that platform where security matters so you're on your own there. From your TrixBox server using SCP, the command should look like the following (except use the private IP address of each of your other Asterisk or Linux servers instead of 192.168.0.104). Provide the root password to your other servers (one at a time) when prompted to do so.

scp /root/.ssh/id_rsa.pub root@192.168.0.104:/root/.ssh/authorized_keys

On a Mac running Mac OS X, the command would look like this (using your username and your Mac's IP address, of course):

For user access only: scp /root/.ssh/id_rsa.pub wardmundy@192.168.0.104:/Users/wardmundy/.ssh/authorized_keys
For full root access: scp /root/.ssh/id_rsa.pub root@192.168.0.104:/var/root/.ssh/authorized_keys

Once the file has been copied to each server, try to log in to your other server from your new TrixBox server with the following command using the correct destination IP address, of course:

ssh root@192.168.0.104

You should be admitted without entering a password. If not, repeat the drill or read the complete article and find where you made a mistake. Now log out of the other server by typing exit.

Installing WebMin. We don't build Linux systems without installing WebMin, the Swiss Army knife of the Linux World. You can use it to start and stop services, check logs, adjust startup scripts, manage cron jobs, babysit your SendMail server, and many, many other tasks that are downright painful without it. If you ever need help from others, WebMin is a great tool for letting others help you.

There are lots of ways to install WebMin. WebMin now is part of the TrixBox yum repository so, after logging in as root, just issue the following command: yum -y install webmin.

WebMin runs its own web server on port 10000. To start WebMin, issue this command: /etc/webmin/start. You access it with a web browser pointed to the IP address of your Asterisk box (i.e. replace 192.168.0.108) at the correct port address, e.g. http://192.168.0.108:10000. Note, https support won't work on port 10000 without a bit of additional tweaking! The login name is root. Then type in your root password and press enter. The main WebMin screen will display. We really don't want the WebMin server starting up each time the OS reboots so do the following. Once you're logged in to WebMin, choose System->Bootup and Shutdown and then click on webmin. Click the No button beside Start at boot time, and then click the Save button. To stop WebMin when you're finished using it, issue this command: /etc/webmin/stop. You can restart it any time you need it, and then use a web browser to access it. But there's no need to waste processing resources. For complete WebMin documentation, click here.

If you're going to be accessing WebMin from outside your firewall, you really don't want to be logging in as root over an unencrypted connection so let's enable https support for WebMin. While still logged into WebMin, click WebMin->WebMin Config->SSL Encryption. Now click Install Net::SSLeay Perl Module. Once the module is downloaded, click the Continue With Install button. The make and make install process will take a minute or two. Once you get the completed sucessfully message, click Return to WebMin. Choose WebMin->WebMin Config->SSL Encryption again. At the bottom of the form, click the Create Now button to create your SSL key. Click Return to WebMin again. Then choose WebMin->WebMin Config->SSL Encryption once more. Change the Enable SSL if available option to Yes, leave the other defaults, and save your changes. Henceforth, you can log into your server using HTTPS: https://TrixBoxIPaddress:10000/.

IP Configuration for Asterisk. We need a consistent IP address or domain name both on your internal network and externally if you expect to receive incoming calls reliably. There are three pieces to the IP configuration: (1) setting the internal IP address of your Asterisk server, (2) configuring a fully-qualified (external) domain name for your new server which will always point to your router/firewall, and (3) configuring your router to transfer incoming Asterisk packets to your Asterisk server. Here's how.

First, log into your server as root using your new password. Now type ifconfig eth0 (that's "e-t-h-zero") then enter, and write down both your inet addr and your HWaddr on the Ethernet 0 interface, eth0. Inet addr is the internal IP address of your Asterisk box assigned by your DHCP server (i.e. your router/firewall). HWAddr is the MAC address of your Asterisk server's eth0 network card. To assure a consistent internal IP address, you can either configure your router/DHCP server to make certain that it always hands out this same address to your Asterisk machine, or you can manually configure an IP address for this machine which is not in the range of addresses used by your DHCP server. Almost all routers now make it easy to preassign DHCP addresses so we prefer option 1. It's generally under the tab for LAN IP Setup or DHCP Configuration and is generally called something like Reserved IP table. Just add an entry and call it Asterisk PBX and specify the IP address and MAC address that you wrote down above. Now each time you reboot your Asterisk server, your router will assign it this same IP addreess.

To assure a consistent external address is a little trickier. Unless you have a static (fixed) IP address, you'll want to use a Dynamic DNS service such as dyndns.org and configure your router to always advertise its external IP address to dyndns.org. DynDNS.org will take care of revising the IP address associated with your domain name when your ISP changes your dynamic IP address. Then you can configure your VoIP provider account using your fully-qualified dyndns.org domain name, e.g. windswept.dyndns.org provides access to our beach house network even though Time Warner cable hands out dynamic IP addresses which change from time to time.

Now you'll need to log into your router and redirect certain incoming UDP packets to the internal IP address of your Asterisk machine. If you want external access to the Apache web server on your Asterisk machine, then map TCP port 80 to the internal IP address of your Asterisk system. For WebMin external access, map TCP port 10000 to your Asterisk system. If you want remote access to your Asterisk system via SSH, then map TCP port 22 to the internal IP address of your Asterisk system. If you want external IP phones or other Asterisk servers to be able to communicate with your Asterisk system, then map the following UDP port ranges to the internal IP address of your Asterisk system:

SIP 5004-5082
RTP 10001-20000
IAX 4569

For more details, read our full article on the subject.

Finally, you'll need to tell Asterisk about some of this. Edit the sip.conf file (nano -w /etc/asterisk/sip.conf) and add the following entries in the [general] section of the file using your fully-qualified domain name for your server and the private IP address range used behind your router/firewall (typically 192.168.0.0 or 192.168.1.0 with most home routers):

externhost = yourdomainname.dyndns.org
localnet=192.168.0.0/255.255.255.0
nat=yes

Designing Your PBX System. For those new to the Asterisk world, we'll be using a web-based GUI to configure Asterisk to meet your needs. Step 1 is to get away from your computer and sit down with a piece of paper. Now lay out how you'd like your new system to operate. How many phones will you have? Will they be software-based phones or good old phones you can put on a desktop? Will they be POTS phones (plain old touchtone phones), cordless POTS phones, SIP phones, IAX phones, or cordless SIP phones? How will you make and receive calls? Are you going to use an existing Ma Bell phone line or VoIP trunk lines from one or more VoIP providers? What should happen when incoming calls arrive? Do you want the caller to get an AutoAttendant message ("Hi. You've reached the Mundy's. Press 1 for Mary, 2 for Ward, or 3 to leave a message.") or do you just want all of your phones to start ringing? What should happen when no one answers or the line is busy? Do you want the calls transferred to a cell phone, another POTS phone, or just sent to voicemail? Which voicemail account? Should all busy phones send callers to the same voicemail account, or do you want one for each phone? What should happen once voicemail arrives? Do you want the phone to ring once a minute? Do you want the message waiting indicator to illuminate? Do you want the voicemail message to be emailed to you? Do you also want it preserved so that you can retrieve it from a touchtone phone? Do you want to be paged with the number of the person that called you?

ATTN: "Type A" Males. With apologies to our female readers, let me chat privately for a moment with the guys. If you have a wife (and want to keep her) or if you have teenage daughters (and want to avoid being killed in your sleep), you'd better get most of this PBX design right if you plan to use Asterisk to replace your existing home phone system. Otherwise, the day after you install your new system, a typical discussion with your spouse will begin with something like this: "What was wrong with our old phones that just rang when someone called and I could actually hear what they were saying when I answered?" With that caveat in mind, let's jump right in to freePBX.

Today's Objective. Keeping in mind that there are a million ways to configure and customize a PBX, we're going to walk you through a very simple setup today. Our objective is to get Asterisk and freePBX configured so that you can make a call and receive a call. In our next article, we'll start adding all the bells and whistles. But, for today, we'll show you how to set up an incoming and an outgoing VoIP trunk so you can make and receive free calls (at least in the U.S.) using a free softphone. When no one answers, the call will be sent to voicemail. And, when a voicemail message is left, the message will be emailed to you. We'll leave integration of existing POTS phones and phone lines for another day.

Choosing VoIP Providers. As you will quickly learn, choosing VoIP providers is an art, not a science. And it can be a slippery slope. A provider that is great one day can turn into an absolute nightmare the next. Take BroadVoice, for example. They used to be one of our favorites. Then the CEO left, and the company's business practices, uh, changed to put it charitably. You can read all about it on this forum or at the Better Business Bureau's site. All it takes is a change in leadership or direction at the company headquarters to go from first to worst overnight. So the best advice we can offer about choosing providers is this. Stay Flexible! Don't put all your eggs in one basket. And don't be in a hurry to disconnect your Ma Bell line and transfer your number until you are pretty confident about your provider. Six months is an absolute minimum, and a year is probably better. VoIP providers come and go at about the same pace as fast food restaurants in a new community.

Having said all of that, we have some providers we really like and some that we don't. YMMV! The basic idea in switching to Voice Over IP technology was to save money... not just for the provider, but for you, too. So PRICE MATTERS. There are typically three types of VoIP service: all-you-can-eat at a fixed monthly price, pay-as-you-go at a per minute (or part of a minute) rate, and free. Some providers only offer outbound service, and others offer incoming and outgoing calls. To receive calls, you've got to have an account with a provider that will give you a phone number unless you want to only get calls from other users of that provider's service, e.g. Skype. You don't have to use the same provider for inbound and outbound calls, and you are better off with backup providers for BOTH inbound and outbound calls.

If you select an all-you-can-eat plan, you basically get the right to make (or receive) ONE phone call at a time to a certain geographic area. This may be a state, an area code, or a country depending upon where you live and which provider you choose. The best of these in the U.S. is TelaSIP at $14.95 a month for unlimited U.S. calling. The runner-up is Axvoice which has a broader variety of plans including an unlimited international calling plan at $22.99 a month. Be aware of the fine print with all-you-can-eat providers. Some such as Teliax don't really offer unlimited calling even tough they call it that. What they offer is unlimited calling up to some monthly cap of minutes. For example, with Teliax, up to 1500 minutes a month are "free" and then you pay 2¢ per minute thereafter. They're not really free because you've paid a $24.99 monthly fee for the initial 1,500 minutes. Then there's our old favorite BroadVoice which now offers unlimited calling with a little asterisk. After you drill down to the third level in their web pages, you'll see this in the fine print: "* Significant restrictions apply to Unlimited Plans." If you violate their undefined "normal residential usage patterns", you agree in advance to let them retroactively charge you 5¢ per minute for every call you've made since you signed up... plus $300/hour in in-house legal fees for successful collection. I wonder if they pay their staff attorneys that much? Their terms of use give them unfettered discretion in defining what's appropriate and inappropriate use. And, arguably, even having multiple people in your household use your "unlimited plan" violates their terms of service. So, unless you've recently won the lottery or just enjoy litigation, here's our best advice on BroadVoice: JUST SAY NO!

With pay-as-you-go providers, there typically are no simultaneous call limitations because you're paying by the minute per call. Some of these providers charge in whole minute increments while others round calls to as little as six second billing increments. Some leave their rates the same for six months or more. Others change their rates almost daily. You don't want to have to visit a web site each time your phone rings to determine what it will cost to pick up the phone. So be alert in choosing a pay-as-you-go provider. The best of the bunch in our opinion is Voxee.com at about a penny a minute for U.S. calls and only slightly more for calls to many international destinations.

And then there are the free providers. Here's a good rule of thumb. Enjoy it while it lasts. Don't expect free to last forever. And, most importantly, READ THE FINE PRINT. It costs the provider something to offer the service and, if they're giving the service away, there IS a catch. You just have to be smart enough to figure out what it is. The best freebies at the moment are VoipDiscount.com for free outbound calls to numerous countries including the U.S. at least today, FreeDigits.com for free incoming DIDs, free incoming calls, and free incoming fax service, and Stanaphone.com for free incoming DIDs and free incoming calls. See our complete list of VoIP Provider reviews for additional information and setup instructions.

If you just want to experiment with your new system and don't want to cough up much money, here's a good way to get your feet wet. Sign up for a free incoming DID number and free incoming calls with Stanaphone's Stana-IN service and sign up with VoIPDiscount.com for free outbound calls. You'll need a Windows machine to initially sign up for both of these services. See our tutorials for details. You won't have a phone number in your local area code, but folks will be able to call you. If you want a number in your local area code and you live in the U.S., sign up for TelaSIP's basic service at $5.95 a month which gets you a local phone number and free unlimited incoming calls ... one at a time. Outbound calls in the U.S. are 2¢ a minute which gives you a good backup to your free VoIPDiscount outbound calling service. There are no obnoxious terms of service or hidden fees with TelaSIP. Just use the service for residential calling.

Downloading a Free Softphone. Unless you already have an IP phone, the easiest way to get started and make sure everything is working is to install an IP softphone. You can download a softphone for Windows, Mac, or Linux from CounterPath. Or download the pulver.Communicator or the snom 360 Softphone which is a replica of perhaps the best IP phone on the planet. Here's a new IAX softphone for all platforms that's great, too, and it requires no installation: Idefisk. All are free! Just install and then configure with the IP address of your TrixBox server. For username and password, use the extension number and password which we'll set up shortly with freePBX. Once you make a few test calls, don't waste any more time. Buy a decent SIP telephone. We think the best value in the marketplace with excellent build quality and feature set is the $85 GrandStream GXP-2000. It has support for four lines, speaks CallerID numbers, has a lighted display, and can be configured for autoanswer with a great speakerphone. Short of paying over double for the snom 360, that's as good as desktop phones get. If you want to use Asterisk throughout your home, buy a good 5.8GHz wireless phone system with plenty of extensions such as the Uniden 8866 which we use (see ad below) and then purchase an SPA-3000 to connect up both your home phone line and all your cordless phones. Our tutorial will show you how.


Initial Setup of freePBX. You still access freePBX just as you accessed the Asterisk Management Portal (AMP), by pointing a web browser to the internal IP address of your new Asterisk system. Once you get to the main TrixBox screen, choose freePBX. When prompted for your username and password, the username is still maint. Enter the password you assigned to freePBX/AMP when you configured your system. In the old days, AMP came preconfigured with everything they thought you'd need to use it. With the new freePBX architecture, you first have to install and enable the modules you want to use. And now others can write modules to expand the capabilities of freePBX without futzing around in the basic source code. You get to these modules by choosing Tools->Module Admin from the main freePBX menu. Unlike some applications, there's really no reason not to activate all of the available modules since they won't slow down Asterisk. The only performance hit is when you click the Red Bar to reload freePBX. The more modules you've activated, the longer it will take to reload freePBX (which isn't very long) since freePBX queries each module to see if changes need to be applied. So, in the Module Administration screen, click Connect to Online Module Repository to first download all of the available modules. Then select all of the Disabled Modules and Enable them. Click Submit and then the Red Bar to save your updates. From time to time, you need to revisit this page to upgrade the modules as bug fixes are released.

As you can see, there are two types of Modules: Local Modules and Online Modules. Local Modules are the pieces that make freePBX work on your local machine. Online Modules provides access to modules which are available for download over the Internet. And Online Modules tells you which ones are newer than the ones currently on your system. Before too long, we wouldn't be surprised to see an option to email you notices when new modules are released or older ones are updated. This is nothing short of fantastic for the Asterisk community if we do say so.

Last but not least, for each Module, there now is online documentation. You can read about all the Module pieces by clicking here. Once you complete the above steps, you're ready to set up your new system.

Configuring freePBX Trunks. When you click the Setup tab in freePBX, the first thing you'll notice is there are a lot more options. Start by adding your Trunks. This works pretty much like it always has. Choose ZAP, IAX2, SIP, or ENUM for each trunk and proceed accordingly. Down the road, the grand plan is to have sample settings for each provider on line here. Very cool!

For our sample setup today, we'll configure SIP trunks for Stanaphone, TelaSIP, and VoipDiscount. For each provider, click on the Setup->Trunks tab in freePBX. Then click Add SIP Trunk. After you complete the entries for each provider, click Submit Changes and then the Red Bar.

StanaPhone Trunk Setup. Here are the entries for the Stanaphone SIP trunk. For Outbound CallerID, enter the phone number assigned to you by StanaPhone. For Maximum Channels, enter 1. Leave the Dial Rules and Dial Prefix blank for the time being.

For Outgoing Settings, enter a Trunk Name of stanaphone. For Peer Details, enter the following using your assigned username and password. Be very careful to match the upper and lower case settings in your assigned password.

host=sip.stanaphone.com
insecure=very
nat=yes
secret=yourpassword
type=peer
username=yourusername

For Incoming Settings, enter a USER Context of from-pstn. This tells Asterisk to process incoming calls through this context in your dialplan. For USER Details, enter the following using your assigned username and password:

canreinvite=no
dtmfmode=rfc2833
host=sip.stanaphone.com
insecure=very
nat=yes
secret=yourpassword
type=peer
username=yourusername

For the Registration String, enter the following using your assigned username, password, and 347 phone number:

yourusername:yourpassword@sip.stanaphone.com/3471234567

Click the Submit Changes button and then click on the Red Bar to save your trunk settings and reload Asterisk. To be sure you have properly registered with Stanaphone, run the Asterisk_Info application which we installed above using your correct IP address: http://192.168.0.108/maint/asterisk_info.php. Under SIP Peers, you should see an entry for sip.stanaphone.com showing a state of Registered. If not, check your username and password entries for typos.

TelaSIP Trunk Setup. Here are the entries for the TelaSIP SIP trunk. For your Outbound Caller ID, fill in the local phone number provided by Telasip. For Maximum Channels, enter 1. For Dial Rules, enter the following:

1|NXXNXXXXXX
NXXNXXXXXX

In the Outgoing Settings section, name your trunk telasip-gw and then enter the following PEER details using your TelaSIP-assigned username and password:

context=from-pstn (if that doesn't work use: from-trunk)
dtmfmode=rfc2833
host=gw3.telasip.com
insecure=very
secret=yourpassword
type=peer
username=yourusername

Leave the Incoming Settings User Context and User Details blank. For your Registration string, enter the following: yourusername:yourpassword@gw3.telasip.com using your actual username and password assigned by TelaSIP. Click Submit Changes and then the red bar to restart Asterisk. Use Asterisk_Info as we did with Stanaphone to be sure you are registering successfully with TelaSIP.

VoipDiscount Trunk Setup. Here are the entries for the VoipDiscount SIP trunk. Create a SIP trunk for the service with a Trunk Name of voipdiscount. VoipDiscount doesn't support an outbound CallerID number so leave it blank. The Outgoing Dialing Rules in the U.S. should look like this:

001+NXXNXXXXXX
00+1NXXNXXXXXX

Add the following PEER Details in Outgoing Settings using your own username (in three places!) and password. Leave the Incoming Settings blank.

allow=ulaw&alaw
authuser=yourusername
disallow=all
fromdomain=sipdiscount.com
fromuser=yourusername
host=sip.sipdiscount.com
insecure=very
nat=yes
qualify=yes
secret=yourpassword
sendrpid=yes
type=peer
username=yourusername

For the Registration String, enter the following using your own username and password:

yourusername:yourpassword@sip.sipdiscount.com

Click the Submit Changes button and click the Red Bar to update Asterisk. Use Asterisk_Info as we did with Stanaphone to be sure you are registering successfully with VoipDiscount.

When you have your Trunks set up, you'll need a way to call out (Outbound Routes), to call in (Inbound Routes), and to process incoming calls: a Digital Receptionist, a Call Queue, a Custom Application, DISA, or a phone to ring (Extensions). For today, we'll get the phones to ring. Then we'll tackle the other options in Parts II and III.

Configuring Outbound Routes. Outbound routes are the rules that determine how calls that are dialed from an extension on your system get processed. The idea here is that you set up a list of priorities. Then, based upon the number dialed, the outbound rules figure out how to route the call. We're going to start with a simple Outbound Route called Everything which will process all calls that are not handled by another Outbound Route. Click Setup->Outbound Routes->Add Route and enter the following:

Route Name ... Everything
Route Password ... [leave it blank]
Pin Set ... [leave it blank]
Emergency Dialing ... [leave it blank]
Dial Patterns: (adjust these if you wish to permit international calls!)
1NXXNXXXXXX
NXXNXXXXXX
Trunk Sequence:
0 sip/voipdiscount
1 sip/telasip-gw

Once you've made all the entries, click the Submit Changes button and then the Red Bar to reload Asterisk. You will be able to place calls by dialing either an area code and phone number or 1 plus an area code and phone number. For international callers, our previous articles will walk you through configuring the dial strings to support various countries. Now you should see two Outbound Routes in your route list. We want to delete the other route so just click on it and then choose Delete Route and click the Red Bar to save your changes. Now there should be only the Everything route in your Outbound Routes list. We'll leave it like that for today, but down the road, we'll add options for emergency calls, toll-free calls, in-state calls, and international calls. After we make those additions, the Everything route will be used as our lowest priority catch-all for calls that don't qualify for processing by another route.

Setting Up Extensions. To add a new extension and voicemail account to your system, click Setup->Extensions->Add SIP Extension and enter the following:

Extension Number ... 500
Display Name ... Office
Extension Options
Direct DID ... [your 10-digit TelaSIP phone number if you have one; otherwise, leave blank]
DID Alert Info ... [leave blank]
Outbound CID ... [your 10-digit TelaSIP phone number if you have one; otherwise, leave blank]
Emergency CID ... [your 10-digit TelaSIP phone number if you have one; otherwise, leave blank]
Record Incoming ... On Demand
Record Outgoing ... On Demand
Device Options
secret ... 1234
dtmfmode ... rfc2833
Voicemail & Directory ... Enabled
voicemail password ... 1234
email address ... yourname@yourdomain.com [if you want voicemail messages emailed to you]
pager email address ... yourname@yourdomain.com [if you want to be paged when voicemail messages arrive]
email attachment ... yes [if you want the voicemail message included in the email message]
play CID ... yes [if you want the CallerID played when you retrieve a message]
play envelope ... yes [if you want the date/time of the message played before the message is read to you]
delete Vmail ... yes [if you want the voicemail message deleted after it's emailed to you]
vm options ... callback=from-internal [to enable automatic callbacks by pressing 3,2 after playing a voicemail message]
vm context ... default

Configuring Inbound Routes. Just as we had to tell Asterisk how to process outbound calls, you also have to define what to do with incoming calls from each of your inbound trunks. Be aware that different service providers have implemented SIP and IAX differently. One of the best providers for proper SIP implementation is TelaSIP because you can route incoming calls based upon the DID numbers associated with each trunk. So you could have one incoming trunk from TelaSIP with multiple DID numbers (for each of your children, for example). Each DID then could be routed to a specific extension, and each extension could have its own CallerID number for outbound calls ... even though you might only have one TelaSIP trunk line. So, to outside callers, it would appear that each individual had his or her own phone line even though everyone might be sharing one or two trunks.

For today, we'll get a default inbound route established, and we'll save the gee whiz stuff for later. To create a Default Inbound Route for your calls, choose Setup->Inbound Routes->Add Route. Then enter the following:

DID Number ... [leave blank]
CallerID Number ... [leave blank]
Zaptel Channel ... [leave blank]
Fax Extension ... disabled
Fax Email ... [leave blank]
Fax Detection Type ... none
Pause After Answer ... [leave blank]
Privacy Manager ... no
Alert Info ... [leave blank]
Destination: ... Core: Office 500

Click Submit and then OK when you're warned that this will create a default incoming route for your calls. Down the road as you add additional incoming routes, the new routes will take precedence unless there's no matching DID in which case this default route will be used.

If you want to create a separate incoming route for your Stanaphone calls just to see how it works, click Add Incoming Route and enter the following:

DID Number ... [your 10-digit Stanaphone number]
CallerID Number ... [leave blank]
Zaptel Channel ... [leave blank]
Fax Extension ... freePBX default
Fax Email ... [leave blank]
Fax Detection Type ... NVfax
Pause After Answer ... 2
Privacy Manager ... no
Alert Info ... [leave blank]
Destination: ... Core: voice mailbox 500

The trick to learn here is that if you want an incoming DID to go straight to voicemail, you need a slight pause to let Asterisk get properly set up for the call or the first couple seconds of your voicemail announcement will be cut off. By adding two seconds of fax detection, everything will work swimmingly.

Allowing Anonymous Inbound SIP Calls. One final step, and your incoming calls should start arriving without a "this number is not in service" message. Choose Setup->General Settings and scroll to the bottom of the page. Under Security Settings, change Allow Anonymous Inbound SIP Calls from No to Yes and click Submit Changes and then the Red Bar. Once this change is made, inbound calls from Stanaphone will work reliably.

Activating Email Delivery of VoiceMail Messages. When you're out and someone leaves you a voicemail message, TrixBox and freePBX will let you forward that voicemail message to your email address as a .wav file which can be played within most email client software. Or you can have the system send an instant message to your cell phone or pager telling you who called, what their phone number was, and how long a voicemail message the person left for you. Or you can do both. In addition, you can tell the system whether to delete the voicemail from your Asterisk server after sending it to your email account. In short, you now can manage all of your incoming email and voicemail from a single place, your email client. In order to send out emails from your server, you'll need to make a few changes.

First, make this adjustment to the /etc/hosts file on the server. Since anonymous emails are blocked by most ISPs, you'll need a fully-qualified domain name for your server. If you don't have your own domain, the easiest alternative is to use the fully-qualified domain name that your ISP assigns to the IP address for your broadband connection. Don't forget to update it when your ISP changes your IP address! To find out what your fully-qualified domain name is, go to a command prompt on your Asterisk server and type: nslookup 123.456.789.001 substituting your public IP address for the preceding numbers. Then write down the name entry without the trailing period. Now edit the hosts file: nano /etc/hosts. Move the cursor to the second line which reads 127.0.0.1 asterisk1.local , and then move the cursor over the first letter of the first domain name shown, usually asterisk1.local. Now type in the fully-qualified domain name you previously wrote down and add a space after your entry. Don't erase the existing entry! Save your settings: Ctrl-X, y, enter. Now restart network services on your Asterisk machine: service network restart.

Next, you need to modify the email message which delivers your voicemails so that it includes your fully-qualified domain name. Don't do this in TrixBox, or you'll mess up the formatting of the email message. You can download a fresh copy here if you need it. Instead, use nano: nano -w /etc/asterisk/vm_email.inc. Press Ctrl-W, type AMPWEBADDRESS, and press the enter key. Delete the word AMPWEBADDRESS and then type either the fully-qualified domain name for your Asterisk server or the private IP address if you only want to read your emails from behind your firewall. When you start typing, the text display may jump all over the place because of word wrap. Don't freak out. You haven't messed anything up. Once you complete your entry, don't erase or change anything else. Save the file: Ctrl-X,Y, then enter.

Now edit vm_general.inc: nano -w /etc/asterisk/vm_general.inc. Change the serveremail entry of vm@trixbox to an email name at the same fully qualified domain you used in your /etc/hosts file above. Then save your configuration and restart Asterisk: amportal restart. If you continue with this setup and still don't receive emails, here's another configuration change that is sometimes necessary. You'll also need to do it if you reloaded settings from an older version of Asterisk. On the Asterisk terminal, log in as root. Switch to the directory where the SendMail configuration file is stored: cd /etc/mail. Make a backup of the config file: cp sendmail.cf sendmail.cf.bak. Then issue the following command: echo CGasterisk.dyndns.org >> sendmail.cf. Substitute the actual domain name of your Asterisk server for asterisk.dyndns.org, but be sure it's preceded by CG with no intervening spaces.Then restart SendMail on your server and try again: /etc/rc.d/init.d/sendmail restart. Finally, if your ISP doesn't permit downstream mail servers (that's you), then take a look at this link which will show you how to designate your ISP as your SMTP smart host using SendMail.


Activating the Nerd Vittles Weather Forecasts in TrixBox. TrixBox 1.1 now includes the Flite text-to-speech engine as well as the Nerd Vittles weather forecasting system. To use it, just dial 611 from a phone on your system and enter a 3-character airport code to retrieve the weather forecast. TrixBox comes with support for about 50 airports. You can easily expand it to 1,000 airports by following along in Part II of our Weather Tutorial. It'll take you about 15 minutes. For complete instructions, read the full article here.

Creating Wakeup Calls in TrixBox. To set up a wakeup call from any extension, dial *62 and enter a two-digit hour and two-digit minute for the wakeup call.

Determining the Extension Number of Any Phone on Your TrixBox System. To determine the extension number of any phone on your system, dial *65 from that extension.

Retrieving VoiceMail from Any Phone With TrixBox. To retrieve voicemail for any extension, dial *98 and enter the voicemail extension number. When prompted, enter the password for that account. To retrieve voicemail for the extension from which you are calling, dial *97 and enter the password for the account when prompted. You can also set your voicemail defaults and record your voicemail greetings using these options.

Useful Functions on Your TrixBox 1.1 System. Here's the complete list of functions that will work out of the box from any extension on your TrixBox system:

  • 611 The Latest Weather Forecast
  • *62 Schedule a Wakeup Call
  • *65 Decipher Extension Number of Any Phone
  • *70 Activate Call Waiting
  • *71 Deactivate Call Waiting
  • *72 Enable Call Forwarding (include forwarding number to avoid prompt)
  • *73 Disable Call Forwarding
  • *90 Enable Call Forwarding on Busy (include forwarding number to avoid prompt)
  • *91 Disable Call Forwarding on Busy
  • *78 Enable Do Not Disturb
  • *79 Disable Do Not Disturb
  • *97 Access Voicemail for Calling Extension
  • *98 Access Voicemail with Prompt for Mailbox Number
  • Well, that should get you started. We'll tackle the gee whiz features in TrixBox and freePBX down the road so visit us again soon. In the meantime ...


    Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you can host up to 6 domains with 30GB of disk storage and 750GB of monthly bandwidth. Free domain registration is included for as long as you have an account. That almost doubles last month's deal, and it really doesn't get any better than that. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money.


    Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.


    Some Recent Nerd Vittles Articles of Interest...

    The Whole House iPod

    While the dust settles a bit in the TrixBox world, we thought we’d digress today and tell you about an incredible whole house audio system. Yes, there’s the iPod for private listening and there are some streaming audio solutions for those that want music in one or two rooms of a home or office. But what if you want music (different music) available in every room of your home. Well, until now, you could look at spending $20,000 to $50,000 for a very proprietary solution such as Elan’s Home Systems. It’s no accident that you won’t find any pricing on their web site.

    As luck would have it, we just moved into a new home that was prewired for audio and video in eight rooms including recessed ceiling speakers in all the rooms. While this is an expensive proposition when retrofitting an older home, it’s fairly reasonable during new construction, and many builders now include it as part of the cost of a new house. The gotcha, however, is adding the multi-room amplifier, the audio devices to produce the music, and the touchpanel control units in each room. Can you spell outrageously expensive! In round numbers, you’re looking at $5,000 for installation of a suitable amplifier, $1,500 to $2,500 for each ultra-proprietary touchpanel display, and another $10,000 or more for the audio sources. These include CD jukeboxes, iPods with infrared remote access, a multi-channel XM radio receiver to the tune of $1,500 plus XM radio fees of nearly $30 a month (for three channels) forever, and loads of consulting fees at $100+ an hour. Each of the touchpanels or keypads is manually configured to match the audio components you purchase so that you can switch audio sources, adjust volume, and skip songs in each room. The double-gotcha is that despite having spent tens of thousands of dollars on this system, you have no ability to adjust anything down the road without another $100 an hour service call from the installer. So just pray they’re still around, or you’re basically stuck with your initial setup forever. A $500 magic box is used to configure the touchpanels and keypads, and, NO, you can’t buy one. It’s not sold to consumers, just dealers. Ouch!

    You should be getting the picture of why we went shopping for an alternative with a bit more flexibility. That’s when we stumbled upon an incredible product called the Sonos Digital Music System. In a nutshell, you have a self-contained system unit in each room where you want music. It includes an optional amp for connection to a pair of speakers, wired and wireless networking, and a user and streaming audio interface that is as good or better than the iPod. Then you add as many touchpanel control units to select music and music sources as your budget can afford. There are also PC and Mac versions of the touchpanel which won’t cost you a dime. Each touchpanel can control every zone (aka room) in your home. What you don’t need with this system is a house prewired for audio because each unit lets you connect directly to a set of speakers or an external amplifier if desired. You also don’t need a wired network throughout your home. Only one of the Sonos units needs to be connected to a wired network. The rest of the devices automatically configure themselves to communicate wirelessly with the other system units and controllers scattered throughout your home. If you buy the starter pack with two system units including amps and one controller unit, you’re looking at $1,200 which works out to roughly $500 per system unit and about $200 for the controller. That’s roughly one tenth the cost of a functionally similar controller unit from Elan except you can configure the Sonos controller while a dealer has to configure the Elan unit … at $100 an hour.

    I feel a little like the guy selling the Ginsu knives on television: "but there’s more." Boy, is there! Not only is the sound of the systems downright incredible (depending upon your speakers, of course), but the variety of available music sources is going to make you want some of these in the morning. Each system unit can stream audio from almost any music source imaginable. This includes MP3’s stored on your PC, Mac, or our latest discovery, a $150 network-attached storage (NAS) device. You also can play Shoutcast streams, either your own or those available for free over the Internet. Another option is to map a file share from a Sonos unit to a Mac or PC. It takes about 10 seconds. Sonos units also can play music from Rhapsody. And, if you’re lucky enough to be a Comcast broadband subscriber like us, a Rhapsody streaming audio subscription with about 50 music channels is yours for free! Just login to your Comcast account and download the Comcast Rhapsody software to any Windows PC. Rhapsody Stations are every bit as good as XM or Sirius channels with one important difference. There’s no additional monthly charge to Comcast customers for as many simultaneous streams as you care to play. That’s quite a contrast from Elan’s three XM streams solution which means three rooms with XM radio and no more … for $30 a month … once you buy your $1,500 Elan XM receiver. With Rhapsody, you won’t need a receiver at all, just an old clunker PC sitting in the corner with the Rhapsody application running. It can be used for other tasks as well. At the moment, we have my daughter’s game PC running Rhapsody with four simultaneous streams playing in seven zones of the house. You can double up zones with the click of a button using any Sonos controller. In addition to all these music sources, you also can connect an old-fashioned analog audio device (like a CD jukebox or an iPod) to each system unit. Music from these sources can be streamed to any combination of rooms you choose, just like traditional Shoutcast streams or Rhapsody stations. The only thing missing with analog device streams is the album art, but it still sounds great.


    There are some other reviews of the Sonos system which are worth a look. Check out David Pogue’s article in the New York Times, the Home Theater View, Audioholics, Playlist Magazine, and PC Magazine. Then you’ll want to run, don’t walk, to buy at least one for yourself! You can purchase units from Sonos and most of their dealers with a 30-day money-back guarantee. We installed eight systems with four remotes in just over two hours. We haven’t quit listening since. Now you know why we’re running a little behind on the Asterisk® and TrixBox articles. Enjoy!


    Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has continued their limited time special on hosting services. For $6.95 a month, you can host up to 6 domains with 15GB of disk storage and 400GB of monthly bandwidth. Free domain registration is included for as long as you have an account. It doesn’t get any better than that, and their hosting services are flawless! We oughta know. We’ve tried the best of them. If you’ve never tried a web hosting provider, there’s never been a better time. Just use this link, and we’ll all be happy.


    Nerd Vittles Fan Club Map. Thanks for visiting! We hope you’ll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don’t know the difference in the last two, here’s the best definition we’ve found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We’re always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you’re visiting as well.

    Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

    Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

    Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it’s all FREE!


    Some Recent Nerd Vittles Articles of Interest…

    Asterisk + The National Weather Service = Free Weather Reports For 1,000 Cities From Any Touchtone Phone

    Our HeroThanks to Asterisk®, Flite, and the National Weather Service, you now can get a quick weather update or a seven-day forecast for any combination of 1,000 U.S. cities using your plain-old touchtone telephone... just one of the many perks you receive for being an American Taxpayer. It doesn't mean the forecast will be right, mind you. But you can still listen and make your own judgments about carrying an umbrella. Just dial 611 and then a three-digit airport code for the city you're interested in. And you can customize things to support any 1,000 cities in the United States that you happen to like. [Note: Looking for Worldwide Weather Forecasts for Asterisk? Here's the link. For U.S. Weather Reports by Zip Code, go here.]

    Prerequisites. To get started, all you'll need is a free Asterisk@Home or TrixBox server (Asterisk@Home or TrixBox will even run in a window on your Windows Desktop), the free Flite speech synthesis engine for Asterisk, our free MySQL database of airport codes and cities in the United States, and, of course, version 2 of our free Asterisk text-to-speech weather application. Yes, we accept donations above to underwrite the costs of future projects, but don't let that stop you if you're busy, broke, or just plain cheap. We won't track you down, and you'll still be able to sleep at night. We don't do this for a living. In fact, we don't do much of anything for a living, but we're still glad you're visiting. Please at least add yourself to the Nerd Vittles Fan Club Map and say something nice. That won't cost you a dime! We're assuming you already have an Asterisk@Home or TrixBox server up and running with Flite installed. If not, click on the links above to install your favorite flavor of Asterisk@Home or TrixBox plus Flite. And, no, this is not Rocket Science! You can finish this project in about 30 minutes without a Ph.D.

    Try It, You'll Like It. At the risk of bringing our clunker TrixBox development server (with a whopping 128MB of RAM) to its knees, we decided to make it easy for you to see how the new Nerd Vittles Weather app works. You can call our Stanaphone number and take it for a spin. Just dial the number shown in the left margin. And understand that the sound quality may not be perfect due to performance limitations of this ancient Intel 386 machine.

    Downloading and Testing Flite. If you already have a TrixBox server up and running, you can skip this section. TrixBox has Flite preinstalled. For those running an Asterisk@Home 2.x server, here's how to quickly install the Asterisk-specific version of Flite on your system. Log into your server as root and issue the following commands:

    cd /root
    wget http://nerdvittles.com/aah2/flite-1.3-1.aah.i386.rpm
    rpm -ihv flite-1.3-1.aah.i386.rpm
    wget http://nerdvittles.com/aah2/app_flite-0.3-1.aah.i386.rpm
    rpm -ihv app_flite-0.3-1.aah.i386.rpm
    amportal stop
    amportal start

    Once you complete the installation process above, load the Asterisk Command Line Interface (asterisk -r) while still logged in as root and be sure that the Flite application is loaded:

    asterisk -r
    show application flite
    quit

    You should get a response from Asterisk that looks something like the following:

    -= Info about application 'Flite' =-

    [Synopsis]
    Say text to the user, using Flite

    [Description]
    Flite(text[|intkeys]): This will invoke the Flite TTS engine,
    send a text string, get back the resulting waveform and play it to
    the user, allowing any given interrupt keys to immediately terminate
    and return.

    Setting Up the Airport Codes Database. We'll be using a MySQL Airports IATA database and a web-based script to get things going. To install the database and pick your own favorite 1,000 airports, you'll need a version of Asterisk@Home or TrixBox that includes phpMyAdmin as part of the bundle (TrixBox->SystemAdministration->phpMyAdmin) or the Asterisk Management Portal AAH enhancements (AMP->Maintenance->phpMyAdmin). Download the zipped airports file to your desktop and unzip it. This database is licensed pursuant to a GNU General Public License. It was adapted from the AirSort application on SourceForge if you happen to be looking for a MySQL database containing worldwide airport (iata) codes. Now crank up phpMyAdmin in the Maintenance tab of Asterisk@Home or TrixBox. Then click on the SQL Query Window icon in the top of the left frame. Now click on the Import Files tab, select the airports.sql file on your Desktop, set the Character Set to ASCII, and click the Go button. Once the file is imported, click on the Home icon in the left panel, click on the Databases pull-down, and choose Airports. Then click on the USairports table below it. When the table opens, click on the Browse tab in the right frame to display the file's contents. Nome is the airport name, iata is the airport code, dialcode is the airport code converted to numbers on a touch-tone phone, citta is the city and state of the airport, and main is the field used to designate whether a particular airport can be accessed using a phone. An asterisk in the main field means Yes. Anything else means No. Now click on the DialCode column heading to sort the table by dialcode. As you scroll through the database, you'll see that every group of matching dialcodes has one entry with an asterisk in the main column. Remember that dialcodes are not unique while airport codes (iata) are. Because of the layout of the alphabet on touchtone phones, as many as a dozen airport codes may share the identical dialcode which is why we needed the main field to pick one. As mentioned above, we've already picked one for each dialcode, but you may have your own ideas about which airports to make active depending upon where you live and what cities you care about. If you change the main entry for a dialcode, remember to also blank out the previous one for that dialcode. Otherwise, the last dialcode entry with an asterisk in the main column will win (i.e. that's the city whose weather report will be played) once the application is finished. Now get your airports database set up in a way that meets your needs so that the dialcodes 000 through 999 select the airport locations of interest to you. Don't mess with the iata codes. Even though the database doesn't enforce it, these are unique and need to stay that way.

    In designing this new application for telephone use, it was tempting to support all of the airports in the United States rather than a measily 1,000 of your favorites. To do this, however, would have meant using either zip codes or giving callers a submenu of airport code cities matching a particular dialcode. We've decided to also support zip codes, and we'll cover that in a future column. The dialcode submenu sounded straight-forward enough until we discovered there were some dialcodes with a dozen or more matching airport codes. To force callers to listen to a list of a dozen cities before ever getting to choose a weather report would have been P-A-I-N-F-U-L. So we've opted for the Fab 1,000 thinking that will meet the needs of most folks. As usual, you are free to make changes in the final software to meet your needs. And, if IVR Hell, long phone calls, and 3,500+ airports at the touch of (lots of) buttons are your thing, have at it!

    Downloading the nv-weather Application. In addition to the airport codes database, there are two additional pieces to version 2 of the nv-weather application: a PHP/AGI script that does the heavy lifting and an addition to your dialplan which enables you to dial 611 from any phone on your Asterisk system to obtain a weather report. To install the PHP/AGI script, log into your Asterisk server as root and execute the following commands in order:

    cd /var/lib/asterisk/agi-bin
    wget http://nerdvittles.com/wp-content/nv-weather2.zip
    mv nv-weather.php nv-weather.old.php
    unzip nv-weather2.zip
    rm -f nv-weather2.zip
    chmod 775 nv-weather.php
    chown asterisk:asterisk nv-weather.php

    If you're using version 1 (or later) of TrixBox or if you're using Asterisk@Home and loaded the dialplan script that we covered in Part I of this series, then you've already got the dialplan script so skip the next section.

    Dialplan Code. In order to activate extension 611 to answer calls for weather information using Asterisk@Home, you'll need to drop the following code into your dialplan in the [from-internal-custom] context of extensions_custom.conf. For TrixBox fans, you'll find this code already lurking in /etc/asterisk/extensions_trixbox.conf.

    exten => 611,1,Answer
    exten => 611,2,Wait(1)
    exten => 611,3,DigitTimeout(7)
    exten => 611,4,ResponseTimeout(10)
    exten => 611,5,Flite("At the beep enter the three character airport code for the weather report you wish to retrieve.")
    exten => 611,6,Read(APCODE,beep,3)
    exten => 611,7,Flite("Please hold a moment while we contact the National Weather Service for your report.")
    exten => 611,8,AGI(nv-weather.php|${APCODE})
    exten => 611,9,NoOp(Wave file: ${TMPWAVE})
    exten => 611,10,Playback(${TMPWAVE})
    exten => 611,11,Hangup

    For versions of AAH before 2.8, once you've added this code using AMP->Maintenance->ConfigEdit->extensions_custom.conf, click the Update button to save your changes, and then reload your Asterisk settings: AMP->Setup->IncomingCalls->SubmitChanges and click the Red Bar. If you'd prefer a different extension (rather than 611), just modify the number in each line of the code above. If you're curious how to pass variables back and forth to a PHP/AGI script, here's a good example. In line 8, we're passing the variable ${APCODE} to the PHP/AGI script with the airport code. In lines 9 and 10, the PHP/AGI script is returning the ${TMPWAVE} variable with the file name of the .wav file containing the weather report.

    Housekeeping 101. Temporary files in /tmp get cleaned up by Linux housekeeping automatically. Temporary files stored elsewhere don't. The weather scripts have to store .wav files in the /var/lib/asterisk/sounds path in order to play them from within your dialplan, but it's a good example of how not to design code on busy systems because it places all of the temporary sound files for each reading of these weather reports in /var/lib/asterisk/sounds/tts. So, from time to time, make a mental note to remove all of these files with a command like this:

    rm -f /var/lib/asterisk/sounds/tts/*

    Following our first article, there were a few suggestions on how to automate this with a cron job. Here's the one we like the best. Log into your Asterisk server as root and edit the following file: nano -w /etc/crontab. Move to the bottom of the file and insert the following code on a blank line:

    3 0 * * * /usr/bin/find /var/lib/asterisk/sounds/tts -type f -mtime +14 | /usr/bin/xargs /bin/rm -f >/dev/null 2>&1

    This code will delete all of the files in the tts directory every two weeks. If you'd prefer a shorter time, change the number 14 accordingly. If you'd prefer to just delete all these temporary files each night, here's a simplified version you can use:

    3 0 * * * root rm -f /var/lib/asterisk/sounds/tts/tts*

    Now save your changes: Ctrl-X, Y, then Enter.

    Taking nv-weather For A Spin. Once you've installed the airport codes database, the PHP/AGI script, and the dialplan script, you should be good to go. Pick up a phone on your Asterisk system and dial 611. When prompted, key in the three-character airport code for the desired city, and presto! If you'd like to be able to review which airport codes are supported, take a look at Part I of this weather series and download the companion web application. Enjoy!


    Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

    Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

    Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

    Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!

    Newbie’s Guide to TrixBox 1.0 and FreePBX 2.1.1, Part I

    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.

    Well, the Nerd Vittles staff move is complete, and today we're back in the saddle. So, hello from Charleston, South Carolina! And now there's a brand-new Asterisk@Home: TrixBox 1.0 with a brand-new Asterisk Management Portal: freePBX 2.1.1. So we've got a lot of new ground to cover. These new Asterisk products are designed to support the casual home or home office user's PBX needs as well as gigantic call centers processing millions of calls a month. Everything is free except the hardware on which to run your new system. That can be a $139 refurbished PC or a multi-processor RAID box with mainframe horsepower. For home use, we've had great luck with older refurb units for under $150 each. And, no, we're not on commission. How much commission could there be on this stuff? [Note: Updated TrixBox 1.2.3 tutorial available here.]

    What freePBX brings to the table is an incredibly simple yet powerful, upgradeable web-based GUI to totally manage your PBX. And TrixBox adds all of the Asterisk bells and whistles you could ever ask for in an integrated PBX: full-featured database management, simple hooks to high-level application development tools such as PHP and Perl, an Apache web server, integrated voicemail and fax-to-email support, contact management, calling card billing, hardware autoconfiguration for Digium and Cisco phone hardware, Microsoft networking support, an integrated text-to-speech system, and loads of free utility software applications for Asterisk compliments of Nerd Vittles. And, yes, TrixBox 1.0 still fits on a single CD! For those new to Nerd Vittles, be aware that we make slipstream changes to articles as users discover things we've missed. Yes, we're human! So check for Comments before you begin or subscribe to our Comments RSS Feed. And, last but not least, be sure to add yourself to the Nerd Vittles Fan Club Map.

    The Game Plan. Because of WordPress article length limitations and our own limited attention span, we're going to divide this Guide into several parts. Today, we'll get your new system running so that you can make your first call. In Part II, we'll cover a number of the bells and whistles that make TrixBox and freePBX such a great combination. Then, in Part III, we'll add some more tips and tricks to help you impress your friends whenever the need arises. And, no we haven't forgotten the other installments in our weather report series. Our updated tutorial for TrixBox 1.1 is now available.

    Hardware Setup. You have two choices for hardware to run this new system. The first is to dedicate a machine to TrixBox and download the TrixBox ISO image to burn a bootable CD. Once you create the TrixBox CD, you simply boot your dedicated PC with the new CD. It will erase and reformat your hard disk for use with Linux and the included Linux and Asterisk applications. If you just want to experiment with TrixBox and don't plan to put the system into production other than for one or two simultaneous calls from home, then you may prefer to download the VMware version of TrixBox or VMwarez's enhanced version. With this approach, you install VMware on your existing Windows XP or Windows 2000 system. Then you run Linux and the TrixBox application in a window on your Windows PC. It does not require a dedicated machine. We've found the performance to be virtually identical to running TrixBox on a dedicated PC provided your Windows machine has at least 512MB to 1GB of RAM. See our previous article for step-by-step instructions on the VMware installation process.

    For now, however, we're assuming you've opted for the dedicated machine install: pure Linux on a clean machine. So begin by downloading the TrixBox 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.3 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. We've covered how to use most of the Linux products in our Mac HOW-TO's (see sidebar), and they work exactly the same way with TrixBox so keep reading. And, yes, this install will reformat (aka ERASE) your hard disk before it begins, but it now warns you first. When you're prompted to create your root user password, type in something you can remember ... or write it down!

    Upgrading TrixBox from a Prior Version of Asterisk@Home. In a nutshell, YOU CAN'T. But there is a way to put most of Humpty back together again once you've installed the new system. Before you begin, understand that you are doing this AT YOUR OWN RISK. NO GUARANTEES. If that bothers you, don't do it! The real trick is to do a little printing and copying of your old data before you insert that TrixBox installation disk. Step 1 is to make a full backup of your old system to a different server before you begin. If you don't know how, read our step-by-step instructions on the subject here. Step 2 is to make another copy of some of the critical files in your system. Duplicates of all of these will also be part of your backup. We typically build directories on a separate server which match the ones we'll be copying over from the old Asterisk system. Here are the directories (including all the subdirectories therein) that we always duplicate. Before you just blindly copy our list, stop and think whether there are special things you do on your existing Asterisk system or special apps that you run. Then find those files and make copies of all of them, too. The important piece in making a successful copy of some of these files is to shut down Asterisk (amportal stop) and MySQL (/etc/init.d/mysqld stop) before you begin. NOTE to CRM users: There's a new version of CRM in TrixBox so it's unlikely that you can restore the databases. Check your current version of AAH (help-aah) and see if there is an option (bundle-crm) to pack up CRM to move it to another machine. If so, do it and follow the instructions. We don't use Sugar so we haven't tested this upgrade option. Here are the directories you'll want to back up:

    /var/lib/asterisk/agi-bin
    /var/www/html
    /var/lib/asterisk/sounds/custom
    /var/lib/mysql
    /root
    /etc/asterisk

    Then there are a couple of individual files that you'll also want to preserve:

    /etc/hosts
    /etc/crontab

    The third step is to take screenshots of every screen you've built using the Asterisk Management Portal (AMP) or a prior version of freePBX. Start in the Setup tab and go right down the list of features. For each option in which you have multiple entries (e.g. Extensions and Trunks), call up each entry and print out the full page. Be especially careful in printing the Trunks entries and make sure you write down every line in the PEER Details and USER Details because those which are out of view will not get printed using a screen print. You'll need to manually fill in the ones that aren't displayed. The same goes for Registration Strings which often scroll out of view on the screen. Finally, using CLI (asterisk -r), make a copy of all your Asterisk database entries: database show. Now save all this information in a safe place until we finish the new install.

    Loading CentOS/4 and TrixBox 1.0. Here's how the install went for us, and we'll walk you through getting everything set up so that it can be used as a production server. There is a wrinkle in the installation process because of a Linux kernel upgrade which triggers a bug in Asterisk which triggers a missing component in TrixBox, but we'll get all that fixed up in short order. Once the install begins, you can expect to eat up about 25 minutes with the CentOS 4.3 install. Just be sure to create your new root user password before you walk away, or it will still be sitting there waiting when you return. Once Linux is installed, the TrixBox CD will eject itself, reboot the system, and begin the Asterisk compile and installation. That takes about 25 more minutes to complete.

    Securing Your Passwords. When it's finished and reboots, log in as root with the password you assigned. Type help-trixbox for a listing of the other four passwords that need to be changed. Change them all NOW!

    passwd admin
    passwd-maint
    passwd-amp
    passwd-meetme

    Getting the Latest CentOS Updates. Once your system is secure, load all of the application updates for CentOS 4.3. There now are lots of updates plus a new kernel install so be patient. If you have zaptel cards, read this thread. The command to issue to begin the update process is yum -y update.

    Rebuilding Zaptel. Every time there is a kernel update with yum (which is the case here), ZAP device support needs to be rebuilt using the new kernel. Unfortunately, a RedHat bug caused the rebuilding process to fail. Here's the fix. Log into your new server as root and issue the following commands to determine which new kernel was loaded on your system:

    cd /usr/src/kernels
    ls

    You should see the original kernel 2.6.9-34.EL-something and the new one: 2.6.9-34.0.1.EL-something. Depending upon the processor in your system, the something may be different than our machine. Write down the name of the new kernel directory and substitute it below for 2.6.9-34.0.1.EL-i686. Now issue these commands:

    cd /usr/src/kernels/2.6.9-34.0.1.EL-i686/include/linux
    mv spinlock.h spinlock.h.old
    wget http://nerdvittles.com/trixbox/spinlock.h
    shutdown -r now

    In a perfect world, once the reboot completes, you should have been ready to rebuild ZAP device support. But Andrew inadvertently left out the source code. So here's what you need to do next. Log into your new system as root again and issue the following commands:

    cd /usr/src
    wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.5.tar.gz
    tar -zxvf zaptel-1.2.5.tar.gz
    mv zaptel-1.2.5 zaptel
    cd /usr/src/zaptel
    make clean
    make install
    shutdown -r now

    Now we can rebuild support for your ZAP devices or ztdummy if you have no ZAP devices. Log in as root again and type the following command: rebuild_zaptel. Then reboot your system: shutdown -r now. Now log in as root again and type amportal stop and then genzaptelconf. Now, here's one final housekeeping chore. Log in as root again and issue these commands:

    touch /etc/fxotune.conf
    /usr/sbin/fxotune -s
    shutdown -r now

    Upgrading to Asterisk 1.2.9.1. Because of a serious security vulnerability in Asterisk, we are modifying this article on June 17 to show how to load the Asterisk upgrade for those that followed this initial tutorial. Log into your server as root and issue the following commands in order:

    rpm -del zaptel-modules-2.6.9-34.EL
    rpm -del zaptel-modules-2.6.9-35.EL
    trixbox-update.sh
    trixbox-update.sh update
    reboot
    rebuild_zaptel
    modprobe wcfxo [if you have zaptel hardware]
    genzaptelconf
    reboot

    Now you should be good to go on the software front. Whew!

    Activating Bluetooth Support. Once the updates are completed, activate Bluetooth support if you plan to use it with our Follow-Me Phoning proximity detection application. Run setup, down arrow to System Services, press ENTER, down arrow to bluetooth and press the space bar, tab to OK, press ENTER, tab twice to Quit and press ENTER.

    Activating Apache HTTPS Support. If you want secure Internet web access to your server, log into your system as root and issue these commands. Once https support is installed, you can access freePBX securely: https://AsteriskServerIPaddress.

    yum -y install mod_ssl
    shutdown -r now

    Restoring Asterisk Info Application. One of the nice applications that previously was bundled in Asterisk@Home was Asterisk Info. It gave a detailed summary of many critical components in Asterisk including a listing of active SIP and IAX peers and registry entries. This is especially helpful when you're setting up new providers and want to see whether you're getting connected successfully. To restore the application, log into your server as root and issue these commands:

    cd /var/www/html/maint
    wget http://nerdvittles.com/trixbox/asterisk_info.zip
    unzip asterisk_info.zip
    rm -f asterisk_info.zip

    Now you can run the application using a web browser pointed to the correct IP address of your server: http://192.168.0.108/maint/asterisk_info.php

    Simplifying SSH Access. If you're going to be connecting to other servers from your new TrixBox system using SSH or SCP, then build your new RSA key pair now. This lets you use SSH and SCP (secure copy) without having to enter a password each time. You can also automate backups and proximity detection scripts as we've explained previously here. Log in to your new TrixBox server as root. From the command prompt, issue the following command: ssh-keygen -t rsa. Press the enter key three times. You should see something similar to the following. The file name and location in bold below is the information we need:

    Generating public/private rsa key pair.
    Enter file in which to save the key (/root/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /root/.ssh/id_rsa.
    Your public key has been saved in /root/.ssh/id_rsa.pub.
    The key fingerprint is:
    1d:3c:14:23:d8:7b:57:d2:cd:18:70:80:0f:9b:b5:92 root@asterisk1.local

    Now copy the file in bold above to your other Asterisk servers, Linux machines, and Macs. There's probably a way on PCs as well, but we've all but given up on that platform where security matters so you're on your own there. From your TrixBox server using SCP, the command should look like the following (except use the private IP address of each of your other Asterisk or Linux servers instead of 192.168.0.104). Provide the root password to your other servers (one at a time) when prompted to do so.

    scp /root/.ssh/id_rsa.pub root@192.168.0.104:/root/.ssh/authorized_keys

    On a Mac running Mac OS X, the command would look like this (using your username and your Mac's IP address, of course):

    For user access only: scp /root/.ssh/id_rsa.pub wardmundy@192.168.0.104:/Users/wardmundy/.ssh/authorized_keys
    For full root access: scp /root/.ssh/id_rsa.pub root@192.168.0.104:/var/root/.ssh/authorized_keys

    Once the file has been copied to each server, try to log in to your other server from your new TrixBox server with the following command using the correct destination IP address, of course:

    ssh root@192.168.0.104

    You should be admitted without entering a password. If not, repeat the drill or read the complete article and find where you made a mistake. Now log out of the other server by typing exit.

    Installing WebMin. We don't build Linux systems without installing WebMin, the Swiss Army knife of the Linux World. You can use it to start and stop services, check logs, adjust startup scripts, manage cron jobs, babysit your SendMail server, and many, many other tasks that are downright painful without it. If you ever need help from others, WebMin is a great tool for letting others help you.

    There are lots of ways to install WebMin. WebMin now is part of the TrixBox yum repository so, after logging in as root, just issue the following command: yum -y install webmin.

    WebMin runs its own web server on port 10000. To start WebMin, issue this command: /etc/webmin/start. You access it with a web browser pointed to the IP address of your Asterisk box (i.e. replace 192.168.0.108) at the correct port address, e.g. http://192.168.0.108:10000. Note, https support won't work on port 10000 without a bit of additional tweaking! The login name is root. Then type in your root password and press enter. The main WebMin screen will display. We really don't want the WebMin server starting up each time the OS reboots so do the following. Once you're logged in to WebMin, choose System->Bootup and Shutdown and then click on webmin. Click the No button beside Start at boot time, and then click the Save button. To stop WebMin when you're finished using it, issue this command: /etc/webmin/stop. You can restart it any time you need it, and then use a web browser to access it. But there's no need to waste processing resources. For complete WebMin documentation, click here.

    If you're going to be accessing WebMin from outside your firewall, you really don't want to be logging in as root over an unencrypted connection so let's enable https support for WebMin. While still logged into WebMin, click WebMin->WebMin Config->SSL Encryption. Now click Install Net::SSLeay Perl Module. Once the module is downloaded, click the Continue With Install button. The make and make install process will take a minute or two. Once you get the completed sucessfully message, click Return to WebMin. Choose WebMin->WebMin Config->SSL Encryption again. At the bottom of the form, click the Create Now button to create your SSL key. Click Return to WebMin again. Then choose WebMin->WebMin Config->SSL Encryption once more. Change the Enable SSL if available option to Yes, leave the other defaults, and save your changes. Henceforth, you can log into your server using HTTPS: https://TrixBoxIPaddress:10000/.

    IP Configuration for Asterisk. We need a consistent IP address or domain name both on your internal network and externally if you expect to receive incoming calls reliably. There are three pieces to the IP configuration: (1) setting the internal IP address of your Asterisk server, (2) configuring a fully-qualified (external) domain name for your new server which will always point to your router/firewall, and (3) configuring your router to transfer incoming Asterisk packets to your Asterisk server. Here's how.

    First, log into your server as root using your new password. Now type ifconfig eth0 (that's "e-t-h-zero") then enter, and write down both your inet addr and your HWaddr on the Ethernet 0 interface, eth0. Inet addr is the internal IP address of your Asterisk box assigned by your DHCP server (i.e. your router/firewall). HWAddr is the MAC address of your Asterisk server's eth0 network card. To assure a consistent internal IP address, you can either configure your router/DHCP server to make certain that it always hands out this same address to your Asterisk machine, or you can manually configure an IP address for this machine which is not in the range of addresses used by your DHCP server. Almost all routers now make it easy to preassign DHCP addresses so we prefer option 1. It's generally under the tab for LAN IP Setup or DHCP Configuration and is generally called something like Reserved IP table. Just add an entry and call it Asterisk PBX and specify the IP address and MAC address that you wrote down above. Now each time you reboot your Asterisk server, your router will assign it this same IP addreess.

    To assure a consistent external address is a little trickier. Unless you have a static (fixed) IP address, you'll want to use a Dynamic DNS service such as dyndns.org and configure your router to always advertise its external IP address to dyndns.org. DynDNS.org will take care of revising the IP address associated with your domain name when your ISP changes your dynamic IP address. Then you can configure your VoIP provider account using your fully-qualified dyndns.org domain name, e.g. windswept.dyndns.org provides access to our beach house network even though Time Warner cable hands out dynamic IP addresses which change from time to time.

    Now you'll need to log into your router and redirect certain incoming UDP packets to the internal IP address of your Asterisk machine. If you want external access to the Apache web server on your Asterisk machine, then map TCP port 80 to the internal IP address of your Asterisk system. For WebMin external access, map TCP port 10000 to your Asterisk system. If you want remote access to your Asterisk system via SSH, then map TCP port 22 to the internal IP address of your Asterisk system. If you want external IP phones or other Asterisk servers to be able to communicate with your Asterisk system, then map the following UDP port ranges to the internal IP address of your Asterisk system:

    SIP 5004-5082
    RTP 10001-20000
    IAX 4569

    For more details, read our full article on the subject.

    Finally, you'll need to tell Asterisk about some of this. Edit the sip.conf file (nano -w /etc/asterisk/sip.conf) and add the following entries in the [general] section of the file using your fully-qualified domain name for your server and the private IP address range used behind your router/firewall (typically 192.168.0.0 or 192.168.1.0 with most home routers):

    externhost = yourdomainname.dyndns.org
    localnet=192.168.0.0/255.255.255.0
    nat=yes

    Designing Your PBX System. For those new to the Asterisk world, we'll be using a web-based GUI to configure Asterisk to meet your needs. Step 1 is to get away from your computer and sit down with a piece of paper. Now lay out how you'd like your new system to operate. How many phones will you have? Will they be software-based phones or good old phones you can put on a desktop? Will they be POTS phones (plain old touchtone phones), cordless POTS phones, SIP phones, IAX phones, or cordless SIP phones? How will you make and receive calls? Are you going to use an existing Ma Bell phone line or VoIP trunk lines from one or more VoIP providers? What should happen when incoming calls arrive? Do you want the caller to get an AutoAttendant message ("Hi. You've reached the Mundy's. Press 1 for Mary, 2 for Ward, or 3 to leave a message.") or do you just want all of your phones to start ringing? What should happen when no one answers or the line is busy? Do you want the calls transferred to a cell phone, another POTS phone, or just sent to voicemail? Which voicemail account? Should all busy phones send callers to the same voicemail account, or do you want one for each phone? What should happen once voicemail arrives? Do you want the phone to ring once a minute? Do you want the message waiting indicator to illuminate? Do you want the voicemail message to be emailed to you? Do you also want it preserved so that you can retrieve it from a touchtone phone? Do you want to be paged with the number of the person that called you?

    ATTN: "Type A" Males. With apologies to our female readers, let me chat privately for a moment with the guys. If you have a wife (and want to keep her) or if you have teenage daughters (and want to avoid being killed in your sleep), you'd better get most of this PBX design right if you plan to use Asterisk to replace your existing home phone system. Otherwise, the day after you install your new system, a typical discussion with your spouse will begin with something like this: "What was wrong with our old phones that just rang when someone called and I could actually hear what they were saying when I answered?" With that caveat in mind, let's jump right in to freePBX.

    Today's Objective. Keeping in mind that there are a million ways to configure and customize a PBX, we're going to walk you through a very simple setup today. Our objective is to get Asterisk and freePBX configured so that you can make a call and receive a call. In our next article, we'll start adding all the bells and whistles. But, for today, we'll show you how to set up an incoming and an outgoing VoIP trunk so you can make and receive free calls (at least in the U.S.) using a free softphone. When no one answers, the call will be sent to voicemail. And, when a voicemail message is left, the message will be emailed to you. We'll leave integration of existing POTS phones and phone lines for another day.

    Choosing VoIP Providers. As you will quickly learn, choosing VoIP providers is an art, not a science. And it can be a slippery slope. A provider that is great one day can turn into an absolute nightmare the next. Take BroadVoice, for example. They used to be one of our favorites. Then the CEO left, and the company's business practices, uh, changed to put it charitably. You can read all about it on this forum or at the Better Business Bureau's site. All it takes is a change in leadership or direction at the company headquarters to go from first to worst overnight. So the best advice we can offer about choosing providers is this. Stay Flexible! Don't put all your eggs in one basket. And don't be in a hurry to disconnect your Ma Bell line and transfer your number until you are pretty confident about your provider. Six months is an absolute minimum, and a year is probably better. VoIP providers come and go at about the same pace as fast food restaurants in a new community.

    Having said all of that, we have some providers we really like and some that we don't. YMMV! The basic idea in switching to Voice Over IP technology was to save money... not just for the provider, but for you, too. So PRICE MATTERS. There are typically three types of VoIP service: all-you-can-eat at a fixed monthly price, pay-as-you-go at a per minute (or part of a minute) rate, and free. Some providers only offer outbound service, and others offer incoming and outgoing calls. To receive calls, you've got to have an account with a provider that will give you a phone number unless you want to only get calls from other users of that provider's service, e.g. Skype. You don't have to use the same provider for inbound and outbound calls, and you are better off with backup providers for BOTH inbound and outbound calls.

    If you select an all-you-can-eat plan, you basically get the right to make (or receive) ONE phone call at a time to a certain geographic area. This may be a state, an area code, or a country depending upon where you live and which provider you choose. The best of these in the U.S. is TelaSIP at $14.95 a month for unlimited U.S. calling. The runner-up is Axvoice which has a broader variety of plans including an unlimited international calling plan at $22.99 a month. Be aware of the fine print with all-you-can-eat providers. Some such as Teliax don't really offer unlimited calling even tough they call it that. What they offer is unlimited calling up to some monthly cap of minutes. For example, with Teliax, up to 1500 minutes a month are "free" and then you pay 2¢ per minute thereafter. They're not really free because you've paid a $24.99 monthly fee for the initial 1,500 minutes. Then there's our old favorite BroadVoice which now offers unlimited calling with a little asterisk. After you drill down to the third level in their web pages, you'll see this in the fine print: "* Significant restrictions apply to Unlimited Plans." If you violate their undefined "normal residential usage patterns", you agree in advance to let them retroactively charge you 5¢ per minute for every call you've made since you signed up... plus $300/hour in in-house legal fees for successful collection. I wonder if they pay their staff attorneys that much? Their terms of use give them unfettered discretion in defining what's appropriate and inappropriate use. And, arguably, even having multiple people in your household use your "unlimited plan" violates their terms of service. So, unless you've recently won the lottery or just enjoy litigation, here's our best advice on BroadVoice: JUST SAY NO!

    With pay-as-you-go providers, there typically are no simultaneous call limitations because you're paying by the minute per call. Some of these providers charge in whole minute increments while others round calls to as little as six second billing increments. Some leave their rates the same for six months or more. Others change their rates almost daily. You don't want to have to visit a web site each time your phone rings to determine what it will cost to pick up the phone. So be alert in choosing a pay-as-you-go provider. The best of the bunch in our opinion is Voxee.com at about a penny a minute for U.S. calls and only slightly more for calls to many international destinations.

    And then there are the free providers. Here's a good rule of thumb. Enjoy it while it lasts. Don't expect free to last forever. And, most importantly, READ THE FINE PRINT. It costs the provider something to offer the service and, if they're giving the service away, there IS a catch. You just have to be smart enough to figure out what it is. The best freebies at the moment are VoipDiscount.com for free outbound calls to numerous countries including the U.S. at least today, FreeDigits.com for free incoming DIDs, free incoming calls, and free incoming fax service, and Stanaphone.com for free incoming DIDs and free incoming calls. See our complete list of VoIP Provider reviews for additional information and setup instructions.

    If you just want to experiment with your new system and don't want to cough up much money, here's a good way to get your feet wet. Sign up for a free incoming DID number and free incoming calls with Stanaphone's Stana-IN service and sign up with VoIPDiscount.com for free outbound calls. You'll need a Windows machine to initially sign up for both of these services. See our tutorials for details. You won't have a phone number in your local area code, but folks will be able to call you. If you want a number in your local area code and you live in the U.S., sign up for TelaSIP's basic service at $5.95 a month which gets you a local phone number and free unlimited incoming calls ... one at a time. Outbound calls in the U.S. are 2¢ a minute which gives you a good backup to your free VoIPDiscount outbound calling service. There are no obnoxious terms of service or hidden fees with TelaSIP. Just use the service for residential calling.

    Downloading a Free Softphone. Unless you already have an IP phone, the easiest way to get started and make sure everything is working is to install an IP softphone. You can download a softphone for Windows, Mac, or Linux from CounterPath. Or download the pulver.Communicator or the snom 360 Softphone which is a replica of perhaps the best IP phone on the planet. Here's a new IAX softphone for all platforms that's great, too, and it requires no installation: Idefisk. All are free! Just install and then configure with the IP address of your TrixBox server. For username and password, use the extension number and password which we'll set up shortly with freePBX. Once you make a few test calls, don't waste any more time. Buy a decent SIP telephone. We think the best value in the marketplace with excellent build quality and feature set is the $85 GrandStream GXP-2000. It has support for four lines, speaks CallerID numbers, has a lighted display, and can be configured for autoanswer with a great speakerphone. Short of paying over double for the snom 360, that's as good as desktop phones get. If you want to use Asterisk throughout your home, buy a good 5.8GHz wireless phone system with plenty of extensions such as the Uniden 8866 which we use (see ad below) and then purchase an SPA-3000 to connect up both your home phone line and all your cordless phones. Our tutorial will show you how.


    Initial Setup of freePBX. You still access freePBX just as you accessed the Asterisk Management Portal (AMP), by pointing a web browser to the internal IP address of your new Asterisk system. The username is still maint. Just enter the password you assigned to freePBX/AMP when you configured your system. In the old days, AMP came preconfigured with everything they thought you'd need to use it. With the new freePBX architecture, you first have to install and enable the modules you want to use. And now others can write modules to expand the capabilities of freePBX without futzing around in the basic source code. You get to these modules by clicking the freePBX option from the TrixBox main menu. Then choose Tools->Module Admin from the main freePBX menu. Unlike some applications, there's really no reason not to activate all of the available modules since they won't slow down Asterisk. The only performance hit is when you click the Red Bar to reload freePBX. The more modules you've activated, the longer it will take to reload freePBX since it queries each module to see if changes need to be applied. So, in the Module Administration screen, click Connect to Online Module Repository to first download all of the available modules. Then select all of the Disabled Modules and Enable them. Click Submit and then the Red Bar to save your updates. From time to time, you need to revisit this page to upgrade the modules as bug fixes are released.

    As you can see, there are two types of Modules: Local Modules and Online Modules. Local Modules are the pieces that make freePBX work on your local machine. Online Modules provides access to modules which are available for download over the Internet. And Online Modules tells you which ones are newer than the ones currently on your system. Before too long, we wouldn't be surprised to see an option to email you notices when new modules are released or older ones are updated. This is nothing short of fantastic for the Asterisk community if we do say so.

    Last but not least, for each Module, there now is online documentation. You can read about all the Module pieces by clicking here. Once you complete the above steps, you're ready to set up your new system.

    Configuring freePBX Trunks. When you click the Setup tab in freePBX, the first thing you'll notice is there are a lot more options. Start by adding your Trunks. This works pretty much like it always has. Choose ZAP, IAX2, SIP, or ENUM for each trunk and proceed accordingly. Down the road, the grand plan is to have sample settings for each provider on line here. Very cool!

    For our sample setup today, we'll configure SIP trunks for Stanaphone, TelaSIP, and VoipDiscount. For each provider, click on the Setup->Trunks tab in freePBX. Then click Add SIP Trunk. After you complete the entries for each provider, click Submit Changes and then the Red Bar.

    StanaPhone Trunk Setup. Here are the entries for the Stanaphone SIP trunk. For Outbound CallerID, enter the phone number assigned to you by StanaPhone. For Maximum Channels, enter 1. Leave the Dial Rules and Dial Prefix blank for the time being.

    For Outgoing Settings, enter a Trunk Name of stanaphone. For Peer Details, enter the following using your assigned username and password. Be very careful to match the upper and lower case settings in your assigned password.

    host=sip.stanaphone.com
    insecure=very
    nat=yes
    secret=yourpassword
    type=peer
    username=yourusername

    For Incoming Settings, enter a USER Context of from-pstn. This tells Asterisk to process incoming calls through this context in your dialplan. For USER Details, enter the following using your assigned username and password:

    canreinvite=no
    dtmfmode=rfc2833
    host=sip.stanaphone.com
    insecure=very
    nat=yes
    secret=yourpassword
    type=peer
    username=yourusername

    For the Registration String, enter the following using your assigned username, password, and 347 phone number:

    yourusername:yourpassword@sip.stanaphone.com/3471234567

    Click the Submit Changes button and then click on the Red Bar to save your trunk settings and reload Asterisk. To be sure you have properly registered with Stanaphone, run the Asterisk_Info application which we installed above using your correct IP address: http://192.168.0.108/maint/asterisk_info.php. Under SIP Peers, you should see an entry for sip.stanaphone.com showing a state of Registered. If not, check your username and password entries for typos.

    TelaSIP Trunk Setup. Here are the entries for the TelaSIP SIP trunk. For your Outbound Caller ID, fill in the local phone number provided by Telasip. For Maximum Channels, enter 1. For Dial Rules, enter the following:

    1|NXXNXXXXXX
    NXXNXXXXXX

    In the Outgoing Settings section, name your trunk telasip-gw and then enter the following PEER details using your TelaSIP-assigned username and password:

    context=from-pstn (if that doesn't work use: from-trunk)
    dtmfmode=rfc2833
    host=gw3.telasip.com
    insecure=very
    secret=yourpassword
    type=peer
    username=yourusername

    Leave the Incoming Settings User Context and User Details blank. For your Registration string, enter the following: yourusername:yourpassword@gw3.telasip.com using your actual username and password assigned by TelaSIP. Click Submit Changes and then the red bar to restart Asterisk. Use Asterisk_Info as we did with Stanaphone to be sure you are registering successfully with TelaSIP.

    VoipDiscount Trunk Setup. Here are the entries for the VoipDiscount SIP trunk. Create a SIP trunk for the service with a Trunk Name of voipdiscount. VoipDiscount doesn't support an outbound CallerID number so leave it blank. The Outgoing Dialing Rules in the U.S. should look like this:

    001+NXXNXXXXXX
    00+1NXXNXXXXXX

    Add the following PEER Details in Outgoing Settings using your own username (in three places!) and password. Leave the Incoming Settings blank.

    allow=ulaw&alaw
    authuser=yourusername
    disallow=all
    fromdomain=sipdiscount.com
    fromuser=yourusername
    host=sip.sipdiscount.com
    insecure=very
    nat=yes
    qualify=yes
    secret=yourpassword
    sendrpid=yes
    type=peer
    username=yourusername

    For the Registration String, enter the following using your own username and password:

    yourusername:yourpassword@sip.sipdiscount.com

    Click the Submit Changes button and click the Red Bar to update Asterisk. Use Asterisk_Info as we did with Stanaphone to be sure you are registering successfully with VoipDiscount.

    When you have your Trunks set up, you'll need a way to call out (Outbound Routes), to call in (Inbound Routes), and to process incoming calls: a Digital Receptionist, a Call Queue, a Custom Application, DISA, or a phone to ring (Extensions). For today, we'll get the phones to ring. Then we'll tackle the other options in Parts II and III.

    Configuring Outbound Routes. Outbound routes are the rules that determine how calls that are dialed from an extension on your system get processed. The idea here is that you set up a list of priorities. Then, based upon the number dialed, the outbound rules figure out how to route the call. We're going to start with a simple Outbound Route called Everything which will process all calls that are not handled by another Outbound Route. Click Setup->Outbound Routes->Add Route and enter the following:

    Route Name ... Everything
    Route Password ... [leave it blank]
    Pin Set ... [leave it blank]
    Emergency Dialing ... [leave it blank]
    Dial Patterns: (adjust these if you wish to permit international calls!)
    1NXXNXXXXXX
    NXXNXXXXXX
    Trunk Sequence:
    0 sip/voipdiscount
    1 sip/telasip-gw

    Once you've made all the entries, click the Submit Changes button and then the Red Bar to reload Asterisk. You will be able to place calls by dialing either an area code and phone number or 1 plus an area code and phone number. For international callers, our previous articles will walk you through configuring the dial strings to support various countries. Now you should see two Outbound Routes in your route list. We want to delete the other route so just click on it and then choose Delete Route and click the Red Bar to save your changes. Now there should be only the Everything route in your Outbound Routes list. We'll leave it like that for today, but down the road, we'll add options for emergency calls, toll-free calls, in-state calls, and international calls. After we make those additions, the Everything route will be used as our lowest priority catch-all for calls that don't qualify for processing by another route.

    Setting Up Extensions. To add a new extension and voicemail account to your system, click Setup->Extensions->Add SIP Extension and enter the following:

    Extension Number ... 500
    Display Name ... Office
    Extension Options
    Direct DID ... [your 10-digit TelaSIP phone number if you have one; otherwise, leave blank]
    DID Alert Info ... [leave blank]
    Outbound CID ... [your 10-digit TelaSIP phone number if you have one; otherwise, leave blank]
    Emergency CID ... [your 10-digit TelaSIP phone number if you have one; otherwise, leave blank]
    Record Incoming ... On Demand
    Record Outgoing ... On Demand
    Device Options
    secret ... 1234
    dtmfmode ... rfc2833
    Voicemail & Directory ... Enabled
    voicemail password ... 1234
    email address ... yourname@yourdomain.com [if you want voicemail messages emailed to you]
    pager email address ... yourname@yourdomain.com [if you want to be paged when voicemail messages arrive]
    email attachment ... yes [if you want the voicemail message included in the email message]
    play CID ... yes [if you want the CallerID played when you retrieve a message]
    play envelope ... yes [if you want the date/time of the message played before the message is read to you]
    delete Vmail ... yes [if you want the voicemail message deleted after it's emailed to you]
    vm options ... callback=from-internal [to enable automatic callbacks by pressing 3,2 after playing a voicemail message]
    vm context ... default

    Configuring Inbound Routes. Just as we had to tell Asterisk how to process outbound calls, you also have to define what to do with incoming calls from each of your inbound trunks. Be aware that different service providers have implemented SIP and IAX differently. One of the best providers for proper SIP implementation is TelaSIP because you can route incoming calls based upon the DID numbers associated with each trunk. So you could have one incoming trunk from TelaSIP with multiple DID numbers (for each of your children, for example). Each DID then could be routed to a specific extension, and each extension could have its own CallerID number for outbound calls ... even though you might only have one TelaSIP trunk line. So, to outside callers, it would appear that each individual had his or her own phone line even though everyone might be sharing one or two trunks.

    For today, we'll get a default inbound route established, and we'll save the gee whiz stuff for the next chapter. To create a Default Inbound Route for your calls, choose Setup->Inbound Routes->Add Route. Then enter the following:

    DID Number ... [leave blank]
    CallerID Number ... [leave blank]
    Zaptel Channel ... [leave blank]
    Fax Extension ... disabled
    Fax Email ... [leave blank]
    Fax Detection Type ... none
    Pause After Answer ... [leave blank]
    Privacy Manager ... no
    Alert Info ... [leave blank]
    Destination: ... Core: Office 500

    Click Submit and then OK when you're warned that this will create a default incoming route for your calls. Down the road as you add additional incoming routes, the new routes will take precedence unless there's no matching DID in which case this default route will be used.

    If you want to create a separate incoming route for your Stanaphone calls just to see how it works, click Add Incoming Route and enter the following:

    DID Number ... [your 10-digit Stanaphone number]
    CallerID Number ... [leave blank]
    Zaptel Channel ... [leave blank]
    Fax Extension ... freePBX default
    Fax Email ... [leave blank]
    Fax Detection Type ... NVfax
    Pause After Answer ... 2
    Privacy Manager ... no
    Alert Info ... [leave blank]
    Destination: ... Core: voice mailbox 500

    The trick to learn here is that if you want an incoming DID to go straight to voicemail, you need a slight pause to let Asterisk get properly set up for the call or the first couple seconds of your voicemail announcement will be cut off. By adding two seconds of fax detection, everything will work swimmingly.

    Allowing Anonymous Inbound SIP Calls. One final step, and your incoming calls should start arriving without a "this number is not in service" message. Choose Setup->General Settings and scroll to the bottom of the page. Under Security Settings, change Allow Anonymous Inbound SIP Calls from No to Yes and click Submit Changes and then the Red Bar. Once this change is made, inbound calls from Stanaphone will work reliably.

    Activating Email Delivery of VoiceMail Messages. When you're out and someone leaves you a voicemail message, TrixBox and freePBX will let you forward that voicemail message to your email address as a .wav file which can be played within most email client software. Or you can have the system send an instant message to your cell phone or pager telling you who called, what their phone number was, and how long a voicemail message the person left for you. Or you can do both. In addition, you can tell the system whether to delete the voicemail from your Asterisk server after sending it to your email account. In short, you now can manage all of your incoming email and voicemail from a single place, your email client. In order to send out emails from your server, you'll need to make a few changes.

    First, make this adjustment to the /etc/hosts file on the server. Since anonymous emails are blocked by most ISPs, you'll need a fully-qualified domain name for your server. If you don't have your own domain, the easiest alternative is to use the fully-qualified domain name that your ISP assigns to the IP address for your broadband connection. Don't forget to update it when your ISP changes your IP address! To find out what your fully-qualified domain name is, go to a command prompt on your Asterisk server and type: nslookup 123.456.789.001 substituting your public IP address for the preceding numbers. Then write down the name entry without the trailing period. Now edit the hosts file: nano /etc/hosts. Move the cursor to the second line which reads 127.0.0.1 asterisk1.local , and then move the cursor over the first letter of the first domain name shown, usually asterisk1.local. Now type in the fully-qualified domain name you previously wrote down and add a space after your entry. Don't erase the existing entry! Save your settings: Ctrl-X, y, enter. Now restart network services on your Asterisk machine: service network restart.

    Next, you need to modify the email message which delivers your voicemails so that it includes your fully-qualified domain name. Don't do this in TrixBox, or you'll mess up the formatting of the email message. You can download a fresh copy here if you need it. Instead, use nano: nano -w /etc/asterisk/vm_email.inc. Press Ctrl-W, type AMPWEBADDRESS, and press the enter key. Delete the word AMPWEBADDRESS and then type either the fully-qualified domain name for your Asterisk server or the private IP address if you only want to read your emails from behind your firewall. When you start typing, the text display may jump all over the place because of word wrap. Don't freak out. You haven't messed anything up. Once you complete your entry, don't erase or change anything else. Save the file: Ctrl-X,Y, then enter.

    Now edit vm_general.inc: nano -w /etc/asterisk/vm_general.inc. Change the serveremail entry of vm@trixbox to an email name at the same fully qualified domain you used in your /etc/hosts file above. Then save your configuration and restart Asterisk: amportal restart. If you continue with this setup and still don't receive emails, here's another configuration change that is sometimes necessary. You'll also need to do it if you reloaded settings from an older version of Asterisk. On the Asterisk terminal, log in as root. Switch to the directory where the SendMail configuration file is stored: cd /etc/mail. Make a backup of the config file: cp sendmail.cf sendmail.cf.bak. Then issue the following command: echo CGasterisk.dyndns.org >> sendmail.cf. Substitute the actual domain name of your Asterisk server for asterisk.dyndns.org, but be sure it's preceded by CG with no intervening spaces.Then restart SendMail on your server and try again: /etc/rc.d/init.d/sendmail restart. Finally, if your ISP doesn't permit downstream mail servers (that's you), then take a look at this link which will show you how to designate your ISP as your SMTP smart host using SendMail.


    Activating the Nerd Vittles Weather Forecasts in TrixBox. TrixBox now includes the Flite text-to-speech engine as well as the Nerd Vittles weather forecasting system. To use it, just dial 611 from a phone on your system and enter a 3-character airport code to retrieve the weather forecast. We now support about 50 airports. In our next installment, that will be expanded to 1,000 so stay tuned. For complete instructions, read our original article.

    Creating Wakeup Calls in TrixBox. To set up a wakeup call from any extension, dial *62 and enter a two-digit hour and two-digit minute for the wakeup call.

    Determining the Extension Number of Any Phone on Your TrixBox System. To determine the extension number of any phone on your system, dial *65 from that extension.

    Retrieving VoiceMail from Any Phone With TrixBox. To retrieve voicemail for any extension, dial *98 and enter the voicemail extension number. When prompted, enter the password for that account. To retrieve voicemail for the extension from which you are calling, dial *97 and enter the password for the account when prompted. You can also set your voicemail defaults and record your voicemail greetings using these options.

    Useful Functions on Your TrixBox System. Here's the complete list of functions that will work out of the box from any extension on your TrixBox system:

  • 611 The Latest Weather Forecast
  • *62 Schedule a Wakeup Call
  • *65 Decipher Extension Number of Any Phone
  • *70 Activate Call Waiting
  • *71 Deactivate Call Waiting
  • *72 Enable Call Forwarding (include forwarding number to avoid prompt)
  • *73 Disable Call Forwarding
  • *90 Enable Call Forwarding on Busy (include forwarding number to avoid prompt)
  • *91 Disable Call Forwarding on Busy
  • *78 Enable Do Not Disturb
  • *79 Disable Do Not Disturb
  • *97 Access Voicemail for Calling Extension
  • *98 Access Voicemail with Prompt for Mailbox Number
  • Well, that should get you started. We'll tackle the gee whiz features in TrixBox and freePBX in our next article so visit us again soon. In the meantime ...


    Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has continued their limited time special on hosting services. For $6.95 a month, you can host up to 6 domains with 15GB of disk storage and 400GB of monthly bandwidth. Free domain registration is included for as long as you have an account. It doesn't get any better than that, and their hosting services are flawless! We oughta know. We've tried the best of them. If you've never tried a web hosting provider, there's never been a better time. Just use this link, and we'll all be happy.


    Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

    Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

    Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

    Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!


    Some Recent Nerd Vittles Articles of Interest...