Home » Search results for 'web sites 101' (Page 7)

Search Results for: web sites 101

The Most Versatile VoIP Provider: FREE PORTING

Introducing Version 3 of the Plug-and-Play Asterisk IP 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.

As the old saying goes, "Third Time's the Charm!" It's almost Halloween at Nerd Vittles, and today you get a real treat as we introduce the third generation of the free turnkey (aka preconfigured) Asterisk system for Windows: nv-TrixBox-1.2.3. With a few minor changes, this version is about as rock-solid as any Asterisk system on the planet. Of course, the planets do continue to move so be sure to check back here from time to time and review all the newly posted comments. None of our readers are particularly shy when bugs are discovered. As with the prior versions, 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 features Asterisk 1.2.12.1 and 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. Update: Looking for a similar version for Linux? It's now available here.

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, the AsteriDex robodialer complete with a web interface to place your outbound calls and to serve up customized CallerIDs for your incoming calls, TeleYapper to broadcast reminders and messages to your clients or little league team, and our new GabCast (podcasting) Player for Asterisk. Last but not least, you get all of the bundled TrixBox 1.2.3 applications including SugarCRM, FTP and SSH support, PHP, MySQL, Perl, Apache, SendMail, integrated fax-to-email support, calling card billing, and more. Then we've rolled in the latest upgrades of freePBX (2.1.3) and WebMin. And it all runs quite peacefully in a CentOS 4.4 Linux wrapper with the 2.6.9-34 Linux kernel which doesn't appear to have the voice timing problem that reared its ugly head in TrixBox 1.2. To the Tinkerers of the World, a word of caution: don't attempt to run yum update or trixbox-update.sh on this build until you hear from us, or you may break it. freePBX updates still are safe using Tools->ModuleAdmin->Connect to Online Repository.

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 6 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" the nv-trixbox-123 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 (561 megabytes!), 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.

Overview. As was true in previous builds, what we've done is build a TrixBox system from the ground up. Then we loaded all the Linux, TrixBox, and freePBX updates through version 1.2.3 in addition to the latest build of freepBX. Then we added the dozens of enhancements which we write about each week. Finally we configured the system so that it's ready to go ... out of the box! This version of TrixBox is also unique in that no bugs have (yet) been reported so it should be rock-solid reliable as a production server. And we've even found a fix for the VMware timekeeping problem in previous releases. So, once you secure the system with your own passwords, plug in the account names and passwords provided by your ITHPs, and apply a minor security patch to Asterisk and address the VMware timekeeping problem (equally easy!), 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 my usual 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 globe) 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 almost 600MB. Don't even try it with a modem! Bandwidth to cover downloads costs money. We've sprung for four terabytes 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 our bandwidth is exhausted. It will be available again on the second day of the coming month until the four terabytes are once again exhausted. So, as they say, the early bird ...

Installing nv-TrixBox 1.2.3. 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 MojoMonster.com and VMwarez.com have agreed to host this download. So just click on BubbaPCguy's mirror or Jim's VMwarez site, and download the file. If, for some reason, those sites are down or too busy, feel free to download the image from our site by clicking here. Then save the zipped file to your Windows Desktop.

Once the download finishes, click on the nv-trixbox-123.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 may 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.

NOTE: If, for some reason, you get an error about a mismatched IP and MAC address when nv-trixbox-123 loads or if no IP address is shown once you log in as root, it means you've lost Internet connectivity. You can restore it easily once you're logged into your system as root. Just download the fixmacaddr script from here. Then copy it to the /root folder on your server. Now issue the following commands:

cd /root
chmod +x fixmacaddr
./fixmacaddr

If you'd prefer to create the script yourself using an editor (nano -w /root/fixmacaddr), log in as root and cut-and-paste the following code. Save the file (Ctrl-X, Y, then Enter) and then execute the commands above.

#!/bin/bash
mac=`ifconfig -a | grep "HWaddr" | cut -d " " -f 11`
echo "DEVICE=eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "BOOTPROTO=dhcp" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "HWADDR=$mac" >> /etc/sysconfig/network-scripts/ifcfg-eth0
service network restart

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. That's why you made a backup CD of the nv-trixbox-123.zip file. Right?

Securing Asterisk. Because of a security vulnerability in the (Cisco) Skinny module of Asterisk, it needs to be disabled. Log into your server as root and edit modules.conf: nano -w /etc/asterisk/modules.conf. Then insert the following line in the [modules] context. Save the file (Ctrl-X, Y, then press Enter) and restart Asterisk: amportal restart.

noload => chan_skinny.so

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

MIME-Construct: Wherefore Art Thou? A Linux utility, MIME-Construct, made it easy to convert images (like faxes) to PDF documents and also facilitated the emailing of just about any document. Unfortunately, it came up missing in TrixBox, and it's difficult to install because of all the Linux dependencies. So here's a simple solution that restores the original functionality of MIME-construct thanks to the programming genius of Rob Thomas. Since Rob's fax-process.pl code (included in freePBX) mimics the old MIME-construct application, the simple solution was just to tweak it a bit for Nerd Vittles and TrixBox compatibility and then copy a renamed version into the PATH (remember the DOS PATH!) on your Linux box. Log in as root and issue these commands, and you'll be back in the fax-to-email business with TrixBox:

cd /usr/local/bin
wget http://nerdvittles.com/trixbox123/mime-construct
chmod +x mime-construct

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

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 for 3 months than $19.95 gets you unlimited calling in the U.S. and two phone numbers (DIDs) in your choice of area codes. 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 outbound 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 1.2.3 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.

