Asterisk@Home Handbook Wiki Chapter 8

Chapter 8 Configuring and using Asterisk@Home features

8.1 Conferencing

Each extension you create will have its own conference. For example extension 200 has conference 8200. Just dial 8200 to get into your conference. If you dial from 8200 you are the moderator.

You need to set a password for the meetme user. Type passwd-meetme from the Linux command line.

Once you have started a conference you can manage it from the WebMeetme page. Just enter the extension for the conference.

External access for conferences is disabled for security reasons. It is not always desirable for people outside the system to have access to conferences

8.1.1 External access to conferences

If you want dial in access to conferences you need to be add an option on one of the auto attendants for this.

First go into the Maintenance page and select Edit configs. The file you want to edit is extensions_custom.conf add these lines to the bottom of the file. Update the file and reload configs.

 include => ext-meetme 
 exten => s,1,BackGround(enter-conf-call-number)
 exten => h,1,Hangup()

Next go into setup and Create a Digital receptionist if you have not already done so. Record a main message for your receptionist. Something like "press # for a company directory or press 1 to enter a conference" click continue and Select 1 for number of menu options.

Next you will have to select an Action for this menu item. Click Custom App and type in custom-meetme,s,1 then click continue.

That should be it when you dial in you select 1 from the main menu and you will be prompted for your conference number. You can dial 7777 from and extension to simulate an incoming call.

8.2 Weather Forecast Dialing

The NWS has disabled ftp access to the site. The addresses below have been updated to match the new location of the same formated data and a previous comment about the data being gone has been removed.

When dialing *61 on a phone connected to a A@H server, a synthesized voice will tell you your local weather. This nifty feature has all been setup in A@H. You will need to make a few changes to point to your local area weather forecast.

1) Go to and choose your state, then your nearest city. If you click on one of the text files, you'll be able to view its contents. Lets use New York as an example. If we decide on New York, the address we will work with looks like this:

2) Now log into your CentOS command line and edit the following file to include the URL for your area: /var/lib/asterisk/agi-bin/weather.agi


my $server = ""; to "";
my $custpath = "city/ny"; to the directory name you found above
my $filename = "new_york.txt"; to the city name you found above.

Also, In the first $AGI->exec line, change it from New York City to the city you have selected. If you really want to get crazy, you can change the second $AGI->exec line too. I added an Opie and Anthony line in there just to get my wife. =]

8.3 DHCP server

Asterisk@Home has a built in DHCP server. This can be used to configure your IP phones. The DHCP server is disabled by default. To make it active type setup-dhcp from the Linux command line. You must then edit the /etc/dhcp.conf file and set it to match your network. On line 4 set up your network address and netmask. On the next few lines enter the setting you want sent to your clients. Edit line 15 and add a range of IP address to give out.
Remember to disable any other DHCP servers you have on your network. These may include a Linksys router or Windows internet sharing PC. Reboot your Asterisk@Home system.

8.4 Flash Operator Panel

Flash Operator Panel is a real-time web interface to Asterisk. You can see what all of your extensions, trunks, and conferences are doing. The op_buttons.conf file has all of the configs for each button in Flash Operator Panel you can edit this using the Config Edit button on the maint menu. You must reboot the Asterisk or restart the panel service after you make changes. The normal config files for Flash Operator Panel end in .cfg we changed them to .conf so they would match the other Asterisk files.

See the Flash Operator Panel we site for more info on Flash Operator Panel.

Open your web browser and go to FOP. You should now be able to click on the little lock, put in your password and you will see it lock up. Now you can begin manipulating items in the panel.

The Flas Operator Panel can easily cause the Safari browser for Mac OS X to crash when it refreshes.

8.4.1 Hang-up on a Call

You can end a call by clicking the big red button.

8.4.2 Transfering a Call

Simply drag the little telephone over to the new extension and it will transfer the call.

8.4.3 Initiating a Call

You can drag and drop your little telephone to another extension. First it will start by ringing your phone then when you pick up and then it will ring the other extension. Once the destination phone is picked up it will initiate the call.

8.4.4 How to Create a Conference

Before creating a conference, there needs to be a call between two extensions first. Then you can add another extension to the conversation (thereby creating a conference) by grabbing an extension in the flash panel and dropping it into the conversation and it will connect you.

8.5 FTP server (vsftpd)

