Chapter 1. A Telephony Revolution

We are what they grow beyond. That is the true burden of all masters.

Jedi Master Yoda

When we first set out in 2004 to write a book about Asterisk (15 years ago as of this edition!), we confidently predicted that Asterisk would fundamentally change the telecommunications industry. Today, the revolution we predicted is a part of history. Asterisk has been the most successful private branch exchange (PBX) in the world for several years now, and is an accepted technology within the telecommunications industry.

The revolution—as necessary as it was to the telecommunications industry of that time—has tailed off significantly simply because the methods by which people like to communicate have changed. Whereas 25 years ago phone calls were the preferred way to converse across distances, the current trend is to send messages or conduct video-chat conference calls. The phone call is seen as a bit of a dead thing, especially by up-and-coming generations. We’re not quite ready for a funeral just yet.

Asterisk remains a powerful technology, and we believe it is still one of the best hopes for any sort of sensible integration between telecom and all the other technologies businesses might want to interconnect with. It will need to find its place within a communications ecosystem that no longer places telephone calls in a place of importance. Our expectation is that WebRTC, which promises to commoditize web-based communications,1 will emerge as a replacement for all the copycat, closed, and proprietary “collaboration” products currently flooding (and confusing) the market. Asterisk can play a role in this new future, and the Asterisk community has willingly and enthusiastically taken on this new concept. So, maybe you’re being told that voice is dead, but anyone who’s paid attention to any science fiction of any kind knows that being able to talk to each other across long distances is not going to be the sole domain of those who type on keyboards. Humans like to talk, and we’ll continue to find ways to do so.

There also exists, it must be noted, a massive generation of people whose memories predate the internet, and for these folks the telephone is still a very useful technology. If one wishes to do business with them, one had better do a good job of handling telephone calls. These folks are retiring from the workforce, but their wallets still carry a lot of clout. Perhaps the PBX is a dying thing, but its tail is very long.

In this book, we’re going to explore the nuts and bolts of Asterisk. It is a flexible, open, standards-compliant toolkit, which we believe is still very relevant to businesses today, and will remain useful for many years to come. The power of Asterisk lies in its flexibility. It has proven to be very useful at tying various types of communications technologies together, and if it is to have any sort of future, it will need to continue to do so. Newer technologies such as WebRTC offer all sorts of possibilities for the future of communication, and the Asterisk community is very focused on this paradigm shift.

The remarkable flexibility of Asterisk comes with a price: it is not a simple system to learn or configure. This is not because it’s illogical, confusing, or cryptic; on the contrary, it is very sensible and practical. People’s eyes light up when they first see an Asterisk dialplan and begin to contemplate the possibilities. But when there are literally thousands of ways to achieve a result, the process naturally requires extra effort. Perhaps it can be compared to building a house: the components are relatively easy to understand, but a person contemplating such a task must either a) enlist competent help or b) develop the required skills through instruction, practice, and a good book on the subject.

Asterisk and VoIP: Bridging the Gap Between Traditional and Network Telephony

It sometimes seems that we’ve forgotten that the purpose of the telephone is to allow people to communicate. It is a simple goal, really, and it should be possible for us to make it happen in far more flexible and creative ways than are currently available to us. New technologies always seek to dominate the market with a proprietary offering. Few succeed. Communications technologies need to interoperate, and technologies such as Asterisk lower the barriers to entry for those wishing to innovate.

It is for this reason—communication—that we believe a future still exists for open source telephony projects such as Asterisk. Yes, people might not want to make “phone calls” anymore, but we believe there will still be value found in conversations. The technologies that can facilitate those conversations may evolve in seemingly radical ways, yet the underlying desire to communicate remains the same.

Asterisk is plugged into the future, and it has a long track record of successfully integrating communications technologies.

The Zapata Telephony Project

When the Asterisk project was started (in 1999), there were other open source telephony projects in existence. However, Asterisk, in combination with the Zapata Telephony Project, was able to provide public switched telephone network (PSTN) interfaces, which represented an important milestone in transitioning the software from something purely network-based to something more practical in the world of telecom at that time, which was PSTN-centric.