Making VMware Keep Correct Time. Until recently, the only sure-fire way to make sure VMware kept the same time as your hardware clock was to use a cron job which polled a time server for the correct time and then reset the VMware/Linux clock every few minutes. That's been fixed, and we'll show you how to patch the boot loader to fix it. But, first, while you're using WebMin, let's disable the time-setting cron job. From the main WebMin menu, choose Hardware->System Clock. In about the middle of the page is an option to Synchronize (the time) on Schedule. Just set it to No and Save your change. Now go to the command prompt on your server and make certain you are logged in as root. Edit the boot loader (nano -w /boot/grub/grub.conf) and move down to line 16 which begins with the word "kernel." Edit that line so that it looks like the following and save your change (Ctrl-X, Y, then Enter). Then reboot your system (shutdown -r now). HINT: Everything after "noapic" is new stuff to be added, and it all must be appended to the end of the existing line.

kernel /vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/ acpi=off noapic nosmp nolapic clock=pit

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.

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.

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


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.


Some Recent Nerd Vittles Articles of Interest...

Introducing Version 2 of the Plug-And-Play Asterisk IP 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.

It's birthday week at Nerd Vittles, and today you get the party favor as we introduce the second generation of our free turnkey (aka preconfigured) Asterisk system: nv-TrixBox-1.1.2. As with the first version, 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 features the latest build of Asterisk (1.2.12.1) and 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, the AsteriDex robodialer complete with a web interface to place your outbound calls and to serve up customized CallerIDs for your incoming calls, and our new GabCast (podcasting) Player for Asterisk. Last but not least, you get all of the bundled TrixBox 1.1 applications including the latest upgrade of freePBX (2.1.2), 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. And it all runs quite peacefully in a CentOS 4.3 Linux wrapper with the 2.6.9-34 Linux kernel which doesn't appear to have the timing problems that reared their ugly heads in CentOS 4.4 and TrixBox 1.2. We've used Andrew's trixbox numbering scheme to indicate that this build began with TrixBox 1.1 and includes the 1.1.1 updates as well as the latest versions of Asterisk and freePBX. Hence, version 1.1.2 is born. While it's not quite the latest and greatest everything that you'd find in TrixBox 1.2, it has one advantage running on almost all VMware Windows platforms: it works! And, to the Tinkerers of the World, a word of caution: don't attempt to run yum update or trixbox-update.sh on this build, or you'll break it. freePBX updates are safe using Tools->ModuleAdmin->Connect to Online Repository.

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" the nv-trixbox-112 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 658.29 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. As was true in version 1 of nv-trixbox, what we've done is build a TrixBox 1.1 system from the ground up. Then we loaded all the Linux, TrixBox, and freePBX updates through version 1.1.1 in addition to the latest builds of Asterisk and freepBX. Then we added the dozens of enhancements which we write about each week. Finally 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 my usual 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 globe) 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 700MB. 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 1.1.2a. 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 and MojoMonster.com have agreed to host this download. So just click here or BubbaPCguy's mirror, and download the file. If, for some reason, those sites are down, you can download the image from our site by clicking here. Then save the zipped file to your Windows Desktop.

Once the download finishes, click on the nv-trixbox-112a.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 may 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.

NOTE: If, for some reason, you get an error about a mismatched IP and MAC address when trixbox-112a loads or if no IP address is shown once you log in as root, it means you've lost Internet connectivity. You can restore it easily once you're logged into your system as root. Just issue the following commands:

cd /root
./fixmacaddr

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

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

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)

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's Corner. If you've been following TrixBox developments recently, you know that there were some technical problems with TrixBox 1.2 on some platforms, especially VMware builds such as our bundle. We don't work under the hood of our car, and we're not especially comfortable under the hood of Linux or Asterisk either. So, it's been a difficult couple of weeks trying to come up with a mix of products that provides the latest Asterisk and frePBX builds as well as a stable operating environment. Thanks to Rob of freePBX fame and Bubba, one of the very best troubleshooters in the TrixBox business, we've come up with a compromise package that works great with VMware and the Nerd Vittles goodies, but could still use a little debugging for anyone that wants to run it on a standalone Linux machine. Why? Because we got everything to work reliably except zaptel which never would compile on our VMware platform. Our solution was pretty simple. We just disabled it in /etc/asterisk/modules.conf because zaptel isn't supported under VMware anyway. And, no, Asterisk doesn't use it for timing any longer so the missing zaptel module shouldn't cause you any headaches. If one of the geniuses gets it working again, we'll post an update in a comment to this article. But, as we said, zaptel is an academic exercise in the VMware world anyway so ... not to worry! Zaptel has been fixed in the version 2a image which is now available for download.



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.


Some Recent Nerd Vittles Articles of Interest...

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

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!

Weather, Weather, Everywhere: Asterisk Weather Forecasts at the Touch of a Button for Any U.S. City

I can remember as a kid how fascinating it was to be able to call a local number (611) and listen to the local weather forecast. Never mind, of course, that it was rarely accurate. Some things change and some things never do. Even as lousy as most weather forecasts are, most of us still are fascinated nonetheless which brings us to the topic of the day: An Enhanced Weather Application for Asterisk®. Last week, we finally got a reliable voice synthesizer installed for all the newer versions of Asterisk. So now we're ready to put it to good use with our first of several text-to-speech projects. We took a little different approach in building this weather module when it's compared to the default application which ships with Asterisk@Home. We wanted not only current conditions but also a 7-day forecast. And we wanted the caller to be able to choose the weather location rather than having to hard-code a specific city into the AGI script. Finally there's even a simple feature for those that don't want to listen to a full 7-day forecast: hang up.

