Home » Technology » Newbie’s Guide to Asterisk@Home 2.5: Unabridged Soup-to-Nuts Installation Guide

The Most Versatile VoIP Provider: FREE PORTING

Newbie’s Guide to Asterisk@Home 2.5: Unabridged Soup-to-Nuts Installation Guide

Want a rock-solid PBX at a rock-bottom price: free! Well, it's been two days since our tutorial on AAH 2.4 but here we go again! Asterisk@Home 2.5 has hit the street because of another serious bug-fix release of Asterisk®. Now you get version 1.2.4 of Asterisk, and you also get 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; NVfaxdetect support; loads of AGI scripts including weather forecasts and wakeup calls; xPL support; the SugarCRM Contact Management System with the Cisco XML Services interface and Click-to-Dial support; plus lots more. And, yes, it still fits on a single CD! NOTE: Virtually nothing has changed between version 2.4 and 2.5 except a new release of Asterisk minus memory leaks. If you waded through the 2.4 install with us, much of what follows will be very familiar. Our apologies! We're as tired of doing this every week as you are. Hopefully, this will be IT for a while.

Effective March 13, 2006, this article has been superceded by our new Soup-to-Nuts Guide for Asterisk@Home 2.7.

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. To begin, download the 2.5 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 (see inset), 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, Comedian 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.


Loading CentOS/4 and Asterisk 1.2.4. Here's how the 2.5 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. 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. First, reboot your system: shutdown -r now. Because a new version of the kernel is installed as part of the yum update, you'll need to rebuild support for ZAP devices. Log in as root and type the following command: rebuild_zaptel. Then reboot your system: shutdown -r now. Now log in as root again and type genzaptelconf. Reboot once more and you're all set to go: shutdown -r now. You only need to rebuild Zaptel when there is a kernel update as there was with this yum update.

Simplifying SSH. If you're going to be connecting to other servers from your new Asterisk@Home 2.5 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.5 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.5 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.5 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. Note that there is a new version of WebMin since our previous article on Asterisk@Home 2.2 was published.

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 start it any time you need it, and then use a web browser to access it. But there's no need to consume processing resources running a second web server when you're not using it.

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 article on the subject.

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

Once you have your account name and password, point your web browser to the IP address of your new Asterisk@Home 2.5 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.5 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.5 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. 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. For those using a dynamic IP address with phones at remote locations connecting to your Asterisk server, we'll show you how to automate the process of changing your Asterisk server's IP address in a future column.

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.5 includes a new version of the Wakeup Call program, and the default setup works. 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. And, the wakeup call application now uses a different method of scheduling wakeup calls which broke our TeleYapper and Telephone Reminder applications. Mental note for would-be developers, don't rely on someone else's code to keep your code working reliably. This is especially true in the open source marketplace. Everyone is full of new ideas, and they don't necessarily stop to think of the impact the improvements will have on other folks' applications. We'll have new versions of our applications ... soon.

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. Pressing the pound key (#) from any phone connected to your Asterisk server now calls up a directory lookup function using the Asterisk Management Portal (AMP).

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 )

[Feb. 5 update] Adding Cellphone Extensions. There was a typo in the After: code above when this article was first published so check your entry against the one shown now. Once you make the above change, 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.5 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. If you really would like to learn more about it, documentation for the application is available here. And, if you decide to use the application, you'll need to uncomment 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

Footnote: The missing A2Billing code from Asterisk@Home 2.1 has been added. You can read all about the problem here. There's also a pretty good step-by-step setup guide for Asterisk@Home here.

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.5. 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. We're going to do some heavy editing of the extensions.conf file so be careful with your cutting-and-pasting: nano -w /etc/extensions.conf. When you're 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 NVfaxdetect can be a bit quirky. You may need to fine tune the timing mechanism in the actual NVfaxdetect(4) lines above. If 4 is too long or too short a delay to detect a fax call, try 10 or nothing at all. 10 works for us. 4 works in Australia apparently. If you need more details, read our original article on this topic. It also explains how to get all of this working with the Nerd Vittles Stealth AutoAttendant if you're using it.


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 to this extension, 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. Very cool!