Asterisk@Home has an FTP server that is used primarily for configuring phones that use FTP such as Polycom. For security reasons only one user is configured by default to user ftp. This user is ftpuser (password: asteriskftp). It can access file in the /var/ftp directory. If you would like other users to have ftp access add them to the /etc/vsftpd.user_list file.

8.6 Cisco XML Services

Asterisk@Home has a Cisco XML Services that can be used to look up contacts in a database. Click on CRM from the Asterisk@Home main menu. (user: admin password: password) and enter all of your contacts and their phone numbers.
Use the setup-cisco command to set up SIPDefault.cnf for your Cisco phones. The setup-cisco script will set your Services URL to http://ipaddressofyourasteriskbox/cisco/directory/services.php you can then use the Services button of your Cisco phone to call your contacts.

8.7 Music On Hold (mpg123)

Asterisk@Home has now uses mpg123 for music on hold. Put a call on hold and they hear music not dead air! See for more info. music on hold info

Topic: How to Select Which Songs to Play for Music On Hold

An example:

Let’s say you want to hear some cool Blues music instead of the typical “elevator music,” all you need to do is create a folder in Asterisk, load the songs into the folder, and point to that newly created folder.


1) Create a folder called Blues in the mohmp3 directory

2) Load the mp3 songs you wish to hear for music on hold

3) Edit the musiconhold.cong file so it reads:
default => /var/lib/asterisk/mohmp3/Blues,r

4) Restart Asterisk – you may be able to just restart moh from the Asterisk CLI

5) Test by calling and asking to be put on hold

Side Note – You can have as many different folders loaded with songs.
A folder with one song will repeat
A folder with many songs will play each one before starting at the top of the list

8.8 FAX to E-mail

Type install-pdf from the Linux command line. This will install support for encoding incoming faxes as PDFs and e-mailing them.

8.8.1 Fax support (SpanDSP)

This section breaks away from the sections above (and below) since this exercise is more complex. Please note your current state of setup, so that you may revert to it after performing this short section, or better yet, just read the below as theory to be used at a later date when you have completed the rest of the manual.

The very, very specific case we are going to cover here is a Digium card with 4 ports; Port 1 is for a real live, paper-eating, paper-spewing fax, and ports 2, 3 and 4 are voice lines from various PSTNs. Port one is an FXS port, while ports 2, 3, and 4 are FXO. Adjust to suit your environment.

  • create 3 separate Zap trunks for 2, 3, and 4, using their numerals in the "Zap Identifier"
  • when you hunt an outgoing call, use these trunks, in the order you want to try them for availability
  • make sure you don't use the Asterisk@home default Zap group (g0) when hunting, or you may end up calling your fax machine on Port 1 for outgoing calls since this default group (g0) does not make any distinction between FXS and FXO
  • create 1 Zap extension for you fax port, using the number '1' for the "channel" field. When you review your changes, you will see the '1' has been expanded into a more complex data structure, btw
  • point your fax setting at the new Zap extension, for instance under your primary "Inbound Routing" set up
  • test away, sending a fax to the previous steps "Inbound Routing" route

You may notice that fax call recognition by Asterisk seems flaky. This may be because Asterisk is listening on the answered in-coming call line for a fax beep from the sender, but the timing of this beep has a wide range of variability since the sending fax has no idea when the call picked up, it just blindly sends the fax tone every few seconds — this may differ on newer fax machines and for various fax models, but then you can't ask your senders to all buy newer fax machines, can you? So if the call is picked up by Asterisk just after the fax tone is sent, Asterisk will probably not hear the tone the next time around before it figures the call is a voice call and starts executing the code to handle a voice call: your phones may ring, the call may be placed in a queue, etc, depending on how you programmed Asterisk to handle voice calls. All of this is very irritating. Unfortunately, the solution may call for a unique fax number with special programming to wait an extra long time when that line is picked up. Waiting an extra long time before sending the call to the voice programming phase will then cause your voice callers to hear dead air for that period unless you program in a fake ring. This working well would be a nice addition to Asterisk@Home possibly, but may introduce other kinds of confusion if not done well and documented.

As for the tone Asterisk hears from the sending fax, you will see the recognition of the tone in the "full" log Asterisk@Home spews out by default under /var/log/asterisk.

When you are done reverse all changes made in this short step to what they were previously, if you need to continue with the flow of this manual.