How It Works. The design is pretty straightforward. You install the nv-weather.php script in your default Asterisk agi-bin directory and add a simple dialplan to your extensions_custom.conf file. Then you pick up an extension on your Asterisk system and dial 611 or the number you've designated for the new weather reports. You'll be prompted to enter the 3-character airport 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 using our pdaweather.org conversion tools. And apologies to 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.

Prerequisites. For the Nerd Vittles Weather Application to work, you'll need an Internet connection to access pdaweather.org. We're using our weather site to convert the NWS weather reports to a text-to-speech-friendly format. Then you'll need an Asterisk@Home 2.x server and the new Flite voice synthesizer for Asterisk. Instead of a dedicated Asterisk server, you can use the VMware-version of Asterisk if you just want to experiment a bit. It runs in a window on your Windows XP/2000 desktop. Our Flite tutorial and the Flite application software are available here. And, as usual, everything you'll need for this project is free!

A Word About Airport Codes. Before we get everything installed and working, let's spend a minute discussing airport codes. At least for some U.S. cities, the folks that thought up airport codes did a pretty crappy job of coming up with three-character abbreviations. Take IAD, for example, which is the airport code for Dulles Airport outside of Washington, D.C. We've compounded the problem by trying to uniquely fit those codes into a telephone keypad consisting of 10 numbers which cover the 26 letters of the alphabet. You'll recall that even Ma Bell herself never considered that letters would actually be used for much of anything on telephones. Remember the Q and Z were originally missing. Times change. It happens. --Forrest Gump

The point of all this is to alert you that some airport codes when keyed in on a touchtone phone are not unique. For example, LAX (Los Angeles, CA) and JAX (Jacksonville, FL) both are keyed in as 529. How do it know? Well, it doesn't. So we were a little arbitrary with some of these. 529 is Jacksonville on this system while Los Angeles is LOS (567) or SNA (762). NYC and our made-up MYB share 692 so Myrtle Beach is 692 and JFK (535) and LGA (542) are used for New York (which happen to be the real airport codes and the locations of the weather stations anyway).

You also may find that your favorite airport is missing altogether. Not to worry! Keep reading! We entered a bunch of airport codes, and then we got tired and quit. As folks have requested other cities through our pdaweather.org web site, we've added them. But soon, all of that will be a thing of the past. How will you know if your town is missing? Well, it's easy. You'll get the Atlanta weather report whether you wanted it or not. So, if that happens, just hang in there for Part II ... coming soon! Here's the list of supported airport codes for today.

Dialplan Code. In order to activate extension 611 to answer calls for weather information, you'll need to drop the following code into your dialplan in the [from-internal-custom] context of extensions_custom.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. Now let's add the PHP/AGI script to your default AGI directory, and we'll be ready to test things out.

Downloading and Installing nv-weather.php. To get the PHP/AGI 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
wget http://nerdvittles.com/aah2/nv-weather.zip
unzip nv-weather.zip
rm -f nv-weather.zip
chown asterisk:asterisk nv-weather.php
chmod 775 nv-weather.php
amportal stop
amportal start

Taking NV-Weather for a Spin. Now we should be all set. Just pick up an extension on your system and dial 611. You'll be prompted to enter the three-character airport code. Choose one that's in the supported list of codes unless you just like the Atlanta weather report. If you want the rest of the world to be able to use your fancy new weather station, then just sign up for a free incoming line with Stanaphone and, using AMP or freePBX, point your new DID to extension 611 on your local Asterisk system. Piece o' cake! Enjoy!

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

Coming Attractions. Well, we're down to the wire on the family move to Charleston. Our next column will be coming to you from there. We'll be revving up our text-to-speech series with an article on using Flite to query and retrieve information from a MySQL database on your Asterisk server in our next episode. This will also be Part II of the Weather Application with the Mother of All Weather Apps. In Part II, we'll turn over complete control of the National Weather Service to you (well, almost!). There will be separate options for Current Conditions, Forecast-at-a-Glance, and 7-day Forecasts. The way it works is you'll get a MySQL database with every airport in the United States. There are about 3,500 of them. You can designate up to 1,000 of them for active use from your phones: 000 through 999. We've chosen a thousand, but you can change them in any way you like and as often as you like. After choosing your favorite 1,000 airports, you simply pick up a phone, dial 611 and enter the three-digit airport code. After giving you a quick current conditions summary, you'll be prompted for which detailed weather report you desire. The script will query the MySQL database for the matching code, contact the National Weather Service for the appropriate report, and presto: instant weather. And it'll all be done from Weather Central: Your Very Own Asterisk@Home Server. So think of today's episode as the appetizer. With the next version, you'll get complete control of the airport database and the types of weather forecasts you wish to listen to. We'll also have lots of tips on building MySQL applications with Asterisk and PHP to keep you busy for the rest of the summer dreaming up your own applications. We'll even publish the best ones here for the rest of the world to share.

Farewell to Asterisk@Home. It's also fitting that, as we leave Atlanta, we also bid farewell to Asterisk@Home this week. Version 2.8 marks the end of the line for Asterisk@Home. Why? Because the scope of use of the product now has far outstripped its name, Andrew Gillis has decided to change the name of the magic bundle we all know and love. But there's much more! The new product will have UPGRADE POWER and freePBX 2.1 and ... well, you'll just have to wait and see. Shouldn't be very long. So we'll all be very busy ... after the move. Adiós Atlanta!

