The Most Versatile VoIP Provider: FREE PORTING

Introducing Version 3 of the Plug-and-Play Asterisk IP PBX for the Intel Mac

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.

We don’t usually write about stuff we haven’t personally tested, but we’re making a partial exception today because we don’t (yet) own an Intel Mac. Donations, anyone? Where were we? Thanks to the work of literally hundreds of developers, there is a terrific Asterisk IP PBX with an incredible array of additional bells and whistles. That product which we have tested extensively is TrixBox 1.2.3. It’s so good, in fact, that we chose it as the base system for all of the Nerd Vittles applications that we write about each week. For Halloween last year, we introduced Version 3 of our Plug-and-Play Asterisk IP PBX for Windows. Then a week later, we showed how to take a standard install of TrixBox 1.2.3 on Linux and NerdVittlize it into the equivalent of our version 3 build for Windows. When you were finished, you had a secure, turnkey Asterisk IP PBX with all of the Nerd Vittles software collection and virtually every mission-critical add-on anyone could ever dream of for a phone system: freePBX, an Apache web server, a SendMail server, PHP, MySQL, WebMin, SugarCRM contact management, FTP and SSH support, Perl, integrated fax-to-email support, calling card billing, and more. And it all runs quite peacefully in a CentOS 4.4 Linux wrapper on either a dedicated Linux machine or on your Windows Desktop.

What was missing unfortunately was a way to run this same system on a Mac. Yes, there’s an Asterisk implementation on the Mac platform. But it’s downright primitive compared with the systems we’ve been writing about for the last 18 months. So today we have not one but two special treats for the Mac enthusiasts of the world. First, it’s now possible to run our standard Version 3 system using the new VMware beta for the Intel Mac. You can download it here (561MB). You’ll also need to install the VMware Fusion beta software on your Intel Mac. Just fill out this form and then download the software. At least the beta is free, and the clients have remained free on other platforms.

Thanks to one of our great contributors, Gillam Hall, there’s now another alternative: a Parallels Desktop image of our Version 3 Asterisk system. You’ll first need to purchase and install Parallels Desktop on your Intel Mac. Parallels Desktop requires Mac OS X 10.4.6 or later. Then you can download the Parallels Desktop image of Version 3 here (535MB).

After installing either VMware Fusion or Parallels Desktop on your Mac, all you need to do is download either our standard VMware Version 3 Build or the new Parallels Version 3 .tar.gz Build, decompress the archived file, and run it in a VMware or Parallels window on your Mac Desktop. Once you get it running, hop over to our Version 3 tutorial for Windows and configure your system. To maximize performance, make sure you also apply the tweaks covered in the Comments to that tutorial. The total setup time is about 30 minutes once you have the download in hand. Enjoy!

What To Do Next. Once your new PBX is humming away, here are the next steps. First, you’ll want to upgrade freePBX to version 2.2.x. The tutorial to walk you through the drill can be found here. Last but not least, you’ll want to apply the latest Asterisk security patches to prevent a denial of service attack on your system. The tutorial for that can be found here.

Securing AsteriDex. Because of a security vulnerability in our very own AsteriDex, you’ll need to download and install this simple patch as well. 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

Nerd Vittles Birthday Bash: freePBX 2.2.0, TrixBox for Macs, CallerID Trifecta for Asterisk, and…

We made some New Year’s Resolutions this year… that we intend to keep. So, no, we’re not going to discuss losing weight. Our most important resolution was to stop getting caught up in upgrade-itis with Asterisk® and TrixBox. After all, we’re building phone systems that folks expect to be considerably more reliable than their Windows desktop machines… which doesn’t take much. We’ve gotten literally hundreds of emails asking the same two questions: when do we plan to switch to TrixBox 2.0 and how about upgrading to Asterisk 1.4? Our answer is always the same to both questions: not anytime soon. Why? Because there is almost nothing that can’t already be done with TrixBox 1.2.3. It’s 99% reliable, at least once you NerdVittlize It using our upgrade script. So what do these upgrades buy you other than another version number? Who knows? We’d suggest you do a lot of reading before making the leap. Start with Chris Sherwood’s Guide and see if there’s some new feature you really can’t live without. And then check out the TrixBox Help Forum to determine if you can deal with the reported problems. That’s the balancing act we all have to perform, and we’ll let you know when we finally take the plunge. For now, we’re happy with the feature set in TrixBox 1.2.3, and it lets us build reliable snap-on applications that really make a phone system hum. If there are features you don’t need or use, just turn them off. That’s what WebMin is for! Think of it as TrixBox 2.0 in reverse. Instead of enabling apps, you disable them. Are you really that short on disk space? As for the feature set, you’re not missing much. Our home phone system has so many gimmicks and gizmos that some callers (mostly my perverted friends) ask to speak to Allison when they call. She doesn’t live with us. She’s a nice Canadian girl, but you might still enjoy listening to her recent interview with Ronald Lewis.

Having said all that, there’s one new product for Asterisk that is nothing short of incredible. That’s the Rob Thomas & Co. upgrade of freePBX to 2.2.0. While the developers have conservatively numbered the new version, don’t be deceived. It’s more like 3.0 compared to the 2.1.3 version that ships with TrixBox 1.2.3. Why the enthusiasm? Because freePBX now includes the toolset that lets developers add unlimited new functionality without mucking around in the basic freePBX code. We’ll show you what we mean in a little bit so hang in there. Our diatribe is almost over.

We’ve also gotten a lot of questions about whether we’ve looked at AsteriskNOW, the new "appliance" from Digium. Yes, we’ve looked and we’ve read some excellent documentation. If all you want to do is set up some extensions around your house and replace your answering machine, it looks like an interesting product. What’s missing? Well, the 80 million things you can do with freePBX for openers. So we actually thought about writing a HOW-TO covering installation of freePBX 2.2.0 with AsteriskNOW, but then we remembered our New Year’s Resolution, not to mention the Asterisk 1.4 wrinkle with a bunch of missing commands. They call them "deprecated." It’s a nice word for throwing the baby out with the bath water. To save a few lines of code, the Asterisk developers removed some important, old commands from the product. So now application developers have to review and update every piece of code they’ve ever written for Asterisk to make sure there aren’t any deprecated commands lurking. To make matters worse, you have to have different versions of applications to run on Asterisk 1.2 and Asterisk 1.4. Dumb idea not to mention a huge waste of time and talent! So… here’s our bottom line: why reinvent the wheel when TrixBox 1.2.3 is rock-solid reliable and when TrixBox uses the very best tools in the business: Asterisk 1.2.12.1, Apache, MySQL, PHP, Flite, SendMail, SugarCRM, and on and on we go. Aside from the IAX security hole which our upgrade script patches, every one of these applications is a proven winner which brings us back to freePBX.

You really, really need freePBX 2.2.0! We plan to build all of our future goodies using it so climb on board today. We promise. You’ll enjoy the ride… every week! If you’re using TrixBox 2.0, you’re all set. If not, here’s how to upgrade your TrixBox 1.2.3 system to freePBX 2.2.0 in about 10 minutes! There’s nothing hard about any of this. The remainder of this article does assume that you have installed TrixBox 1.2.3 from the original .iso image and then NerdVittlized it on a dedicated Linux machine OR that you’ve installed our VMware/Windows XP version of TrixBox 1.2.3 which comes NerdVittlized out of the box. Otherwise, as they say, YMMV. If you’re new to all of this and have no idea what NerdVittlizing means, read up on the gerund here, and then come back and join us once you’ve secured your system and added all of the the Nerd Vittles goodies.

When we get finished with the freePBX upgrade to your TrixBox 1.2.3 system, everything that worked before you started the upgrade will still work when you get finished. Of course, we recommend you try this out on a non-production system and verify for yourself that your system still functions reliably. That’s what VMware is for! But we think you’ll find that you still have a system that is ready to put in production: phones ring, applications run just as before, and all the things you have come to rely upon in your phone system will still function. And we’ll have an essential, new building block to add all sorts of additional features to your system in coming weeks without breaking anything. We’re even going to add a few goodies today just to get you started!

