Chapter 4. Initial Configuration of Asterisk

I don’t always know what I’m talking about, but I know I’m right.

Muhammad Ali

Completing all the steps in Chapter 3 should have left you with a working Asterisk system. If it did not, please take the time to go back and review the steps, consult the wiki, engage the community, and get your system running.

Unfortunately, we cannot yet make any calls, because we have not yet created any channels. To get this plane to fly, we’re going to need some runways. While there are dozens of different channel types, and dozens of different ways to configure each type of channel, we just want to get some calls happening, so let’s try and keep things simple. We have decided to guide you through the configuration of four channels: a Foreign eXchange Office (FXO) channel, a Foreign eXchange Station (FXS) channel, a Session Initiation Protocol (SIP) channel, and an Inter-Asterisk eXchange (IAX) channel.[49] We selected these channel types because they are far and away the most popular channel types in use in small Asterisk systems, and one of the goals of this book is to keep things as simple as is reasonable. If we cover the basics of these channels, we will not have done an exhaustive survey of all channel types or topologies, but we will have created a base platform on which to develop your telecommunications system. Further scenarios and channel configuration details can be found in Appendix D.

Our first effort will be to explore the basic configuration of analog interfaces such as FXS and FXO ports with the use of a Digium TDM11B (which is an analog card with one FXS port and one FXO port).[50]

Next, we’ll tackle a few Voice over Internet Protocol (VoIP) interfaces: a local SIP and IAX2 channel connected to a softphone or hardphone, along with connecting two Asterisk boxes via these two popular protocols.

For SIP, we are going to cover Linksys, Polycom, Aastra, Grandstream, and Cisco sets. If we do not cover your phone model, we apologize, but what is important to realize is that while most of these devices have many different parameters that you can define, generally only a few parameters need to be defined in order to get the device to work. That will be our goal, because we figure it’s a lot less frustrating to tweak a functioning device than to get it perfectly set up on the first try. We won’t discuss all the features you may want your channel to have (such as caller ID or advanced codec and security settings), but you will be able to make and receive calls with your phone, which should put a smile on your face—a good state to be in as we dig deeper into things.

Once you’ve worked through this chapter, you will have a basic system consisting of many useful interfaces, which will provide the foundation we need to explore the extensions.conf file (discussed in detail in Chapter 5), where the dialplan is stored (technically, it contains the instructions Asterisk needs to build the dialplan). If you do not have access to the analog hardware, some of the examples will not be available to you, but you will still have configured a system suitable for a pure-VoIP environment.

What Do I Really Need?

The asterisk character (*) is used as a wildcard in many different applications. It is a good name for this PBX for many reasons, one of which is the enormous number of interface types to which Asterisk can connect. These include:

  • Analog interfaces, such as your telephone line and analog telephones

  • Digital circuits, such as T1 and E1 lines

  • VoIP protocols such as SIP and IAX[51]

Asterisk doesn’t need any specialized hardware—not even a sound card—even though it is common to expect a telephone system to physically connect to a voice network. There are many types of channel cards that allow you to connect your Asterisk to things like analog phones or PSTN circuits, but they are not essential to the functioning of Asterisk. On the user (or station) side of the system, you can choose from all kinds of softphones that are available for Windows, Linux, and other operating systems—or use almost any physical IP phone. That handles the telephone side of the system. On the carrier side, if you don’t connect directly to a circuit from your central office, you can still route your calls over the Internet using a VoIP service provider.



[49] Officially, the current version is IAX2, but since all support for IAX1 was dropped many years ago, whether you say “IAX” or “IAX2,” you are talking about the same version.

[50] This configuration used to be known as the Digium Dev-lite kit. For more information on FXS versus FXO, keep reading. Put simply, this card will give us one port to connect to a traditional analog line from the phone company (FXO), and one port to connect to an analog telephone (FXS), which is any type of phone that will work with a traditional home telephone circuit.

[51] …and H.323 and SCCP and MGCP and UNISTIM

Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.