8.9 xPL

xPL is a very simple and powerful home automation protocol. It can be used it interface Asterisk into an existing home automation system. For example if you get a call your TiVo can display the caller ID info on your TV screen and turn down the stereo.

If you have a Microsoft based home automation system, see the xPL project page (

If you have a fully Linux based system MisterHouse ( has a good xPL interface.

One of the best features of xPL is the ability to mix and match applications. A few Windows apps, MisterHouse on Linux, Asterisk@Home on CentOS, and a TiVo can all be on the same network and share xPL information.
xPL is not running be default. To enable it type cd /usr/src/xplast then type ./

Once xPL is installed and running it will send out xPL heartbeat messages. xPL will also send out notification of new voicemail messages. xPL can also send out callerid info for any incoming calls. you must add a line to extensions.conf to make it do this. Add this line to extension.conf at a location where you want the callerid sent out.

exten => s,1,AGI,xplring.agi

For example a good place to add this line is to the [from-pstn-timecheck] section. Be sure to renumber the following lines.

 exten => .,1,Goto(s,1)
 exten => s,1,AGI,xplring.agi
 exten => s,2,GotoIf($[${IN_OVERRIDE} = forcereghours]?from-pstn-reghours,s,1:)
 exten => s,3,GotoIf($[${IN_OVERRIDE} = forceafthours]?from-pstn-afthours,s,1:)
 exten => s,4,GotoIfTime(${REGTIME}|${REGDAYS}|*|*?from-pstn-reghours,s,1:)
 exten => s,5,Goto(from-pstn-afthours,s,1)

8.10 Sugar CRM

SugarCRM is a complete CRM (Customer Relation Management) system. Although most of the features of this software package are beyond the needs of home users the contact management module in this package is the best we have ever seen in a web application. SugarCRM also has sophisticated user management.
Asterisk@Home uses SugarCRM mainly to manage contacts. SugarCRM is integrated into the Cisco XML phone directory making it possible to look up CRM contacts from a Cisco phone.

We have also added a click-to-dial function to CRM so that you can dial contacts directly from the web interface.

The default account for CRM is admin with a password of password. Once you have logged in you can create CRM users. You should make a CRM user for each extension. Enter the extension of a phone when you create a user so Asterisk will know where to send click-to-dial calls for that user. Use standard Asterisk notation for extensions. For example for sip extension 200 enter SIP/200 in the extension field.

8.12 VoiceMail

To enable voicemail on an extension simply "enable" it in the extensions config from the AMP gui. To support sending of mail, refer to this entry: from the forums.
Another good message from the forums to review is the following.

But one item not mentioned in either of these messages is the need to first install the sendmail package with yum.

yum install sendmail-cf

Basic steps to be able to send your voice mail through email once you have enabled the feature in an extension.

Login to asterisk server via ssh.

yum install sendmail-cf

This installs the necessary files for configuration of the snedmail client.

nano /etc/mail/

Edit the following lines
dnl define(`SMART_HOST',`smtp.yourprovider')

Then press CTRL-X, and type in Y, hit enter. You'll be asked for the file name you want "File Name To Write: /etc/mail/", so hit enter.

make -C /etc/mail

This rebuilds your /etc/mail/ file.

/etc/init.d/sendmail restart

This restarts sendmail.

You should now be able to have your voice mails sent to you via email.

8.12.1 Retrieving Voicemail

To listen to voicemail, there are 4 ways:
  1. Pick up your extension and dial *98.
  2. Call your extension from an outside line, and press * when your hear your voicemail greeting.
  3. Log in to the Asterisk Recording interface at http://your.asteriskbox.address/recordings/. Use your extension number and voicemail password to log in.
  4. Receive it in an email if your system is configured to do so. Depending on system configuration, your voicemail may or may not be available on the Asterisk system after it is emailed to you.

8.13 Connecting to your CentOS Command Line Remotely

Being able to connect to your CentOS Command Line remotely can a vital part of administering Asterisk@Home. Being able to do so securely is an absolute requirement. Asterisk@Home uses OpenSSH to accomplish this.

8.13.1 What is OpenSSH

According to Wikipedia and the OpenSSH web site OpenSSH (Open Secure Shell) is a set of computer programs providing encrypted communication sessions over a computer network using the SSH protocol. It was created as an open alternative to the proprietary Secure Shell software.

OpenSSH is a FREE version of the SSH protocol suite of network connectivity tools that increasing numbers of people on the Internet are coming to rely on. Many users of telnet, rlogin, ftp, and other such programs might not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other network-level attacks. Additionally, OpenSSH provides a myriad of secure tunneling capabilities, as well as a variety of authentication methods.

The OpenSSH suite includes the ssh program which replaces rlogin and telnet, scp which replaces rcp, and sftp which replaces ftp. Also included is sshd which is the server side of the package, and the other basic utilities like ssh-add, ssh-agent, ssh-keysign, ssh-keyscan, ssh-keygen and sftp-server. OpenSSH supports SSH protocol versions 1.3, 1.5, and 2.0.

OpenSSH is primarily developed by the OpenBSD Project, and its first inclusion into an operating system was in OpenBSD 2.6. The software is developed outside the USA, using code from roughly 10 countries, and is freely useable and re-useable by everyone under a BSD license.

8.13.2 How do I begin using OpenSSH?

Luckily OpenSSH is already installed on A@H. That means we don't have to worry about installing and configuring it (in other words, I won't be covering the installation in this handbook).

Please note, you really don't have to create a Public/Private key pair. You can always use an SSH client to connect to your A@H Server without the keypair, however in the long run its more secure to do it this way.

First we need to create a Public/Private key pair. OpenSSH uses this key pair to encrypt information between itself and the client software that connects to it. After you create the key pair, you should use the same file on all your Asterisk servers. At the CentOS command line, type the following command:

ssh-keygen -t rsa and press ENTER 3 times.
Note, you can put in a key passphrase if you want. When you use the file in your SSH client, you'll be asked to retype the passphrase.

[root@asterisk1 /]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
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/
The key fingerprint is:
5a:01:1a:20:6f:b9:54:68:b1:b1:d0:3e:e3:26:34:70 root@asterisk1.local

8.14 Open A2Billing

To login to Open A2Billing, go to http://asteriskipaddress/a2billing

Default login details are "root" and "myroot".

8.15 Bluetooth Presence Detection

Imagine if your PBX can automatically forward calls to your bluetooth-enabled cellphone when you leave home (or wherever the PBX is installed). AAH 2.1+ lets you do just that and here's how...

8.16 Setting up your NTP Time Server

According to the wikipedia:

The Network Time Protocol (NTP) is a protocol for synchronising the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP port 123 as its transport layer. It is designed particularly to resist the effects of variable latency.

Using an NTP server entry, you can make absolutely sure that the time on your A@H server is the actual time according to whatever time authority is out there (US Naval Observatory?). Your A@H Server already has NTP installed by default. However you may want to change the default setting sometimes. For example, you want your A@H server to point to the same NTP server as your Polycom Phones, etc etc.

For a list of NTP servers, please refer to:

Please avoid using Public NTP Primary (stratum 1) Time Servers. These servers are ONLY for use by the Public NTP Secondary (stratum 2) Time Servers. Please use a Secondary server listed here (I personally use a pool server):

Better yet, use a pool listing! That way if one NTP server ever goes down, it will send the A@H server to another server! Very cool!

For example, since I'm in NYC, I will use a sub-zone of the North American servers ( There are 171 servers in this zone so I know I'm good to go. The listing is as follows:


Once you've decided what server you want to use, login to your CentOS console and type in the following command to make sure you have NTP installed:

rpm -qa | grep ntp

If you see "ntp-4.2.0.a.20040617-4" (or something of a sort), then go ahead and type in the following to make sure you can even reach your server:


If not, find out why. Maybe its your firewall, DNS is not resolving, etc etc. (My server was on a DMZ with very tight rules and I forgot to open up NTP). Once you get it to work, type in the following command to change your NTP servers:

nano /etc/ntp.conf

8.17 Changing *60 to give the exact time

The time of day routine accessed by dialing *60 uses the phrase, "At the sound of the tone, the time will be exactly...", which conveys a false sense of accuracy - users might actually think that the beep tone falls on the turn of the minute, which is not the case. At the cost of quite a bit of extra code, you can make this routine give the time at ten second intervals, with a beep that falls within approximately one second of the stated time, which should be close enough for most applications. Of course this will not be accurate if the computer's clock is not synched to an accurate NTP server, as described in the previous paragraph.

Here is a revised Time of Day routine, which replaces the existing one that is usually found in extensions_custom.conf in AAH:

exten => *60,1,ringing
exten => *60,2,Set(FutureTime=$[${EPOCH} + 8])
exten => *60,3,Set(FutureTimeMod=$[${FutureTime} % 10])
exten => *60,4,Set(FutureTime=$[${FutureTime} - ${FutureTimeMod}])
;180 in next line is max # seconds connection can be held open. Use multiples of 10.
exten => *60,5,Set(MaxConnectTime=$[${FutureTime} + 180])
exten => *60,6,Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
exten => *60,7,GotoIf($["${FutureTimeMod}" < "0"]?10:8)
exten => *60,8,wait(1)
exten => *60,9,goto(6)
exten => *60,10,Answer
exten => *60,11,Set(FutureTime=$[${FutureTime} + 10])
exten => *60,12,Set(FutureTimeMod=$[${FutureTime} % 60])
exten => *60,13,wait(1)
exten => *60,14,playback(at-tone-time-exactly)
exten => *60,15,SayUnixTime(${FutureTime},,IM)
exten => *60,16,GotoIf($["${FutureTimeMod}" = "0"]?17:19)
exten => *60,17,SayUnixTime(${FutureTime},,p)
exten => *60,18,goto(22)
exten => *60,19,playback(and)
exten => *60,20,SayUnixTime(${FutureTime},,S)
exten => *60,21,playback(seconds)
exten => *60,22,Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
exten => *60,23,GotoIf($["${FutureTimeMod}" < "1"]?26:24)
exten => *60,24,wait(1)
exten => *60,25,goto(22)
exten => *60,26,playback(beep)
exten => *60,27,Set(FutureTimeMod=$[${MaxConnectTime} - ${EPOCH}])
exten => *60,28,GotoIf($["${FutureTimeMod}" < "1"]?29:11)
exten => *60,29,Hangup

Others have proposed modifying the time of day routine, for example at this page:
However I believe the above routine is more accurate, if a bit longer.
Note: Modified after original post to include timeout in case caller doesn't hang up & minor error corrections. Also the timeout as written may occasionally let the caller stay connected for an extra ten seconds; should that really bother anyone you can subtract one or two from the value used used in line 5, e.g. for a three minute (180 second) timeout, instead of using 180 try 179 or 178. The main reason the timeout was added was to prevent someone from parking the call or placing it on hold and consuming system resources.

8.18 Sendmail

A@H contains sendmail for sending and receiving mail. It does not contain a user interface but the mailboxes can be viewed via webmin if you have that installed.

As delivered it supports on internal mail, and there may be good reasons for that. If you would like to be able to receive mail (and spam, and attacks) from outside of your machine you'll have to open your firewall on port 25 and tell sendmail to allow external connections.

This later is best done by modifying and re-compiling it to generate However the compiler is not included in a@h, which may indicate that .mc and .cf are not in sync(?). You may therefore care to just edit directly and live with the consequences. To do this edit /etc/ with your favorite editor (I use mc) and find the line:

O DaemonPortOptions=Port=smtp,Addr=, Name=MTA

Comment this line out by prefixing it with a hash:

#O DaemonPortOptions=Port=smtp,Addr=, Name=MTA

and file it. Use webmin to stop and start sendmail and test it using telnet adddress 25. You should get a 0100 prompt at which you can just type quit.

More information can be found at

= An Alternative - MSMTP =

As spam filtering gets more and more aggressive, the traditional approach of using the Sendmail 'smarthost' feature (described elsewhere), doesn't always work.

A different approach is to install Instead of being a full MTA, it emulates sendmail behaviour from Asterisk's perspective, but it connects directly to an existing email (SMTP) server and sends the mail via it. Thus you can configure it with your own email account information and it will send it using your email account.

Like sendmail, it also supports alternative port specification. In addition, it lets you specify TLS (SSL-based) connections to your email server which may occur on a different port (425) and hence avoid a port 25 portblock.

8.19 DUNDi

Setting up DUNDi (Distributed Universal Number Discovery) on Asterisk@Home can be an involved process. Please see the DUNDi Tutorial for Asterisk@Home.

Created by: GinelLipan, Last modification: Mon 11 of Jun, 2012 (05:34 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+