Upgrading to freePBX 2.2.0. The upgrade process is straight-forward, but you need to pay attention and perform the steps in the order we’ve outlined below. Winging it will result in a system that either doesn’t work at all or one that may exhibit all sorts of quirky behavior. So, be reasonable. Do it our way! We’ve tested this about a dozen times on all sorts of different machines which is something you’re probably not going to find all that exciting to replicate.

First, make sure that your TrixBox 1.2.3 server is working reliably. It handles incoming calls correctly, voicemail works, outbound calls work, etc. Once you’re certain that you have a stable TrixBox 1.2.3 system, then log into your server as root and issue the following commands in order. If, for some reason, the freePBX mirror site is unavailable, substitute bestof.nerdvittles.com/applications/callerid for mirror.freepbx.org below:

cd /usr/src
wget http://mirror.freepbx.org/freepbx-2.2.0.tar.gz
tar zxvf freepbx-2.2.0.tar.gz
cd freepbx-2.2.0
./install_amp  (When prompted whether to overwrite existing files, type a)

Once the installation is completed, don’t reboot your system or restart Asterisk! Instead, using a web browser (IE 6 works great) point the browser to the IP address of your web server. Choose System Administration and type the username maint followed by your password to gain access. Now choose freePBX. Whatever you do, don’t click the Red Bar to update settings until you’ve completed all of the steps below.

Pass #1. We’re going to make three passes through the FreePBX module update process before we’re ready to click the Red Bar. So choose Tools then Module Admin then click Check for Updates online. Click Download all at the top, far right side of your browser window. Then click the Process button followed by the Confirm button. Wait for the downloads to be processed. Then click the Return button at the bottom of the browser window.

Pass #2. Click Upgrade all at the top, far right side of your browser window. Then click the Process button followed by the Confirm button. Wait for the upgrades to be processed. Then click the Return button at the bottom of the browser window.

Pass #3. Click Upgrade all at the top, far right side of your browser window. Then click the Process button followed by the Confirm button. Wait for the upgrades to be processed. Then click the Return button at the bottom of the browser window.

Finally, click the Red Bar to apply the configuration changes. Count to 20. Now let’s log into your server as root again and make a minor correction or two, and you’ll be ready to reboot and go. Once you’re logged in, issue the following commands to fix the initial voice prompts with our Stealth Autoattendant:

cd /var/lib/asterisk/sounds/custom
mv nv-greeting.wav nv-greeting.wav.bak
mv nv-menu.wav nv-menu.wav.bak

Now edit line 428 in the extensions.conf file to resolve a freePBX bug with Enum Lookups:

nano -w /etc/asterisk/extensions.conf
Ctrl-W and type: arg3 is pattern
press Enter key
Ctrl-W again and press Enter key

You can verify the line number by pressing Ctrl-C in Nano. You should be positioned on line 428 which begins like this:

