Want a rock-solid PBX at a rock-bottom price: free! Yep, it's been a week and here we go again! Asterisk@Home 2.2 has hit the street primarily because of a bug-fix release of Asterisk®! Now you get the latest version of Asterisk (version 1.2.1), 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; fax 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 some more bug fixes. And it amazingly still fits on a single CD!
Editor's Note: This version of Asterisk@Home has been superceded. For the latest tutorial on or after March 13, click here.
The installation process is pretty straightforward. You download the 2.2 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.1. Here's how the 2.2 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 unless you have Digium cards. If you do, read the caution which follows before proceeding. There are about forty of them as we write this so be patient. The update command to issue is yum -y update.
Dec. 27 WARNING: There is an additional wrinkle with running yum update with Asterisk@Home 2.2 if you have Digium cards. Read this SourceForge thread and make sure you understand what's necessary to put Humpty back together again before running yum update if you have Digium cards in your Asterisk system.
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 commands:
cd /usr/src/zaptel
make install-udev
rebuild_zaptel
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.2 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.2 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.2 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.2 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 article on Asterisk@Home 2.0. It fixed a major security flaw in some of WebMin's perl scripts so you'll definitely want this upgrade:
cd /root
mkdir webmin
cd webmin
wget http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin-1.250-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 used to be 10000 to 20000 so there's a conflict on port 10000 with WebMin. Beta 6 fixed this, but version 2.2 doesn't have the change. So, if it still says 10000 on your system, change it to 10001. 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.
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.2 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.2 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:
context=telasip-in
dtmfmode=rfc2833
fromuser=youraccountname
host=gw3.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@gw3.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. You'll see a couple of ugly error messages. Ignore them. It's a beta bug. Just 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. Both are free! Just install and then configure with the IP address of your Asterisk@Home 2.2 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 two 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/lib/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 Broken. Asterisk@Home 2.2 includes part of a new version of the Wakeup Call program. Unfortunately, it doesn't work. Fortunately, the old version still does. And, we've also fixed the code in the new version. To reload the old version, log into your server as root and issue the following commands:
cd /var/lib/asterisk/agi-bin
mv wakeup.php wakeup-new.php
wget http://nerdvittles.com/wakeup.zip
unzip wakeup.zip
rm wakeup.zip
chmod 775 wakeup.php
chown asterisk:asterisk wakeup.php
Or, if you'd prefer to use a patched copy of the new version, log into your server as root and issue these commands instead:
cd /var/lib/asterisk/agi-bin
mv wakeup.php wakeup-new.php
wget http://nerdvittles.com/wakeupnew.zip
unzip wakeupnew.zip
rm wakeupnew.zip
chmod 775 wakeup.php
chown asterisk:asterisk wakeup.php
There are basically two problems with the new wakeup code. The first is that a number of the voice files are assumed to be in /var/lib/asterisk/sounds/extra, a directory which doesn't exist in the Asterisk@Home setup. We've fixed that problem in the wakeupnew.zip file which you can install above. The second problem is that the wakeconfirm application is missing entirely. This is used to prompt the user to answer a question ... to make sure the person is REALLY awake. This application is not enabled in the default setup so just don't activate it until we can do a little more investigative work.
Adjusting Call Parking Extensions. Traditionally, dialing extension 700 parked a call on Asterisk@Home systems, and the call could be picked up by dialing the parked extension in the range of 701 to 799. To retain this 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. 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.
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 => _.,1,Goto(from-pstn-timecheck,s,1)
New Custom Speed Dialing. Asterisk@Home 2.2 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 actual dialplan lines in extensions_custom.conf and reload Asterisk:
; CallingCard application
; un-comment the 5 lines below to use this app
;exten => _X.,1,Answer
;exten => _X.,2,Wait,2
;exten => _X.,3,DeadAGI,a2billing.php
;exten => _X.,4,Wait,2
;exten => _X.,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 2.2 here.
SugarCRM Contact Management. Asterisk@Home includes the latest and greatest version of 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.
Other Out-of-the-Box Utilities. Asterisk@Home 2.2 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. 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.
Where To Go From Here. After you get a functioning Asterisk system, you're ready to move on to the 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. Enjoy!
Some Recent Nerd Vittles Articles of Interest...
This was a great article! Started last night and expect to finish tonight. No problems, clear instructions — WooHoo!
Everything was good to go… I just wish there was an easy way to print this document out cleanly.
[WM: Try switching to a different theme. We support dozens and some print out better than others.]
Good stuff – always looking for a good tip or two for A@H. One note though, on the wakeup patch you’ve got "chmod 775 wakeup.agi" and "chown asterisk:asterisk wakeup.agi" as final changes – both of which error on my fresh install. Shouldnt that be "…Wakeup.php" for both (the php extension as opposed to agi)?
Seemed to fix things on this end. THanks for the tips – keep ’em comming
Matt
[WM: Thanks for catching the error. I’ll fix it in the article as well.]
excellent article – everything works perfectly.
I was speaking with gene over at telasip about a week ago who told me that they’re trying to migrate everyone over to gw4 from gw3 – I’m currently using gw4 and having no problems.
[WM: We also use gw4 with no problems. In fact, if anyone wants to try a free call through our server and try it out, here’s how.
You should add a comment in this paragraph:
[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
As I understand it, this causes all calls coming in on 4041234567 to be routed to extension 200. Doing this prevents you from setting up a ring group with more then one extension. I am not sure that it was necesary, but I commented the lines out and added:
exten => _.,1,Goto(from-pstn-timecheck,s,1)
That seemed to fix it as incoming calls ring all extensions as they should…. BTW thanks for turning me on to Telasip, I have now purchased 3 lines through them. So far, Gene has been great to work with and very helpfull. Thanks for your wonderfull contribution to the asterisk@home community.
[WM: You got everything exactly right. The idea here is for Nerd Vittles to be a learning experience but, at the same time, we provide some samples that will get folks started so that at least one phone will ring. Thanks for your note.]
I recently followed your guide for Asterisk@Home 2.1 and everything went great, I have a working PBX. Now I see version 2.2 has come out. Is there a way for a Linux and Asterisk newbie to upgrade version 2.1 to 2.2 without starting over?
[WM: There’s really not an upgrade path that works. Lucky for you it’s only been a week so write down what you’ve got, make copies of all the files in /etc/asterisk (but use these for reference ONLY; don’t just copy them into 2.2 or you may get unpredictable results!), and print screen shots of all the Asterisk@Home AMP screens to give you an idea how you"ve set things up. Trust me. It’s a lot easier the second, third, fourth, fifth, … well, you get the idea.]
I am facing a lot of problems after moving from 1.3 to 2.2, but I have to thanks too for this well written guidance. Maybe you can help?
I am from Germany, which means e.g. I can?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ǩ?°?É‚Äò?Ǭ¢t see [de] in the indication.conf, etc.
But some more important question:
1. recording:
How I have to configure the recording feature for each chat (record in/out in extension and General settings/Dial command options). I can?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ǩ?°?É‚Äò?Ǭ¢t find the voice files in the defined directory (agents.conf: savecallsin=/var/calls) or typical directories like var/lib/ or var/spool/ (the mentioned monitor directory does not exist).
How about urlprefix= and createlink=, nothings works
2. big echo problems (in contradiction to 1.3):
How I can improve/fix this problems? I have no idea what to do first.
3. Queue problems: HoldMusicCategory: the mentioned directory is filled with mp3 standard files, but no music is played during the waiting period
Also there is no Caller Announcements for the first caller in the queue, only the second caller gets an announcement.
Also the ring on one of the phones (ringall) stops after 20s, why ?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ǩ?°?É‚Äû?ɬ? this is maybe easy if I can change the ?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ä?ÀÜ?ɬ¨retry?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?-Select-Button in queue definition? Where I can find this page?
I am also not sure if the wrap-up-time is working correct, because (I defined ?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ä?ÀÜ?ɬ¨0?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?) the next 20s should ring in this case immediately after the first try.
4. voice-message e-mail-delivering:
to send voce messages isn?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ǩ?°?É‚Äò?Ǭ¢t possible (but this is not easy to explain)
I am using only external IAX-trunks and internal SIP phones (hard + soft)
Thanks in advance for any advise.
[WM: Sorry but we don’t do tech support. I’m retired, remember! You might want to visit the Voxilla forums and post some of your questions there. I’d do them one at a time if you expect a response. Good luck!]
Have you tried Idefisk
http://www.asteriskguru.com/tools/idefisk_beta.php
I?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ǩ?°?É‚Äò?Ǭ¢ve found it to be excellent and wonder whether it might be worth introducing it to your following?
I cant wait until your presence article – is it going to be Jive/Wildfire based?
Great blog!!!
Rich
Hey there, great blog. Currently working with @Home 2.1 and have an Analog phone, SIP (X-Lite) phone and Polycom 300 IP Phone associated with my PBX. I can get each phone to call both ways with exception of the Polycom, where I can’t dial out. Wondering if could please point me in the right direction.
[WM: Head over to the Voxilla Asterisk forum or the SourceForge Asterisk@Home forum and someone will get you going in short order.]
Ward, you should publish this great work on A@H as a book. I also have a question to you. I followed the instructions to install a@h 2.2 and now I am not seeing any incoming numbers in the caller ID. I see my own BV number in CID. If I revert back to 1.5 all things work just fine. Any, idea what might be the problem ? Thanks
[WM: Thanks for the book suggestion, but we don’t do books. As for BV, read the BV setup article on this site. BV does things a little differently … to put it nicely.]
One suggestion:
When you edit your vm_include.inc file your can change the link to ARI which I think is a much cleaner more professional interface.
"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."
Instead, use "http://my.fullyqaldomname.com/recordings"
Also – the current version of AAH doesn’t have the latest ARI code. Get it here: http://www.littlejohnconsulting.com/?q=ari
– DJS
Just starting going through the AAH 2.2 article. I was getting stuck after the yum -y update. I could not get the zaptel devices to show up, even after a kernel rebuild and genzaptelconf. After some digging, I found that one of the rpms that were updated, overwrote the /etc/udev/rules.d/50-udev.rules and /etc/udev/permissions.d/50-udev.permissions files. These files used to contain some zaptel entries that were blown away. Merging the changes back into these files solved the problem. Just a FYI.
Thankyou thankyou thanyou !
Thankyou to NerdVittles for 2.2 (as well as Andrew obviously) , and thankyou to Mr Berry. That last problem has been driving me nuts for a couple of days !
Now working ok
I need to know how to setup H.323 extensions in A@H. I’ve done some reading and it seems like I have to setup some kind of forwarding from the H.323 Gatekeeper to a SIP extension and vice versa to have it work, but this seems a little over complicated for a PBX (*) that supports H.323. Any suggestions would be great!
Thanks,
Michael Davidson
A job well done needs to be recognized….I’ll then join the guys here and say "Congrats" for such a great documentation…it really got me going….
A2Billing seems to be interesting…can’t wait for an article on that one!
Again, thanx
Jay
I’m having the same problems as #12 up there, not being able to get zaptel working after the yum update. I get an error: "Error: missing /dev/zap!" when it tries to start up zap. I don’t understand #12’s solution, so if someone wouldn’t mind elaborating and/or updating the article, I’d appreciate it. Great work here!
[WM: see below. If you’re still having problems, take a look at the Digium card discussion in this HOW-TO Guide from Australia.]
yum -y update
reboot
rebuild_zaptel
reboot
genzaptelconf
reboot
Addendum. I tracked down your problem on SourceForge. Here’s the discussion thread that will show you how to fix the yum update problem. Sorry, but I don’t yet have any Digium cards, or I could have been more helpful.
I keep getting the following when using the above NAT address update script. I’m not much of a linux buff, so I don’t know what’s wrong.
no crontab for root – using an empty one
crontab: installing new crontab
"/tmp/crontab.XXXXzGioi0″:2: bad minute
errors in crontab file, can’t install.
Do you want to retry the same edit?
Thanks for your helpful,easy-to-understand blog! Keep up the top-notch work!
[WM: Post the crontab entry so we can have a look.]
I finally figured out #12’s solution. Simpler than it seemed; those two files are missing the zaptel entries after the yum update, but they can be recovered from the rpm saves of the same files. Thanks for your response WM, and happy New Year!
#18 can you elaborate more. I am having the same problem as #12 but I can’t find a link to read the sourceforge article.
Thanks
[WM: See link in #17 Addendum above. The main article has also been amended.]
Hi and thanks for all the great stuff on AAH.
As a beginner to AAH (just installed V2.2 and have it running nicely) and ip-telephony I am truly grateful for these guides and insights to this GREAT system. I am amazed at what I can do already!!
I am currently rebuilding our phone setup at home and looking forward to getting deeper inside AAH. A thing for the wishlist would be some words on how to strip the aah-setup for things that aren?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ǩ?°?É‚Äò?Ǭ¢t ?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®?¢‚Ä?ÀÜ?ɬ¨must haves?¢ÀÜ?°?Ǭ¢?¢‚Ǩ?°?ɂİ?Ǭ®? for the home user, like A2Billing and maybe the CRM.
Thanks Again.
/Kenneth
[WM: Kenneth, Thanks for the kind words. As for stripping out unnecessary code, do yourself a HUGE favor. Don’t! I don’t know how many people I’ve cautioned over the years about this only to have them do it anyway and then find out they’ve deleted a component that they really needed or the system needed to function reliably. So, one more time, DON’T!]
for a good SSH client on WIN32 use PUTTY
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Hi Ward
Thanks for all the hard work in producing your Asterisk@Home tutorials – I’d be lost without them.
I’ve been trying to correct the Max Channels bug in my 2.2 asterisk@home installation and in my newbie ignorance I think there could be a } missing from the new s,7 line. Please could you confirm so that I don’t have to jump out of the nearest window. Thanks Terry
[WM: The way it’s shown in the article is what is shown in the bug report.]
A couple of things:
Problem:
Has anyone worked with integrating with Avaya (S8500 w/ Communication Manager in particular, not Definity). I am working on this now, but I cannot get the PBX to open an outbound channel to the Avaya system. Also, is there a debug watch mode that you can enter on Asterisk to watch what happens during a call on the PBX side? Tailing a log file maybe?
[WM: Hi Walter, Questions such as the above are better posted on the Voxilla or SourceForge forums where you can get threaded input from numerous individuals. Best of luck.]
Additional Components:
One thing I found useful (if you are going to add components to this setup) is to add gcc-c++ to this image. The tools to add H323 ability will not compile without this installed. Of course yum -y install gcc-c++ will do the trick for most, I think it should be just included.
[WM: Agreed! You might want to pass this along in a new message thread on SourceForge which Andrew reads daily.]
A helpful tip: If you are using TelaSIP and experiencing one way audio, you may want to try a different telasip-gw host entry as the one stated in this (excellent) guide. Instead of the entry in the article, try this in sip_additional.conf:
[telasip-gw]
type=peer
host=gw4.telasip.com
qualify=yes
insecure=very
context=telasip-in
username=yourusername
secret=yourpassword
Doing this solved my one way audio problem. I got this setting from TelaSIP support.
Very good tutorials, these are even better than the official How To. I want to know something, you recommend the ip phone Uniden UIP-1868P IP Wireless Phone, I saw in the Buy.com esepecification page, that it only work with Packet8. Can I use it as an extension in my A@H box?
[WM: That particular model is locked to Packet8 so it won’t work with Asterisk. We like Uniden’s wireless phones, however, and the one and two-line 5.8GHz phones work great with an SPA-3000.]
If you are looking for the UIP-1868 to work with asterisk, take a look at: http://perceiva.com/technologies/docs/uip1868.html
Took a lot of tinkering since it doesn’t come with any directions…but you must get the unlocked version (not the Packet 8 or Vonage version) for it to work with Asterisk
I have installed TrixBox and Asterisk PBX within Windows. My system configuration includes a Celeron 2 GIG processor and 1 Gig
of RAM and DSL connection. When testing the voicemail platform I am experiencing the choppy voice quality with internal voice prompts. I have changed various codecs using the soft phone options. I have also tried changing jitter buffer from between 5ms to 100 ms with no improvement. I am not currently with SIP provider, testing internally with IP. Any Thought’s into how to minimize choppy voice
quality ?
[WM: Be sure you’re running the latest, stable version of TrixBox (1.2.3) from our build. And, if you still have problems with choppy sound, apply this fix.]
HI guys i’m looking a place to find some help or a place to write my problem with asterisk and a SIP/TRUNK. Someone knows where? or who?(i already went to the forums)
happy new year!