From caller ID to long distance, anything your phone can do, Asterisk (http://www.asterisk.org) can do better — and cheaper. Asterisk, an open source telephony project sponsored by Digium (http://www.digium.com), greatly reduces the cost of traditional telecommunication technology and operation, and moves Voice over Internet Protocol (VoIP) into the mainstream. With VoIP, telephone calls are transmitted over an Internet connection, eliminating long distance charges and the need for a traditional proprietary telephone service plan. If you own a telephone, heed the call to Asterisk.
Because Asterisk is based on VoIP, Asterisk provides an inexpensive telecommunication solution perfect for a small business, a home office, or even an entire household. And because Asterisk has the ability to communicate seamlessly between VoIP and the public switched telephone network using any of the most popular codecs and protocols, it allows for high voice quality at no toll costs. Also, Asterisk’s freely and widely available open source code can replace a traditional hardware PBX. Finally, unlike most VoIP telephone systems, Asterisk integrates with a wide range of hardware and standards-based telephony equipment.
“Asterisk was designed to be able to do everything a traditional telephone system can do, and much more,” said Mark Spencer, creator of Asterisk and founder of Digium.
The Linux configuration of Asterisk offers a myriad of calling features, including caller ID, call waiting, and voicemail. Moreover, it has all of the advanced capabilities of a professional-grade telephone system, such as conference call bridging, auto-attendant, interactive voice response (IVR), overhead paging, directory listing, and many more.
Along with the Asterisk code, the only equipment needed to set up a small PBX is a PC with a Linux operating system, an analog or digital telephone, an inexpensive Digium TDM400P card with Foreign Exchange Station (FXS) or Foreign Exchange Office (FXO) modules, and an Internet connection. [Foreign Exchange allows the user to have a number that doesn’t originate from a local office. FXS supplies a ringing voltage to telephone lines, and FXO sends and receives phone calls through a central office switch.]
The Digium TDM400P card, starting at $125, can be used to connect to a conventional phone or phone line. Each card can terminate up to four telephones or telephone lines, or can service even more when used in conjunction with an IP telephone. A PC can hold several TDM400P cards, one in each PCI slot.
This Is Not Your Father’s PBX
While Asterisk started out as a Open Source Software implementation of a standard PBX (see the sidebar, “Necessity is the Mother of Asterisk”), it has grown into much more.
Necessity is the Mother of Asterisk A few years ago, Auburn University engineering student Mark Spencer set out to create a business to provide support to lost Linux users. However, he was faced with a crossroads when he discovered that he would need an expensive, proprietary, hardware-based PBX system to handle the telephone traffic that his customers generated. So, instead of shattering his company’s fragile bank account just to set up a small telephone network, he set out to build his own PBX using the most powerful tools he had at his disposal: his love of open source, Linux, and his knowledge of the C programming language. Within a short time, Spencer succeeded in building a functional, software-based PBX on a small sector of his own PC’s hard drive. He named it Asterisk — after the much-used UNIX “wildcard” character — to represent his then-lofty goal of having a single, all-inclusive open source telephony package to meet all needs. The initial version of the PBX could already handle the traffic that Spencer’s own business generated. Spencer soon realized, however, that the application he’d created to aid him in his quest to serve the Linux community was itself a service to the community. Spencer renamed the company “Digium,” shifting his focus into full-time maintenance and extension of the Asterisk application and the design of simple, yet effective hardware to complement the services Asterisk provides. |
For example, when you dial into Digium’s main telephone number (877-LINUX-ME), you’ll hear the default Asterisk IVR (in a surprisingly sultry voice) say…
Thank you for calling Digium — your Open Source telecommunications supplier. If you know your party’s extension, you may dial it at any time. Otherwise, press one for sales, two for technical support, three for customer service, four for accounting, nine for a company directory, or zero for an operator.
Dial an extension number to be transferred directly to the person you need to speak with. Or, press nine and enter the first three digits of your contact’s last name to be connected to that person, even if he or she is in a different city or country! The IVR can say whatever you’d like it to say, and can also access a database. All of these features are set up with a simple Asterisk configuration file.
The entire Asterisk application is licensed under the GPL with special exceptions for OpenH323 and G.729 code. New features are implemented weekly (if not daily) as needed, and bugs are eliminated by a team of “Bug Marshals” as they appear on Digium’s Bug Tracker web site (http://bugs.digium.com).
For individual users, Asterisk open source telephony lowers cost, frees customers from proprietary solutions, and eliminates upgrade costs. For service providers, Asterisk fulfills the needs of all kinds of businesses, and can be customized as much as needed.
Putting Asterisk to Work for You
“Asterisk is so open-ended. You can start solving immediate problems right away, yet it provides for easy, future development,” says John Harragin, of Monroe-Woodbury Schools in New York state (http://www.mw.k12.ny.us). “We’re a big school district, and we generate a lot of calls — about 220,000 this school year alone — and a lot of the calls we make are internal. Internal calls used to tie up two lines, but now that we have implemented Asterisk, we can free up all of the lines we were previously using for those calls.”
Monroe-Woodbury’s internal calls are now made using VoIP across the school’s WAN using Asterisk’s IAX protocol. “We did have a couple of PBXs and old key systems across a dozen buildings with different exchanges. A Centrex system would not have worked for us. Now, we are gradually replacing our old key systems with a few Asterisk servers. We can also use modern applications like voicemail, which was impossible before. We think Asterisk will end up saving the Monroe-Woodbury School System $10,000 per year. It’s already saving us half that.”
The key advantage to Asterisk is that it allows you to build a telephony solution that suits your organization’s needs. For instance, many businesses now need call centers to handle a high volume of calls. Aheeva, a Montreal, Quebec-based consulting service (http://www.aheeva.com), is one such company. They use Asterisk to manage the high volumes of traffic they generate at their 55-seat call center.
Aheeva has experience using several different solutions that cost millions of dollars, such as the Lucent Genesis PBX system and Nortel switches, and can see no advantage to those solutions versus Asterisk. Aheeva’s Asterisk-based call center now handles approximately 55,000 to 60,000 IP calls a day, all running through a single Digium PCI four-port T1/E1 card. Aheeva’s noticed no loss in voice quality, and has implemented a whole host of new applications unavailable to them in the past.
For example, Aheeva’s created many custom solutions: a video screen capture application based in Macromedia Flash that merges sound and video; a multi-lingual, VoiceXML text-to-speech application that reads text from documents, such as help files or web pages, to a caller; and an automated, speech recognition application that transcribes call center employees’ voice recordings into text and loads it into a database. The text can then be screened for certain (inappropriate) words.
“We immediately saw the potential in the Asterisk solution. We adopted Asterisk and got to know it very well,” says Georges Karam, CEO of Aheeva.
Vidanetwork (http://www.vidanetwork.com) is yet another company that’s benefitting greatly from Asterisk. Vidanetwork has developed a browser-based application that can easily be integrated with a credit card payment gateway. This application allows online users to sign up, buy minutes on a pre-paid calling card, make payments, or view their calling records on the Internet.
Vidanetwork has created both a high-end Asterisk-based application that can be deployed by service-providers, and a low-cost application suitable for small- and medium-sized businesses. Both of the applications Vidanetwork has developed can be controlled by a centralized network management system. This system can manage multiple Asterisk servers in a distributed network environment, and allows device status monitoring, user management, flat-rate billing, accounting, and backup and recovery tools.
Finally, WallStreet*E Online Brokerage (WSE, http://www.wallstreete.com) once had a problem that’s common among companies: making communication efficient and cost-effective between many locations scattered all over the world.
“We had old phone systems that were expensive to upgrade,” said Francisco Otalvaro, CEO of WallStreet*E. “We were increasing the number of brokers, and they were located all over the United States. We wanted to have our brokers and their clients access one centralized system — and one where interoffice communications could be done over our WAN or the Internet, saving us from the long-distance toll charges we were paying.”
To better serve its brokers, WSE decided that it needed to enhance its communications system. They chose to contact SipRack Systems, an Asterisk developer and Digium hardware reseller. SipRack Systems provides SIP VoIP network solutions using Asterisk. SipRack Systems created a telephone network for WSE using their pre-existing T1 connection. WSE can easily move, add, or change their IP phone set-up as easily as they can move a computer. After the company was interconnected over a WAN and the remote offices were directly connected to the headquarters over a T1 line, the company realized a 20 percent savings in network administration alone, in addition to the savings for features like voicemail and long distance tolls.
Setting Up Asterisk
To get your hands on the Asterisk code, you can either download the latest stable build, or, to stay current, go to Asterisk’s CVS repository.
To use CVS, set the CVSROOT and do a checkout.
# cd /usr/src # export CVSROOT=:pserver:anoncvs@cvs. digium.com:/usr/cvsroot # cvs login # cvs checkout zaptel libpri asterisk
When prompted for the CVS password, type anoncvs. After the server sends you all the latest and greatest Asterisk code, issue the following commands (as root) to build Asterisk and install it on your system:
# cd zaptel # make clean; make install # cd ../libpri # make clean; make install # cd ../asterisk # make clean; make install
Here, Zaptel is the hardware driver and Libpri is the library of ISDN PRI drivers for Zaptel.
The next thing to do is look at the .conf files in the Asterisk source code. Sample .conf files are included to help you and illustrate how common options are set up. For instance, logger. conf controls log files and log levels, and voicemail.conf configures voicemail mailboxes and general voicemail parameters.
The extension is a fundamental concept in Asterisk configurations. Extensions are defined as phone numbers or number patterns that can be included with a dial plan to control Asterisk. Groups of extensions are called contexts, and are available for you to configure Asterisk to implement a certain behavior on a group of extensions.
All telephone system extensions are defined in the Linux directory /etc/asterisk. Each extension is specified using a pattern, and several special, pre-defined extensions are provided by Asterisk.
Putting Asterisk to Work at the Office
Asterisk, of course, covers all of the typical telephony applications, such as giving you a dial tone when you pick up the phone, dialing with touch tones (or a rotary dial), and connecting your call. It also supports three-way calls, call waiting, call forwarding, and likely anything else your telephone service offers. But it also goes far beyond that.
* VOICEMAIL. Asterisk also offers advanced voicemail, including dial-in access, multiple message folders for each voicemail mailbox, customized messages for busy and away, and even web and email access to voicemail.
All of the voicemail features are easily managed using /etc/ asterisk/voicemail.conf. Different extensions can be sent to different voicemail boxes, hear different voicemail greetings, and so on.
For example, the following code configures a simple extension with voicemail:
exten => 600,1,Dial(Zap/9,15) exten => 600,2,Voicemail(u600) exten => 600,102,Voicemail(b600)
Now, if the number represented by Zap/9 is dialed, the phone rings for up to 15 seconds. If there’s no answer, the caller hears the extension’s voicemail greeting and is asked to leave a message. If the extension is in use, Asterisk plays a busy message instead of an unavailable message when sending the caller to voicemail.
* IVR MENU SYSTEM AND MUSIC ON HOLD. To help control the flow of telephone traffic and send callers to the person they need to talk to from one main number, many businesses now use an IVR menu system. IVR stands for Interactive Voice Response and the concept is something most people are familiar with: IVR presents a spoken menu that greets you when you call into a company number.
Extensive support for an IVR menu system is included with Asterisk. It can be used to present a company main menu and an employee directory to callers, and to handle voicemail prompts and menus. If the caller wishes to be transferred, Asterisk can play “on hold” music from a library of MP3s (or other sound files) to entertain the caller while waiting. Informative MP3s may also be played instead of music.
The IVR menu system is also highly extensible beyond these basic uses and has been used for applications like ordering prescriptions and movie tickets, and handling a pre-paid calling card account.
* NIGHT MODE IVR. Many businesses prefer to implement a separate IVR message to play after-hours. Asterisk can easily be configured to change to night mode at a certain time, like 5:30 pm. Instead of the usual menu, the IVR might recite the standard business hours and suggest that the caller call back during those hours, but can also allow the caller to go to the main menu and direct a voicemail message to a certain person.
* “MEET ME” CONFERENCING. Many business are now conducting meetings between several parties over the phone rather than in person. This is a huge convenience and Asterisk can be used to set up these call conferences. Multiple callers can meet in a virtual conference room and speak with all other members of the conference. An additional feature called “MeetMe Count” lets all the members of the meeting know how many are involved in the conference.
* CALLER ID AND CALL MANAGEMENT. Caller ID is a useful feature in any phone and takes a larger role in Asterisk through the configuration of extensions. Extensions can take caller ID information, pattern match it, and then determine who the person is, where they are calling from, and route the call accordingly.
Asterisk executes in software many of the functions that expensive hardware (like switches and routers) has traditionally implemented. This saves a small business an incredible amount of money that would have otherwise been spent on bulky, proprietary telephone systems.
The Asterisk architecture includes a series of channels for communicating with different protocols. These include Voice over Internet Protocol (VoIP) protocols, codecs, and signaling. PROTOCOLS * IAX. The native Asterisk protocol. It is simple, bandwidth efficient, and completely firewall friendly. * SIP. A popular protocol for IP phones. Asterisk can give it and take it. * H.323. The predecessor to SIP * MGCP. The Media Gateway Control Protocol, another VoIP signaling and control protocol * SCCP . The Cisco “Skinny” Protocol CODECS * G.711 �law (US) * G.711 alaw (Europe) * G.723.1(pass-through only without license) * G.726 * G.729 (requires a license unless using pass-through) * GSM * iLBC * Speex (limited to 8kHz mode) * LPC10 * Mp3 (decode only) * ADPCM * Linear SIGNALING * T1/E1 RBS (Robbed Bit Signaling) * ISDN PRI and PRA (Q.931) EuroISDN * NFAS * GR-303 * ADSI (for LCD screen phones; send text and simple graphics along with a phone call) * PSTN (Public Switched Telephone Network; the old-school copper-wire phone network, courtesy of Ma Bell. Includes Loopstart, Groundstart, FXO and FXS.) THE ASTERISK-NATIVE OPEN SOURCE IAX PROTOCOL Asterisk includes its own Open Source protocol, called IAX (for Inter-Asterisk Exchange). Digium makes an IAXy (a.k.a. S100I) device that operates independently of a computer or any software and can translate IAX protocol between an Ethernet line and an analog phone. |
Extending Asterisk: You Get What You Put Into It
Since Asterisk is open source software, it’s designed to be extensible and customizable, and the Asterisk Gateway Interface (AGI) makes that much easier to do. The AGI allows developers to write a script in any language to customize Asterisk without going modifying the core C code. Since Asterisk interacts with your script via STDIN and STDOUT, nearly any language can be used. Most Asterisk developers use either C, Perl, Python, or PHP, but any language that can handle STDIN and STDOUT may be used with the AGI.
The following code configures an AGI script to interact with Asterisk. The script’s function is to figure out which company employee a caller spoke with last and then route the call to the same employee.
exten => s,1,AGI(agi-lookup.agi) exten => s,2,Background(intro) exten => 100,1,AGI(agi-save.agi) exten => 100,2,Dial(Zap/9,15) exten => 100,3,Voicemail(u100) exten => 120,1,AGI(agi-save.agi) exten => 120,2,Dial(Zap/24,15) exten => 120,3,Voicemail(u101)
The incoming call is compared against a database file, linked to agi-lookup.agi. The script is then executed.
Digium’s line of PCI hardware was designed to unlock all of the power of Asterisk using a standard PC. Plus, it replaces much more expensive interface cords, gateways, switches, and routers from companies like Cisco, Intel, Dialogic, and Lucent, giving you full control of your telephone network while greatly reducing the price.
Some of the Digium cards include the TDM400P, a PCI interface with four phone ports that lets you mix and match FXS and FXO interfaces with up to four plug-in modules per PCI card; the IAXy, a compact stand-alone module that translates IAX protocol between your analog telephone and an IP network; and the TE405P/TE410P, which provides four E1 or T1 interfaces through your PCI slot.
The Future of Asterisk
Asterisk 1.0 is currently being readied for release and is very near completion. Commercial licenses are available (through Digium) for any developers who would like to implement features of Asterisk within non-GPL applications.
And, as Asterisk grows to be more robust, it attracts more and more users and developers. On September 22-24, 2004, the first annual AstriCon Asterisk User’s Conference (http://www.astricon.net) will take place in Atlanta, GA. The event is a combination of a tutorial session, a trade show, a user conference, and a developer summit. Mark Spencer, Asterisk’s creator, will be the keynote speaker. Many established Asterisk developers will also be speaking.
Twenty-five years ago the United States telephony market was dominated by a single, massive monopoly.
We’ve progressed a long way from those days, and Asterisk is already chipping away at proprietary vendors in much the same way Linux has eroded the commercial operating system market.
Imagine this: with your help, Asterisk could very well make all of telephony free within the next five years!
Underground Asterisk Applications Asterisk’s dial plans can allow you to set up interesting features. Here are just a few. THE TELE-TORTURE SYSTEM Hassled by a particular salesperson, IRS employee, creditor, or ex-girlfriend (or ex-boyfriend)? Asterisk can recognize these people and make their calls particularly unpleasant. Why not: * Play an IVR message that states “I’m sorry, but we are currently busy helping other telemarketers. Please hold indefinitely.” * Put them on hold and play your Backstreet Boys MP3 collection. * Treat them to a series of Jeff Foxworthy jokes. Then, if they’re still sane, give them a busy signal. Or, reroute their call to the nearest Amway representative. THE ANGRY EX-GIRLFRIEND EXTENSION The extension set-up above can easily be modified to take care of an obnoxious caller (be it male or female): exten => 600/2565552868,1,Congestion exten => 600,1,Dial(Zap/9,15) exten => 600,2,Voicemail(u600) exten => 600,102,Voicemail(b600) Now, if the caller at 256-555-2868 tries to call, her caller ID signal will match the pre-defined pattern and Asterisk will send her the “busy signal” (congestion tone). Other calls will be sent through the usual route. |
Rick Segrest is Marketing Manager for Digium, the company that created Asterisk. He also enjoys writing, graphic design, and programming. You can contact Rick at rsegrest@digium.com. Betsy Kervin is a Marketing Specialist for ADTRAN, Inc., a leading manufacturer of telecommunications and networking equipment.
No comments yet.