The Zapata Telephony Project was conceived of by Jim Dixon, a telecommunications consulting engineer who was inspired by the incredible advances in CPU speeds that the computer industry has now come to take for granted. Dixon’s belief was that far more economical telephony systems could be created if a card existed that had nothing more on it than the basic electronic components required to interface with a telephone circuit. Rather than having expensive components on the card, digital signal processing (DSP)2 would be handled in the CPU by software. While this would impose a tremendous load on the CPU, Dixon was certain that the low cost of CPUs relative to their performance made them far more attractive than expensive DSPs, and, more importantly, that this price/performance ratio would continue to improve as CPUs continued to increase in power.

Like so many visionaries, Dixon believed that many others would see this opportunity, and that he merely had to wait for someone else to create what to him was an obvious improvement. After a few years, he noticed that not only had no one created these cards, but also it seemed unlikely that anyone was ever going to. At that point it was clear that if he wanted a revolution, he was going to have to start it himself. And so the Zapata Telephony Project was born:

Since this concept was so revolutionary, and was certain to make a lot of waves in the industry, I decided on the Mexican revolutionary motif, and named the technology and organization after the famous Mexican revolutionary Emiliano Zapata. I decided to call the card the “tormenta” which, in Spanish, means “storm,” but contextually is usually used to imply a big storm, like a hurricane or such.

Perhaps we should be calling ourselves Asteristas. Regardless, we owe Jim Dixon a debt of thanks, partly for thinking this up and partly for seeing it through, but mostly for giving the results of his efforts to the open source community. As a result of Jim’s contribution, Asterisk’s PSTN engine came to be. And thanks to this marrying of VoIP and PSTN, the open source telecom revolution was born!

Over the years, the Zapata Telephony interface in Asterisk has been modified and improved. The Digium Asterisk Hardware Device Interface (DAHDI) telephony interface in use today is the offspring of Jim Dixon’s contribution.

Massive Change Requires Flexible Technology

Every PBX in existence suffers from shortcomings. No matter how fully featured it is, something will always be left out, because even the most feature-rich PBX will always fail to anticipate the creativity of the customer. A small group of users will desire an odd little feature that the design team either did not think of or could not justify the cost of building, and, since the system is closed, the users will not be able to build it themselves.

If the internet had been thusly hampered by regulation and commercial interests, it is doubtful that it would have gained the wide acceptance it currently enjoys. The openness of the internet meant that anyone could afford to get involved. So, everyone did. The tens of thousands of minds that collaborated on the creation of the internet delivered something that no corporation alone ever could have.3

As with many other open source projects (such as Linux and so much of the critical software running the internet), the development of Asterisk was fueled by the dreams of folks who knew that there had to be something more than what traditional industries were producing. These people knew that if one could take the best parts of various PBXs and separate them into interconnecting components—akin to a boxful of LEGO bricks—one could begin to conceive of things that would not survive a traditional corporate risk-analysis process.

Asterisk itself has become the basis of many massively productized creations. And yet, under the hood, the soul of that open source project still remains.

Asterisk: The Hacker’s PBX

Asterisk is the ultimate hacker’s PBX. The term hacker has, of course, been twisted by the mass media into meaning “malicious cracker” to the uneducated. This is unfortunate, because the term actually existed long before the media corrupted its meaning. Hackers built the networking engine that is the internet. Hackers built the Apple Macintosh and the Unix operating system. Hackers are also building your next telecom system. Yes, some of these folks are malicious, but the minds that steer the development of Asterisk are well aware of this, and you’ll find that Asterisk allows you to build a system that’s far more capable of rapidly responding to security threats. Open source software doesn’t hide its faults behind corporate spin departments. The dirt gets dragged out into the open where it can be dealt with. Rather than being constricted by the dubious and often poor security of closed systems, the Asterisk community quickly responds to changing trends in security, and you’ll be able to fine-tune your telephone system in response to both corporate policy and industry best practices.

Like other open source systems, Asterisk will be able to evolve into a far more secure platform than any proprietary system, not in spite of its hacker roots, but rather because of them.

Asterisk: The Professional’s PBX

Asterisk is an enabling technology, and as with Linux, it will become increasingly rare to find an enterprise that is not running some version of Asterisk, in some capacity, somewhere in the network, solving a problem as only Asterisk can. You’re already using Asterisk, even if you don’t know it.

The Asterisk Community

