Chapter 4. Initial Configuration of Asterisk

Table of Contents

What Do I Really Need?
Working with Interface Configuration Files
Setting Up the Dialplan for Some Test Calls
FXO and FXS Channels
Determining the FXO and FXS Ports on Your TDM400P
Configuring an FXO Channel for a PSTN Connection
Zaptel Hardware Configuration
Zapata Hardware Configuration
Dialplan Configuration
Dialing In
Configuring an FXS Channel for an Analog Telephone
Zaptel Hardware Configuration
Zapata Hardware Configuration
Dialplan Configuration
Configuring SIP Telephones
Basic SIP Telephone Configuration in Asterisk
Defining the SIP device in Asterisk
Configuring the Device Itself
Essential Server Components
DHCP server
FTP server
CounterPath’s X-Lite Softphone
Polycom’s IP 430
DHCP server
Protocol to use for downloading
The Polycom configuration files
Cisco 7960 Telephone
Linksys SPA-942
Logging in to the phone
Registering your phone to Asterisk
Configuring the Dialplan for Testing
Connecting to a SIP Service Provider
Connecting Two Asterisk Boxes Together via SIP
Configuring Our Asterisk Boxes
SIP Phone Configuration
Configuring the Dialplan
Configuring an IAX Softphone
Configuring the Channel Configuration File (iax.conf)
Configure the Softphone
Configuring the Dialplan for Testing
Connecting to an IAX Service Provider
Connecting Two Asterisk Boxes Together via IAX
Configuring Our Asterisk Boxes
IAX Phone Configuration
Configuring the Dialplan
Using Templates in Your Configuration Files
Connecting to the Console
Enabling Verbosity and Debugging

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, Installing Asterisk 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, Configuration Files.

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, Dialplan Basics), 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.

[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.