Other Out-of-the-Box Utilities. Asterisk@Home 2.5 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. If you like it, here's how 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.

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 (that match the provider with whom you have set up an account) 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)


Some Recent Nerd Vittles Articles of Interest...


45 Comments

  1. Instead of _. as catch-all extension, it’s better to use always _X. because there is some chance that AAH logs ‘h’ in the CDR instead of real extension.

    [WM: Excellent point. I fixed it. Thanks. We all learn something every day!]

  2. Ward – regarding the amended contexts for faxing, I have just noticed that that there are unexpected spaces in some of the priorities which I have listed below (spaces included). Unfortunately, at times the formatting of posts on the "Whirlpool" forums creates unpredictable results.

    I thought I would bring these to your attention to avoid creating any unnecessary heartache for your readers. You might like to double check in case I have missed anything.

    [from-pstn-reghours]
    exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-reghours-nofax ,s,1:2)
    exten => s,10,Goto(ext-group,${INCOMING:4}, 1)
    exten => s,12,Goto(ext-queues,${INCOMING:4} ,1)

    [from-pstn-afthours]
    exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-afthours-nofax ,s,1:2)
    exten => s,5,SetVar(intype=${AFTER_INCOMING })
    exten => s,8,Goto(ext-local,${AFTER_INCOMIN G:4},1)
    exten => s,10,Goto(ext-group,${AFTER_INCOMI NG:4},1)
    exten => s,12,Goto(ext-queues,${AFTER_INCOM ING:4},1)

    [ext-fax]
    exten => analog_fax,2,DBGet(DIAL=DEVICE/${F AX_RX}/dial)

    [WM: I had noticed a couple of these, but thanks.I’ve cleaned them up.]

  3. I think that the right correction for extensions.conf is:
    exten => s,22,GotoIf($[$[${HuntMembers}] >= 1]?30 )

    [WM: Right you are. I’ve updated the article. Thanks.]

  4. Would it not be wonderful to simply have a sip extension hotdial a channel directly and get internal dial tone directly ! any takesrs ? (yes I believe the IAX between two boxes may support this as DISA)

  5. Ward, thanks for all the help your site provides. It has helped me tremendously.

    Question: Is it possible to take a backup from a 2.4 system and restore it to a 2.5 system? Since the versions are so close that might work as opposed to having to reconfigure everything.

    [WM: You might try backing up /etc/asterisk and restoring it. That should get just about everything.]

  6. A chart of prerequisites would be very helpful. Like, "if you want to do this, you’ll need this and this and this…" IP phone, fixed IP address, VOIP acct., etc.

    [WM: Good idea, but it would be a very long list of if-then-this suggestions. I may take your suggestion and do a separate article on Asterisk Prerequisites: What You Need To Do Whatever.]

  7. Does anyone else have the problem with AAH 2.5 that prevents from from deleting the default ZAP/g0 trunk and the default outbound 0 route1? I get a PHP warning when I try to remove the route and the trunk persists when I delete it, and apply changes.

    [WM: Add a new trunk and route before you delete the defaults.]

  8. Thanks again, Ward, for the update on installing AAH 2.5. Unfortunatly, I’m getting to memorize the install routine with AAH by heart. Perhaps I should look for a job as a "Professional AAH Reinstaller". I really shouldn’t complain as I didn’t contribute to all of this code; I just wish I could let this version roll for at least a few months before I have to do it again. Once again, thanks; Nerd Vittles rules!

    [WM: I’m sympathetic to say the least. Writing about the same thing over and over gets tedious as well … even with cut-and-paste. I think I could do an install blindfolded at this point. Hopefully, this release will do it for a while. The bottom line is that Asterisk 1.2 was akin to beta code when it was released, and it’s taken four iterations to get most of the kinks out. I’m not sure that’s much worse than Windows 95, 98, or XP when all is said and done.]

  9. I think a thanks word would never express all that i want to say, but i promise i am going to learn as i am doing now and, in few months, i’ll be helping the others just like you do.
    my best regards and deep respect, Nerd Vittles

  10. I updated our system using /var/aah_load/asterisk-update.sh
    This was from a running and configured AAH 2.2 system.

    Are there better ways or other scripts to accomplish this so that is will take along the AAH changes as well? Is what I did "kosher"?

    Thank you for all of your amazing work!

    Ismet

  11. I think there’s a typo in "If you want remote access to your Asterisk system via SSH, then map TCP port 143…"

    The default SSH port is 22. TCP port 143 is normally used by IMAP.

    [WM: Bad night at the track. You’re correct. Thanks.]

  12. First and foremost…LOVE your site..very helpful.

    Just a quick correction, the SugarCRM version included in A@H is 3.5, but the latest release is 4.01. I wish we could find a way to upgrade to 4.x and still have the dialing abilities.

  13. Ward. Thanks for your efforts. Truly appreciated!

    I just wanted to mentionned a little problem w/ Telasip config. section above:

    Setting Up An Outbound Trunk

    host=gw3.telasip.com

    youraccountname:yourpassword@gw3.telasip.com

    I think they have changed their server from gw3.telasip.com to gw4.telasip.com (plzzz noticed the numeric value)

    Not sure if someone already mentionned it but I thought I’d let you know:
    Changing the server URL to gw4.telasip.com corrects the problem.
    I was sometimes getting All circuits are busy now error msg..and my A@H won’t even register at all.

    Thanks again for your time and have a great one!

    Claude

  14. OK, I’m missing something basic. I burned the ISO to CD, let it do its thing and was not prompted for any input until I got the "asterisk1 login" prompt. So, since I didn’t provide a password for root, what is "your password" in the above how-to?

    Comments about my stupidity welcomed in advance…

    [WM: It’s password. See the tutorial.]

  15. please do not recommend anything from WalMart.

    That company, those who support it, and that entire way of thinking, is ruining this country, possibly even this planet. Sound melodramtic? Perhaps. Just keep it up & see if it is true.

    Thank you.

  16. aswsome guide as usual! The only *slight* addition I would make would be to modify the instructions on port forwarding to forward only 10001 to 20000 as doing 10000 to 20000 opens up webmin to the outside world. Which is, by itself fine, but if you’re not using it remotely an un needed possible security risk.

  17. Ward, I wonder if you can have Kennonsoft make an icon for Asteridex. I had a link to it on the old .html page, but it does not look good now without an icon. I would like to use it in replacement of the SugarCRM or the Forums icon. I wouldn’t mind donating again for this cause.

    [WM: Good idea. I sent a note and got a quick response from Tony Vincent with not one but two new icons. Take another look at the amended article. Detailed instructions and the new icons have been added. Thanks again for the suggestion. That’s what makes Asterisk so special!]

  18. Great guide, one tweak to make. Basic for people who have built Linux boxes before, but not everyone. If you want to run yum updates etc. from the start and you’re on a fixed IP, you need to set up eth0, default route and nameservers first.

  19. Can we upgrade from version 1.5 or is there no path? We have a very large system built, but love the look of 2.5, a fresh build will take sometime.

    Great TUT’s help us out a lot in the past!

    [WM: Short answer: NO. Long answer: Almost everything in AAH 2.5 is different including the Linux kernel, the Asterisk Management Panel, etc. In short, moving your existing config files would permanently damage AAH 2.5. You can take screenshots of existing information in your AMP setup screens, and then type it in again. You can export your MySQL data and then import it into the new system. Also some of your AGI scripts will still work, but we’d recommend you backup the new stuff first. Better yet, start over. We’ve done it about a hundred times now. It’s fun!]

  20. Great tutorial, love your site. I wonder if you know of a good tutorial on configuring asterisk realtime, for example add/deleting iax extensions, etc. The information on the web is always pieces here, pieces there. There is never a complete write up or example in one place. Thanks.

    [WM: Give me a little better hint, and we’ll work on it.]

  21. We have an internal company portal where a new user can be added. User information is kept in a mysql database. We also want to use that portal to add asterisk extensions for a user. I would add couple lines in my portal application to write the extension to the mysql on asterisk server after I write into the portal mysql. So I don’t have to add a new user through my portal and use AMP to create the extension. I am using Asterisk@Home 2.5, and we are using IAX clients.

  22. I have enjoyed your articles. Let me ask one intriguing question. Can one use Asterisk for a community phone project wired and or wireless for about 5000 people to give them a cheap way to talk? I will appreciate your comments.

    [WM: Absolutely. Many are doing just that.]

  23. Are Yapper and Reminder fixed for 2.5?

    [WM: Not yet. TeleYapper 2.5 will be released on Tuesday, Feb. 14. The Telephone Reminder System still is in the hands of the programming department, moi.]

  24. My AAH install is in jeopardy! My fiance just tried to call her parents house (local to us though I have all outgoing calls going through Telasip instead of the PSTN line) and it rang 3 or so times and then the phone went dead – no dial tone, no busy signal, nothing! I dialed my cell phone (also local to us) just to test and it went through just fine. We then tried her parent’s number again and we got the same dead phone several more times before I unplugged the Sipura3000 from the PSTN and gave her a "real" phone. I haven’t done anything to disable calls to her parents (I swear!) and am at a loss as it what’s going on. I’m no expert but nothing looked out of the ordinary in the logs and my install is pretty much a stock 2.5 install from this site with Telasip and a Sipura3000. If I can’t resolve this I’m sure my fiance will force me to 86 my newly installed AAH setup – help!

    [WM: Check the logs and turn on debugging in the CLI to see what’s going on. This isn’t a good forum for solving problems like this. Head on over to Voxilla and post your question once you have some better detail about the problem.]

  25. Ward, any luck with phone paging in 2.5? I have tried it with 3 different installs and on all 3 systems the phones just ring and never pick up. Worked fine in AAH 2.1. The soundcard paging that you mentioned works fine (assuming you know how to turn the sound up on your sound card).

  26. I just finished setting up Asterisk (one afternoon, wao! the Linux learning curve dropped to zero). I am a newcomer and these are my questions:

    1) Why can’t everything be managed from AMP?
    2) I guess the opposite to AMP is to manually tweak the config files. In such case which one has precedence?
    3) Am I totally lost?

    Thank you for your answers and keep up the good work!

  27. Because I seem to be good at finding problems, I’ll answer the question above me first. Parts of Extensions.conf does not get written to, if you tweak it, the tweaks change. If you mess up something that amp needed to be able to make it function (E.G. a reference to a variable set in extensions_additional.conf) then it will be broken and you will have to replace the file or find where you broke it and fix it. Extensions_additional.conf is pretty much stored entierly in a mysql database, and whenever you change things through amp, it updates the database and rewrites the file. Extensions_custom.conf is for you to play with, and AMP doesn’t need anything it it to make its system funciton. Other file sets have a simmilar pattern going on.

    On to the problems… I was checking our logs today and noticed another syntax error being called out by the system (we had to reboot because of a memory leak, btw, and we’ll see if this somehow had anything to do with it) but I traced it out and found this line in..

    [macro-rg-group]

    exten => s,2,GotoIf($[${CALLERIDNAME:0:${LEN(${RGPREFIX})}} != ${RGPREFIX}]?4:3) ; check for old prefix

    And I also had to trace down the meaning of TOK_NE (it’s not equal token, btw) and figured out that there is a missing close bracket in the expression jut before the !=. So the line SHOULD look like this…

    exten => s,2,GotoIf($[${CALLERIDNAME:0:${LEN(${RGPREFIX})}}] != ${RGPREFIX}]?4:3) ; check for old prefix

    Thanks, Great job with the site btw. And regarding someone’s table of requirements, The idea poped into my head of developing a web site that asks a series of questions about the requirements on thier side and it will return a sheet of requirements for a server to match… I might start work on that after tomorrow even.

  28. It looks like I was wrong, btw… on the previous comment. I missed the close bracket after the !=. I’m having trouble decifering what is going on with that line.

    A workaround… I removed that line and the line after it. It seems to work fine.

    If someone can help me figure out what’s going on there, i’d be very appriciative.

  29. Wow! This is a great site. I have been playing with Asterisk@home and am looking at installing it in our office. Everything is working great but I can’t get call recording to work. I can set recording to always in the extention set up and everything is great. What I can’t do is on demand recording. I have the AAH 2.5 installed and have added the ‘w’ and ‘W’ to dialing options and also added [globals]
    DYNAMIC_FEATURES => automon to extentions.conf but no joy in Muddville. Any help would be greatly appreciated.

    [WM: Have you added automon => *1 to the featuremap context of features.conf?]

  30. Now, why can’t I have this article in a PDF? or maybe in a printable form? Without the comments…
    This is GOLD man!
    Oh, and I haven’t installed A@H yet. AND… Is there a way that I can use my existing (home) phone(s) seeing that I do not have an IP, SIP phone yet?
    Without you, I think I would be lost. Thanx
    Daniyl

  31. With regards to the NVFaxDetect… THANKS!! That was a very easy change to impliment and is working great with my IAX trunks.

    There was one thing I did end up adding however, as I noticed it would not detect incoming faxes to DIDs (Or Incoming Routing as it’s now refered to)

    I edited the webpage that adds the DID’s to asterisk’s configs and implimented your changes there. AMP now has the option to answer immidiately and wait for a given amount of time – so instead of having it answer() and wait(x), it now will answer(), Playtones(ring), and NVFaxDetect(x). Here’s how:

    Edit the file: /var/www/html/admin/did.php

    Find the following section:

    if ($answer == "1″) {
    $addarray[] = array(‘ext-did’,$account,$i++,’Answer’,",",’0′);
    $addarray[] = array(‘ext-did’,$account,$i++,’Wait’,$wait,",’0′);
    }

    and change it to:

    if ($answer == "1″) {
    $addarray[] = array(‘ext-did’,$account,$i++,’Answer’,",",’0′);
    $addarray[] = array(‘ext-did’,$account,$i++,’Playtones’,’ring’,",’0′);
    $addarray[] = array(‘ext-did’,$account,$i++,’NVFaxDetect’,$wait,",’0′);
    }

    Now not only can you have incoming DID’s accept faxes, but also have them emailed to different email addresses based on the fax handling options you specify in the AMP Incoming Route screen.

    Keep up the great work, and thanks for all the help you’ve been!!

    -Kris

    [WM: Great suggestion. Thank you.]

  32. Ward, think you could request a couple more icons for the a2billing and a2customer links? I love the blog, great work as always! I’m hoping to start working on the Asteridex and getting that setup in my environment.

  33. You’ve recommended using Phlink boxes in your Mac section and have gone into great detail about Asterisk on controlling phone communications in Nerd Vittles. I’m wondering which would be better for a person or small business.

    I’m more into Macs than Windows/Linux, but am familiar enough with computers to have no problem either way in implementing such a system. My first computer was an Apple II+ back in 1979 and I’ve worked at three Apple dealers and four schools/school boards in my time doing tech support work. While I can fix most any old Mac (OS9 and under) I’m still getting used to OSX and use the computers as computers not toys.

    My business has three lines on a rotary setup, an individual phone line used by the company that is also indicated as being with an associated company, a single dedicated fax line for receiving faxes and a single line that we use for computer equipment to dial out (Western Union terminal, POS terminal, etc.). The last line of the three line rotary is also used for a second Western Union terminal dial-out line. I am contemplating replacing the DOS box Western Union terminals with either small XP boxes or Macs capable of running Windows and having them connect via the internet, but need to assure
    myself of the security of doing so.

    I’ve been thinking of getting a VOIP line for cheaper long distance capabilities, having a Skype line for incoming calls as well as calls to other Skype people and possibly other VOIP lines if needed for specific VOIP features that might be available inexpensively depending on what our primary Canadian VOIP might offer.

    I’d like to be able to build a system whereby callerID would identify who was calling and be able to populate a screen saying who was calling, potentially record the details of certain calls, provide IVR capability for those who call here seeking information on what we do, etc.

    I keep tossing between Asterisk and using Phlink or Phone Valet running on Macs. Each has their good and bad points, costs and being able to tie everything together to make it as seamless as possible. And since Asterisk has an OSX port, is it possible to do a Mac with Asterisk and Phlink/Phone Valet in combination to get the best of both worlds? Phlink/Phone Valet for land lines and Asterisk for VOIP/Skype/etc.? (since Asterisk on the Mac doesn’t seem to support the Digium cards to connect land lines, or am I missing something?)

    Thanks for your input or suggestions on where to go for further info. Some days there are too many options to choose from and I am working on too many other projects to do proper service to these decisions as well.

    [WM: For what you’re talking about, it’s Asterisk hands-down. If you don’t want to go the Linux route, you might want to hold off a few weeks and try the new SPA-9000 which is a preconfigured Asterisk system minus voicemail. But frankly, based on your experience, it sounds like Asterisk on Linux would be a walk in the park for you. Any $500 PC with an IDE drive works. If I were running my business on it, I’d probably want a spare as well. Read our articles. It’ll reduce the learning curve by about 99%. If you want to get something up and running on a Windows PC just to try, you can’t beat the new VMware solution. I wouldn’t run my business on it, but it’ll quickly give you a good idea of what Asterisk can do. Best of luck.]

  34. i have asterisk 2.4, vonage analog lines, and vonage soft phone lines. i having issues with incoming calls. it appears that dtmf is not working for incoming calls on both vonage analog and soft phone accounts. i have tested the pbx using ext 7777 and everything is fine.

    the vonage analog lines are connected using a digium card.

    i have tried just about everything i can think of. is there a trick in getting vonage to send dtmf signals cleanly to my pbx, or is this a know issue?

    has anyone out there run into the same issue and resolved it? everything would be perfect if this issue could be resolved. any help would be greatly appreciated.

    thanks,
    sean

  35. Hi,
    Great articles!!! I am still experiencing memory leak with Asterisk 2.5. Is this a known issue or is it just me?

    [WM: Memory leak means things get worse and worse until your system ultimately crashes. Are you seeing crashes? Linux is designed to use all the memory it can get its hands on. So, just because your system shows less free resources on Day 2 than it did on Day 1 doesn’t necessarily mean there’s a memory leak. It may just be Linux caching more data to speed processing up. Tell us more.]

  36. Anyone know how make different incoming trunks do different options?? It seems that no matter what config files I modify, ALL my incoming calls go to the incoming calls setting specified in AMP. Its as if something is overriding my DID incoming calls settings. Anybody have an idea for me?

    Thanks

  37. First of all, this article is top notch! Followed to the ‘T’ and now have a system up and running. Two questions though, is it normal to have large delays in festival transacation (like the default weather)? Also, in testing with a softphone, and dialing a different extension, I get "The person at extension" sound, but no actual number, and then it just hangs up, anyone else seen this?

    [WM: Haven’t seen the second problem you mentioned. But we have the same issue with long Festival delays which we didn’t see at all in AAH 1.5. I’ve mentioned to Andrew, but he doesn’t see it. It may be a low memory, slow processor issue in my case. What type PC are you running?]

  38. THANK YOU!! Your articles and blogging are so helpful! I’ve successfully setup my AAH and saved loads of time thanks to you. Keep up the great work!

  39. I know this isn’t the Tech support site for Asterisk, but I have 1 question no one seems to be able to answer, Is there anything I can do to make call-waiting active on all extensions by default? It’s driving me insane.

    [WM: The problem is that you have to set a flag to set call waiting OFF with Asterisk. Here’s a thread on Voxilla that will show you how to do it quickly without picking up each phone.]

  40. Important Tip for Call-Forward-On-Busy

    Insert the following Code into extensions.conf just above
    ; cancels call forward on busy for calling extension
    exten => *91,1,Macro(user-callerid)

    —%< ------------------------------------------------- ; activate Call-Forward-On-Busy (CFB) with *90 exten => *90,1,Answer
    exten => *90,2,Wait(1)
    exten => *90,3,BackGround(please-enter-your)
    exten => *90,4,Playback(extension)
    exten => *90,5,Read(fromext,then-press-pound)
    exten => *90,6,Wait(1)
    exten => *90,7,BackGround(ent-target-attendant)
    exten => *90,8,Read(toext,then-press-pound)
    exten => *90,9,Wait(1)
    exten => *90,10,DBput(CFB/${fromext}=${toext})
    exten => *90,11,Playback(call-fwd-on-busy)
    exten => *90,12,Playback(for)
    exten => *90,13,Playback(extension)
    exten => *90,14,SayDigits(${fromext})
    exten => *90,15,Playback(is-set-to)
    exten => *90,16,SayDigits(${toext})
    exten => *90,17,Macro(hangupcall)
    —–%<-------------------------------------------

  41. Fantastic article. Ever since I stepped into the voip telephony world, Ward and family have become my new best friends. Thank you for taking the time to write these articles, you are simply fantastic.

    I have setup a nice Asterisk @home system, I got a stealth autoattendant going. I have implemented the ivr which says press 1 to continue which then gets forwarded to a ring group which rings all extensions and then gets dumped to an extensions vmail. If 1 is not received from the caller, then it is assumed this could be a telemarketer and a Zapateller sit tone is sent out, I am plagued with telemarketers!! My problem is, when the caller presses 1, i want them to hear music while all the phones ring, but i am not able to get the music on. Any ideas?

    my extensions_additional.conf ivr code:

    [aa_1]
    include => aa_1-custom
    exten => 1,1,Goto(ext-group,1,1) ; jump
    exten => fax,1,Goto(ext-fax,in_fax,1)
    exten => h,1,Hangup
    exten => hang,1,Playback(vm-goodbye)
    exten => hang,2,Hangup
    exten => i,1,Playback(invalid)
    exten => i,2,Goto(s,7)
    include => ext-local
    include => app-messagecenter
    include => app-directory
    exten => s,1,GotoIf($[${DIALSTATUS} = ANSWER]?4)
    exten => s,2,Answer
    exten => s,3,Wait(1)
    exten => s,4,SetVar(LOOPED=1)
    exten => s,5,GotoIf($[${LOOPED} > 2]?hang,1)
    exten => s,6,SetVar(DIR-CONTEXT=default)
    exten => s,7,DigitTimeout(3) ; Bell-Inbound
    exten => s,8,ResponseTimeout(7)
    exten => s,9,Background(custom/aa_1) ; Stealth Auto-Attendant
    exten => t,1,Zapateller ; jump
    exten => t,2,Wait(2)
    exten => t,3,Zapateller
    exten => t,4,Wait(1)
    exten => t,5,Zapateller
    exten => t,6,Hangup

    [ext-group]
    include => ext-group-custom
    exten => 1,1,SetMusicOnHold(default)
    exten => 1,2,Macro(rg-group,ringall,20,,250-260-280-290-261)
    exten => 1,3,Macro(vm,250) ; jump

    P.S.I have a incoming bell (pstn) line connected to a tdm card with 1 FXO and 1 FXS and sipura fxs device and some ip phones.

  42. I can’t get X-Lite to register with my Asterisk Server. The internal IP address for Asterisk. Everything works fine when I put the internal IP address with X-Lite; however, when I attempt to use my external static IP address, X-Lite will not work. What am I doing wrong?

    Thanks,
    Craig

    [WM: You can’t get to your own external IP address from inside with most NAT-based routers.]

  43. This site is one-of-a-kind! I have never come across any site better than this. What are the odds of adding IM (Instant Messaging) to it?

    Again..Well Done!

Comments are closed.