There’s no sense beating around the bush: the Asterisk community is a shadow of its former self. A dozen years ago, Asterisk was just about the coolest thing in open source. Today, most enthusiasts have moved on. What remains, however, is an experienced and battle-tested community of professionals, who have been there and done that.

Do not expect a team of people willing to work for free on your projects. The price of entry to this community is a personal commitment to skills development. If you bring a sense of entitlement to this community, you will not enjoy the responses. If, however, you bring curiosity and enthusiasm and a willingness to dive in, get your hands dirty, and do the work, you will find a community more than willing to share their hard-won knowledge with you.

The following are some of the places the Asterisk community hangs out.

Asterisk’s Discourse-Based Community Site

Asterisk moved its official forums to https://community.asterisk.org/ in 2015. This appears to be the most active community right now, and the signal-to-noise ratio is excellent. The Digium folks do a good job of moderating this, and several of their senior and experienced people are actively involved.

Bear in mind that this is not like paid support. You are expected to do the work yourself, but you can expect to get some good quality advice here, which can help to steer you in the right direction.

The Asterisk Mailing Lists

The activity on these lists has been reduced to a trickle (down from hundreds of messages per day to maybe a dozen threads per month). They are probably most useful as an historical archive, but may be worth searching through when you’re working on an intractable problem. Of the mailing lists you will find at lists.digium.com, these two are likely to be the most useful:

Asterisk-Users

This list is a shadow of its former self. Whereas it used to generate several hundred messages per day, most of this traffic has moved to Digium’s Asterisk Community site (above).

Asterisk-Dev

The Asterisk developers hang out here. The purpose and focus of this list is the discussion of developing the software that is Asterisk, and participants vigorously defend that purpose. Expect a lot of heat if you post anything to this list not specifically relating to the programming or development of the Asterisk code base. General coding questions (such as queries on interfacing with AGI or AMI) should be directed to the Asterisk-Users list.

Warning

The Asterisk-Dev list is not second-level support! If you scroll through the mailing list archives, you’ll see this is a strict rule. The Asterisk-Dev mailing list is about discussion of core Asterisk development, and questions about interfacing your external programs via AGI or AMI should be posted on the Asterisk-Users list.

Asterisk Wiki Sites

This isn’t really a community hangout, but it deserves a mention. Digium maintains a wiki for Asterisk at wiki.asterisk.org. This site is constantly kept up to date by the Digium team, and automated scripts export the XML-based documentation from the Asterisk source into the wiki itself, all of which helps to ensure that the data you’re reading is an accurate representation of the world.

An older wiki exists at www.voip-info.org, which is these days somewhat of an historical curiosity, and a source of much enlightenment and confusion. While there is a massive amount of information contained here, much of it is out of date. We include reference to it here simply because you’re likely to land on it one day and think you’ve hit the mother lode, but what you’ve actually found is more akin to a museum of historical oddities: fascinating, but not necessarily relevant.

The IRC Channels

The Asterisk community maintains Internet Relay Chat (IRC) channels on irc.freenode.net. The two most active channels are #asterisk and #asterisk-dev.4 To cut down on spambot intrusions, both of these channels require registration to join. To register, run /msg nickserv help when you connect to the service via your favorite IRC client.

Conclusion

So where to begin? Well, when it comes to Asterisk, there is far more to talk about than we can fit into one book. This book can only lay down the basics, but from this foundation you will be able to come to an understanding of the concept of Asterisk—and from that, who knows what you will build?

1 And more, perhaps, given that WebRTC is revolutionizing native apps too!

2 The term DSP also means digital signal processor, which is a device (usually a chip) that is capable of interpreting and modifying signals of various sorts. In a voice network, DSPs are primarily responsible for encoding, decoding, and transcoding audio information. This can require a lot of computational effort.

3 We realize that the technology of the internet formed out of government and academic institutions, but what we’re talking about here is not the technology of the internet so much as the cultural phenomenon of it, which exploded in the early ’90s.

4 The #asterisk-dev channel is for the discussion of changes to the underlying code base of Asterisk and is also not second-tier support. Discussions related to programming external applications that interface with Asterisk via AGI or AMI are meant to be in #asterisk.

Get Asterisk: The Definitive Guide, 5th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.