Homework. For those that like to get a head start on things, you can go ahead and download the MySQL Airports IATA database and a web-based script to take a look at everything. You'll need Asterisk@Home 2.7 or earlier to edit the database because these versions include phpMyAdmin as part of the Asterisk Management Portal (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 and 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 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 need the main field to pick one. As mentioned above, I'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. So there's your homework. 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 ruled out zip codes because nobody can remember more than a handful of them anyway. 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!

To assist with your exploration of the airport codes and to give you some hints about how we use those to actually obtain weather reports from the National Weather Service, we're also providing our working prototype of a web page that retrieves weather reports. Keep in mind that it is our very rough, working prototype and does no text-to-speech magic at this point. But it'll show you how to build one and give you some great tips and tricks for retrieving, parsing, and manipulating web site data within a PHP script. Since your Asterisk@Home server has Apache running, you can simply drop this script into the web directory and access it using a web browser to call up http://YourServer'sIPaddress/airport.php?code=list or http://YourServer'sIPaddress/airport.php?dialcode=list. The former will display all the airports in the database while the latter displays only those in which the dialcodes are asterisk-enabled. When you click on a link, you should get a weather report or two suitably parsed for use in text-to-speech apps as well as some other options which we haven't yet finished. To install the script, log into your Asterisk server as root and execute the following commands in order:

cd /var/www/html
wget http://nerdvittles.com/wp-content/airport.zip
unzip airport.zip
rm -f airport.zip
chmod 775 airport.php

For Part II of this series, click here.


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!

A Marriage Made in Heaven: Sprint Cellphone + Asterisk@Home = Unlimited U.S. Cell Phone Calls for $5

Last week Sprint announced the availability (beginning today!) of a new add-on for existing and new Sprint cellphone customers. For $5 more a month and a little Yankee ingenuity, you now can make unlimited FREE calls between your Sprint cellphone (or multiple PCS phones if you’re on a shared plan) and your residential phone number regardless of the wireline carrier. In short, your home phone service need not be with Sprint. If you have Sprint home phone service, then the new PCS to Home service will be free. In either case, no cellphone minutes will be assessed for inbound (read comments!) or outbound calls between your Sprint cellphone and your home number … ever. In fact, they’ll show up on your statement as PCS-to-PCS calls which are also free.

For Sprint business customers with a business plan of $50 or higher a month (that’s easy!), you can do the same thing with your business landline for $8 a month instead of $5. Later this year Sprint reportedly will offer business customers the opportunity to expand the plan to up to 30,000 business DID’s. Here’s a link to Sprint’s web site with a comprehensive FAQ and details on how to order the new PCS to Home service. Be aware that this is a new Sprint feature, and you now know more about it than most Sprint reps … so let the torture begin. The first rep we got indicated that it was $5 per PCS phone even on residential shared calling plans. The FAQ on the web site says otherwise, and you’ll probably need to walk them through it or ask for a supervisor.

You might be asking what all this has to do with Asterisk®. Well, plenty! Some of our regular readers no doubt have already figured it all out. For the neophytes, here’s today’s lesson. Connect your home phone line to your Asterisk server with a Sipura SPA-3000 (click here for our tutorial on how to do it). Better yet, switch your home phone line to a VoIP BYOD Plan (see below) and save a bundle. Next, add a little code (which we’ll get to shortly) to extensions_custom.conf to answer incoming calls from your cellphone to your PSTN line, provide DISA dialtone to make an outbound call, and PRESTO! You now can phone home with your Sprint cellphone by pressing a single pre-programmed button on your phone and make outbound calls to anywhere in the U.S. through your home VoIP service without eating up a single cellphone minute on your plan. Your Asterisk system will answer on the first ring and give you dialtone to make the call. It’s that easy!

Sprint PCS Residential Plan Costs. Here’s the math. A basic Sprint cellphone plan: $35. Sprint to Home service: $5. TelaSIP’s unlimited US48 VoIP calls: $15 a month. Home phone number transferred to BYOD plan at BroadVoice (here’s how) or AxVoice (here’s how) for unlimited incoming calls: $9. Unlimited nationwide Sprint cellphone calls: Priceless … and FREE. Total cost for residential home and cellphone service with unlimited nationwide calling: $64 a month plus about $4 in Sprint add-on fees. Remember this gets you unlimited nationwide calling BOTH from your cellphone and your home phones. And you can convert the BroadVoice BYOD plan to an all-purpose second line within your entire state for $4 more a month. This also provides some redundancy when one of your VoIP providers has problems. It happens! — Forrest Gump


Sprint PCS Business Plan Costs. A basic Sprint PCS business plan cellphone: $50. Sprint to Home Office service: $8. Penny-a-minute calls through voxee.com. Unlimited nationwide Sprint cellphone calls: 1.1¢ per minute. Local business line from Ma Bell Jr.: $50. Total cost: $108 a month plus tip and taxes and 1.1¢ per minute in 6-second billing increments.

It’s Not the NFL, But There Is A $25 Signing Bonus. So today your mission is to sign up for a Sprint PCS phone if you don’t already have one. Then sign up for the new PCS to Home service. Now we’ll show you how to hook everything up and begin enjoying unlimited cellphone calls with no per minute charges … ever. Just do us both a favor. If you sign up for new Sprint service, email us your new Sprint phone number the day after your service is activated. With Sprint’s Referral Program, we’ll both receive a free $25 debit card. Doesn’t get much easier than that to earn free bucks. And, if you tell us, we’ll keep your email address on file and pass along other user’s phone numbers for you to claim some referral credits if there are sufficient new subscribers to pass around once we exhaust our authorized dozen referrals for the year. Can’t help it. WE LOVE SPIFFS!

