Asterisk Open-Source PBX System

Use one system to manage voice over IP and conventional phone lines, manage voice mail and run CGI-like applications for phone users.

So, you need to deploy a Private Branch eXchange (PBX) system for your small office. Or, maybe you want a voice-mail system running on your Linux box at home. What about an interactive voice response (IVR) system for home automation? Voice over IP (VoIP) capabilities would be nice too. How do you do it? One very interesting and powerful solution is Asterisk, a GPLed PBX system built on Linux that bridges the gap between traditional telephony, such as your telephone line, and VoIP. Asterisk also supports a host of other features that make it an attractive solution. In this article, I touch on some of these features and give you enough information to get started without having to buy any special hardware.


Asterisk is an open-source project sponsored by Digium. The primary maintainer is Mark Spencer, but numerous patches have been contributed from the community. As of this writing, it runs only on Linux for Intel, although there was some success in the past with Linux PPC, and an effort is underway to port Asterisk to *BSD. Digium also sells various hardware components that operate with Asterisk (see Resources). These components are PCI cards that connect standard analog phone lines to your computer. Other hardware is supported as well, such as hardware from Dialogic and Quicknet. Asterisk has its own VoIP protocol, called IAX, but it also supports SIP and H.323. This leads us to one of Asterisk's most powerful features: its ability to connect different technologies within the same feature-rich environment. For example, you could have IAX, SIP, H.323 and a regular telephone line connecting through Asterisk (see Figure 1—courtesy of Digium).

Figure 1. Asterisk can connect regular telephone lines and multiple VoIP standards.

The developer can extend Asterisk by working with the C API or by using AGIs, which are analogous to CGI scripts. AGIs can be written in any language and are executed as an external process. They are the easiest and most flexible way to extend Asterisk's capabilities (see Listing 1).

Getting Started

An official release hasn't happened for quite a while, but there is talk of one coming. Currently, the best way to get Asterisk is by CVS:

export CVSROOT=\
cvs login (password is "anoncvs")
cvs co asterisk

If you plan on using a PCI card from Digium, you should look at zaptel as well. If you plan on having connectivity, you need to check out libpri.

There is no configure script, so you simply use make. You also need readline, OpenSSL and Linux 2.4.x with the kernel sources installed in order to compile Asterisk properly:

cd asterisk
make clean install samples

This compiles Asterisk, installs it and also installs the sample configuration files. The last target overwrites any existing configuration files, so either skip this target or back up any existing configuration files if you want to preserve them. If you are using zaptel or ISDN, compile those before compiling Asterisk. Asterisk is installed in /usr/sbin/ with the configuration files in /etc/asterisk/ by default. Voice-mail messages are stored in /var/spool/asterisk/voicemail/. CDRs for billing and log files are located under /var/log/asterisk/.

You can start Asterisk by typing asterisk at the command line. However, the best way to use Asterisk during the testing phase is to run it with the -vvvc options. The -vvv option is extra-verbose output, and the -c option gives you a console prompt, which allows you to interact with the Asterisk process. For example, you can submit commands to Asterisk, such as management and status commands.

Asterisk's operation and functionality relies on several configuration files. We discuss three of them in this article, but several others exist. Here, we set up Asterisk so that users can call each other through IAX. We also set up voice mail and give users a way to manage their voice-mail messages.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

German Book to Asterisk: "Der Weg zu VoIP Asterisk von A bis Z"

Silvio's picture

Buch Bekanntmachung: Der Weg zu VoIP Asterisk von A bis Z

For english see bellow.

Als ich Oktober 2005 angefangen habe mit Asterisk zu arbeiten, gab es nur wenig zusammenhängende Informationen zu Asterisk. Es gab bereits ein Buch zu Asterisk, jedoch wurden dort einige Themen ausgelassen. Auch im neuen Asterisk von Oreilly wird nur Asterisk besprochen, jedoch nicht auf Telefonkarten, VoIP Telefone, Zusatzprogramme eingegangen.

Der Buch Inhalt ist auf die deutschsprachigen Länder, Deutschland, Österreich, Schweiz, bezogen.

Das Buch "Der Weg zu VoIP Asterisk von A bis Z" beschreibt nicht nur Asterisk sondern auch alles Dinge,
welche mit Asterisk verwendet werden können. Hier einige Beispiele aus dem Buchinhalt.

- Einführung in Asterisk
- Benötigte Hardware für Asterisk
- Asterisk installation
-- Das erste Gespräch
-- Echo Call test
-- die sprechende Uhr

- die Konfigurationsdateien
- Sicherheit

- Anrufbeantworter
- Sprachausgabe auf deutsch wechseln
- makeln, weiterleiten
- Music on Hold
- Automatisch weiterleiten

- PSTN(POTS) integration
- ISDN integration

- SIP Telefone
- Sprachcodecs
- Asterisk Konfigurationsprogramme
- Asterisk und Billing
- Rollout in einem Unternehmen
- Alternativen zu Asterisk
- VoIP Protokolle
- ...

