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

In the extensions.conf file, an entry called callerid.agi calls an AGI script. This is a simple example illustrating the AGI interface. The script is placed in the /var/lib/ asterisk/agi-bin/ directory and is invoked by Asterisk as an external process. AGI and Asterisk communicate through stdin, stdout and stderr. Variables are passed in to the AGI through stdin, and the AGI can pass information back to Asterisk through stdout. Messages destined for the Asterisk console are written to stderr. Two parameters always are passed to the AGI: the full path to the AGI and the arguments that are passed to the AGI through the exten entry. The AGI collects the callerid and sends it to a GUI application running on another machine. The GUI application can be retrieved from my Web site (see Figure 2). AGI scripts also can be used to retrieve information. If you need to query a database for information about the call or the user, you can use the AGI interface as well.

Figure 2. A GUI application shows the caller ID information for incoming calls.

Making a Call

So, what can we do now? After creating the configuration files above and starting Asterisk (asterisk -vvvc), we can try some calls. Currently, the availability of IAX soft clients is limited. SIP soft clients, including kphone and xten, and hard clients from Cisco, SNOM and other vendors also are available that will work with Asterisk, but I concentrate on using IAX in this article. Gnophone (Figure 3) is the oldest client and was developed by Digium. Work also is being done on a cross-platform client, as well as a Windows client. Another client is available that belongs to the tel Project at SourceForge. I have modified the user interface to that client (Figure 4). It is still alpha software, but it's functional. In fact, I used this client to establish a call between Germany (Reinhard Max), Australia (Steve Landers) and the US (me). Whichever client you choose, you need to define your user name, password and context for each Asterisk server with which you want to connect. Then, you can call anyone defined in the iax.conf file (if the dialplan is set up correctly). So, if I want to call my wife, I simply dial 222, or I can type maria (because I have defined this in the dialplan). If I want to check my voice-mail messages, I can dial 6245.

Figure 3. Digium's Gnophone is a software phone client you can use with Asterisk.

Figure 4. Alpha but working software: a modified version of the client from the tel Project.


I have touched on only a few of Asterisk's capabilities, but this article should give the reader a glimpse of Asterisk's potential. Asterisk scales well from small setups to larger and more complex configurations. For example, Asterisk servers in different locations can be connected through the IAX protocol, creating a virtual PBX. Because Asterisk runs on Linux you can leverage existing tools to help interface and manage Asterisk. For instance, you could have Web access to the CDRs, configuration files and voice mail. In fact, a CGI script comes with Asterisk that allows you to access your voice-mail messages with a Web browser. I encourage readers to explore Asterisk further and leverage its powerful features.


I would like to thank Digium, Reinhard Max and Steve Landers for their assistance with this article.

Brett Schwarz lives near Seattle, Washington, with his wife, son and dog. Although he is familiar with multiple platforms, his platform of choice is Linux. He has many years of experience working on both computer and telecom systems. He can be contacted through his home page at



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