Prerequisites. Before we get started, here’s what you should have already done. Yes, you need a Sprint PCS phone with PCS to Home service. And we’re assuming you’ve already set up your Asterisk@Home server with an SPA-3000 connecting your home phone line as well as a working VoIP trunk (SIP or IAX2) from TelaSIP or some other provider. TelaSIP setup instructions are available here. Instead of an SPA-3000, you can use a $10-$20 OEM version of Digium’s WildCard X100P PCI card to connect your home PSTN line, but read this first. You get what you pay for!

Overview. Our Asterisk design to get this working goes like this. We’ll create a custom-disa context to manage our incoming calls from the Sprint cellphone. Then we’ll intercept all of your incoming calls and route them to this context to check and see if it’s a call from your Sprint cellphone. If it is, we’ll use a dialplan with the specific Sprint phone number to activate DISA and a dialtone for the caller. If it isn’t a call from your Sprint cellphone, we’ll pass it on to your default Incoming Call dialplan. If you’re using our Stealth AutoAttendant, you’d basically route calls which aren’t from your Sprint cellphone to the autoattendant. Otherwise, you let the custom-disa context process the call.

Building the custom-disa Dialplan. Using the Asterisk Management Panel (AMP) from your web browser pointed to the IP address of your Asterisk server, choose AMP->Maintenance->Config Edit->extensions_custom. Move to the bottom of the file and insert the following code:

[custom-disa]
exten => 6781234567,1,Answer
exten => 6781234567,2,Wait(1)
exten => 6781234567,3,Authenticate(123)
exten => 6781234567,4,DISA(no-password|from-internal)
exten => i,1,Goto(from-pstn-timecheck,s,1)

Replace 6781234567 in each of the four lines above with your Sprint phone number. If the little Mrs. has a Sprint phone, too, duplicate the first four lines and enter the next Sprint phone number for each of the four lines you added. Then renumber all of the lines so that they’re unique, i.e. 1,2,3,4 becomes 1,2,3,4,5,6,7,8. Replace the 123 password in each of the Authenticate lines with whatever you wish to use. Remember that it’s very easy to spoof CallerID numbers so you probably do want a password so you don’t sell the farm. If you prefer to live dangerously, delete the Authenticate lines and renumber. IT’S YOUR PHONE BILL! If you take out the Authenticate line, then you’ll get an immediate dialtone whenever you phone home from your Sprint cellphone. The exten=>i entry in the dialplan handles all the incoming calls that don’t match any Sprint phone number that you’ve entered in this context. So, if someone calls you from the White House (2024561414), the i entry in the custom-disa dialplan would process the call and send G.W. to your standard Incoming Calls context. Save your entries when you finish by clicking the Update button.

Rerouting Incoming Calls to custom-disa. There are two places we need to adjust to reroute incoming calls to the custom-disa context we just built. Using AMP again, edit the from-sip-external context in the extensions.conf file: AMP->Maintenance->Config Edit->extensions.conf->from-sip-external. Comment out all the existing lines with a leading semicolon. Now add the following new line and then click the Update button:

exten => _X.,1,Goto(custom-disa,${CALLERIDNUM},1)