Das Buch ist bereits teilweise frei erhältlich im Internet verfügbar.
Die ersten 30 Seiten finden man jetzt schon unter

Jede Woche, oder beim Verkauf eines Buch Exemplares, wird eine Seite freigegeben. Das Buch wird also Zeit abhängig freigegeben. Zudem unterstützt man mit dem Kauf des Buches die freie Erhältlichkeit des Buches.

Das Buch hat rund 243 Seiten und kann unter bezogen werden.


Book announcement: Der Weg zu VoIP Asterisk von A bis Z

First at all: The book is only aviable in the german language. The book does describe Asterisk as well as things that are usefull for Asterisk: VoIP-Telefons, Configuration Software, Billing Software, Telefonycards, ...

The book content is sutiable for the german speaking countries: Germany, Austria and Switzerland.

Parts of the book are allready free avialbe on the internet.
The first 30 pages can be found at

Everyweek, and if someone buys the book, one page more will be free aviable. With the buy of the book the freedom of the book is supported.

The book has 244 pages and can be bought at

Best Regards

Asterisk Connects wtih GoogleTalk

Anonymous's picture

New project is underway to connect GoogleTalk/Jabber with Asterisk. Delivery date and details can be seen here:

Faxing with Asterisk using AsterFax

Anonymous's picture

You can also fax with Asterisk using AsterFax which is an email to Fax gateway.

And you plug it in...

Anonymous's picture the Verizon rj11 jack on the wall!
Or you use the magical wireless connectivity available only in the author's town.

Very technical, very specific article. How about a followup that dumbs it down just a bit, such as, you connect the Digium PCI card to your network, this is how much upload speed you'll need per line, you find a voip carrier by looking for this service (sip...) You can/can't have branch offices with the same number and transfer calls across the city/town with call transfer...

I know someone stuck on Vonage's two line SB plan, who is looking for something cheap, where he can migrate his number to something like Broadvoice or some other service, and have one or two (or more) voice lines, plus a fax line like through Vonage. Number portability takes care of the original number, but the technical details on using Asterisk with a carrier to replace Vonage (or Broadvoice which has their own adapters like Vonage, or bring your own adapter) still isn't clear.

What exactly needs to be done to migrate from Vonage Voip to Asterisk, where I can get one voice and one fax (or actually 2 voice lines) which actually has functional call "hunting" for each voice line? Who do I call to order the service, once I have a dedicated box for Asterisk and Digium modems? Unless the cost comes in less than either Vonage for two lines, or Broadvoice or other Voip for multiple single lines, what's the point besides the geek factor? Using call forwarding on busy with multiple single lines, you get all the benefits of all the other services, without worrying about another point of failure in the hardware, a huge UPS for a computer vs. a UPS for a few phone adapters, plus the cost of electricity of running that computer 24/7 every month.

While the technical details are nice, the major part of the story, the connection explanation/possibilities as compared to something like Vonage/Broadvoice so one can fully understand what/why is missing. The technical details would be a nice addition, but I doubt that most post-purchase users are going to use this article for relying on their phone system when the mailing list for Asterisk and the abundant docs online are all available and will be utilized anyway.

Good technical explanation, but the article misses the mark. Thanks for the article anyway.

Asterisk Rapid Installation

Eran's picture

Xorcom has released version 0.9 of Debian and Asterisk auto-installer. It can turn any PC to pre-configured PBX from scratch in a few minutes, and contains lots of extra software and features. It is free and open source.
Asterisk auto-install CD

Eran Gal
Xorcom Ltd
Asterisk Solutions

Re: Asterisk Open-Source PBX System

Anonymous's picture

callerid example is wrong

Should be:


Re: Asterisk Open-Source PBX System

Anonymous's picture

good catch, although in the context of what I was doing, it wouldn't really have any affect. Technically, I should have had:


Re: Asterisk Open-Source PBX System

Anonymous's picture

Or, even more technically correct would be:


This sets the CALLERIDNAME variable to brett and the CALLERIDNUM variable to 111 (referencing the whole callerid with CALLERID) if required... (look in Readme.variables for other interesting stuff)


Re: Asterisk Open-Source PBX System

Anonymous's picture

ok, that didn't work it (it was stripped out...) should be


Perhaps you mean...

Anonymous's picture

Do you mean like this?


Re: Asterisk Open-Source PBX System

Anonymous's picture

ok, I'm just about to give up on this stupid filtering!

callerid = "brett" less-than-sign 111 greater-than-sign

replace the 'less-than-sign ' with 'shift ,' and greater-than-sign 'shift .'

or look at


Re: Asterisk Open-Source PBX System

Anonymous's picture

right...I think the filtering was messing everyone up...thanks

Re: Asterisk Open-Source PBX System

Anonymous's picture

where is callerid.agi?

cant find it :(

Re: Asterisk Open-Source PBX System

Anonymous's picture

it's on my website:

Re: Asterisk Open-Source PBX System

Anonymous's picture