exten => s,1,GotoIf($["{$ARG3}" = 

Just insert an exclamation point (!) immediately before the equals sign (=) so that it looks like this != and save your change: Ctrl-X, Y, then press Enter.

Now restart your server, and you’re done: shutdown -r now. Congratulations! You now should have a functioning freePBX 2.2.0 system. Be sure to take a look at the Release Notes and the freePBX Wiki.

Adding Free Directory Assistance to freePBX. We’ll have a whole bunch more to say about freePBX 2.2.0 in coming weeks, but we wanted to give you a couple of sneak previews of new functions which are incredibly powerful. First, there’s a new way to add loads of functionality to your system without having to be a programmer. For example, here’s how to integrate free Directory Assistance into your system by simply dialing 411 from any phone connected to your Asterisk system.

Using your web browser, go back into freePBX (System Admin, freePBX, Setup) and choose Misc Destination. Make the following entries:

description  Directory Assistance
dial  8003733411

Then click the Submit Changes button followed by the Red Bar to reload your configuration into memory.

Now choose Misc Application and make the following entries:

description  Information
Feature Code  411
Status  Enabled
Destination  Misc Destination:Directory Assistance

Then click the Submit Changes button followed by the Red Bar to reload your configuration into memory. Now dial 411 from any phone on your system and enjoy free Directory Assistance.

Checking Your AutoAttendant. The real beauty of the new Misc Application function is that you can use it for internal testing of almost anything. For example, to try out your Stealth AutoAttendant by dialing 412 from any extension, add the following Misc Application:

description  Test AutoAttendant
Feature Code  412
Status  Enabled
Destination  IVR:Stealth AutoAttendant

Click the Submit Changes button followed by the Red Bar to reload your configuration into memory. Now dial 412 from any phone on your system and you can try out the Nerd Vittles Stealth AutoAttendant without having to dial into your system from an outside phone.

Accessing the VoiceMail System. Another nice trick is to add hidden extensions to access VoiceMail. Let’s assume you want to do this for extension 500 and for the hidden extension number we add another zero: 5000. Here’s how to set up the Misc Application:

description  VoiceMail 500
Feature Code  5000
Status  Enabled
Destination  Core:voicemail box 500

Click the Submit Changes button followed by the Red Bar to reload your configuration into memory. Now dial 5000 from any phone on your system to access the VoiceMail box for extension 500. It’s an easy way to leave messages for someone else on your system without dialing in from an outside phone. You can also use it to retrieve voicemail. Just press the asterisk (*) button while the voicemail prompt is playing on the phone. Then enter your voicemail password for extension 500. You should be catching on by now. Build a few more just for fun.

Happy Birthday to Us. We’ll close by mentioning that it’s a big week here at Nerd Vittles. And we have a couple more surprises for you. This Friday marks our Second Birthday. Hard to believe it’s been two years. We spent our first six months covering what you could do with a $500 Mac mini. But the last 18 months have been devoted almost exclusively to Asterisk. Our gift to you is the brand new Best of Nerd Vittles web site. Have a look. There’s an RSS Feed for the new site as well. We think you’ll enjoy both the new format and the content. And, it’ll only get better as time marches on.

And your gift to us? Glad you asked. What a great time to send along a modest contribution through the PayPal link at the top of the page. If every person that reads Nerd Vittles each week donated just ten bucks with any major credit card, we’d have the resources to pull off some really slick projects and hire a little help. Those additions just aren’t feasible without Yankee Dollars. So skip that overpriced cheeseburger today and do your part for the cause. We promise to spend it wisely, and, just like your church, we won’t come calling again (at least not too often) until this time next year. Finally, an apology for the yo-yo’s at PayPal. Once in a while, their system tacks on a shipping charge to donations. No shortage of Village Idiots, is there? If it happens to you, just reduce the amount of your donation accordingly. We’ve screamed and hollered for two years, but it still happens once in a while for no apparent reason. We’ve gotten two generous contributions in recent days for $47.50, not the sort of number someone usually pulls out of their hat. But thanks nevertheless and our apologies for the shipping charge! Now back to the party. All together now… Happy Birthday, Nerd Vittles… and to all a good night.

From the Really Cool Dept. We’ve got a few more surprises to pull out of our hat so hang in there. What’s this? A New Bunny! We received a rather unique birthday gift from a fan. It’s a new Nabaztag/tag Wi-Fi Rabbit. We’ve named him PatTheNerd, what else? In addition to blinking lights and wiggly ears, you get a talking bunny with one of the best voice synthesizers on the planet. And it all runs over a self-configured wireless network connection on your LAN. Want to try it out? Feel free to send us a voice message. Just click on the bunny (inset). And soon, you’ll be able to issue voice commands directly to your bunny as well. Who’s Yo Daddy?

If you’ve never heard of these little guys, you’ve got some serious reading to do. Start here and then head to their Forum. Every kid should have one! And, once you get yours, leave it to Nerd Vittles to turn your little critter into a Weather Bunny, maybe not as cute as the one at your local television station, but still pretty cool. Your Weather Bunny will tell you the latest weather conditions in any city in the United States as often as you like. Just add an entry to your Asterisk crontab! Sound familiar? You can download our WeatherBunny for NabazTag application written in PHP at your convenience. And now there’s a News Bunny as well! We’ll continue NerdVittlizing Pat in the coming weeks so stay tuned. Pat should be great at providing message alerts and reading emails and voicemail. Someone has even set up an Asterisk voicemail box for their rabbit. So what are you waiting for? Order one for yourself and put a bunny to work! Thanks, anonymous!

News Flash! For Intel-based Mac users, the wait is over. A beta of VMware is now available simply by filling out this form. Once installed, you should be able to run the VMware version of TrixBox 1.2.3 or the VMware version of TrixBox 2.0 on your Mac Desktop. Let us know how it goes! We’re jealous and wishing we had an Intel Mac ourselves. All we got was a dumb bunny.

CallerID Trifecta. NOTE: This application has been superseded. Continue reading the latest article here.

Finally, we’ll leave you with some seriously good, new software if we do say so. It’s been almost a year since we last discussed CallerID Tips and Tricks. Seems to be our favorite topic on Nerd Vittles around the time of our birthday celebration. Don’t ask us why? But we wanted to continue the tradition this year by introducing an all-new CallerID Trifecta. Thanks to freePBX 2.2.0, with just a couple minutes of effort, you can snap our code into the web directory on your Asterisk server, make a couple of freePBX entries, and, presto, you get instant CallerID name lookups for all your incoming calls using AsteriDex, the Google Residential Phonebook, and AnyWho. We’ll add more sources including SugarCRM in the coming weeks. For today, you’ll find the documentation and download at this link on the Best of Nerd Vittles site. Particularly for those outside the U.S, we think you’ll find the PHP code easy to follow if you want to build additional directory resources on your own. Just be careful to always exit from the procedure rather than letting it just play out, or freePBX gets squirrelly and often just dumps incoming calls into voicemail. Guess how we know. Enjoy and thanks for visiting!


Some Recent Nerd Vittles Articles of Interest…

New Year’s Roundup: Pick-of-the-Litter VoIP Providers for Asterisk

The Answer to the Best Riddle of the YearIt’s been a while since we last looked at the VoIP Providers that make Internet telephony hum with Asterisk® systems. So today we wanted to share our experiences with the best of the best over the past six months. For those just making the plunge, our most important rule of thumb remains the same: DON’T PUT ALL YOUR EGGS IN ONE BASKET. Particularly in the Internet Telephony Service Provider (ITSP) business, there are some excellent small providers that tend to be one-man bands. And, without casting a spell on anyone, you certainly need to be aware that these small companies depend upon the good health of their fearless leaders to survive. As Forrest Gump would say, "Stuff happens."

Another important reason for diversifying your VoIP connections has to do with reliability. It’s still the Wild West in Internet Telephony Land, and things do go wrong for minutes or hours. And, in the case of some providers, downtime can stretch into days if not weeks. One final word of advice also remains the same: DON’T STAKE YOUR ENTIRE BUSINESS ON VoIP JUST YET. That’s not to suggest that businesses can’t reap enormous financial benefits by moving much of their outbound telephone traffic to VoIP. But, if your livelihood depends upon the phone to always ring when a customer calls, don’t trust your inbound traffic to VoIP, period.

We’re not going to spend much energy discussing Vonage, Packet8, Comcast, Time Warner, and some of the Baby Bell VoIP offerings for a couple of reasons. First, they are expensive. And, more importantly, none of them encourage (and most actively discourage or outright prohibit) use of a PBX such as Asterisk with their services. While it is feasible to use these services with an Asterisk or TrixBox system, you’re typically limited to using their connections in much the same way you would use a traditional PSTN connection (aka landline) from "the phone company" in your area. This entails connection of an ATA device such as an SPA-3000 to manage calls to and from the line. Here’s how.

All-You-Can-Eat Plans. Types of VoIP offerings fall into several categories. So called "all-you-can-eat" plans in theory provide unlimited incoming and outgoing U.S. calls for a fixed monthly fee. Some include Canada as well. These usually are limited to residential use, and they almost always are limited to a single call at a time. Most of the complaints you hear from users and providers center around abuse of these plans. When monthly calling volume on an all-you-can-eat plan regularly exceeds 2,000 minutes a month, you can expect problems. Why? Because your provider is paying some upstream provider by the minute for your calls, and the unlimited deal is no longer profitable for the provider. Nothing personal, but they really don’t care about you once you become a liability on their spreadsheet. BroadVoice, for example, has turned Terms of Service into an art form… to the point that it would make many lawyers blush. Abuse of their services (based solely upon what they secretly define as abuse) can result in retroactive, recalculated billing based upon per minute fees back to the time you signed up for their service. And, you agree to this in advance. While BroadVoice VoIP service remains acceptable, their terms of service and customer service are a nightmare with backbilling always lurking around the next corner. Those that attempt to protect themselves from these business practices by using single-use credit cards now are subjected to a $500 "fee" plus in-house attorney collection fees billed at $300 an hour. For most folks, the financial risks far outweigh any actual or perceived cost savings so our recommendation remains: JUST SAY NO to BroadVoice.

Our old favorite, TelaSIP, has gotten out of the all-you-can-eat business because of increased costs from their providers. Our new favorite in the all-you-can-eat department is AxVoice where $18.99 a month buys you unlimited calling in the U.S. and Canada. For $4 more a month, you can add all or parts of 20 other countries. That’s almost identical to the BroadVoice offering once they’ve tacked on their hidden fees. And you don’t have the obnoxious terms of service to worry about. AxVoice plans also include free 911 service and free local number portability unlike many other providers.

Unlimited Incoming Call Plans. Closely related to the all-you-can-eat plans are the free incoming call plans. These typically are bundled with a phone number (DID) in your local area to receive incoming calls usually one at a time. Some of these plans remain the best bargain in the VoIP industry. They also provide needed redundancy in your Asterisk system while spreading out the usage minutes between providers. This, in turn, reduces your risk of having a problem with your provider on an all-you-can-eat plan. We have two favorites in the free incoming plan with DID category depending upon your circumstances. If you only need one inbound phone number, then les.net is the best deal on the planet at $3.99 a month. They even provide two simultaneous channels with your local number. If you need multiple inbound numbers or if you want several DIDs in different area codes, then AxVoice is a good option as well. You get 3 DIDs for $8.99 a month with free 911 support on all the numbers plus free number portability if you want to kiss Ma Bell goodbye. Be aware that, unlike TelaSIP and les.net, AxVoice does not provide a method for your Asterisk system to determine which DID is ringing. For business-class service, we recommend VoIP Street which has DIDs in most cities with flat-rate unlimited inbound calling (with support for two simultaneous calls) for $9.95 a month.

Unlimited Incoming Hybrid Plans. A new hybrid category has sprung up recently. With these plans, you typically get a DID with unlimited incoming calls as well as a fixed number of minutes for outbound calls to the U.S. and Canada. Our favorite is TelaSIP which offers two channels with unlimited incoming calls and 500 minutes of outbound calls to US48 and Canada for $14.95 a month. You can add another 1,000 minutes of outbound calls for $10 more a month. In addition to impeccable service, TelaSIP offers complete control over your outbound CallerID upon request. While federal law requires that your CallerID accurately identify who you are, the flexibile CallerID is especially helpful to professionals that wish to display their office phone number even when making calls from home. It’s also useful in households with teenagers so that each one can display a number that coincides with individually-assigned inbound DIDs.

Pay-As-You-Go Providers. Once you have your local phone number with incoming calls covered, our recommendation for the balance of your outbound long distance calls is to pay as you go unless you use an enormous number of minutes. And, even if you rack up loads of outbound call minutes, be aware of the risks if you choose an all-you-can-eat provider. For pay-as-you-go outbound calling, there really is no reason with Asterisk not to use multiple providers. Most require only a small deposit and a credit card to open an account, and most don’t care how many simultaneous calls you are making. After all, you’re paying for them by the minute. The real beauty of most of these providers is that, if you don’t make any calls, you don’t pay anything. Our favorite and least-cost (sometimes) outbound provider is VoicePulse. We added "sometimes" because their rates fluctuate daily and sometimes hourly. However, they’re usually a bargain. For example, at 10 a.m. Eastern time yesterday, you could place an outbound call to anywhere in the U.S. for 1¢ or less. A large portion of the destinations were half of that! They have a unique offering for Asterisk that lets you configure your system to actually check their rate table before selecting them to terminate the call. Their web site explains how to set it up. And there’s a freePBX and TrixBox module that makes everything plug-and-play. You can get a $2 sign-up credit to try out their plan at no cost by using this link. Our other top pay-as-you-go providers are Vitelity at 1.39¢ a minute to U.S. and Canada and les.net at 1.5¢ a minute to U.S. and Canada. With Asterisk and especially TrixBox or freePBX, it’s incredibly easy to structure your dialplan so that outbound calls are automatically routed to the next available provider in the event an individual provider’s service is down.

Toll-Free Plans. For those that need or want a toll-free number in the U.S., the hands-down winner is Vitelity. For 50¢ a month and 1.9¢ a minute, you get a toll-free number of your choice for a one-time setup fee of $10. Numbers are activated almost instantly, and the voice quality of the calls is top-notch.

Other Plans of Interest. For Asterisk experimenters, there are some other interesting deals out there. For unlimited free incoming calls with a New York DID, you can’t beat Stanaphone. Their per minute calling rates aren’t too bad either. And, if you don’t mind checking the new calling rules regularly, you can make 300 minutes of calls every 7 days (this week!) to several dozen countries for three months for $15 with voipdiscount.com. Just be aware that their fine print (and rates) change almost daily.

Provider Setup Instructions for Asterisk. Configuration of the various providers’ services has already been covered in previous articles. Just review the configuration tips on our Projects Page for detailed instructions.

Quick Reference Guide. Every article deserves a chart for the learning impaired like us. We’ve condensed this article into such a beast on our soon-to-be Best of Nerd Vittles site for those that need a quick reference. We’ve also included some free samples and tips and tricks below for those that don’t want to wade through all of last year’s Nerd Vittles articles.


Free Samples. Everybody loves free samples. Not sure about TelaSIP, you say. Well, take it for a test drive. Just call our Charleston number (shown in the inset) and wait for the fast busy to hang up. There’s no charge for the call because you’re never "connected." Within 15 seconds you’ll get a return call allowing you to make a FREE 10-minute phone call to almost anywhere in the U.S. All you have to do is key in the password you’re provided when you answer the return call. Keep in mind a few things. You have to call from a phone with CallerID so that the system knows where to call you back. Both legs of the call (to you and to the person you call) use GSM compression so you’re seeing TelaSIP at its most efficient but not necessarily with the best voice quality. You can set it differently on your own system if you like.


Nerd Vittles Demo Hot Line. You now can take a number of Nerd Vittles projects for a test drive while checking out the quality of les.net! The current demos include (1) MailCall for Asterisk with password 1111 (retrieve your email by phone), (2) NewsClips for Asterisk (latest news headlines in dozens of categories), (3) Weather Forecasts by U.S. Airport Code, and (4) Weather Forecasts by U.S. ZIP Code. You’re not prompted for #4 yet, but it does work! 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.


1-800-411-METROFree Directory Assistance Service. For those in the U.S. that just can’t live without Directory Assistance, write these numbers down and add at least one of them to your Asterisk dialplan for free directory assistance calls in the United States: 1-800-411-METRO and 1-800-FREE-411. We’ve had much better success with the second number lately. Both are free VoIP calls with the providers listed below once you set up an accounts with them. You can read our reviews of these providers here. Assuming you have an account, just add ONE of the following sets to the [from-internal-custom] or pfrom-internal-trixbox] context in extensions_custom.conf:


exten => 411,1,Dial(IAX2/goiax/18003733411)   ; GoIAX Free Call
exten => _1NXX5551212,1,Dial(IAX2/goiax/18003733411)
exten => _NXX5551212,1,Dial(IAX2/goiax/18003733411)

exten => 411,1,Dial(IAX2/fwd/*18003733411)    ; FWD Free Call
exten => _1NXX5551212,1,Dial(IAX2/fwd/*18003733411)
exten => _NXX5551212,1,Dial(IAX2/fwd/*18003733411)

exten => 411,1,Dial(IAX2/teliax/18003733411)  ; Teliax Free Call
exten => _1NXX5551212,1,Dial(IAX2/teliax/18003733411)
exten => _NXX5551212,1,Dial(IAX2/teliax/18003733411)

Free Directory Assistance Listing. Now that you have free directory assistance, you may be asking yourself, "How Do I Get My VoIP Number Listed With Directory Assistance Services?" Well, there’s finally a way. Just visit List Yourself! and sign up. Then you can verify that all went well in a few days. If we could only get Google to use the same listings in their Google Phonebook, the world would be almost perfect.


Some Recent Nerd Vittles Articles of Interest…

Introducing U-Rang II: Windows Desktop Screenpop Utility for Asterisk

It’s been five days since U-Rang hit the street and, with over 1,000 downloads, it seemed like a good time for an update. After all, it’s a new year so out with the old, and in with the new. Version 2 introduces an entirely new user interface (see inset) and an intuitive calling log based upon (what else) phone slips, two of the most requested additions from the early adopters.

All of the functionality of version 1 has been retained so you still can monitor multiple extensions on your Asterisk® system if you want to. When an incoming call arrives, the ubiquitous phone slip will pop up on your desktop with the time and date of the call as well as CallerIDname and number information of the caller. And, if you’re using the Nerd Vittles CallerID enhancements, then your Asterisk system will check the Google Phonebook, AnyWho, and AsteriDex for supplemental CallerID information in addition to what’s provided by your local phone company. The easiest way to get CallerID enhancements is to install either our PBX-in-a-Flash script for TrixBox 1.2.3 or the VMware version of TrixBox 1.2.3. Both are available by clicking the links at the top of this page.

We’ve also refined the user interface a bit so that the application can be installed on Windows systems in an office environment with no end-user ability to disable or terminate the application. And, yes, we know some of you want a SugarCRM link to the screen pop. But we had to save something for version 3. So stay tuned.

To download U-Rang II and for complete installation instructions, just visit our almost-ready-for-prime-time Best of Nerd Vittles site. Enjoy!

Introducing U-Rang: Free Windows ScreenPop Utility for Asterisk

To close out 2006, it’s free software day again at Nerd Vittles. And today we have another application checked off the 2006 Wish List. It’s a screen pop application for Windows desktops that pops up and tells you who’s calling on any Asterisk® extensions you’d like to monitor. The entire installation takes about 10 minutes for the first desktop and about 2 minutes for any other desktops on the same network.

We’ve named the application U-Rang in honor of our favorite Addams Family character (the guy on the left). And today you also get a sneak peek at our new Best of Nerd Vittles site which officially opens on January 19, 2007, during the Nerd Vittles Second Birthday Bash. That’s where you will find the complete U-Rang download and documentation. We think you’ll agree that it’s a much better web format for tutorials, but don’t worry. Nerd Vittles isn’t going anywhere. We just want to migrate our best material to a format which is easier to maintain long term.

We plan to introduce Mac and Linux versions of U-Rang in the coming weeks, but we just couldn’t quite pull it off for today. Check back soon for updates. Or, better yet, subscribe to the Nerd Vittles and Best of Nerd Vittles RSS Feeds for instant updates. For the 75% of you that use Windows Desktops (ugh!), enjoy! Our usual warnings apply. Use the software at your own risk. Don’t sell stuff that you got for free. And, last but not least, it’s version 1, and you know what that means.

We’d love to hear suggestions for enhancements. Just post a comment here. Our comments are moderated to filter out the gambling and drug creeps of the world. Don’t be alarmed if it takes about a week for your comment to show up. You see we’re headed out on a cruise of the Caribbean tomorrow without a computer. Not to worry. We’ll read and post every last comment when we return sometime next year. Actually, this is a business trip to find a good ship to host the first Nerd Vittles GeekNik Cruise, but don’t tell my wife and daughters. Happy New Year!

The Asterisk Weather Station: Forecasts from Any Phone for 42,740 U.S. Zip Codes

Weather MapAfter we published our article providing Asterisk® weather forecasts for 1,000 U.S. cities using airport codes, we heard from a number of folks asking if we could do something similar using zip codes to retrieve forecasts from the National Weather Service. Well, Santa is two weeks early, and today you get your wish: an enhanced weather application for Asterisk that supports every last zip code in the United States, all 42,740 of them. As with our original weather application based upon airport codes, this one requires the Flite voice synthesizer which now is an integral part of all TrixBox builds. You'll note that there are no thermometers and barometers to install with this application. So, to be perfectly candid, this is really a virtual weather station. The National Weather Service does the forecasting, the U.S. Postal Service does the locating, and the Asterisk Weather Station simply provides the glue to put the two together and retrieve and play the results using your touchtone telephone. The good news is that you actually control and manage this application rather than worrying about dialing into someone else's system only to find that they've gone out of business or quit providing the service. And, if you only want to hear current conditions for a particular zip code rather than the full 7-day forecast, we've retained the high tech solution we introduced with our original weather application: just hang up the phone. And the total cost. Well, that's the same as always here at Nerd Vittles: zero, zip, nada. Merry Christmas! [Note: Looking for Worldwide Weather Forecasts for Asterisk? Here's the link.]

How It Works. The design is pretty straightforward. You install a MySQL zip code database. Thanks, Novak! Then you add a simple dialplan to your extensions_custom or extensions_trixbox config file and tell freePBX the extension on your Asterisk system to dial to retrieve the forecasts. Finally, you download the nv-weather-zip.php script into your default Asterisk agi-bin directory. When you dial 9-4-7 (that's Z-I-P), the Asterisk Weather Station will prompt you to enter the 5-digit zip code of the city for which you want to hear the weather forecast. In a few seconds you'll be listening to the latest information from the National Weather Service. And apologies to all of our foreign friends. Yes, we know you have weather, too. We just don't know of an equivalent organization like the National Weather Service in every country. If you do, then it'll be fairly simple to adjust the code to meet your local needs. Here's a Canadian solution. If you have solutions for other countries, do everyone a favor and post a comment.

Prerequisites. For the Asterisk Weather Station to work, you'll need an Internet connection to access the National Weather Service reports. Then you'll need either a TrixBox Asterisk server or an Asterisk@Home 2.x server and the new Flite voice synthesizer for Asterisk. Instead of a dedicated Asterisk server, you can use our VMware version of TrixBox if you just want to experiment a bit. It runs in a window on your Windows XP/2000 desktop. If it's not already part of your Asterisk system, our Flite tutorial and the Flite application software are available here.

Downloading the Zip Code Database. We searched far and wide to find a free MySQL zip code database that could be used with TrixBox. But there wasn't one. So the Nerd Vittles elves started with Novak Banda's free zip code data and converted it into something MySQL could understand. You're welcome. Before downloading the database, kindly read and heed Novak Banda's license agreement. Then download zipcodes.zip to your desktop and unzip the file. Once you decompress the archive, you should have two files: zipcodes1.sql and zipcodes2.sql. We'll use these in a minute to build your very own, free MySQL zip code database on the fly. Buy someone in need a little Christmas present with the money you saved. You'll both be happier!

Installing the Zip Code Database. Using your web browser, access your TrixBox server by entering the IP address of the server. Click on System Administration, log in as maint with your password, and then click phpMyAdmin to enter the world of MySQL. Now click on the Import link at the bottom of the right pane. Choose the zipcodes1.sql file on your Desktop, uncheck the Partial import box and leave the other settings as they are. Then click Go. Be patient with the imports. This is a BIG database, and numerous indexes have to be created as well. When the import finishes, you should see a message which says "Import has been successfully finished. 22003 queries executed." Now choose the zipcodes2.sql file on your Desktop and click Go again. When the import completes, you should see a message which says "Import has been successfully finished. 20741 queries executed." Double-check to make sure you got the whole database by exiting from phpMyAdmin. Then start it up again and select the zipcodes database. In the right panel, it should show a zipcodes table with 42,740 records. Close phpMyAdmin if all is well. Otherwise, repeat the drill.

Dialplan Code. In order to activate extension 947 to answer calls for your Asterisk Weather Station, you'll need to drop the following code into your dialplan in the [from-internal-trixbox] context of /etc/asterisk/extensions_trixbox.conf. The easiest way is to access TrixBox from your browser and choose System Administration, Config Edit. Then click on the extensions_trixbox.conf file in the left column, scroll down into the [from-internal-trixbox] context and cut-and-paste the following. Then click the Update button to save your changes.

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

Adding a Miscellaneous Destination. While you're still in TrixBox with your browser, choose freePBX and then choose Setup, Misc Destination. Add a new entry for WeatherByZipCode with 947 as the Dial entry. Save your entry and then click the Red Bar to reload Asterisk.

Downloading and Installing the Asterisk Weather Station. To get the Asterisk Weather Station script installed, you'll need to log into your Asterisk server as root. Then issue the following commands in order:

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

Taking the Asterisk Weather Station for a Spin. Now we should be all set. Just pick up an extension on your system and dial 947. You'll be prompted to enter a five-digit zip code. Punch in 90210 and check out the Valley Girls weather forecast. Enjoy!

Housekeeping 101. Temporary files in /tmp get cleaned up by Linux housekeeping automatically. Temporary files stored elsewhere don't unless you're using a Nerd Vittles build of TrixBox with either the VMware edition of nv-trixbox for Windows or PBX-in-a-Flash for Linux. The weather scripts store .wav files with your requested weather forecasts 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/*

Or just 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 folder every two weeks. If you'd prefer a shorter time, change the number 14 accordingly. Now save your changes: Ctrl-X, Y, then Enter.

Installation Script. Some folks may find an install script easier to deal with. Here's a Script-Trix link if you want one.


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 (1) MailCall for Asterisk with password 1111 (retrieve your email by phone), (2) NewsClips for Asterisk (latest news headlines in dozens of categories), (3) Weather Forecasts by U.S. Airport Code, and (4) Weather Forecasts by U.S. ZIP Code. You're not prompted for #4 yet, but it does work! 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 50GB of disk storage and 999GB 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!

Adding an iTunes Telephone Controller to Your Asterisk PBX

If you're as lazy as the rest of us, then getting up to change what's playing on iTunes or to adjust the volume is just too much like work especially if you've installed one of our PBX-in-a-Flash™ Asterisk® systems on either a dedicated Linux machine or your Windows Desktop. For long-time readers of Nerd Vittles, you may recall that we covered how to build a streaming audio server using iTunes last year. So today we add the missing piece which will let you change songs, adjust the volume, and pause and restart iTunes using any touchtone phone connected to your Asterisk or TrixBox system. Special thanks to jpe for figuring all of this out and to Acme Technologies and to David Schlosnagle for their work on the iTunes Command Line Interface.

Overview. To get things working, there are just a few, easy steps. First, you'll need a Mac running the Panther or Tiger versions of Mac OS X. Next, you'll need to download and install the iTunes Command Line Interface. Then you'll need a rock-solid Asterisk system. We recommend TrixBox 1.2.3 which you can install using our tutorial and installation scripts above. Finally, we'll add a voice prompt and tweak the dialplan a bit using freePBX to handle the telephony interface to iTunes. And, presto, you're done.

Installing the iTunes CLI. We're assuming you've already got a Mac up and running with the required version of Mac OS X. If not, start there. Then download the iTunes Command Line Interface onto your Mac Desktop. Unless you've secured Safari, it will decompress the downloaded file automatically leaving you an iTunes Remote Control folder on your Desktop. If it doesn't automatically decompress the .sit file, then just double-click on it. Now open a Terminal window and switch to root access using your Mac password: sudo su. Then execute the following commands:

cd Desktop
cd "iTunes Remote Control"
cp itunes /bin/itunes
chmod +x /bin/itunes
ifconfig
itunes play
itunes play

The ifconfig command lets you decipher the private IP address of your Mac. Write down the inet address for the network interface you're using to connect your Mac to your private network (usually found in the listing for en0 or en1). To complete the installation on the Asterisk box, you'll also need to know a username and password for your Mac. If you don't know, you can find all your Mac usernames by changing to the /Users folder and typing ls. The last two commands should crank up iTunes on your Mac Desktop and begin playing whatever the last song or podcast you listened to. If everything's working, you can close the Terminal window on your Mac. We're done with the Mac part of the drill.

Password-Free SSH Access. As with our Proximity Detection System and Backup tutorials, we want to use SSH to communicate between the Asterisk system and iTunes on your Mac. As you know, SSH typically prompts for a password when you connect to a remote resource. So here's the trick if you haven't read our previous articles. Log into your Asterisk system as root. Because the Asterisk system will actually be the actual user connecting with SSH, we need to switch from the root user to the asterisk user account to get things set up correctly: su asterisk. Then, 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 (/var/lib/asterisk/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/lib/asterisk/.ssh/id_rsa.
Your public key has been saved in /var/lib/asterisk/.ssh/id_rsa.pub.
The key fingerprint is:
1d:3c:14:23:d8:7b:57:d2:cd:18:70:80:0f:9b:b5:92 asterisk@asterisk1.local

Now we want to copy the public key file (in bold above) to your Mac from your Asterisk system using SCP. The command should look like the following (except use the private IP address of your Mac instead of 192.168.0.104 and use your Mac username instead of the two instances of username below). Provide the Mac password for the username you've chosen when prompted to do so.

scp /var/lib/asterisk/.ssh/id_rsa.pub username@192.168.0.104:/Users/username/.ssh/authorized_keys

Once the file has been copied, you now should be able to log into your Mac from your Asterisk system using SSH without being prompted for a password. Let's try it. Here's the command. Just substitute your username and the IP address of your Mac below:

ssh username@192.168.0.104

You should be admitted without entering a password. Type exit twice to log out of your Asterisk system and to log out as user asterisk. If it didn't work, repeat the drill or read the complete article and find where you made a mistake.

Modifying Your Dialplan to Support the iTunes CLI. Now we're ready to cut and paste some code. Connect to your Asterisk system using your web browser by pointing to the internal IP address of your server: http://192.168.0.104. Choose System Administration and log in with username maint and your password. Now choose Config Edit and click on extensions-trixbox.conf in the list of config files. When the editor opens, add the following lines in the [from-internal-trixbox] context of the file:

exten => 673,1,Answer ; Dial MP3 to manage iTunes
exten => 673,2,Wait(1)
exten => 673,3,DigitTimeout(5)
exten => 673,4,ResponseTimeout(7)
exten => 673,5,Goto(itunes,s,1)

This will let you dial MP3 or 6-7-3 from any extension on your Asterisk system to manage iTunes on your Mac. While you're still editing extensions-trixbox.conf, scroll to the bottom of the file and add the following chunk of code:

[itunes]
exten => s,1,setvar(user=username)
exten => s,2,setvar(ituneshost=192.168.0.104)
exten => s,3,background(custom/itunes)
exten => s,4,background(beep)
exten => 1,1,system(ssh ${user}@${ituneshost} /bin/itunes mute)
exten => 1,2,goto(99,1)
exten => 2,1,system(ssh ${user}@${ituneshost} /bin/itunes pause)
exten => 2,2,goto(99,1)
exten => 3,1,system(ssh ${user}@${ituneshost} /bin/itunes unmute)
exten => 3,2,goto(99,1)
exten => 4,1,system(ssh ${user}@${ituneshost} /bin/itunes prev)
exten => 4,2,goto(99,1)
exten => 5,1,system(ssh ${user}@${ituneshost} /bin/itunes play)
exten => 5,2,goto(99,1)
exten => 6,1,system(ssh ${user}@${ituneshost} /bin/itunes next)
exten => 6,2,goto(99,1)
exten => 7,1,system(ssh ${user}@${ituneshost} /bin/itunes vol 25)
exten => 7,2,goto(99,1)
exten => 8,1,system(ssh ${user}@${ituneshost} /bin/itunes vol 50)
exten => 8,2,goto(99,1)
exten => 9,1,system(ssh ${user}@${ituneshost} /bin/itunes vol 100)
exten => 9,2,goto(99,1)
exten => 0,1,system(ssh ${user}@${ituneshost} /bin/itunes mute)
exten => 0,2,goto(99,1)
exten => *,1,system(ssh ${user}@${ituneshost} /bin/itunes vol down)
exten => *,2,goto(99,1)
exten => #,1,system(ssh ${user}@${ituneshost} /bin/itunes vol up)
exten => #,2,goto(99,1)
exten => 99,1,NoOp(${SYSTEMSTATUS})
exten => 99,2,GotoIf($["${SYSTEMSTATUS}" = "APPERROR"]?99,6)
exten => 99,3,background(num-was-successfully)
exten => 99,4,background(activated)
exten => 99,5,goto(s,4)
exten => 99,6,background(im-sorry)
exten => 99,7,background(an-error-has-occured)
exten => 99,8,wait(1)
exten => 99,9,background(goodbye)
exten => 99,10,Hangup
exten => t,1,goto(s,1)
exten => h,1,Hangup

Now move up to the first line of code (s,1) and change username to reflect the account name on your Mac that will be used to manage iTunes. It's got to be the same one that was used in the SSH keygen step above! Now move to the second line of code (s,2) and plug in the IP address of the Mac running iTunes. Save your changes by clicking the Update button. Close your browser, and don't worry about restarting Asterisk just yet because we have one final step to go.

Installing the iTunes CLI Voice Prompt. Just to give our new system a professional touch, let's add a custom voice prompt from Allison Smith to greet callers dialing MP3 on your system. Log into your Asterisk server as root and issue the following commands. The final one will restart Asterisk to load our dialplan updates from above.

cd /var/lib/asterisk/sounds/custom
wget http://nerdvittles.com/trixbox123/itunes.gsm
chown asterisk:asterisk itunes.gsm
amportal restart

Taking the iTunes Controller for a Spin. Now that the installation is complete, let's try it out. Make sure your Mac is turned on. Then pick up a telephone on your system and dial MP3. You'll be welcomed by Allison and prompted to enter a command. Using the commands shown on the adjacent keypad diagram, you can control virtually all aspects of iTunes. When you've finished entering commands, just hang up. It's that simple. If you happen to be streaming iTunes music to other desktops or your cellphone, then you'll really appreciate this addition to your Asterisk application software collection. 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 50GB of disk storage and 999GB 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!

PBX-in-a-Flash: HOW-TO NerdVittlize Your TrixBox 1.2.3 Asterisk PBX

NOTE: The system referenced in this article is no longer supported by Nerd Vittles as this version of Asterisk® has been phased out. For the latest and greatest, please consider our new PBX in a Flash offering.

Perhaps the most requested new article by Nerd Vittles' readers has been a HOW-TO for configuring a Linux-based TrixBox system to do everything our VMware TrixBox build for Windows can do. So today we decided to tackle it. If you read nothing else, read the following cautionary note: This application only works with a clean build of TrixBox 1.2.3 using the TrixBox .iso install on a dedicated PC. If you've already installed TrixBox 1.2.3 and made any configuration changes either to Linux or Asterisk with or without using freePBX, do not use this program. It will overwrite (aka erase) all of your existing settings! Just consider it the last critical step in an initial TrixBox 1.2.3 install, and you should be fine. There, you've been warned.

Overview. If you can cook French Toast without burning yourself or setting your kitchen on fire, then PBX-in-a-Flash™ will be a piece of cake for you. The good news is that, with a clean TrixBox 1.2.3 .iso install, this may just be the greatest thing since sliced bread. Why? Because it builds you a turnkey Asterisk PBX with all of the security patches, and freePBX and WebMin updates, and Nerd Vittles apps in just a few minutes with no user intervention. You'll still need to secure your passwords and walk through the freePBX module updates process, but you'll be ready to roll with 8 extensions and 2 phone lines in less than 30 minutes... and that includes installation of TrixBox from the boot disk. You really don't need to know much of anything about Linux or Asterisk for that matter. And, as much as we love freePBX, the number of menus and options can be intimidating until you get your feet wet. PBX-in-a-Flash solves that by preconfiguring virtually everything on your new system. For ease of reference, portions of our previous tutorials on TrixBox 1.2.3 and the VMware build for TrixBox 1.2.3 are also repeated here so that everything is easy to follow. And, when you're finished, phones ring, voicemail works, voicemail messages get emailed to you without any further tweaking of Linux and SendMail, callers get a welcoming message and music on hold before your phones start to ring, and those (like you) with the secret password can do all sorts of other tricks while the AutoAttendant plays... such as getting dial tone to make an outbound call using your (almost) free VoIP international calling plan.

Here are the basic steps:

Step 1. Download and install the TrixBox 1.2.3 .iso on a dedicated PC ... and, yes, VMware installs should also work.

Step 2. Download and run the Nerd Vittles pbx-in-a-flash script to get everything loaded, configured, and up to date.

Step 3. Reboot your system and be sure all your passwords are secure.

Step 4. Load and activate all of the new freePBX modules. We've preconfigured the rest of freePBX for you.

Step 5. Sign up and then enter your usernames and passwords for your VoIP hosting providers.

Step 6. Plug in and set up your phones.

Step 7. Enjoy!

Step 1. Installing TrixBox 1.2.3. Begin by downloading the TrixBox 1.2.3 ISO image from here and burn a CD (click here if you need a refresher course). Using your dedicated PC, insert the CD you made, plug your machine into the Internet, and turn it on. Then watch while TrixBox loads CentOS/4.4 (with an older Linux kernel that doesn't break voice applications!) and all the Asterisk and Linux goodies imaginable: Apache, SendMail, Asterisk Mail, SugarCRM, MySQL, PHP, phpMyAdmin, SSH, Bluetooth, freePBX, the Flash Operator Panel, Call Detail Reporting, and on and on. This install will reformat (aka ERASE) your hard disk before it begins, but it will warn you first. You'll be prompted to choose your keyboard language, then your time zone, and then your root user password. Make up a password that you can remember but others can't ... and write it down! About 5 or 10 minutes after the installation begins (depending on the speed of your machine), the boot disk will eject. Be sure to remove it before the system reboots to continue the install, or it'll just start over by rebooting from the CD again. When the installation is finished, you should see a login prompt.

So You Need a $100 Computer? TrixBox runs best on a dedicated machine. And, unless you have an old clunker sitting around, here's a deal you shouldn't pass up. It's a used Dell OptiPlex GX150 for $47.91. Bump up the RAM to 256MB for $12.95 (recommended) and add $32 for shipping, and it still comes in at under $100. If you're feeling downright wealthy, add another $10 for a one year parts and labor warranty including shipping fees (recommended). You can also bump up the processor to 1 Ghz for $30 more, and the box still comes in at under $140.

Step 2. Installing PBX-in-a-Flash. Now for the fun part. Don't do anything on your system yet except to login as root with the password you wrote down. At the command prompt, type these commands in order:

cd /root
wget http://nerdvittles.com/trixbox123/pbx-in-a-flash
chmod +x pbx-in-a-flash
./pbx-in-a-flash

Read the warning and then press the Enter key to proceed with the pbx-in-a-flash update. When it finishes, you'll be prompted to press the Enter key again to reboot your system. Just do it!

Step 3. Securing Your Passwords.When the install is finished and reboots again, log in as root with the password you assigned. Type help-trixbox for a listing of the other passwords that need to be changed. Change them all NOW! Keep it simple and use the same password for everything. You're not going to expose this web server to the Internet anyway... if you're smart.

passwd admin
passwd-maint
passwd-amp
passwd-meetme

Securing AsteriDex. Because of a security vulnerability in our very own AsteriDex, you'll need to download and install this simple patch. Log into your Asterisk server as root and issue the following commands:

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

Securing and Activating A2Billing. This web-based application allows you to generate and issue calling cards to individuals so that they can place calls remotely through your Asterisk server. If you've always wanted to be just like Ma Bell, here's your Big Chance! There's very little that you can do with an AT&T calling card that can't be done as well or better using A2Billing. And, it won't take an M.B.A. to undercut AT&T's calling card rates and still make buckets of money. All you need now are a few customers. But first, a word of caution. Assuming your Asterisk server has web exposure on the Internet, you need to secure the admin and root passwords in this application whether you use it or not. To access the application, go to http://192.168.0.104/a2billing/ using the actual internal IP address of your Asterisk server. Log in as root with a password of myroot. Click on the ADMINISTRATOR tab in the left column and then click Show Administrator. Now click on the Edit button beside each of the two administrator accounts and change the passwords to something secure. If you really would like to learn more about it, documentation for the application is available here. And, if you decide to use the application, you'll need to uncomment six actual dialplan lines in /etc/asterisk/extensions_trixbox.conf and reload Asterisk. Be sure to use a separate DID for this application and point it to custom-callingcard,s,1. We'll have a terrific new VoIP provider with dirt cheap DID rates to tell you about shortly so stay tuned!

;[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. We're going to stop repeating the substitution tip from here on. Whenever you see a reference to 192.168.something, just substitute the private IP address of your TrixBox server. Once the SugarCRM login screen appears, specify admin for your username and password for your password. Whether you use the application or not, change the admin password. It's easy. Just click the Administrator link under Welcome admin. Then click the Change Password button. Complete documentation for the application is available here. If contact management is your thing, knock yourself out, and we'll talk to you next spring when you finish getting everything set up to run your business. It's a great product, but be prepared to invest lots of time in the project if you expect to use it productively. If all you need is a phone dialer and a database that can display CallerID info for your friends and business associates, our AsteriDex product will be a better fit, and it takes about 2 seconds to enter each new person into the AsteriDex database.

Step 4. Load and Activate freePBX Modules. freePBX is the web GUI which manages your Asterisk system. You access it with a web browser by going to the IP address of your Asterisk server. If you don't know the IP address, log in as root, and it will tell you. Then go to that IP address with your browser, e.g. http://192.168.0.142/. At the main TrixBox menu, choose System Administration. When prompted for your username, type maint with the password you assigned above for passwd-maint. Now choose FreePBX and then Tools and then Module Admin. Put a check mark beside each of the Modules (shown in green) and then click Submit. After the modules are enabled, click the Red Bar at the top of your screen to reload the settings into Asterisk.

Next, select the Online Modules Repository. Put a check mark beside each of the Modules (shown in orange) and then click Submit. After the modules are installed and enabled, click the Red Bar at the top of your screen to reload the settings into Asterisk.

Before the extensions will actually ring (instead of going directly to voicemail), you'll need to click on Setup->Extensions. Then choose each extension and at least click the Submit button followed by the Red Bar. This is a security feature to encourage you to change the password for each extension including its voicemail password.

If you'd prefer that callers hear Music on Hold rather than ring tones after the AutoAttendant plays, then click Setup-> General Settings and change the entry for Asterisk Dial Command Options from tr to tm. To enable recording of incoming calls by pressing *1, add a lowercase w to the string. Then click Submit and the Red Bar when you're finished.

Step 5. Setting Up Your VoIP Providers. Before you can place calls to real phone numbers, you'll need at least one outbound VoIP provider. Before you can receive calls from real phone numbers, you'll need at least one inbound DID trunk (aka "phone number") from a VoIP provider. These can be the same provider or different ones. Unlike with Ma Bell, more is better in the VoIP world because it gives you some redundancy... and stuff does break from time to time.

You add hosting providers in freePBX by adding Trunks in the Setup menu. We've preconfigured your system for two providers, VoipDiscount and Stanaphone, so that all you have to do is click on each of those trunks, plug in your account names/numbers and passwords, save your updates, click the Red Bar, and you're off to the races. You may want to choose your own providers which is perfectly fine. But, for $15 which works out to $5 a month, our two picks will get you started for three months with free incoming calls, a free phone number, and 300 minutes a week of free outbound calls to dozens of countries including the U.S., most of Europe and Asia, and Australia. During that three months, you can start your VoIP Provider Education here and then you can read our reviews and HOW-TO's for setting up dozens of different providers with Asterisk here.

DISA Security. Getting remote dialtone can be a dangerous thing in the wrong hands so let's put your own password (of any length) on the DISA function that is triggered by pressing 8 when your AutoAttendant answers your incoming calls. In freePBX, choose Setup. Then click DISA in the left column of freePBX and then DialTone in the right column. Now enter a PIN that will let you sleep well at night ... knowing that you are paying for all outbound DISA calls. When you finish, click the Submit Changes button and then the Red Bar to reload Asterisk.

Step 6. Setting Up Your Phones. Before your new PBX will be of much use, you're going to need something to make and receive calls, i.e. a telephone. For today, you've got three choices. Option #1 and the best home solution is to use a Plain Old Telephone or your favorite cordless phone set (with 8-10 extensions) if you purchase a little device (the size of a pack of cigs) known as a Sipura SPA-1001. It's under $60. Be sure you specify that you want an unlocked device, meaning it doesn't force you to use a particular service provider. Once you get it, plug the SPA-1001 into your LAN, and then plug your phone instrument into the SPA-1001. Your router will hand out a private IP address for the SPA-1001 to talk on your network. You'll need the IP address of the SPA-1001 in order to configure it to work with Asterisk. After you connect the device to your network and a phone to the device, pick up the phone and dial ****. At the voice prompt, dial 110#. The Sipura will tell you its DHCP-assigned IP address. Write it down and then access the configuration utility by pointing your web browser to that IP address.

Once the configuration utility displays in your web browser, click Admin Login and then Advanced in the upper right corner of the web page. When the page reloads, click the Line1 tab. Scroll down the screen to the Proxy field in the Proxy and Registration section of the form. Type in the private IP address of your Asterisk system which you wrote down previously. Be sure the Register field is set to Yes and then move to the Subscriber Information section of the form. The preconfigured extensions are set up as 500 through 508 with voicemail activated for extension 500 and 501 presently. To keep things simple, enter House Phone as the Display Name. Enter 500 as the User ID. Enter 1234 as the Password, and set Use Auth ID to No. Click the Submit All Changes button and wait for your Sipura to reset. In the Line 1 Status section of the Info tab, your device should show that it's Registered. You're done. Pick up the phone and dial 611 to get a current weather report or dial 511 to get today's news headlines.

If you're like us, you've gone to all this trouble downloading your fancy new PBX, and you sure as hell don't want to wait a week for your Sipura 1001 to arrive before trying it out. So here's the quick and dirty solution. There's software that will run on your Windows, Mac, or Linux desktop that acts like a telephone. You obviously need speakers and a microphone on your system for this to work. Assuming you have those, go to CounterPath's web site and download X-Lite for your favorite OS. There's a manual there, too, but you probably won't need it. Once the download completes, click on it to start the install. Accept the obnoxious license agreement and install the software in the default directory. Unless you want X-Lite to load every time you restart your machine, uncheck the Launch on Startup checkbox. Reboot your system and, if it's also running your TrixBox system, restart it first. Then run the X-Lite application. Click No to turn off X-Lite's spyware. When the "SIP Accounts" window opens, click the Add button and fill in the following data:

Display Name ... House Phone
User name ... 500
Password ... 1234
Auth. User Name ... 500
Domain ... the IP address of your TrixBox system

Leave the other defaults and click on the Check Voicemail tab. For the Number to Dial to Check Voicemail, enter *97. Then click OK and Close. If your Windows Firewall is doing what it's supposed to, it will probably block the connection to your Asterisk system. When prompted, tell it to allow future connections. If this happens and X-Lite does not register with your Asterisk system, click the Down Arrow at the top of the softphone (Show Menu). Click SIP Account Settings, Properties, OK, and Close again. You now should be registered. Dial 611 and get your first weather report. To exit from X-Lite, click the Down Arrow and then Exit.

Step 7. Enjoy! We saved the best for last. All you have to do now is learn about all the great freebies that have just fallen into your lap. Here's a little info to get you started.

Linux 101. If you're new to Linux and/or Asterisk, here are a few commands you'll need from time to time. And, if you didn't already know, you don't just pull the plug on a Linux system ... even if it's running in a window on your Windows Desktop. Linux caches lots of stuff to speed up processing. So always shut things down gracefully if your data matters.

df -h ... Free disk space remaining on your Linux system. Be sure you always have the required 6GB of Windows space for this app!
logout ... Logs you out of the Linux system.
Ctrl-Alt ... Gives your Windows cursor back and lets you run other Windows apps until you click again in the nv-TrixBox window.
asterisk -r ... Runs the Asterisk Command Line Interface (CLI) after you've logged in as root.
quit ... Exits gracefully from the Asterisk CLI
amportal restart ... Restarts Asterisk.
/etc/webmin/start ... Starts up WebMin, the Swiss Army Knife of Linux. Access it with a web browser: https://TrixBoxIPaddress:10000/
shutdown -h now ... Shut down your Linux system right now. Wait for VMware Player window to close!
shutdown -r now ... Reboot your Linux system right now.
nano -w filename ... Edit any file in your Linux system. Ctrl-X, Y, then Enter saves your changes.
cd dirname ... Changes to another directory below current directory.
cd /dirname ... Changes to another directory below the root directory.
ls ... The Linux equivalent of dir to get a directory listing.
cd /var/www/html ... Home of the TrixBox web server files accessed at http://TrixBoxIPaddress/ or https://TrixBoxIPaddress/
cd /var/lib/asterisk/agi-bin ... Home of the TrixBox and Asterisk scripts for Asterisk apps.
cd /var/lib/asterisk/sounds ... Home of Allison and all the voices prompts that make up the Asterisk system.
cd /etc/asterisk ... Home of all the Asterisk, TrixBox, and freePBX configuration files.

The Nerd Vittles Collection. Below are links to tutorials for the Nerd Vittles applications that are preloaded in the PBX-in-a-Flash install. AsteriDex and MailCall require some quick configuration so take a look at the tutorials. You also may want to change the Telephone Reminders default password of 123 in line 28 of /etc/asterisk/extensions_trixbox.conf. If you do, remember to restart Asterisk for the change to take effect.

AsteriDex - The Poor Man's Rolodex (http://TrixBoxIPaddress/asteridex/)

NewsClips for Asterisk - Get the News By Telephone (Dial 511)

MailCall for Asterisk - Get Your Email By Telephone (Dial 555)

Weather Reports by Airport Code - Get the Latest Weather Forecasts for 1,000 U.S. Cities (Dial 611)

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

GabCast Studio for Asterisk - Create and Play PodCasts Using Your Phone (Dial *422 and 422)

TeleYapper Message Broadcasting System - Deliver Appointment Reminders and Important Info to Any Custom Calling List (Dial 674)

What To Do Next. Once your new PBX is humming away, here are the next steps. First, you'll want to upgrade freePBX to version 2.2.x. The tutorial to walk you through the drill can be found here. Last but not least, you'll want to apply the latest Asterisk security patches to prevent a denial of service attack on your system. The tutorial for that can be found here.

Where To Go From There. If you're new to the Asterisk world, you have lots of fun (and learning) ahead of you. Start with the comments to this article for late-breaking news. Then take a look at our Newbie's Tutorial. We've already done most of the work for you here so you'll get to see how much fun you missed. Seriously, it's an easy read and covers many topics that we didn't get to here. So start there. If you want to review what actually got installed with the PBX-in-a-Flash script, take a look at our article on the VMware build of TrixBox 1.2.3. You'll also want to get plugged into the TrixBox Forums. That's the place to ask questions after you do some reading. Posting support questions on Nerd Vittles just doesn't work because of the cumbersome blog format. Don't email us questions either! About 20,000 pages of our tutorials get downloaded each day so we hope you'll understand why free, individualized tech support is not possible. We do accept thank you notes with or without donations to the site. Finally, take a look at our catalog of articles, projects, and Asterisk resource links. You'll find just about everything you'll ever need there. Enjoy!

Nerds' Corner. The trick to building the backup image which makes PBX-in-a-Flash tick lies in the backup script which we use to back up critical pieces of our TrixBox system to a redundant server. Before you can use it to backup your own TrixBox system, you'll need another TrixBox server or any Linux system. Then you'll need to run through the SSH autologin trick which is outlined in our TrixBox 1.2.3 tutorial. This sets up your system so that you can log into other Linux machines with ssh or scp without having to type your password. Finally, you'll need to modify the last line of the backup script so that it points to the correct IP address of your remote Linux server. If you want more detail on the backup process, read our article: Backups and Redundancy with Asterisk. The only remaining piece to make all of this portable was to create a compressed archive of the backup folder on the backup server and make it available to you using the new pbx-in-a-flash script. This command did the trick:

tar cfvz /tmp/backup.tar.gz /backup