Now edit or create an Incoming Route for your home phone number using your real number instead of 6781234567: AMP->Setup->Inbound Routing. Click the Submit Changes button when you finish and then click the Red Bar to reload Asterisk.

  • DID Number: 6781234567
  • Caller ID Number: 6781234567
  • FAX Extension: AMP default
  • FAX Email: blank
  • Immediate Answer: No
  • Pause After Answer: 0
  • Privacy Manager: No
  • Destination: Custom App custom-disa,6781234567,1
  • Testing Our Masterpiece. We need to make two calls to be sure things are working properly. First, store your home phone number in your Sprint cellphone so you can push one button to phone home. Now place a call to your home phone number from your Sprint cell phone. When prompted for your password, enter it and then make your first free call. Second, place a call to your home phone number from some other phone that is not specified in [custom-disa]. This call will be routed to your default incoming call handler or autoattendant. Enjoy!

    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 we know 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. And one final note. TelaSIP’s web site doesn’t rate as the fanciest on the planet, but they do have great VoIP phone service at rock bottom prices. And that’s what this drill is all about. But, if you’re still not sold on TelaSIP, check out our other VoIP Provider Reviews.

    Quick Tip. Here’s a final little trick. When you set up your TelaSIP account, tell Gene that you’d like your account set up on gw4.telasip.com so that you can only make calls in the 48 states covered by the free unlimited plan. That’s the way the One Ringy-Dingy service works. Once this is done, it’s pretty safe to remove the password from the DISA script which saves some dialing when making outbound calls from your cellphone. Then it’s just a matter of watching your call logs (AMP->Reports) regularly to make sure no one is spoofing your CallerID number to take advantage of free calling from your server. In short, free calls won’t hurt you financially, and it will take a pretty bright creep to figure out your cellphone number, your home phone number, and to know that you’ve got Asterisk configured to do this in the first place. HINT: Don’t brag about it! In reviewing the logs, if you see someone is spoofing your CallerID number and regularly making calls to places you don’t recognize, then you can always reinstate the DISA password step in your dialplan.


    A Word About Web Hosting Providers. You’ve no doubt seen the BlueHost ads on our site lately. And, as many of you know, we don’t advertise things we don’t believe in. We switched hosting providers for Nerd Vittles about a month ago. So let me just say BlueHost Rocks! If you’ve ever thought about building your own web site either for your business or for your family, do it right with the very best tools, servers, bandwidth, and price. BlueHost has all of that plus a special ingredient that really sets them apart: nice people. Read their ad if you want technical details. But let us save you hundreds of hours and hundreds of dollars comparing literally thousands of providers hoping to find just the right one. You can’t and won’t go wrong with BlueHost. Yes, we’ll be living it up Friday night if you sign up through our spiffy ad links. But, if vendor commissions bother you, go to their web site and sign up directly. It won’t hurt our feelings a bit. They’re that good! And you can get every dime back within 30 days if you’re not a happy camper. They say that professionalism is contagious in an organization. Have a look at the BlueHost CEO’s blog, sign up, and judge for yourself. You won’t be sorry.


    Another Move in the Works. Not to bore you with personal stuff, but … we had so much fun moving Nerd Vittles last month that we’ve decided to move the entire Mundy clan to the Charleston, South Carolina area. As a former Army brat, I was accustomed to annual moves, but we’ve called Atlanta home since the dawn of the PC era 25 years ago. So this one’s a little tougher. But the move gets us closer to my big girls, a great school for our little girl, an hour from the beach house, and an incredible neighborhood that was built the way all neighborhoods should be. Between now and June 1, we have three home closings and lots of packing and downsizing to do. And the Nerd Vittles articles may become (more) sporadic for a bit. But hang in there. We’ll keep our sense of humor, and one day soon everything will get back to normal … whatever that is.

    Nerd Vittles User Map. Nerd Vittles now supports well over 5,000 visitors a day. Two-thirds of you still use Windows. Try this! Over 1,000 a day find us in a Google search result. And about a third of you hang around for over an hour each visit. Wow! Who woulda thunk Asterisk and little Nerd Vittles could grow this big this fast. THANKS for visiting! We hope you’ll take a second and add yourself to our Frappr World Map compliments of Google. Australians and New Zealanders, don’t be shy! 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." The map still isn’t quite representative of where all of our visitors are coming from, but we’re getting there. Give it another week or two. Finally, 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. We’ll check it out one of these days.


    Some Recent Nerd Vittles Articles of Interest…

    ISP-In-A-Box: The $500 Mac mini (Create Your Own Planet … Really!)

    Today we're officially launching three new Planet sites for the universe to enjoy ... at least those with an Internet connection. For those unfamiliar with Planet, it's a terrific RSS news feed aggregrator which downloads news feeds published by web sites and aggregates their content into a single combined web page showing the collective feeds in chronological order, latest news first. Planet Mac collects news from two dozen of the most well-respected Mac sites on the web while Planet Gadget focuses on late-breaking news about all your favorite new toys collected from more than a dozen worldwide sites. And, last but not least, for all you Superman buffs: Planet Daily, a site with all the latest (real) news headlines from around the globe. There are loads of other planet sites of interest. A long list is available at Planet Planet, the mothership. And, yes, there's even a Planet Asterisk®. Finally, for those of you lucky enough to have a Nokia 770 Internet Tablet, you'll be happy to know that virtually all Planet sites are Nokia 770-friendly. In fact, hitting the 150% zoom key gives you a perfect Big-Type read with no horizontal scrolling, the way eBooks oughta be but usually aren't. If you missed our review, the Nokia 770 is the best $350 travel companion imaginable ... well, almost.

    This is where most press releases end. But today we're going to show you how to build your own Planet: add a Mac, one Python, a feed parser, a templating engine, and a domain. Mix and serve. Presto! Your own new Planet is born. While this project will run on a Windows or Linux machine, it's much more fun to build and maintain it on a Mac ... because it's a 30-minute project! About half of our readers don't (yet) have a Mac. Too bad! But there's still hope. You really don't have to live with viruses, trojans, root kits, adware, and other secret back doors into your system unless you just enjoy pain. Anyway, there's never been a better time to try a Mac. Can you spell Intel R-O-C-K-E-T? Our tutorials will get you up and running in no time with your own web server, mail server, MySQL and PHP servers ... at no additional cost. Take it from a guy that lived and breathed PCs for over 20 years: Come on Over from the Dark Side. You'll never look back! We haven't, and the learning curve is virtually non-existent. </end of rant>

    Now, where were we? For our own Planet sites, we're actually maintaining them on three iMacs (Mac minis work just as well), and then we're uploading content once an hour through a cron job to our redundant WestNIC-hosted Linux servers for all the world to see. It's called bandwidth, and you'll need plenty of it if you tackle a project such as those we've bitten off today. Of course WestNIC is practically giving bandwidth away at the moment: 500 gigs a month with 10 gigs of permanent (backed up!) storage for under $10 a month. Wow! We've used WestNIC for well over a year now, and it's been flawless. That's quite a contrast from our three previous hosting providers, all of whom served up a nightmare about once every three months. The $8.95 deal probably expires in the next couple days so HURRY if you're interested. That price is less than 10% of the going rate from most reputable providers for this much bandwidth.


    Where to Begin. The real trick to making the Planet software work is getting the right Python engine installed on your system. While both Mac OS X Panther and Tiger come with Python preinstalled, it's unfortunately an older version which lacks support for python-bdb, the critical component to achieve liftoff with Planet. So download MacPython 2.4.1 from here. Once you've downloaded the software, just install it as you would any other Mac application. Can you say double-click? If you're running Tiger, you'll also want to apply the installer fix which is explained on the web site. Finally, grab the latest nightly build of Planet from here. Once the tar ball decompresses on your desktop, rename the folder to planet just to keep things simple. Because of some privileges issues, the easiest way to get things working is to give everyone full rights to this folder. Open a Terminal window, switch to root access, and set the rights substituting your account name on your Mac for mine (in bold):

    sudo su
    chmod 777 /users/wardmundy/desktop/planet
    exit

    Be sure your Mac's web server is running (System Preferences->Sharing->Personal Web Server) and then create a web folder for your new Planet site using your account name, not root. Just issue this command:

    mkdir /library/webserver/documents/planet

    Configuring Planet. Before you can actually test things out, we need to do a little basic configuration magic with Planet. From your desktop, double-click the planet folder, then the examples folder, then the fancy folder. Now Ctrl-Click on config.ini and choose Open With ... TextEdit. You'll need to modify a few sections of code. Starting at the top, you'll see a section that looks like this:

    # Every planet needs a [Planet] section
    [Planet]
    # name: Your planet's name
    # link: Link to the main page
    # owner_name: Your name
    # owner_email: Your e-mail address
    name = Planet Schmanet
    link = http://planet.schmanet.janet/
    owner_name = Janet
    owner_email = janet@domainname

    In the name field, give your planet a name. In the link field, insert the fully qualified domain name for your planet. Fill in your owner_name and owner-email address, and you're all set. Now move down the page to new_feed_items and change the 2 to something like 30. This sets the number of items your application will download from each RSS feed. You can adjust all of this later depending upon your subject matter. Continue moving down the page until you get to output_dir. Change the existing output entry to the address of your new web site directory on your Mac: /library/webserver/documents/planet. Leave the remaining settings alone at least until we get a successful first run.


    The final step is setting up the actual RSS feeds which will be supported by your Planet application. Scroll further down the page until you get to the last section which starts like this:

    [http://www.netsplit.com/blog/index.rss]
    name = Scott James Remnant
    face = keybuk.png
    # pick up the default facewidth and faceheight

    [http://www.gnome.org/~jdub/blog/?flav=rss]
    name = Jeff Waugh
    face = jdub.png
    facewidth = 70
    faceheight = 74

    If you haven't done so already, now it's time to figure out what you want to cover in your Planet application. It could be subject matter oriented. If you need some ideas, just scan the RSS Feeds available from the Washington Post. Or you may choose just to collect your favorite RSS feeds into a Personal Planet. If you're addicted to your Nokia 770 like we are, trust us when we say you'll never touch another news reader after you see the zoomed text display of a Planet site on your Internet Tablet. Once you figure out your site's contents, write down the names of the sites and the addresses of the feeds. Then you simply replace the examples in the config file with your own selections. For example, a Nerd Vittles entry would look something like this. You'll note that we've commented out the optional "face" which is reserved for a picture of the blog owner. If you decide to use faces, you'd also want to uncomment the facewidth and faceheight lines and insert the correct dimensions for the picture to speed up loading of the web page.

    [http://mundy.org/blog/wp-rss2.php]
    name = Nerd Vittles
    #face = nerd1.png
    # pick up the default facewidth and faceheight
    #facewidth = 62
    #faceheight = 80

    When you complete all of your RSS feed entries, press Command-S to save your config file changes to disk.

    Setting Up the Web Site. We don't need to do much construction work on the Planet web site since the Planet application will handle the heavy-lifting for us. We do, however, need to copy a few things to the web site directory. So open your web site directory with Finder (DefaultDrive->library->webserver->documents->planet). Then open the planet folder on your Desktop in a second Finder window. Now copy the images folder from output to the open planet web folder. Also copy the planet.css style sheet to your planet web folder. If you have a favicon.ico file for your new web site, put it in there, too.


    Modifying the Look and Feel of Your Site. Don't do it now, but make a mental note that you can customize your Planet site in any way you desire. Just be sure you make a backup of the web site template before you make improvements. The template is in the /examples/fancy folder and is named index.html.tmpl. You can edit the file with any text editor including TextEdit, pico, and nano. If you use pico or nano, be sure to start up the editor with -w to avoid unexpected line wrap problems.

    Taking Your Planet for a Spin. Ready for a test run? Drop down to a Terminal windows again, and switch to root access (sudo su). Switch to the planet folder on your Desktop using your account name, not mine (replace all of the bold entries). And then give it a whirl:

    cd /users/wardmundy/desktop/planet
    /usr/local/bin/python /users/wardmundy/desktop/planet/planet.py /users/wardmundy/desktop/planet/examples/fancy/config.ini

    You'll get some feedback that looks something like the following although you won't have any cached data on your first run:

    INFO:planet.runner:Loading cached data
    INFO:planet:Feed http://www.popgadget.net/index.xml unchanged
    INFO:planet:Feed http://feeds.gawker.com/gizmodo/full unchanged
    INFO:planet:Feed http://mundy.org/blog/wp-rss2.php unchanged
    INFO:planet:Updating feed http://www.bradsdeals.com/rss.cfm?c=6
    DEBUG:planet:Items in Feed: 20
    INFO:planet:Feed http://feeds.feedburner.com/ubergizmo unchanged
    INFO:planet:Updating feed http://www.woot.com/Blog/Rss.aspx
    DEBUG:planet:Last Modified: 2006-01-27T17:15:41+00:00
    DEBUG:planet:Items in Feed: 20
    ERROR:planet:Error 404 while updating feed http://gizmonews.com/wp-rss2.php
    INFO:planet:Updating feed http://www.engadget.com/rss.xml net:Items in Feed: 40
    INFO:planet:Updating feed http://techbargains.com/rss.xml
    DEBUG:planet:E-Tag: "4679fc226323c61:94c"
    DEBUG:planet:Last Modified: 2006-01-27T17:00:12+00:00
    DEBUG:planet:Items in Feed: 93
    DEBUG:planet:Removed expired or replaced item http://www.techbargains.com/news_displayItem.cfm/57004
    DEBUG:planet:Removed expired or replaced item http://www.techbargains.com/news_displayItem.cfm/56997
    DEBUG:planet:Removed expired or replaced item http://www.techbargains.com/news_displayItem.cfm/56969

    INFO:planet.runner:Processing template examples/fancy/index.html.tmpl
    INFO:planet.runner:Writing /library/webserver/documents/planet/index.html
    INFO:planet.runner:Processing template examples/atom.xml.tmpl
    INFO:planet.runner:Writing /library/webserver/documents/planet/atom.xml
    INFO:planet.runner:Processing template examples/rss20.xml.tmpl
    INFO:planet.runner:Writing /library/webserver/documents/planet/rss20.xml
    INFO:planet.runner:Processing template examples/rss10.xml.tmpl
    INFO:planet.runner:Writing /library/webserver/documents/planet/rss10.xml
    INFO:planet.runner:Processing template examples/opml.xml.tmpl
    INFO:planet.runner:Writing /library/webserver/documents/planet/opml.xml
    INFO:planet.runner:Processing template examples/foafroll.xml.tmpl
    INFO:planet.runner:Writing /library/webserver/documents/planet/foafroll.xml

    The object here is to get a clean run. The way to figure that out is to look in the first section above for lines that begin with the word "ERROR." These are processing errors in accessing the sites you specified for inclusion in your Planet site. What this usually means is that either a site you chose is down, or the address of the site is incorrect, or the format of the RSS feed is not yet supported by Planet. You won't find many of the latter since Planet supports most flavors of RSS feeds. In any case, these errors need your attention and should be fixed in or removed from your config file before you automate the data collection process. The second section of code above tells you whether Planet was successful in generating the documents for your web site. If you don't see errors here, then you should be able to access your site at http://localhost/planet/ using your favorite web browser.


    Automating Your Planet Site. Once you get a successful run and get the errors resolved, you'll want to automate the data collection process. You don't want to have to manually run the planet python script every time you want to visit your web site. And, if you plan to offer the site to others, then it obviously needs to be kept current. Also, if you plan to publish your web site through a hosting provider or even .Mac, this also can be automated. First, you need a script. And then you need to tell your Mac to run it periodically by adding a crontab entry. Here's the runupdate script we use. And, yes, your Planet also produces RSS feeds which can be published by copying those files to your host provider as well as what's shown below. Look in /library/webserver/documents/planet for the names of the RSS feed files. To begin, create a text file in the planet folder on your Desktop and insert something like the following. Be sure to chmod 775 runupdate to make the script executable. And remember to always run your script as root, or it will fail. Don't run the script yet. We've got to move the planet folder on your Desktop first.

    #!/bin/bash
    cd /users/wardmundy/planet
    /usr/local/bin/python /users/wardmundy/planet/planet.py /users/wardmundy/planet/examples/fancy/config.ini
    cd /library/webserver/documents/planet
    /usr/bin/ftp -in <<EOF
    open planetgadget.com
    user username password
    bin
    hash
    prompt
    cd www
    dele index.php
    rename index.html index.php
    put index.html
    bye

    There are several potential gotcha's above. First, make sure you are positioned in the planet folder on your desktop before running the planet python script as root. Second, use your account name in the bolded entries on the second and third lines above, not mine. Third, make sure you are running the correct version of python to execute the script because there now are two versions on your Mac. Providing the extended name for python solves this. Fourth, insert the domain name of your host provider in lieu of planetgadget.com and provide the account name and password that you use to gain FTP access to your site. The www entry is the directory location of the web pages on our FTP site. YMMV!

    Our hosting provider supports both .html and .php web pages so we perform a little magic here. Before uploading the updated web page (index.html), we first must delete the old one. But, when we do that, we run the risk that someone will hit the site at the moment the page is gone. This would result in a 404 error, and no web page. Not good!. So, what we do is rename the page to index.php after first deleting the old index.php file. Then, if someone hits the page during the update, they will get the index.php page which displays (when there is no index.html page). And it will look exactly like index.html since it has no embedded PHP code and, in fact, is the older version of the identical page.

    The final step in automating updates of your Planet web site is to add a crontab entry on your Mac so that the above script runs periodically during the day and night. Before we do that, open a Finder window with the default folder for your accountname. Then drag the planet folder into this directory. Be careful not to accidentally drag the folder inside some other folder already stored in your accountname folder. Now open a Terminal session, switch to root user access (sudo su), and add the following line to the bottom of the system crontab file (pico -w /etc/crontab). Note that there should be a single tab between each of the seven entries below. Delete the intervening spaces! If it lines up with the other entries in your crontab file, you've done it correctly. Then save your changes: Ctrl-X, Y, then press Enter.

    01 5-20 * * * root /users/wardmundy/planet/runupdate

    Be sure to use your account name instead of mine. This crontab entry runs the script at one minute after the hour between the hours of 5 a.m. and 8 p.m. If you wanted the script to run hourly all day and night, replace 5-20 with an asterisk (*). If you wanted the script to run once every four hours, replace 5-20 with */4. If you only want the script to run at certain hours, just replace 5-20 with a list of the hours separated by commas with no spaces. Enjoy your new Planet!

    Coming Attractions. Later this week we'll clue you in to the first (ever) Valentine's gift-with-a-plug for the Little Mrs. that won't get you killed. Caution: YMMV Then next week we'll be hot on the trail of the new, new, new Asterisk@Home release! Come join us. It's free.

    Other Asterisk Projects? For a list of our previous Mac projects, click here. For a complete catalog of our previous Asterisk projects, click here. For the most recent articles including those you missed over the Christmas and New Year's holidays, click here and scroll down the page.