Home » Technology » Telephony (Page 82)

Category Archives: Telephony

The Most Versatile VoIP Provider: FREE PORTING

The Next Frontier: Introducing Asterisk@Home 2.8 and freePBX

We've dragged our feet a bit on releasing a Newbie's Guide to Asterisk@Home 2.8 waiting for some of the dust to settle. This release includes not only an upgrade to CentOS Linux and Asterisk® but also introduces a revolutionary new user interface to Asterisk, freePBX 2.01. Of course, there is the usual collection of add-on products (SendMail, Asterisk Mail, PHP, PHPmyAdmin, MySQL, SugarCRM, the Festival Speech Engine, Flash Operator Panel, Open A2Billing, Digium card auto-configuration, loads of AGI scripts including weather forecasts and wakeup calls, xPL support, Microsoft File Sharing and Networking support through Samba and much more) which makes Asterisk@Home one of the most revolutionary products in the commercial or open source marketplace. And, yep, it's still free!

Let us begin by suggesting who shouldn't install this software: NEWBIE'S! If you're one of them or if this is your first Asterisk installation, do yourself a huge favor and cut your teeth on Asterisk@Home 2.7. Our complete Newbie's Guide to Asterisk@Home 2.7 will get you up and running in under an hour. It is a production-quality PBX that just plain works. And it will all but eliminate any new user frustrations that often accompany installation of bleeding edge open source software. Asterisk@Home 2.8 certainly qualifies, and we mean that as a compliment! If you already have an Asterisk@Home system in production, this is an excellent opportunity to leave it alone and either buy a new PC (here's a small-footprint Compaq unit that will set you back less than $150). We just bought several! Or you can run a VMware version of Asterisk@Home 2.8 in a window on your Windows XP desktop. Our instructions for installing the VMware versions are available here. Untested BitTorrent links are available here which will conserve bandwidth at vmwarez.com.

Having said all of that, let us hasten to add that WE LOVE ASTERISK@HOME 2.8! The main reason is that it finally provides an incredibly simple upgrade system in freePBX which will eliminate your having to reinstall every single component from scratch each time a bugfix to the freePBX shell is released. And freePBX, which replaces the Asterisk Management Portal (AMP), finally provides a web interface to virtually anything you'd want to do with Asterisk without having to dig into their code. Finally, freePBX introduces modules which make it easy to add OR upgrade one component without the rip-and-replace drill which has accompanied Asterisk@Home upgrades since Day One. In conclusion, there now are simple upgrade paths for CentOS and its applications, Asterisk, freePBX, and SugarCRM. That all but eliminates the need to continually reinstall Asterisk@Home from scratch and will allow most of us to concentrate on adding new functionality. That's a WIN, WIN deal in our book!

In this introductory article to Asterisk@Home 2.8, we're going to skip some of the hoops we normally walk you through in our Newbie's Guide and point you to some of the new resources which have been put in place to support freePBX. You may want to print out the Newbie's Guide to Asterisk@Home 2.7 if you need a refresher course on some of the basics. We'll refer you to sections of that tutorial as we move quickly through the basics and then get to the good stuff in Asterisk@Home 2.8. The most important tip today is getting your system set up correctly so that you can quickly upgrade when new freePBX releases come out. This has been an almost daily occurrence for the past several weeks and probably will continue that way for at least another month or so. Not to worry! It's brain-dead simple to upgrade once you have your system properly configured. So let's get started.

Basic Asterisk@Home Installation Steps. Download the ISO image of Asterisk@Home 2.8 from your favorite mirror site and make yourself an installation CD. Load it into a machine whose hard disk can be dedicated to Asterisk@Home (i.e. erased). Before booting the system with the new CD, be sure the machine has Internet connectivity or the installation will fail without much of a clue that that's what went wrong. You'll be prompted to choose your root user password for CentOS as part of the install. When the installation completes, log in as root and change your other passwords according to our previous tutorials. Then run yum -y update to get the latest CentOS patches. If you want https web support, do yum -y install mod_ssl. If you want Bluetooth support, perform the same steps outlined in our earlier Newbie's Guides. Then reboot. As we write this, there is no kernel update to the new version of CentOS so there's no need to rebuild the zaptel drivers. When that changes, you'll need to go through the zaptel source rebuild drill which is outlined in our last Newbie's Guide.

Configuring freePBX for Easy Updates. There have been any number of problems identified with Asterisk@Home 2.8 on the SourceForge forums. Most of these involve minor tweaks to freePBX source code. "Minor" is, of course, in the eye of the beholder. It's sorta like minor surgery. That's surgery other folks are having. As tempting as it may be to make changes to the internal code of freePBX, DON'T! If you do, you will jeopardize your ability to automatically update the freePBX modules as new source code is released because each module now has a checksum which is tested before an update is permitted. Bug fixes are released almost daily so you won't have to wait long for a fix. Just to repeat again for slow learners and tinkerers: By messing with the freePBX source code, you will have just destroyed the very best feature of Asterisk@Home 2.8: instantaneous upgrades in place! We're by no means the freePBX experts, but some of the experts do read our columns and will post corrections if we haven't gotten what follows quite right. The critical component to Asterisk@Home 2.8 is getting it set up so you can quickly install freePBX updates as they are released. The web interface will even tell you when something new is available once it is configured properly. But, for this to work, we need to get freePBX upgraded from version 2.01 to the version 2.1beta. Here's how. Log into your Asterisk@Home server as root and issue the following commands before you do any configuring using the freePBX web interface:

cd /usr/src
rm -rf /usr/src/freepbx
svn co https://svn.sourceforge.net/svnroot/amportal/freepbx/trunk freepbx
cd freepbx
./install_amp --force-version=2.0.1
amportal restart

You're now set up to download future updates whenever you need them using commands like this:

cd /usr/src/freepbx
svn update
./install_amp --force-version=2.0.1
amportal restart

Keep in mind that you only need to do this when the freePBX "engine" is replaced. All of the individual components which make up freePBX (think of them as spark plugs if you remember what those were) now can be updated from within the web interface itself. If you want more details about the process, click here but we think we've got it about right.

Getting Started with freePBX. You still access freePBX just as you accessed AMP, by pointing a web browser to the internal IP address of your new Asterisk system. The username is still maint. Just enter the password you assigned to freePBX/AMP when you configured your system. In the old days, AMP came preconfigured with everything they thought you'd need to use it. With the new freePBX architecture, you first have to install and enable the modules you want to use. And now others can write modules to expand the capabilities of freePBX without futzing around in the basic source code. You get to these modules by choosing Tools->Module Admin from the main freePBX menu. Unlike some applications, there's really no reason not to activate all of the available modules since they won't slow down Asterisk. The only performance hit is when you click the Red Bar to reload freePBX. The more modules you've activated, the longer it will take to reload freePBX since it queries each module to see if changes need to be applied.

The other thing you need to know about Modules is that there are two types: Local Modules and Online Modules. Local Modules are the pieces that make freePBX work on your local machine. Online Modules provides access to modules which are available for download over the Internet. And Online Modules even tells you which ones are newer than the ones currently on your system. To install new modules after an engine update, you first may need to Uninstall and Remove the old modules from within the Local Modules window if the modules appear to be corrupted. Otherwise, don't or you'll lose your existing configuration data. See the comments for more details. You can do it safely this time IF you haven't input any data yet. Next go back to the Online Modules window and click Download beside each module you want to obtain. When the downloads complete, return to the Local Modules window and click Install then Enable for each module. It sounds harder than it really is, but it's exactly the upgrade path that most of us have been clamoring for these past dozen or so months. Just check the Online Modules window from time to time to see what's new and install it. There were four new updates just today! Before too long, we wouldn't be surprised to see an option to email you notices when new modules are released or older ones are updated. This is nothing short of fantastic for the Asterisk community if we do say so.

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

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

When you have your Trunks set up, you'll need a way to call in (Inbound Routes), call out (Outbound Routes), and a way to process incoming calls: a Digital Receptionist, a Call Queue, a Custom Application, DISA, or a phone to ring (Extensions). And you can add Follow Me routing now with the click of a button. And did we mention the incredible flexibility which has been added to manage calls at different times of the day, week, or month? Check out Time Conditions. The only piece that's still missing is a way to Monitor Inbound Routes by Channel rather than by DID since some providers don't pass DID information but hopefully that will come in due course. You can follow along in our previous tutorials for the basics. When you're ready to explore the new Configuration options, here's the link with all the latest and greatest information. Using freePBX at the moment is akin to laying track in front of a steaming locomotive, but the benefits are so enormous and the bug fixes are being released so quickly that you really won't find it very painful. We haven't! Having said that, I don't think you'd want to stake your business on it at the moment, but it's quickly getting there. And you'll find the adventure downright exhilarating. To our guiding light, Rob Thomas, and the entire freePBX development crew, our hats are off! You get an A+ in our book on this one. And, of course, our usual thanks and gratitude to Andrew Gillis for single-handedly producing nearly flawless versions of Asterisk@Home month after month after month.

Restoring the Asterisk@Home Maintenance Functions. If you're like us, you've become dependent upon the Maintenance functions previously included in the AAH web interface to AMP. You have two choices: either clone it from a system you already have or wait on Rob Thomas to finish his new one. It's easy to restore them if you have an existing Asterisk@Home system running in parallel. First, log in to your new AAH 2.8 server as root and issue this command: mkdir /var/www/html/maint. Then log in to your old AAH system as root and issue the following command substituting the IP address of your AAH 2.8 server for 192.168.0.128. Provide your root password to your new server when prompted.

scp -r /var/www/html/maint/*.* root@192.168.0.128:/var/www/html/maint

Now you can access the old Maintenance functions by pointing your web browser to http://192.168.0.128/maint/. Just ignore the Asterisk@Home version number unless you want to crank up Nano and edit /var/www/html/maint/index.php.

Where to Go From Here. This article is a bit of a work in progress for a couple of reasons. First, if you haven't heard, we're moving. In and of itself that wouldn't be a big deal except (1) the movers are coming in three weeks and (2) we're attempting to cram 5500 square feet of "stuff" into the new 3500 square foot house. With less than a month to go, the blog articles have temporarily moved down the priority list a bit ... unless you want to join me sleeping in the street. Second, the amount of new technology in Asterisk@Home 2.8 is truly mind numbing, and it's going to take the whiz kids and us some time to absorb and digest all of the changes and enhancements. Do yourself and everyone else a favor. As you find new features or problems, post them here or on SourceForge so that we all can benefit from the discoveries. We'll do our best to incorporate new changes into this article in the coming weeks so check back often and be sure to read the comments or subscribe to the Nerd Vittles Comments RSS feed. Enjoy!

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, is running a special this month 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. 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 User 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. You'll notice there's a little bug in the map display at the moment. It wipes out everyone in the U.S. and Canada. Is that loud cheering we hear? Not to worry! You can restore us all by moving east or west on the default display, or choose the Big Map Display option after you add yourself, and you can see the whole Nerd Vittles universe. frappr bug fixed: May 3.

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

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

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

Introducing The Idolizer: Free Asterisk AutoDialer for American Idol® Addicts

After a fun day of packing boxes for the Big Move, there's nothing quite as mind numbing as an hour of the FOX TV® network's American Idol® and 50 of your favorite commercials. The Little Mrs. doesn't mind the one hour break in production. It's the two additional hours voting for Kelly Pickler that drives her up the wall. She really can sang. Honest, honey! Enter, The Idolizer. Today's Asterisk® project is for those that have better things to do than dialing a tollfree number for two hours every Tuesday evening. And, no, the show's producers don't like autodialers. Too damn bad! We don't like commercials (especially ten at a time), but they're still showing those. Here's the deal. Cut out the commercials, and we'll turn off our autodialer. And I'll bet DialIdol.com will, too. And, no, we're not affiliated with the Fair and Balanced® network nor the American Idol® show. We just don't wanna waste two hours dialing the same phone number over and over ... when we could be packing boxes and making the Little Mrs. happy.

Prerequisites. To use The Idolizer autodialer with Asterisk, you'll need a free Asterisk@Home PBX or at least a copy of the VMware version of Asterisk@Home that runs in a Window on your Windows XP desktop. This works on versions of Asterisk@Home at least as far back as 1.5. Our tutorials will get you up and running in under an hour. Then you'll need an account with a hosting provider that gives you free calls to toll-free numbers or unlimited outbound calling in the U.S.

Installation. Using the Asterisk Management Portal (AMP) or freePBX, choose Maintenance->Config Edit->extensions_custom.conf and add the following custom context to the bottom of the file:

[custom-idolizer]
exten => s,1,SetGlobalVar(COUNTER=1)
exten => s,2,Answer
exten => s,3,Wait(2)
exten => s,4,Dial(sip/8664365701@telasip-gw|18|L(10000:2000:5000)) ; 18 for TelaSIP, 22 for FWD
;exten => s,4,Dial(iax2/*18664365701@fwd|22|L(10000:2000:5000)) ; 18 for TelaSIP, 22 for FWD
exten => s,5,Goto(h,1)
exten => s,105,NoOp(BUSY)
exten => s,106,Goto(h,1)
exten => h,1,SetGlobalVar(COUNTER=$[${COUNTER} + 1])
exten => h,2,NoOp(Counter: ${COUNTER})
exten => h,3,Wait(6)
exten => h,4,GotoIf($["${COUNTER}" < "999"]?s,2) exten => h,5,Hangup

Once you know the phone number of the contestant you wish to vote for, make the following adjustments to the code above:

  • Provider ... Replace telasip-gw with the trunk name of your VoIP provider in line s,4 (see samples)
  • Protocol ... Be sure you specify the correct protocol for your provider: sip or iax2 (see samples)
  • Dialing Prefix ... The dialing prefix must be added to match what your provider expects to receive before the 10-digit, toll-free number (see samples)
  • Toll-Free Number ... Enter the 10-digit number (default: 8664365701) of your favorite contestant in line s,4 (see samples)
  • AutoDial Counter ... Set the maximum number of times you want the call placed in line h,4 (999 is default)
  • Now move to the top of the file and insert the following code in the [from-internal-custom] context using an available extension number on your system (default=1234):

    exten => 1234,1,Goto(custom-idolizer,s,1)

    Click the Update button to save your changes, and then reload Asterisk: Setup->Incoming Calls->Submit Changes->Red Bar.

    Tweaking the Settings. If you find that your calls aren't being completed or that your votes aren't being registered (i.e. the call disconnects before you are thanked for voting), it's easy to fine tune the script. The number 18 in s,4 tells the dialer how many seconds to wait for an answer when placing calls. The number 10000 in s,4 (in thousandths of a second) tells Asterisk how long to stay connected once a call is answered. And the number 6 in h,3 tells Asterisk how many seconds to wait between placing calls.

    Using the AutoDialer. When you're ready to begin your dialing spree, pick up an extension on your system and dial the extension number you assigned to The Idolizer (default=1234). Put the receiver down (don't hang up!) and enjoy the rest of your evening while The Idolizer does the dialing for you. When you're ready to stop voting, hang up the phone. If you'd like to follow the progress of your calls, fire up the Command Line Interface (CLI) on your Asterisk system (asterisk -r) and enjoy the show!


    Nerd Vittles User 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." The map still isn't quite representative of where all of our visitors are coming from, but we're getting there. 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.

    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!

    VoipDiscount.com: Free Asterisk Calling Returns to the VoIP Wild West

    We return to the VoIP Wild West again today with another free calling discovery. As most of you know, these don’t last forever, but they sure are great while they exist. VoipDiscount.com is one of the better deals to come along in quite a while because of the scope of the countries to which you can place free calls. As you can see from their banner, the list includes not only the United States and Canada, but also 50 49 OTHER COUNTRIES including Mexico and most of Europe, South America and the Far East! And calls to formerly expensive places such as Costa Rica are about a penny a minute. Click on the banner for their complete price schedule. The only (published) catch is you have to open an account with at least $15 to cover the upfront costs of calls to these other places. Be sure to read the comments for some others!

    Getting Started. To begin, you’ll need to download their softphone client from the VoipDiscount.com web site using a Windows PC. When you’ve installed the softphone, run the application and create a username and password for yourself. Once you’ve verified your email address, you can add 10 euros (about $15) to your account using a major credit card or PayPal, and you’re all set. Be sure you configure the client to NOT start up each time you start Windows since we’re going to be using the service with your Asterisk® server. And, when you shut down the client, be sure to look in the Windows Toolbar at the bottom of your display and REALLY exit from the softphone to shut it down. Otherwise, you won’t be able to connect to the service with Asterisk since you can’t have two clients logged in at the same time.

    Creating a VoipDiscount Trunk. If you’re using Asterisk@Home or the Asterisk Management Portal (AMP), or FreePBX, then getting things set up for VoipDiscount is a breeze. Open the management portal with your web browser pointed to the IP address of your Asterisk system and choose Setup->Trunks. Now create a SIP trunk for the service with a Trunk Name of voipdiscount and with Outgoing Dialing Rules in the U.S. that look like this:

    001+NXXNXXXXXX
    00+1NXXNXXXXXX
    001NXXNXXXXXX

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

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

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

    yourusername:yourpassword@sip.sipdiscount.com

    Click the Submit Changes button and click the Red Bar to update Asterisk.

    Creating a VoipDiscount Outbound Route. Now choose the Outbound Routes option and click Add New Route. Fill in the blanks with something like the following:

  • Route Name: OutVoipDisc
  • Route Password: leave blank
  • Dial Patterns: 88|NXXNXXXXXX
  • Trunk Sequence: sip/voipdiscount
  • Now click the Add button and then the Submit Changes button. Then move the Dialing Route for OutVoipDisc to the top of your list of dialing priorities, and click the Red Bar to reload your new Asterisk settings.

    Making a Test Call. Once you complete the above steps, you should be able to make a test call to anywhere in the U.S. by dialing 88-678-1234567 where 88 is the dialing prefix you set up in the Outbound Route (make it anything you like!), 678 is the area code for the call, and 1234567 is the local phone number. For those in other countries or, if those in the U.S. wish to call outside the U.S., add the appropriate dial patterns for each country to both the Trunk Dialing Rules and the Outbound Route Dial Patterns. For example, for U.K. calls, the trunk rule would be 0044. and the outbound dial pattern would be 88|0044.! Dont’ forget the trailing period at the end of both of these entries. Enjoy!

    The Bait and Switch Begins. Well, it didn’t take long. It’s been a day, and Mexico already has disappeared from the free list. It’s now 6¢ a minute. That’s 40%-500% more than Voxee.com depending upon the city you call in Mexico. We’ll keep you posted with new "developments" each week. In the meantime, talk fast and check for current rates before you dial. This is going to be fun!


    Adding Automatic Callbacks to Your Asterisk Voice Mail System. Don’t you just love those Baby Bell phone messages that say "Press 1 and, for a charge of 75¢, we will place this call for you"? Well, now you can add similar functionality to your Asterisk Voicemail System minus the 75¢ charge. Sometimes it’s a lot more convenient to have the computer do the dialing after you’ve listened to a voicemail message particularly when you’re zipping down the highway at warp speed. To add the functionality to Asterisk using the Asterisk Management Panel (AMP) or freePBX, here’s how. Open the settings for the voicemail extension you wish to configure with this option: Settings->Extensions->ext#. Now scroll down to the vm options field and add the following: callback=from-internal. Save your changes and click the big Red Bar to update Asterisk. In the future, when you listen to a voicemail message on this extension and want to automatically return the call, choose 3 for Advanced Options and then 2 to Return the Call. Just be sure your Default Asterisk Outbound Route is configured to dial using the same number format as your received CallerID numbers, and you’re all set. And, by the way, this works with Asterisk@Home versions at least as far back as 1.5. Too bad no one ever bothered to document it. Very slick!


    Nerd Vittles User 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." 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.

    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.

    Coming Attractions. By the end of this summer, we’ll be ready to begin tackling some of the Asterisk hardware cards including the new Sangoma cards and the soon-to-be-released Digium cards. All of these new cards now support hardware echo cancellation. There’s just one catch: we don’t have any. If you’d like to make a small contribution to assist with the project, just click on the donate button in the top right corner of the main page. When the kitty grows sufficiently to fund the cards, we’ll begin our in-depth tutorials to assist everyone in making the right hardware choices. And, by the way, we’re not talking about huge individual donations. We’d much prefer 200 people donating $5 each rather than Bill Gates coughing up $1,000. But, heck, whatever works to get the hardware funded.

    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…

    Upgrading Asterisk@Home 2.7 to Asterisk 1.2.6: Here’s How

    When you finish the Asterisk@Home 2.7 install and the yum updates for CentOS/4, you now are ready to load the latest, greatest version of Asterisk®: version 1.2.6. Here’s how. Make a backup of your system FIRST! Log in to your new Asterisk server as root, or better yet, use SSH to log in as root, and then cut and paste each command below in order. Be advised that, if you’re using Asterisk@Home, this update will break faxing capability and MP3 support built into the AAH bundle. But your phones will still ring! If you’re at all nervous about proceeding, don’t. Instead, you may wish to try your luck with yesterday’s release of Asterisk@Home 2.8 Beta 1 incorporating these updates … and much, much more. For Pioneers that opt to go the beta route, you may wish to refer back to our AAH 2.7 installation instructions as well as the 50 or so comments from the early adopters.

    Why update at all? Well, there are lots of reasons. Here’s the list. And there are loads of zaptel improvements as well. And AAH 2.8 brings a new version of CentOS (4.3), the latest release of SugarCRM with the Asterisk plug-in, and integrated support for freePBX, the next generation of the Asterisk Management Portal (AMP). If faxing is a critical requirement for you, be advised that either approach outlined here will probably break fax capabilities for the short term. One simple, short-term faxing solution is to sign up for a free fax number at faxdigits.com which we covered earlier this week. You can’t beat free!

    Upgrading to Asterisk 1.2.6.

    amportal stop

    cd /usr/src
    wget http://ftp.digium.com/pub/telephony/zaptel/zaptel-1.2.5.tar.gz
    wget http://ftp.digium.com/pub/telephony/libpri/libpri-1.2.2.tar.gz
    wget http://ftp.digium.com/pub/telephony/asterisk/asterisk-1.2.6.tar.gz
    wget http://ftp.digium.com/pub/telephony/asterisk/asterisk-addons-1.2.2.tar.gz
    wget http://ftp.digium.com/pub/telephony/asterisk/asterisk-sounds-1.2.1.tar.gz

    tar -zxvf zaptel-1.2.5.tar.gz
    tar -zxvf libpri-1.2.2.tar.gz
    tar -zxvf asterisk-1.2.6.tar.gz
    tar -zxvf asterisk-addons-1.2.2.tar.gz
    tar -zxvf asterisk-sounds-1.2.1.tar.gz

    cd zaptel-1.2.5
    make clean
    make install
    cd ..

    cd libpri-1.2.2
    make clean
    make install
    cd ..

    cd asterisk-1.2.6
    make clean
    make install
    cd ..

    cd asterisk-addons-1.2.2
    make clean
    make install
    cd ..

    cd asterisk-sounds-1.2.1
    make clean
    make install
    cd /root

    amportal start


    Free Asterisk Calling Returns to the VoIP Wild West. Coming next Wednesday, April 5, don’t miss the latest Nerd Vittles discovery: a VoIP provider with unlimited FREE CALLS TO 52 COUNTRIES including all of the U.S., Canada, and Mexico as well as most of South America, Europe, and the Far East. And calls to Costa Rica and some of our other favorite island getaways are about a penny a minute. Works great with Asterisk, too! And, speaking of island getaways, we’re off to Pawleys Island today for a little R&R. Visit our Pawleys Island WebCam (which I promise will have live pictures by tomorrow!) and catch a wave!

    Nerd Vittles User 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." 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.

    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.

    Coming Attractions. By the end of this summer, we’ll be ready to begin tackling some of the Asterisk hardware cards including the new Sangoma cards and the soon-to-be-released Digium cards. All of these new cards now support hardware echo cancellation. There’s just one catch: we don’t have any. If you’d like to make a small contribution to assist with the project, just click on the donate button in the top right corner of the main page. When the kitty grows sufficiently to fund the cards, we’ll begin our in-depth tutorials to assist everyone in making the right hardware choices. And, by the way, we’re not talking about huge individual donations. We’d much prefer 200 people donating $5 each rather than Bill Gates coughing up $1,000. But, heck, whatever works to get the hardware funded.

    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!

    Don’t Guess Who’s Coming to Dinner: Use Asterisk

    With apologies to Sidney Poitier, yes, even your doorbell can now be part of your Asterisk® system. And it probably should. Kevin Flanagan and his wife run a ski lodge in Mt. Washington Valley, New Hampshire. For baseball fans, you’ll be interested in knowing that Babe Ruth spent a lot of time hanging out in Room #2 at the Cranmore Mountain Lodge primarily because his daughter owned it in the 1940’s. Anyway, Kevin wrote us about his DOORBELL several months ago, and we’ve been chomping at the bit to publish his article but were just waiting for a lull in the Asterisk updates. I hate to even say that for fear that Asterisk@Home 2.8 will hit the street in the morning. [Footnote: Guess what? It did!] So, today, we’re going to show you how to hook up your doorbell to Asterisk. And, we’ll throw in an intercom as well. When someone rings your doorbell, they’ll get music on hold or a prerecorded announcement while your phones go crazy!

    The product that makes all of this work is DoorBell Fon. You’ll need the controller and at least one Door Box, available now in white, ivory, or brass. Home Depot has this equipment as well if you prefer to window shop first. You connect the Door Box to the Controller using the existing doorbell wires. Then you add a cheap X100P card to your free Asterisk system and connect it to the controller. Check out eBay for the cheapest X100P deals. Next you adjust the zapata-auto.conf file in /etc/asterisk to point to a custom context to answer incoming calls from the Door Box. And finally, you set up a custom Call Queue to manage the incoming door bell rings. Once you have the equipment, it’s about a 60 minute project assuming you have an easy way to get a phone cord between your controller and your Asterisk system. Total cost: about $200-$250 depending upon the Door Box you select. Kevin’s step-by-step guide in PDF format can be downloaded here. Terrific idea, and thanks for sharing it with all of us, Kevin.


    Google PhoneBook CallerID Update. For those already using Google phonebook CallerID lookups which were part of our Enhanced CallerID System for Asterisk, there is an update to fix a change in the way Google displays phonebook results. Just execute the following commands after logging in as root on your Asterisk server to update your system:

    cd /var/lib/asterisk/agi-bin
    mv calleridname.agi calleridname.agi.old
    wget http://nerdvittles.com/wp-content/calleridname.agi
    chown asterisk:asterisk calleridname.agi
    chmod 775 calleridname.agi

    You’ll also need to reconfigure the settings in the script following the original instructions once you complete the download. Then try this slick trick.


    Another Provider With Free DIDs and Free Incoming Fax Numbers. There’s another new kid in town. FreeDigits.com not only offers free incoming DID’s in area code 515. That’s beautiful, downtown Des Moines, Iowa if you’re curious. You also get unlimited free incoming minutes with your free DID, unlimited free calls to other FreeDigits subscribers anywhere in the world, and 60 free outbound minutes to try out their service. And you can get a free incoming fax number, too. All of your incoming faxes will be delivered as PDF documents to your email account without tying up your phone line.

    For your VoIP calls, you can add another DID in your favorite area code or an 800 number for $4.95 a month. Inbound 800 number calls are 5¢ a minute (about double what we’ve paid for at least the last 10 years) and outbound calls in the U.S. and most of Canada are 3¢ a minute after you use up your freebies. That’s about three times the cost of voxee.com. International rates also are about triple those of voxee.com, but you can’t beat the free DID offer with free incoming calls. And the free number for incoming faxes is the only free service of its kind still remaining on the planet.

    Here’s the Asterisk SIP trunk setup that worked for us. Use AMP to create a new SIP trunk with freedigits as your trunk name and the following PEER Details using yourphonenumber and yourpassword as assigned by FreeDigits:


    canreinvite=no
    context=from-sip-external
    dtmfmode=rfc2833
    fromdomain=freedigits.net
    fromuser=yourphonenumber
    host=freedigits.net
    insecure=invite,port
    nat=yes
    secret=yourpassword
    type=friend
    username=yourphonenumber

    Leave the Incoming Settings blank, and enter your registration string in this format: yourphonenumber:yourpassword@freedigits.net. Sounds great! Works great!


    Nerd Vittles User 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." 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…

    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…

    Newbie’s Guide to Asterisk@Home 2.7: Unabridged Installation and Upgrade Guide

    Want a rock-solid PBX at a rock-bottom price: free! Asterisk@Home 2.7 has hit the street with some new goodies and a new release of Asterisk®. So here we go again. With this update, you get version 1.2.5 of Asterisk as well as the latest and greatest version of Linux, CentOS 4.2, the latest Festival Speech Engine (1.96), the latest version of the Asterisk Management Portal (1.10.010), the Flash Operator Panel (version 0.24), Open A2Billing, Digium card auto-configuration, loads of AGI scripts including weather forecasts and wakeup calls, xPL support, the latest SugarCRM Contact Management System with the Cisco XML Services interface and Click-to-Dial support, Microsoft File Sharing and Networking support through Samba (3.0.10), plus dozens and dozens of free utility software applications for Asterisk compliments of Nerd Vittles. And, yes, Asterisk@Home 2.7 still fits on a single CD! By popular request, we've also added something new in this tutorial: some tips and tricks to assist those of you upgrading from a previous version of Asterisk@Home. No, you can't just copy your old config files over and expect things to work. But, in the Nerd Vittles' tradition, we'll show you how to take most of the torture out of the upgrade process. For those new to Nerd Vittles, be aware that we make slipstream changes to articles as users discover things we've missed in our first pass. So check for Comments before you begin or subscribe to our Comments RSS Feed. And add yourself to our Frappr map.

    The installation process is pretty straightforward. You need a dedicated machine for this install although, for Windows users, here's another option that doesn't require a dedicated machine. The VMware edition from vmwarez.com runs in a window on your Windows XP or 2000 desktop and has been updated to version 2.7. You can download it here. The Asterisk@Home project now supports a VMware version as well. Just download asteriskathome_27.exe and then download and install the VMware Player.

    For now, however, we're assuming you're doing the dedicated machine install: pure Linux on a clean machine. So begin by downloading the 2.7 ISO image from here, burn a CD (click here if you need a refresher course), use an old clunker PC or a $200 WalMart special, insert the CD you made, plug your machine into the Internet and turn it on. Then watch while Asterisk@Home loads CentOS/4.2 and all the Asterisk and Linux goodies imaginable: Apache, SendMail, Asterisk Mail, SugarCRM, MySQL, PHP, phpMyAdmin, SSH, Bluetooth, the Asterisk Management Portal, the Flash Operator Panel, Call Detail Reporting, and on and on. We've covered how to use most of the Linux products in our Mac HOW-TO's (see sidebar), and they work exactly the same way with Asterisk@Home so keep reading. And, yes, this install will reformat (aka ERASE) your hard disk before it begins, but it now warns you first.


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

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

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

    /etc/hosts
    /etc/crontab

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

    Loading CentOS/4 and Asterisk 1.2.5. Here's how the 2.7 install went for us, and we'll walk you through getting everything set up so that it can be used as a production server. Once the install begins, you can expect to eat up about 25 minutes with the CentOS 4.2 install. The install CD then will eject itself, reboot the system, and begin the Asterisk compile and installation. That takes about 25 more minutes to complete.

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

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

    Getting the Latest CentOS Updates. Once your system is secure, load all of the application updates for CentOS 4.2. There now are over 50 updates and installs so be patient. If you have zaptel cards, read this thread first! The update command to issue is yum -y update.

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

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

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

    Once the reboot completes, you can rebuild support for your ZAP devices or ztdummy if you have no ZAP devices. Log in as root again and type the following command: rebuild_zaptel. Then reboot your system: shutdown -r now. Now log in as root again and type amportal stop and then genzaptelconf. Reboot once more and you're all set to go: shutdown -r now.

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

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

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

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

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

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

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

    ssh root@192.168.0.104

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


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

    There are lots of ways to install WebMin. We prefer the easy way which is to issue the following commands at a Linux prompt after logging in as root. Note: WebMin updates come out all the time. If you want to be sure you start with the latest and greatest version, go to their web site first and write down the number of the current version. Then substitute it below when issuing these commands.

    cd /root
    mkdir webmin
    cd webmin
    wget http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin-1.260-1.noarch.rpm
    rpm -Uvh webmin*


    WebMin runs its own web server on port 10000. To start WebMin, issue this command: /etc/webmin/start. You access it with a web browser pointed to the IP address of your Asterisk box at that port address, e.g. http://192.168.0.108:10000. The login name is root. Then type in your root password and press enter. The main WebMin screen will display. We really don't want the WebMin server starting up each time the OS reboots so do the following. Once you're logged in to WebMin, choose System->Bootup and Shutdown and then click on webmin. Click the No button beside Start at boot time, and then click the Save button. Before we forget, we need to also make one change to the new Asterisk@Home configuration to avoid problems down the road. The default RTP listening ports for Asterisk@Home are set to 10000 to 20000 so there's a conflict on port 10000 with WebMin. Log in as root and, using an editor, call up the rtp.conf file: nano /etc/asterisk/rtp.conf. Now change the rtpstart port from 10000 to 10001 and save the change: Ctrl-W, Y, and press Enter. Then restart Asterisk: amportal restart. Finally, to stop WebMin when you're finished using it, issue this command: /etc/webmin/stop. You can restart it any time you need it, and then use a web browser to access it. But there's no need to waste processing resources.

    IP Configuration for Asterisk. We need a consistent IP address or domain name both on your internal network and externally if you expect to receive incoming calls reliably. There are three pieces to the IP configuration: (1) setting the internal IP address of your Asterisk server, (2) configuring an external qualified domain name which will always point to your router/firewall, and (3) configuring your router to transfer incoming Asterisk packets to your Asterisk server. Log into your server as root using your new password. Now type ifconfig eth0 (that's "e-t-h-zero") then enter, and write down both your inet addr and your HWaddr on the Ethernet 0 interface, eth0. Inet addr is the internal IP address of your Asterisk box assigned by your DHCP server (i.e. your router/firewall). HWAddr is the MAC address of your Asterisk server's eth0 network card. To assure a consistent internal IP address, you can either configure your router/DHCP server to make certain that it always hands out this same address to your Asterisk machine, or you can manually configure an IP address for this machine which is not in the range of addresses used by your DHCP server. Almost all routers now make it easy to preassign DHCP addresses so we prefer option 1. It's generally under the tab for LAN IP Setup and is generally called something like Reserved IP table. Just add an entry and call it Asterisk PBX and specify the IP address and MAC address that you wrote down above. Now each time you reboot your Asterisk server, your router will assign it this same IP addreess. To assure a consistent external address is a little trickier. Unless you have a static (fixed) IP address, you'll want to use a Dynamic DNS service such as dyndns.org and configure your router to always advertise its external IP address to dyndns.org. DynDNS.org will take care of revising the IP address associated with your domain name when your ISP changes your dynamic IP address. Then you can configure your VoIP provider account using your fully-qualified dyndns.org domain name, e.g. windswept.dyndns.org provides access to our beach house network even though Time Warner cable hands out dynamic IP addresses which change from time to time. Finally, you'll need to log into your router and redirect certain incoming packets to the internal IP address of your Asterisk machine. If you want external access to the Apache web server on your Asterisk machine, then map TCP port 80 to the internal IP address of your Asterisk system. For WebMin external access, map TCP port 10000 to your Asterisk system. If you want remote access to your Asterisk system via SSH, then map TCP port 22 to the internal IP address of your Asterisk system. If you want external IP phones or other Asterisk servers to be able to communicate with your Asterisk system, then map the following UDP port ranges to the internal IP address of your Asterisk system:

    SIP 5004-5082
    RTP 10001-20000
    IAX 4569

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

    Restoring Settings from a Previous Version of Asterisk@Home. If you're building a new system for the first time, skip down to Basic System Configuration. For those of you already running an older version of Asterisk@Home, here's where the fun begins. Get out your AMP screen prints which you made previously. Start up the Asterisk Management Panel (AMP) by pointing a web browser at the IP address of your new system. If you don't know the IP address, log in as root and type ifconfig. The IP address shown under eth0 is typically the address you need. Once AMP loads, start at AMP->Settings->Trunks and recreate entries to match all the Trunk entries on your prior system. After you've added your trunks, delete the default ZAP/g0 trunk unless it was part of your prior configuration. Click the Red Bar to reload your changes.

    Next, reenter all of your Outbound Routes and then delete the 9_outside default route unless it was part of your earlier configuration. Make sure the priority order of your new routes matches that of your old routes. If not, use the arrow keys beside the various routes to adjust the order to match. Then click the Red Bar to save your changes.

    Step 3 is to recreate all of the Extensions from your previous system. Be sure that both the device technology and extension numbers match your old system. Otherwise, customizations in your extensions_custom.conf file may no longer work. If you have extensions outside your firewall, you'll need to edit those entries after creating them in order to change the NAT, CanReinvite, and Qualify settings. When you're finished adding and editing all of your extensions, click the Red Bar to save your changes.

    Step 4 is to recreate all of your Ring Groups. Make sure you use the identical numbers for your new ring groups. When you're finished, click the Red Bar to save your changes.

    If you're using a Digital Receptionist (AutoAttendant) or Call Queues with voice prompts, now is a good time to copy your custom voice prompts to the new system. Copy all of the prompts from your old system to /var/lib/asterisk/sounds/custom and then log into your server as root and adjust rights the file (chmod 775 /var/lib/asterisk/sounds/custom/*) and ownership of the files: chown asterisk:asterisk /var/lib/asterisk/sounds/custom/*. Now copy all of the files beginning with aa to the PC on which your web browser is being used to access AMP. Then delete all of the aa files: rm -f /var/lib/asterisk/sounds/custom/aa*.wav. You need local copies of these files to recreate your autoattendants using AMP's Digital Receptionist.

    Rebuild your Digital Receptionist entries next. If you have custom sound files, upload them in AMP from your local hard disk and test them to be sure everything is working. Now you can recreate your Call Queues and make the entries match your prior setup. Next, adjust the General Settings and then the Incoming Calls setup to match your previous configuration. Click the Red Bar to save your changes.

    The next step is an important one. We want to add the information from your old extensions_custom.conf file to the new /etc/asterisk/extensions_custom.conf file without destroying the new entries in the new file. First, make a duplicate of the new file while logged in as root: cp /etc/asterisk/extensions_custom.conf /etc/asterisk/extensions_custom.conf.bak. Now print out the contents of both files and label them as OLD and NEW. Mark out sections in the OLD file that match information in the NEW file. Then carefully cut-and-paste the missing information contained in your OLD file into the NEW file. Be sure you put pieces of code in the same relative position. Information in these configuration files is divided up into contexts which always start with a heading like this: [from-external-custom]. A context ends when the next heading appears in the file. So make sure that entries from your OLD file appear in the same context in the NEW file. This is especially important with the [from-external-custom] context at the top of the file. Save your changes. Then repeat the same drill with sip.conf and features.conf. There shouldn't be many changes in these. Then make backup copies of vm_email.inc and vm_general.inc, and copy your old versions over to the new server. Change permissions (chmod 777 /etc/asterisk/vm*.inc) and ownership (chown asterisk:asterisk /etc/asterisk/vm*.inc) on these two files. Once you're finished, reload Asterisk: amportal restart.

    Next, you'll need to copy back all the files you saved for /var/lib/asterisk/agi-bin and /var/www/html. Don't overwrite any existing files on the new system unless you've first made a backup copy of the file and you know what you're doing. Once you get the files copied back, you'll need to adjust ownership of the files and permissions. It's OK for root to own files in the web directories. Do it for any subdirectories as well.

    chown asterisk:asterisk /var/lib/asterisk/agi-bin/*
    chmod 775 /var/lib/asterisk/agi-bin/*
    chmod 775 /var/www/html/*

    Next, you'll need to restore your MySQL and Asterisk database entries. Make backup copies of any new databases you intend to overwrite first! There are several important pieces in making a successful restore of some of these files. First, shut down Asterisk (amportal stop) and then MySQL (/etc/init.d/mysqld stop). Now copy the full directories back over and put them under /var/lib/mysql. Then you'll need to adjust the ownership and permissions to match what MySQL expects, or they won't work when you restart MySQL. Each MySQL database has a matching directory name in /var/lib/mysql. Set the ownership of each directory: chown mysql:mysql directoryname. Set the permissions for each directory: chmod 700 directoryname. Then cd directoryname, reset file ownership for all files (chown asterisk:asterisk *), and reset file permissions for all files (chmod 660 *). Once you finish, restart MySQL: /etc/init.d/mysqld start. Then restart Asterisk: amportal start. Finally, using Asterisk CLI, restore any custom database entries you made with database put commands. Whew!

    Now skip down to Activating Email Delivery of VoiceMail Messages and continue with the install.

    Basic System Configuration. To get a basic Asterisk system up and running, you only need to do a few things. First, you need an Outbound Trunk to actually deliver your outbound calls to Plain Old Telephones (POTS). Second, you need to configure an Outbound Route to tell Asterisk which trunk to use to deliver your outbound calls to the intended recipients. Third, you'll need an Inbound Route to send incoming calls to a phone on your system. Finally, you'll need to configure at least one extension so that you can plug in some sort of telephone instrument to place and receive calls using your new Asterisk server. The phone can be a hardware device such as an IP telephone or a POTS phone, or it can be a software device such as a free IP softphone. The advantage of IP telephones and softphones is that they require no additional hardware besides your Asterisk server. A POTS phone or our favorite, a 5.8GHz wireless phone system with up to 10 extensions, both require an additional piece of hardware although some of the newer IP wireless phones give you the best of all worlds (see inset). To use a POTS phone, the hardware required is either a circuit board with an FXS port or an external black box (ATA device) such as a Sipura SPA-1001. If you also want to connect your Ma Bell phone line to your Asterisk server, then you need a circuit board with an FXO port or an external black box (ATA device) such as a Sipura SPA-3000. Our favorite is the SPA-3000 because it has both FXO and FXS ports in a box the size of a pack of cigarettes for under $100.


    Setting Up An Outbound Trunk. You configure an outbound trunk using your web browser and the Asterisk Management Portal (AMP). But first, you have to have an account with a service provider. This is the company that carries your calls from your Asterisk server to plain old phones in your neighbor's house or Aunt Betty's in California. With VoIP, it's a good idea to have two providers, but today let's start with one. We'll save you some time and lots of money. Unless you make substantial international calls regularly, use TelaSIP/VoipExpress. If you want to know why, read the full article here. Or just try a free call for yourself using our server. Basically, $5.95 a month gets you a local number in your choice of area code with free incoming calls, and 2¢ per minute for outbound calls to anywhere in the U.S. $9.95 a month buys you all of that plus free outbound calls in the area code of the phone number you select. $14.95 a month gets you a number in the area code of your choice with unlimited incoming calls and unlimited outbound calls to anywhere in the U.S. There are no sneaky add-on fees and no obnoxious terms of service. Just be sure to tell them to configure your account for use with Asterisk. They also have very reasonable business plans. If, on the other hand, you'd prefer to try another provider, take a look at our easy setup guides for most of the major VoIP providers here. Finally, a word to the wise about phone plans. Don't expect to sign up for a residential plan and use it all day and night for your business. In addition to being dishonest, it's also quite obvious at the hosting provider's end. Not only will you lose your account, you may also be liable for the entire cost of the business use of the connection.

    Once you have your account name and password, point your web browser to the IP address of your new Asterisk@Home 2.7 server and log in as maint with the password you selected. Then choose AMP->Setup->Trunks->Add SIP Trunk assuming you're using TelaSIP. NOTE to existing users: if you already have an Asterisk server using your TelaSIP account, don't use the same account at the same time on your new Asterisk@Home 2.7 server! Plug in the CallerID number you were assigned for your account. Set Maximum Channels to 2. For the Dial Rules, use the following (substituting your local area code for 404 below):

    1|NXXNXXXXXX
    NXXNXXXXXX
    404+NXXXXXX

    In the Outgoing Settings section, name your trunk telasip-gw. Then enter the following for the Peer Details using your own account name for username and fromuser and using your own assigned password for secret. Be sure to enter the correct host that was assigned to your account:

    context=telasip-in
    dtmfmode=rfc2833
    fromuser=youraccountname
    host=gw4.telasip.com
    insecure=very
    secret=yourpassword
    type=peer
    username=youraccountname

    Leave the Incoming Settings section blank, and in the Registration String, enter the following using your account name and password:

    youraccountname:yourpassword@gw4.telasip.com

    Click the Submit Changes button, and then click the red bar to reload Asterisk. Now we need to add the context which will actually process the incoming calls from TelaSIP. Choose AMP->Maintenance->Config Edit->extensions_custom.conf and add the following code at the bottom of the file substituting your new phone number for 4041234567. Save the file and reload Asterisk to finish the setup. See the Comments to this post for a more versatile approach which will let you use your TelaSIP line for Ring Groups.

    [telasip-in]
    exten => 4041234567,1,NoOp(Incoming call on TelaSIP #4041234567)
    exten => 4041234567,2,Dial(local/200@from-internal,20,m)
    exten => 4041234567,3,VoiceMail(200@default)
    exten => 4041234567,4,Hangup

    Configuring an Outbound Route. Now we need to tell Asterisk where to send our outbound calls when we dial them. To get started, we'll just send everything to the TelaSIP trunk we just configured. Choose AMP->Setup->Outbound Routing->Add Route. For Route Name, use Outside. Leave the password blank. For Dial Patterns, enter the following:

    NXXXXXX
    NXXNXXXXXX
    1NXXNXXXXXX

    For the Trunk Sequence, choose SIP->telasip-gw from the drop-down list. Then click Submit Changes. Be sure you also delete the sample outbound route that came with the install, or your outbound calls may go nowhere. Finally, click the red bar to save your new Outbound Routing setup.


    Configuring an Extension. You have to have an extension to make and receive calls with Asterisk@Home so let's build one. Choose AMP->Setup->Extensions->SIP to begin. For the Extension Number, let's use 200 to keep things simple. For the Display Name, make up something that tells where this phone will be located, e.g. Kitchen. For the Outbound CID, use 200. For secret, make up a password for this extension. For Voicemail and Directory, choose Enabled. Plug in your password again. Type in your email address, and, if you want to also be paged when you get a new voicemail, type in a pager email address. Click the Yes button beside Email Attachment, and leave the other settings alone. Now click the Submit button and then click the red bar to save your changes and reload Asterisk.


    Downloading a Free Softphone to Test Asterisk. Unless you already have an IP phone, the easiest way to get started and make sure everything is working is to install an IP softphone. You can download a softphone for Windows, Mac, or Linux from CounterPath. Or download the pulver.Communicator. Here's a new IAX softphone for all platforms that's great, too, and it requires no installation: Idefisk. All are free! Just install and then configure with the IP address of your Asterisk@Home 2.7 server. For username and password, use your extension number and password from above. Once you make a few test calls, don't waste any more time. Buy a decent SIP telephone. We think the best value in the marketplace with excellent build quality and feature set is the under $100 GrandStream GXP-2000. It has support for four lines, speaks CallerID numbers, has a lighted display, and can be configured for autoanswer with a great speakerphone. Short of paying three times as much, that's as good as desktop phones get. If you want to use Asterisk throughout your home, buy a good 5.8GHz wireless phone system with plenty of extensions (our two favorites are shown in the insets below) and then purchase an SPA-3000 to connect up both your home phone line and all your cordless phones. Our tutorial will show you how. The final option is to use a wireless IP phone which is the best of both worlds, a cordless phone that talks IP telephony without an ATA blackbox such as the Uniden UIP1868 (see also insets above).


    Activating Email Delivery of VoiceMail Messages. When you're out and someone leaves you a voicemail message, Asterisk@Home will let you forward that voicemail message to your email address as a .wav file which can be played within most email client software. Or you can have Asterisk@Home send an instant message to your cell phone or pager telling you who called, what their phone number was, and how long a voicemail message the person left for you. Or you can do both. In addition, you can tell Asterisk@Home whether to delete the voicemail from your Asterisk server after sending it to your email account. In short, you now can manage all of your incoming email and voicemail from a single place, your email client. In order to send out emails from your Asterisk@Home server, you'll need to make a few changes. First, make this adjustment to the /etc/hosts file on the server. Since anonymous emails are blocked by most ISPs, you'll need a fully-qualified domain name for your server. If you don't have your own domain, the easiest alternative is to use the fully-qualified domain name that your ISP assigns to the IP address for your broadband connection. Don't forget to update it when your ISP changes your IP address! To find out what your fully-qualified domain name is, go to a command prompt on your Asterisk server and type: nslookup 123.456.789.001 substituting your public IP address for the preceding numbers. Then write down the name entry without the trailing period. Now edit the hosts file: nano /etc/hosts. Move the cursor to the second line which reads 127.0.0.1 asterisk1.local , and then move the cursor over the first letter of the first domain name shown, usually asterisk1.local. Now type in the fully-qualified domain name you previously wrote down and add a space after your entry. Don't erase the existing entry! Save your settings: Ctrl-X, y, enter. Now restart network services on your Asterisk machine: service network restart. Next, you need to modify the email message which delivers your voicemails so that it includes your fully-qualified domain name. Don't do this in AMP, or you'll mess up the formatting of the email message. You can download a fresh copy here if you need it. Instead, use nano: nano -w /etc/asterisk/vm_email.inc. Press Ctrl-W, type /cgi, and press the enter key. You're now positioned where you need to type either the fully-qualified domain name for your Asterisk server or the private IP address if you only want to read your emails from behind your firewall. When you start typing, the text display is going to jump all over the place because of word wrap. Don't freak out. You haven't messed anything up. Once you complete your entry, don't erase or change anything else. Save the file: Ctrl-X,Y, then enter. Now go into AMP->Maintenance->Config Edit->vm_general.inc with a web browser. Change the serveremail entry to an email name at the fully qualified domain you used in your /etc/hosts file above. Then save your configuration and restart Asterisk. If you continue with this setup and still don't receive emails, here's another configuration change that is sometimes necessary. You'll also need to do it if you reloaded settings from an older version of Asterisk. On the Asterisk terminal, log in as root. Switch to the directory where the SendMail configuration file is stored: cd /etc/mail. Make a backup of the config file: cp sendmail.cf sendmail.cf.bak. Then issue the following command: echo CGasterisk.dyndns.org >> sendmail.cf. Substitute the actual domain name of your Asterisk server for asterisk.dyndns.org, but be sure it's preceded by CG with no intervening spaces.Then reboot your server and try again: shutdown -r now. Finally, if your ISP doesn't permit downstream mail servers (that's you), then take a look at this link which will show you how to designate your ISP as your SMTP smart host using SendMail.


    To configure the voice mail forwarding options, go into the Setup tab of the Asterisk Management Portal using a web browser. Click on Extensions and then click on an extension you already have configured. In the Voicemail and Directory section of the form, enter either (or both) your email address and your pager or cellphone's text messaging address. To email the voicemails as attachments, just click Yes beside Email Attachment. To delete the voicemail message from your voicemail inbox after sending it to your email address (not recommended until you first get it working correctly), click Yes beside Delete Vmail.

    Call Recording Fixed. This update fixes inbound and outbound call recording which now works reliably. You can set your preferences for call recording when you set up each extension. The recordings are stored in /var/spool/asterisk/monitor unless you set other preferences in agents.conf.

    Paging Fixed. If you want to use paging with your Asterisk system, the sound card problems in Asterisk@Home 2.1 and Asterisk 1.2 have been resolved. Review this posting on SourceForge for additional details. It now works with full and half-duplex sound cards. Thanks, Tracy!

    Wakeup Calls Good News & Bad News. The good news is that Asterisk@Home 2.7 includes the latest version of the Wakeup Call program, and the default setup works. Just dial *62. The bad news is that the "annoy" option which is supposed to force the user to key in a number to prove they're awake still doesn't work.

    Adjusting Call Parking Extensions. Traditionally, pressing the pound key (#) and dialing extension 700 parked a call on Asterisk@Home systems and notified you of the parked extension. The call then could be picked up by dialing the parked extension in the range of 701 to 799 from any extension on your system. The new setup is to press # and dial 70 to park a call and 71-79 to pick it up. If you prefer the old setup, you'll need adjust the settings in features.conf. Go to AMP->Maintenance->Config Edit->features.conf and make it look like this:

    [general]
    parkext => 700 ; What ext. to dial to park
    parkpos => 701-799 ; What extensions to park calls on
    context => parkedcalls ; Which context parked calls are in

    Directory Lookup Fixed Sorta. When callers press pound (#) after a voicemail pick up, it now activates a directory lookup function using AMP if you set Company Directory to first or last name in General Settings.

    Max Channels Bug Remains. A bug has been reported because of a deprecated command that makes Asterisk@Home's calculation of maximum channels invalid. To fix it, goto AMP->Maintenance->Config Edit->extensions.conf->macro-dialout-trunk and comment out line s,7 so that it looks like this:

    ;exten => s,7,CheckGroup(${OUTMAXCHANS_${ARG1}})

    Then insert a new line s,7 just below it which looks like this:

    exten => s,7,GotoIf($[ ${GROUP_COUNT()} > ${OUTMAXCHANS_${ARG1}} ]?108)

    Then click the Update button and reload Asterisk to activate the change.

    Syntax Error in extensions.conf Causes Failed Incoming Calls. One of our readers has discovered a nasty little bug in extensions.conf that will cause some incoming calls to fail. Edit extensions.conf->macro-dial and change line s,22 as follows. Then reload Asterisk.
    Before:

    exten => s,22,GotoIf($[$[${HuntMembers} >= 1]?30 )

    After:

    exten => s,22,GotoIf($[$[${HuntMembers}] >= 1]?30 )

    Adding Cellphone Extensions. It's really easy to add "extensions" which dial directly to your cellphones or phones in remote locations. Just create a new Ring Group, give it a Group Number that matches the extension number you want to dial to complete the call (e.g. 244), choose hunt for the Ring Strategy, enter your cellphone number in the extension field with a # on the end using a dial string that matches your outbound trunk requirements (e.g. 16781234567# if your provider requires a 1-areacode-number format), choose a ring time in seconds, and a destination if no answer. If you want to have Asterisk track you down, enter several different phone numbers in the extension list. If you change hunt to ringall then all of the numbers will be called simultaneously instead of sequentially. Save your Ring Group entry, click the Red bar to reload Asterisk, and then dial the Ring Group extension number from any phone on your system. Presto!

    Tweaking SIP.conf. There are a few changes we recommend you make in the [general] context of the sip.conf file. Using the Asterisk Management Portal, go to AMP->Maintenance->Config Edit->sip.conf. It's a good idea to include your actual CallerID number of your default outbound trunk here instead of Default. We also recommend that you add allow=gsm just below the existing allow=alaw line in the file. You may also want to include progressinband=yes which assures that callers will hear ring tones when placing calls even if your provider doesn't provide them. This is a fairly common complaint with BroadVoice in particular. Don't forget to reload Asterisk once you make these changes: AMP->Setup->Incoming Calls->Submit Changes and then click the Red bar.

    Connecting Remote Extensions or a Remote Asterisk Server. If you plan to connect remote extensions to your Asterisk server, then add the following entries to sip.conf above using your own fully-qualified domain name and the first three octets of the private IP address of your Asterisk server:

    externip = myasteriskbox.dyndns.org
    localnet=192.168.0.0/255.255.255.0
    nat=yes

    You'll also either need to define your Asterisk server as a DMZ device in your firewall setup, or you can open the following UDP ports and map all of them to the private IP address of your Asterisk box: 4569, 5004-5082, and 10000-20000. If you only hear half of a conversation with a remote extension, it's usually a NAT problem meaning you probably forgot to do the port mapping drill. We plan to cover remote extensions and interconnecting Asterisk servers in more detail in a future column so stay tuned. In the meantime, if you have a dynamic DNS connection that changes your IP address regularly and you don't want to wrestle with manually updating your Asterisk server each time there's a change, just download chandave's sip reload script and copy it to your /etc/asterisk directory. Then execute the following commands while logged in as root:

    chown asterisk:asterisk /etc/asterisk/sip_reload.sh
    export EDITOR=nano
    crontab -e
    00,05,10,15,20,25,30,35,40,45,50,55 * * * * root /bin/sh /etc/asterisk/sip_reload.sh >/dev/null 2>&1

    Save your crontab addition in the usual nano way, and you're all set: Ctrl-X, y, then enter. This clever little script will make sure your Asterisk server always knows its own IP address regardless of how often your ISP changes it. And you'll never lose inbound connectivity from remote extensions or servers for over 5 minutes. If you'd like to read the full discussion, visit this link on the Voxilla forum.

    Managing Incoming Calls. For long time readers of this column, you already know that our recommended strategy for handling incoming calls is to set up a simple Stealth AutoAttendant. Basically, this is a welcome message that greets your callers and then transfers them to an extension or ring group of your choice. The advantage of this approach is that it also lets callers like you press buttons to navigate through various options on your Asterisk system without advertising them to the public at large. If you're just getting started with Asterisk, you can read all about setting up a Stealth AutoAttendant here. If you'd prefer to manage your incoming calls with AMP, you'll still need to fix the [from-sip-external] context in the extensions.conf file, or all your incoming SIP and IAX calls will ring busy. To fix it, choose AMP->Maintenance->Config Edit->extensions.conf->from-sip-external. Comment out all the lines in the existing file by adding a semicolon at the beginning of each line. Then add the following line, save your changes, and reload Asterisk.

    exten => _X.,1,Goto(from-pstn-timecheck,s,1)


    New Custom Speed Dialing. Asterisk@Home 2.7 has a built-in speed dialing utility. The reserved speed dial numbers are 300 to 399. Adding a number to your speed dial list is easy. Just pick up an extension and dial 300-3xx-6781234567 where 3xx is the speed dial code you want to create and 6781234567 is the phone number you want dialed when you enter the speed dial code. Just make sure you enter the number to be called in a format that is supported by your Asterisk dialplan, i.e. if outside calls need to be preceded by a 1 or a 9, then the number should be entered in a matching format. You can look up speed dial numbers by dialing an asterisk followed by the 3-digit speed dial code, e.g. *301 would tell you the number stored in speed dial 301. If you need additional flexibility with both web browser and phone access as well as 1 to 5-digit speed dial codes, download our free AsteriDex robodialer.

    Fixed A2Billing: Asterisk Calling Card Platform. 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. Heck, I'll sign up with you. I sign up for everything. But first, a word of caution. Assuming your Asterisk server has web exposure on the Internet, you need to secure the admin and root passwords in this application whether you use it or not. To access the application, go to http://192.168.0.104/a2billing/ using the actual internal IP address of your Asterisk server. Log in as root with a password of myroot. Click on the ADMINISTRATOR tab in the left column and then click Show Administrator. Now click on the Edit button beside each of the two administrator accounts and change the passwords to something secure. Documentation for this application is available here. There's also a pretty good step-by-step setup guide for Asterisk@Home here. To use the application, uncomment the 6 actual dialplan lines in extensions_custom.conf and reload Asterisk:

    ;[custom-callingcard]
    ;exten => s,1,Answer
    ;exten => s,2,Wait,2
    ;exten => s,3,DeadAGI,a2billing.php
    ;exten => s,4,Wait,2
    ;exten => s,5,Hangup

    SugarCRM Contact Management. Asterisk@Home includes the best open source contact management application on the planet, SugarCRM. You access the application with a web browser: http://192.168.0.104/crm/ substituting the private IP address of your Asterisk box, of course. Specify admin for your username and password for your password. Whether you use the application or not, change the admin password. It's easy. Just click the Administrator link under Welcome admin. Then click the Change Password button. Complete documentation for the application is available here. If contact management is your thing, knock yourself out, and we'll talk to you next spring when you finish getting everything set up to run your business. It's a great product, but be prepared to invest lots of time in the project if you expect to use it productively.

    Conflict Between ZAP cards and Fax Modules. For those using ZAP cards, be aware that there is a reported conflict with the fax modules. See this link for details and updates.

    Incoming Fax Support. The NVfaxdetect software that we showcased back in December, 2005, now is included in Asterisk@Home 2.7. The major advantage of NVfaxdetect is that it works with SIP and IAX trunks as well as ZAP lines. Unfortunately, you'll still need to manually configure the Asterisk Management Portal to use it. Thanks to Thunderbird in Australia, it's pretty easy to make the necessary changes. First, enable faxing support. Go to AMP->Setup->General Settings and set Extension of Fax Machine to system. Then fill in your email address. Click the Submit Changes button to save your changes. This sets the default route for incoming faxes. If you want to specify different fax destinations for different DID trunks, then set up Inbound Routing using AMP and define the fax extension as system (instead of default) with an email address for delivery of the fax for each particular DID. You'll also need to make sure you have outbound email functioning on your Asterisk server (see above), or none of the rest of this matters. NVfaxdetect converts your incoming faxes to PDF documents and then emails them to you. So the next step is to get that conversion functionality working. Log in to your Asterisk server as root and type the following command: install-pdf. Now make a backup copy of your extensions.conf file: cp /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf.bak. Carefully edit extensions.conf: nano -w /etc/extensions.conf. When finished, save your changes and restart Asterisk: amportal restart.

    Find and delete the entire [from-pstn-reghours] context. Replace it with the following:

    [from-pstn-reghours]
    exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-reghours-nofax,s,1:2) ; if fax detection is disabled, then jump to from-pstn-nofax - else continue
    exten => s,2,Answer
    exten => s,3,Playtones(ring) ; play fake ring so caller doesn't wonder what's going on
    exten => s,4,NVFaxDetect(4) ; detect faxes while playing ring sound - goes to "fax" extension if detected
    exten => s,5,SetVar(intype=${INCOMING})
    exten => s,6,Cut(intype=intype,-,1)
    exten => s,7,GotoIf($[${intype} = EXT]?8:9) ; If INCOMING starts with EXT, then assume its an extension
    exten => s,8,Goto(ext-local,${INCOMING:4},1)
    exten => s,9,GotoIf($[${intype} = GRP]?10:11) ; If INCOMING starts with GRP, then assume its a ring group
    exten => s,10,Goto(ext-group,${INCOMING:4},1)
    exten => s,11,GotoIf($[${intype} = QUE]?12:13)
    exten => s,12,Goto(ext-queues,${INCOMING:4},1)
    exten => s,13,Goto(${INCOMING},s,1) ; not EXT or GR1 - it's an auto attendant
    exten => fax,1,Goto(ext-fax,in_fax,1)
    exten => h,1,Hangup

    Find and delete the entire [from-pstn-afthours] context. Replace it with the following:

    [from-pstn-afthours]
    exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-afthours-nofax,s,1:2) ; if fax detection is disabled, then jump to from-pstn-nofax - else continue
    exten => s,2,Answer
    exten => s,3,Playtones(ring) ; play fake ring so caller doesn't wonder what's going on
    exten => s,4,NVFaxDetect(4) ; detect faxes while playing ring sound - goes to "fax" extension if detected
    exten => s,5,SetVar(intype=${AFTER_INCOMING})
    exten => s,6,Cut(intype=intype,-,1)
    exten => s,7,GotoIf($[${intype} = EXT]?8:9) ; If INCOMING starts with EXT, then assume its an extension
    exten => s,8,Goto(ext-local,${AFTER_INCOMING:4},1)
    exten => s,9,GotoIf($[${intype} = GRP]?10:11) ; If INCOMING starts with GRP, then assume its a ring group
    exten => s,10,Goto(ext-group,${AFTER_INCOMING:4},1)
    exten => s,11,GotoIf($[${intype} = QUE]?12:13)
    exten => s,12,Goto(ext-queues,${AFTER_INCOMING:4},1)
    exten => s,13,Goto(${AFTER_INCOMING},s,1) ; not EXT or GR1 - it's an auto attendant
    exten => fax,1,Goto(ext-fax,in_fax,1)
    exten => h,1,Hangup

    Find and delete the entire [ext-fax] context. Replace it with the following:

    [ext-fax]
    exten => s,1,Answer
    exten => s,2,Goto(in_fax,1)
    exten => in_fax,1,StopPlaytones ; you must do this or it will play ring sounds over your fax
    exten => in_fax,2,GotoIf($[${FAX_RX} = system]?3:analog_fax,1)
    exten => in_fax,3,Macro(faxreceive)
    exten => in_fax,4,Hangup
    exten => analog_fax,1,GotoIf($[${FAX_RX} = disabled]?3:2) ;if fax is disabled, just hang up
    exten => analog_fax,2,DBGet(DIAL=DEVICE/${FAX_RX}/dial);
    exten => analog_fax,3,Dial(${DIAL},20,d)
    exten => analog_fax,4,Hangup
    exten => out_fax,1,txfax(${TXFAX_NAME}|caller)
    exten => out_fax,2,Hangup
    exten => h,1,system(tiff2ps -2eaz ${FAXFILE} | ps2pdf - ${FAXFILE}.pdf)
    exten => h,2,system(mime-construct --to ${EMAILADDR} --subject "Fax from ${CALLERIDNUM} ${CALLERIDNAME}" --attachment ${CALLERIDNUM}.pdf --type application/pdf --file ${FAXFILE}.pdf)
    exten => h,3,system(rm ${FAXFILE} ${FAXFILE}.pdf)
    exten => h,4,Hangup()

    Be aware that VoIP faxing is quirky. Here's why. You also may need to adjust the timing mechanism in the actual NVfaxdetect(4) lines above. If 4 doesn't work, try 10 or nothing at all. If you need more details, read our original article on this topic. Be sure to read Comment 25!


    Asterisk Recording Interface. A new web-based utility for managing your voicemail now is included in AMP and can be accessed by clicking Voicemail & Recordings on the initial AMP screen at the IP address of your Asterisk system. It also can be accessed at http://Asterisk-IP-address/recordings/. To log in to the Asterisk Recording Interface (ARI), just enter an extension number on your Asterisk system and the password for that extension. From the web interface, you can manage your voicemail messages including playing them back, you can review the call log, and you can set your voicemail password as well as your desired setup for recording calls by setting the call monitor defaults for this extension. Change your ari_admin_password on line 53: nano -w /var/www/html/recordings/includes/main.conf.

    Other Out-of-the-Box Utilities. Asterisk@Home 2.7 comes bundled with a number of additional utilities. Here are some of them. You can retrieve the current time by dialing *60. If the time is wrong, you can reset your default time zone by logging into your server as root and typing config. A current weather report for New York is available by dialing *61. You can change the city by following our previous tutorial which is available here. Something has come unglued in the festival script, however, because there is a noticable 10-second delay between each line of text that is read now. To set up a wakeup call from any extension, dial *62. To determine the phone number of any extension, just dial *65. You can use the default MeetMe conferencing system from any or all of your extensions by dialing 8 plus the number of an existing extension. Additional conference rooms can be added by editing meetme_additional.conf. Finally, you can record customized voice prompts for your system by dialing 5678 from any extension. Before this will work, edit the extensions_custom.conf file (AMP->Maintenance->Config Edit->extensions_custom.conf) and uncomment the seven lines shown below which are located at the bottom of the file. Just remove the leading semicolons. You'll also need to uncomment the following line near the top of file at the beginning of the [from-internal-custom] context: ;include => custom-recordme.

    ;[custom-recordme]
    ;exten => 5678,1,Wait(2)
    ;exten => 5678,2,Record(/tmp/asterisk-recording:gsm)
    ;exten => 5678,3,Wait(2)
    ;exten => 5678,4,Playback(/tmp/asterisk-recording)
    ;exten => 5678,5,Wait(2)
    ;exten => 5678,6,Hangup

    Once you make a recording, it needs to be moved to /var/lib/asterisk/sounds/custom with a new filename.gsm, e.g. mv /tmp/asterisk-recording.gsm /var/lib/asterisk/sounds/custom/hihoney.gsm. Then change the ownership of the file: chown asterisk:asterisk /var/lib/asterisk/sounds/custom/hihoney.gsm. You then can play the recording with a line like this in your dialplan: exten=>s,1,Playback(custom/hihoney) where hihoney is the name you assigned to the recording without its .gsm extension.

    AAH Web Facelift. Last, but not least, the folks at KennonSoft have posted a new self-configuring AAH web interface (see inset). It automatically chooses icons to match the applications installed on your system. Here are the commands to install it. Log into your server as root and issue the following commands:

    cd /var/www/html
    wget http://www.kennonsoft.org/projects/asterisk/admin-ui.tar
    tar -xvf admin-ui.tar
    rm -f admin-ui.tar
    mv index.html index2.html

    NOTE: It's been reported that there may be a display formatting bug with IE 6. Line 2 of the code above should begin with wget.

    In order for the bottom row of buttons to appear, you must install WebMin (installation instructions above), AsteriDex, and Phone Reminders 2.5. If you'd like to use our AsteriDex RoboDialer, install it from the link in this sentence and the icon will then appear. If you've moved your AsteriDex application to a directory different than /var/www/html/asteridex, make the necessary adjustment to ./asteridex in line 15 of the index.php file. To download and install the Telephone Reminders software, read our Telephone Reminders 2.5 update tutorial. Once its installed, the Telephone Reminders icon will appear when you access the main web page on your Asterisk server.

    Microsoft Networking Support with Samba. Asterisk@Home 2.7 now includes full Linux support for Microsoft Networking with Samba server and client modules. This means your Asterisk server now can be accessed as "Drive G:" from any Windows system. And you can also access your Asterisk system from any Mac or Linux system with Samba support. To install the Samba 3.0.10 modules, log into your Asterisk server as root and issue the following command: setup-samba. Once the installation completes, edit the Samba config and enter the workgroup name of your default Microsoft network in lowercase letters: nano -w /etc/samba/smb.conf. Then restart Samba: /etc/init.d/smb restart. You now can log into asterisk1 share with a username of root and your root password from any Windows PC in the same workgroup or any Mac or Linux machine running Samba in the same default workgroup. Additional Samba customization can be made using WebMin (Servers->Samba Windows File Sharing). Works flawlessly!

    1-800-411-METROFree Directory Assistance Service. For those in the U.S. that just can't live without Directory Assistance, write this number down or add it to your Asterisk dialplan for free directory assistance calls in the United States: 1-800-411-6387. It's also a free VoIP call with the providers listed below once you set up an account with one of them. You can read our reviews of these providers here. Assuming you have an account, just add ONE of the following sets to the [from-internal-custom] context in extensions_custom.conf:


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

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

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

    Where To Go From Here. After you get a functioning Asterisk system, you're ready to move on to some really cool things that make Asterisk a one-of-a-kind PBX. There are customized weather reports, web and phone-based dialers from a MySQL address book, incoming fax to PDF conversion with email delivery, blacklisting of telemarketers, bluetooth proximity detection so that your home or office calls automatically transfer to your cellphone when you depart with your bluetooth device, and on and on. You'll also want to take a more in-depth look at many of the topics we've covered above. For a complete catalog of all of our Asterisk projects and everything else we've written about Asterisk@Home, go here. Then take a look at a terrific writeup from the other side of the globe: Asterisk@Home for Dumb-Me. Finally, there's an Asterisk@Home Handbook Wiki project under development that's worth a careful look. And, for the latest Asterisk news, don't miss Planet Asterisk.


    Some Recent Nerd Vittles Articles of Interest...

    Asterisk Call Queues: The Smarter Way to Manage Incoming Calls

    Ever wished you could screen incoming calls and route them to another person, or to an autoattendant, or to voicemail without the caller knowing what you're up to? Need a free Automatic Call Distribution (ACD) System for your business (with Elevator Music no less) that will balance incoming call workload among your employees? Ever wanted to prioritize incoming calls from different groups of callers? How about a simple way to access hidden features on your Asterisk® system when you're away from your home or office? Well, the latest Asterisk (1.2.4) now can do all of this without breaking a sweat... with Call Queues. And, with Asterisk@Home 2.5 and its included Asterisk Management Portal, you can build a complete Call Queue System in about half an hour.

    Prerequisites: For today's project, you'll need at least Asterisk@Home 2.5. It can even be installed on your Windows desktop if you just want to experiment. We haven't yet tested this with Asterisk@Home 2.6, but we can always use a good guinea pig to report back. Just about any kind of incoming trunk should work: SIP, IAX2, or ZAP/PSTN. Then you'll need at least one Asterisk extension and a few external phone numbers we can play with to demonstrate how everything works. Depending upon what features you decide to use in your own system, you may also need a few customized voice prompts from Allison Smith although we'll provide some samples to get you started. The main voice prompt to explain to callees how to manage incoming calls from the call queue was funded previously by readers just like you. For the freeloaders, that's what the donate button is for ... to keep the goodies coming. To order your own voice prompts, you first sign up for an account at thevoice.digium. com. Then you go to digium.com and order 1 voice prompt (20 words) for $12 or 5 voice prompts with up to 20 words each ($50). When you sign up for your Digium account to actually pay for the prompts, make sure you use the same email address that was used when you signed up for your account on thevoice.digium.com (where you'll request creation of the prompts from Allison). After your check clears, Digium will deposit voice prompt credits in your thevoice.digium.com account. You then can log in there, type out what you want your prompts to say, and a few days later the prompts will be sitting there for you to review and download. It doesn't get much easier than that.

    Overview. We're going to build a new flavor of our original Stealth AutoAttendant except today we're going to take advantage of a Call Queue to enhance the functionality of the original system. Along the way, we'll also show you how to expand this into a full-blown Automatic Call Distribution System for your business, large or small. The way today's system will work goes something like this. A caller calls your home. Asterisk answers the call and plays a message that says something like the following: "Hi. You've reached the Rockefeller's residence. Someone will be with you in a moment." Asterisk will then crank up Music on Hold and will direct the call to your Home Call Queue. This call queue will simultaneously ring all of your house phones and, if desired, your cell phone, Aunt Betty's phone at the nursing home, and your office extension. The CallerID displayed on all the ringing phones will be that of the incoming call. As with all Asterisk calls, whoever answers the call first gets the call. And there's no limit to the number of call queues on your system. It's just another "extension" to Asterisk. So it's easy to set up individual call queues for you and your spouse as well as each of the kids. Each can have its own incoming DID and a separate list of numbers to call when incoming calls arrive. Same goes for business use except you can add the ACD functionality of spreading out the incoming call workload to various employees.

    When an incoming call arrives, if you don't answer the call, Asterisk optionally can play an AutoAttendant menu after a time limit that you specify giving the user choices of calling you or your spouse on your cellphone, calling your vacation home, or simply leaving a message on your voicemail system. Whatever you want it to say and do is pretty much up to you. If the incoming caller doesn't take tha bait and press a button, the phone extensions and outside numbers you've designated will all start ringing again. If the second attempt fails, the caller will get the IVR menu again after which the caller will be dumped into voicemail if the caller fails to choose an option. Again, you can set this scenario up in any way you like. That's just the way we've set it up for the example.

    If the caller chooses an option, the call will be transferred to the appropriate number inside or outside your Asterisk PBX system. If you happen to be calling in to your own system, you can press single-digit numbers for other options that weren't identified in the IVR voice prompt to activate other Asterisk features such as DISA or reading your voicemail. If you'd prefer to dump calls you don't answer directly into your voicemail system, that can be done as well although you would lose the IVR features including the hidden functionality we've outlined. There are lots of options. Experiment!

    If someone does answer the incoming call from the Call Queue, Asterisk will play instructions about available choices. We've sprung for that voice prompt, and the choices go something like this:

  • Press the star key (*) to immediately answer the incoming call.
  • Press the pound or hash key (#) and enter a phone number to transfer the incoming call elsewhere. The caller won't have a clue!
  • Press the pound or hash key (#) followed by 86 (that's VM for Voice Mail in case you're wondering) to transfer the incoming call to your voicemail.
  • Continue to wait for the tone and the call will automatically be connected.
  • You can add other obnoxious options here if you'd like. Basically, you can transfer any incoming call to any extension number for which you've created a custom context. These give you the full flexibility of the Asterisk programming language. For our purposes today, they can be used to irritate or annoy people who are irritating or annoying. Here's an example. Adding the following code to the [from-internal-custom] context of extensions_custom.conf and then transferring a call by pressing #-3-8-3 (D-U-D) will play a message that everyone in your household is busy taking other calls from telemarketers and to please try the call again later. Works great for calls with no CallerID if you want to personally review these. Click!

    exten=>383,1,Answer
    exten=>383,2,Wait(1)
    exten=>383,3,Background(tt-allbusy)
    exten=>383,4,SetMusicOnHold,default
    exten=>383,5,WaitMusicOnHold,30
    exten=>383,6,Background(thank-you-for-calling)
    exten=>383,7,Background(goodbye)
    exten=>383,8,Congestion
    exten=>383,9,Hangup

    Gotcha Alerts. We discovered one anomaly in building this on our Asterisk system. By the way, we've loved that word "anomaly" ever since it was first used by Ashton-Tate, the folks that marketed dBASE. They just never could bring themselves around to calling anything a bug. Anyway, here's the Call Queue problem which didn't appear for us until about the third day of testing.

    Sometimes, when transferring a call either to another number or to voicemail, the transfer occurs on your end before the transfer is executed on the caller's line. This means the person receiving the transfer from you (or your voicemail system) may actually answer the call and start yacking well before the transfer kicks in on the caller's end so that they can hear what's being said. The delay on our system was about 10 seconds so it shouldn't pose a problem for calls transferred to another person. It'll usually take them that long to get to a phone anyway. For voicemail transfers, our solution was to add an 11 second delay in the script which connects the queued call to voicemail. We'll show you in the code below how to adjust that should you need to.

    Keep in mind that Asterisk is managing two separate voice channels: the caller's incoming call and your outbound call either to voicemail or another number. There doesn't appear to be a good synchronization mechanism to assure that both transfers happen at or near the same time. We used a clunker PC for testing so this may just be a result of our system's slow processor and 128MB of available memory. Or it may be a bug in the code that will get improved down the road. We'd be interested in hearing from others so that we can report it as a bug if, in fact, it is.

    Call Queues also work in Asterisk@Home 1.5 ... sort of. What doesn't work is breaking out of the connection by pressing * or #. In short, a message will play to the callee announcing the call, and then the caller is connected. You'll need a different Allison recording than what we're providing today to do this, since the standard options don't function. But it will work with this one limitation. And you can accomplish almost the same thing by hitting the # key immediately after the announcement prompt completes and the calling party is connected to you.

    Today's Game Plan. We're going to begin by downloading some sample voice prompts, then create some Ring Groups to handle cellphones or external phone numbers (we covered Ring Groups last week if you need a refresher course), then build an IVR menu, then create a sample Call Queue, and finally take it for a spin. Once it's working, we'll show you how to further customize it for business use or to meet your own special requirements. Some of the voice prompts are ones we use on our home system so they're not going to be much help except to give you an idea what's possible. Just follow along and, once you've built the sample system, it's easy to order your own voice prompts and swap them with our samples. We'll also point you to some generic prompts that come with Asterisk. These may suffice especially for home use without spending a dime.

    Call Queue Voice Prompts. Every Call Queue has at least two voice prompts: one that answers the incoming call to your Asterisk system and a second one that announces the call to you or whoever the recipient of the call happens to be. A third voice prompt is required if you want to provide the caller with an IVR menu of choices if or when no one answers the incoming call.

    The first two voice prompts are in .gsm format and need to be copied to the /var/lib/asterisk/sounds/custom directory on your Asterisk system. To create an IVR menu using the Asterisk Management Portal, you'll need a third voice prompt in .wav format which can be stored anywhere on your Asterisk server. We've provided ours just so you can see how it works in the example, and we'll save it to the custom directory also just to keep things simple. There's another advantage to storing stuff in this custom directory. They get backed up as part of the AMP backup system script. To download the prompts, log in to your Asterisk server as root and then switch to user asterisk: su asterisk. Now issue the following commands:

    cd /var/lib/asterisk/sounds/custom
    wget http://nerdvittles.com/aah2/callqueue.zip
    unzip callqueue.zip
    rm -f callqueue.zip
    ls -all

    Now look in the list of files displayed and check to see if you have any existing files that begin with aa_. These are existing sound files for autoattendants you've already created. If there aren't any, then do the following:

    mv nothome.wav aa_1.wav
    exit

    If you have existing autoattendant sound files in the directory, just add one to the number of the highest one shown and then issue the move and exit commands above. For example, if you have an aa_1.wav and aa_2.wav files already, then mv nothome.wav aa_3.wav. We'll need this in a bit.

    VoiceMail Redirector. For today's project, we've built a generic voicemail redirector. When you transfer a call to extension 86 (that's VM for VoiceMail), it will send the caller to the voicemail account matching the extension number of the phone on which you picked up the call. The code below assumes all of your extensions are 3 digits. If not, change the number 3 in lines 20, 30, and 40 to the actual number of digits in your extensions. If the number of digits varies, you'll need to seek "professional help" at Voxilla or SourceForge. If you need something different or if you want to reroute all incoming calls to one particular voicemail box, you can adjust the code accordingly. Using a web browser, go to the IP address of your Asterisk system and log in to the Asterisk Management Portal (AMP) as maint using your password. Then go to Maintenance->Config Edit->extensions_custom.conf. In the [from-internal-custom] context, add the following code:

    exten => 86,1,Answer ; V-M
    exten => 86,2,Wait(1)
    exten => 86,3,GotoIf($["${CHANNEL:0:3}" = "SIP"]?20)
    exten => 86,4,GotoIf($["${CHANNEL:0:3}" = "ZAP"]?20)
    exten => 86,5,GotoIf($["${CHANNEL:0:4}" = "IAX2"]?30)
    exten => 86,6,GotoIf($["${CHANNEL:0:5}" = "Local"]?40)
    exten => 86,7,Playback(hangup-try-again)
    exten => 86,8,Playback(goodbye)
    exten => 86,9,Wait(1)
    exten => 86,10,Hangup
    exten => 86,20,VoiceMail(${CHANNEL:4:3}@default)
    exten => 86,21,Goto(99)
    exten => 86,30,VoiceMail(${CHANNEL:5:3}@default)
    exten => 86,31,Goto(99)
    exten => 86,40,VoiceMail(${CHANNEL:6:3}@default)
    exten => 86,41,Goto(99)
    exten => 86,99,Hangup

    If you want to force a specific extension to a different voicemailbox, add two lines to the top of this code that look like this using your extension instead of 400 (in both lines) and the voicemail box number instead of 444 before @default in the first line:

    exten => 86/400,1,VoiceMail(444@default)
    exten => 86/400,2,Hangup

    And finally, as noted above, if you find that calls are not immediately transferring the caller to VoiceMail when you transfer the calls with #86, adjust exten=>86,2, Wait(1) to a longer delay. exten=>86,2, Wait(11) does the trick on our old clunker PC. Hopefully, someone with a better performing PC and more RAM will report back in a Comment indicating whether such a fix is necessary on more robust systems.

    Once you add the above code to your extensions_custom.conf file, save your changes and then reload Asterisk by clicking: AMP->Setup->Incoming Calls->Submit Changes->Red Bar.

    Creating Ring Groups for External Phone Numbers. AMP isn't the sharpest tool in the shed and only knows about local extensions. So, if you want to use external phone numbers (such as cellphones) in your Dialplan, then you need to set them up as Ring Groups so AMP can handle them just like a local extension. Let's create three just so we'll have some to use in our example. You can go back and change these later to meet your own needs. Using a web browser, go to the IP address of your Asterisk system and log in to the Asterisk Management Portal (AMP) as maint using your password. Then go to Setup->Ring Groups->Add Ring Group. Add a Ring Group for each cellphone or external phone number you want to integrate into your Dialplan. Use extension numbers (for the Group Numbers) that aren't already in use on your system. Each entry should look something like this (be sure to use a dial string that matches your outbound trunk):

  • Group Number: 411
  • Ring Strategy: ringall
  • Extension List: 16781234567#
  • Ring Time: 40
  • Destination if No Answer: some voicemail account on your system
  • Click the Submit Changes button after you complete each Ring Group and then click the Red Bar to reload the new Ring Group into Asterisk. Repeat for at least 3 external numbers.

    Creating an IVR Menu with AMP. To keep things simple today, we're going to build a quick Interactive Voice Response (IVR) menu using AMP. Using a web browser, go to the IP address of your Asterisk system and log in to the Asterisk Management Portal (AMP) as maint using your password. Then go to Setup->Digital Receptionist->Create New Voice Menu. Enter an extension number that can be used for you to interact with AMP while you're building this. On the Record Menu page, you can record your own voice prompt. For the example, let's use the one we've provided from Allison Smith. Just pick up the extension you chose to use in building this and dial *99. You should hear the Mundy's nothome IVR message. If not, go back to the Call Queue Voice Prompts section above and complete the steps. Otherwise, name the menu: Unavailable Menu and enter the following in the description: 1-MaryCell 2-WardCell 3-BeachHouse 4-Voicemail. Then click the Continue button.

    In the Options for Menu form, leave the Directory Context the way it is. For the number of menu options, enter 4 and click Continue. You can go back and increase this number later to support stealth options. The only trick to stealth options is adding the stealth contexts to the bottom of your extensions_custom.conf with context names beginning with custom. For example, to add a DISA option with a password, you could include something like the following and add a fifth option to your autoattendant:

    [custom-disa]
    exten => s,1,Wait(1)
    exten => s,2,Authenticate(1234)
    exten => s,3,DISA(no-password|from-internal)
    exten => s,4,Hangup()

    In the next screen, you actually associate tasks on your system with the choices given in your voice prompt. For options 1, 2, and 3, pick Ring Groups corresponding to the first three choices in your voice prompt. For option 4, choose a voicemail account for callers to leave voicemail messages. Click the Continue button and then the Red Bar to update your configuration.

    Creating a Call Queue. Now we're ready to actually create a call queue to process incoming calls. Using a web browser, go to the IP address of your Asterisk system and log in to the Asterisk Management Portal (AMP) as maint using your password. Then go to Setup->Queues->Add Queue. Fill out the form with the following entries substituting a Queue Number (extension number) which doesn't conflict with existing numbers on your system, a Static Agents entry which includes at least one local extension number on your system, and a Failover to Voicemail number which matches an existing voicemailbox on your system. Do NOT use external numbers in the Static Agents field although you can use Ring Group numbers which point to external numbers.

  • Queue Number: 299
  • Queue Name: queue1
  • Queue Password: leave blank
  • CID Name Prefix: q:
  • Static Agents: 201
  • Agent Announcement: callqueue
  • Hold Music Category: default
  • Maximum Wait Time: 1 minute
  • Maximum Callers: 2
  • Join Empty: yes
  • Leave When Empty: no
  • Ring Strategy: ringall
  • Agent Timeout: 30 seconds
  • Retry: 2 seconds
  • Wrapup Time: 0
  • Call Recording: no
  • Frequency: 30 seconds
  • Announce Position: no
  • Announce Hold Time: no
  • Voice Menu: Unavailable Menu
  • Join Announcement: welcome
  • Failover to Voicemail: 201
  • Click the Submit Changes button after you complete the entries and then click the Red Bar to reload the Queue into Asterisk.

    Once you finish creating the call queue, we need to set it to handle incoming calls. Click the Incoming Calls tab in AMP, and set the Regular Hours and/or After Hours destination to the Call Queue we just created above. Click the Submit Changes button once again and then click the Red Bar to reload your changes into Asterisk. Now place either an internal call to the extension number of your call queue or just dial the external number that connects to your Asterisk system to take your new Queue for a test run.

    Customizing Voice Prompts. To customize the system with a voice announcement for your home or office, simply order a voice prompt to replace our welcome voice prompt. The agent announcement voice prompt should be fine as delivered. Once you download your new voice prompt from Allison, log into your system as root and copy the file to the /root folder. Then convert the .wav file to a .gsm file with a command like this using the name of the .wav file provided to you by Allison Smith:

    sox r16212345-4105.wav -r 8000 -c 1 welcome.gsm

    Now copy the file to your /var/lib/asterisk/sounds/custom directory and change the ownership of the file from root:

    cp welcome.com /var/lib/asterisk/sounds/custom
    chown asterisk:asterisk /var/lib/asterisk/sounds/custom/welcome.gsm

    If you'd prefer something more generic until your customized sound file arrives, change the Join Announcement entry from welcome to pls-wait-connect-call or one of the other Asterisk sound files we've provided in the download. As another interim solution, you might want to try Loquendo synthesized voice files which can be created and then downloaded from here using the Firefox or Safari browsers. Once you play your creation, just choose File, Save As and give it a name to download the .wav file to your desktop. Then convert it to .gsm as shown above. We never could get a download to work with Internet Explorer, but maybe it was just late.

    Implementing an Automatic Call Distribution System. For those that use Asterisk@Home at work, it's a two-minute drill to convert what we've built today into a full-blown Automatic Call Distribution (ACD) System. For each department in your office, simply create a separate queue and route that department's DID trunks to the queue. Then add a list of the department extensions separated by carriage returns in the Static Agents field. Finally, adjust the Ring Strategy and Caller Announcement options to meet your business requirements. Hovering the cursor over the Queue and Caller Announcement Options will show what choices are available and what the various options do.


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


    Some Recent Nerd Vittles Articles of Interest...