Asterisk Open-Source PBX System
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.
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.
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.
AGI Information: home.cogeco.ca/~camstuff/agi.html
“Asterisk: A Bare-Bones VoIP Example”, by John Todd (Asterisk and SIP Setup): www.onlamp.com/pub/a/onlamp/2003/07/03/asterisk.html
Asterisk Client: tel.sf.net
Asterisk Forum: www.pbxtech.info/forumdisplay.php?f=113
Asterisk HOWTO (Beta): megaglobal.net/docs/asterisk/html
Asterisk Wiki: www.voip-info.org/wiki-Asterisk
Brett's Web Site: www.bschwarz.com
Cross-Platform IAX Client and IAXPhone: iaxclient.sf.net
Digium (Documentation and Hardware): www.digium.com
Getting Started with Asterisk: www.automated.it/guidetoasterisk.htm
Notes on Asterisk: asterisk.drunkcoder.com
Perl Modules for Asterisk and Other Information: asterisk.gnuinter.net
Windows IAX Client: laser.com/dante/diax/diax.html
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 www.bschwarz.com.
- Readers' Choice Awards 2013
- Mars Needs Women
- RSS Feeds
- Sublime Text: One Editor to Rule Them All?
- Raspberry Pi: the Perfect Home Server
- December 2013 Issue of Linux Journal: Readers' Choice
- IBM Will Minimize Impact of Future Disasters
- Tech Tip: Really Simple HTTP Server with Python
- Linux Systems Administrator
- Senior Perl Developer
- This should be very helpful
54 min 24 sec ago
- As much as I share your point
3 hours 14 min ago
- So girls had it better ?
6 hours 45 min ago
- Reply to comment | Linux Journal
7 hours 6 min ago
- why is GNOME 3 in the fifth position at 14.1 %?
12 hours 38 min ago
- Sublime Is Brilliant!
17 hours 41 min ago
18 hours 31 sec ago
- Rapid[Disk,Cache] better than native ram caching?
18 hours 25 min ago
- Nothing is perfect
18 hours 38 min ago
- Mixtapes Community
1 day 17 min ago