BUY THIS BOOK
Add to Cart

Print Book $39.95


Add to Cart

Print+PDF $51.94

Add to Cart

PDF $31.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £28.50

What is this?

Looking to Reprint or License this content?


Switching to VoIP
Switching to VoIP By Theodore Wallingford
June 2005
Pages: 502

Cover | Table of Contents | Colophon


Table of Contents

Chapter 1: Voice and Data: Two Separate Worlds?
Telephony is the communication of spoken information between two or more participants, by means of signals carried over electric wires or radio waves. Ever since Alexander Graham Bell invented the telephone circuit and first envisioned the public telephone system, consumers and businesses have relied on telephony as a staple of human interaction.
With the advent of Internet technologies and high-speed data connectivity in the enterprise, a new family of telephony technologies began taking hold. Voice over IP, or VoIP, has significant appeal for the enterprise, for service providers, and for end users, because it allows the Internet and commonplace data networks, like those at offices, factories, and campuses, to become carriers for voice calls, video conferencing, and other real-time media applications. VoIP-savvy organizations are discovering that they can apply the paradigm of distributed, software-based networking to voice applications and enable a new generation of telecommunications features, cost-savings, and productivity enhancements.
VoIP can replace business telephone systems, or it can add value to existing traditional telephony devices. For instance, long-distance connectivity between two offices with traditional telephone systems can often be accomplished with a lower cost per call when VoIP is employed.
VoIP network protocols can serve as a platform for other communication media like text messaging and video conferencing. In fact, you've probably used a flavor of VoIP for such an application by now; they've been popular as an Internet pastime for several years. Yahoo! offers a "party line"-style service that features Voice over IP chat rooms (http://chat.yahoo.com). Apple's iChat and Microsoft's NetMeeting applications also offer text, voice, and video calling delivered through VoIP protocols.
Dozens of standards define how Voice over IP works, but little documentation exists on best practices for implementing and maintaining the technology in the enterprise. There's not much introductory instruction for VoIP, so beginners may have a hard time taking their first steps with it. There have been several high-profile implementation failures among large enterprise adopters, and this may be why IP telephony has such an intimidating reputation.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
The PSTN
In 2004, there were close to 200 million traditional, landline telephones in use in the United States. The network that connects all these phones together wraps around the globe. The job of the PSTN (Public Switched Telephone Network) is to reliably facilitate telephone conversations at any time of day, year-round. The PSTN combines analog, digital, and electromechanical data links that strive to make sure that every time you pick up your phone receiver, you hear a dial-tone, and every time you're hungry, you can reliably dial up the local pizza parlor.
When designing a network that connects many phones (called endpoints in the world of telephony), there are two approaches: mesh networks and switched networks. In a mesh network design, every endpoint has a permanent connection to every other endpoint, so all can communicate with one another. The first experimental networks developed by telephone pioneers worked this way.
Meshes are not very practical, because once you add more than a few endpoints, the number of permanent links between endpoints becomes absurd. For example, in a mesh with 10 endpoints, 100 separate links have to be maintained. In a mesh with 100 endpoints, 10,000 links have to be maintained. It doesn't make much sense to maintain so many network links, because there's a better way: the switched network.
In switched networks, links between endpoints don't need to be permanent because they aren't needed constantly. The only time a link between two endpoints is needed is when a call is in progress between them; the rest of the time, the link is idle, unused. Switching is a method whereby links are established and removed as needed, eliminating the need for a mesh. The PSTN is a switched network.
The PSTN carries each phone call by setting up and tearing down a temporary link, usually an electrical circuit, between a caller and a callee. The links that carry the calls may be comprised of copper wires, fiber optics, or radio systems, depending on the network infrastructure that exists between the caller and callee.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Key Systems and PBXs
As the telephone became more important in the business world, innovators extended its capabilities and made it more convenient. They did so using enterprise telephony devices—gateways that connect privately owned phones together into a private voice network with self-managed calling features. When the enterprise gained ownership over its own voice network, it set about building telephony applications specific to its business.
One such device is a KTS, or key telephone system. In many small businesses, telephones can share a group of telephone company POTS lines through the use of a KTS. Each phone in a key system has direct access to one or more of the telephone company's lines, just as a simple residential phone has access to a single line. Unlike a single-line phone setup, KTSs allow a group of phones to use more than one telephone line at a time. This allows a single operator to place a call on hold while answering a call on another line, among other things, without using any phone company calling features. Generally, KTSs are not referred to as switches, because they rely upon the circuit-switching abilities of the central office in order to connect calls.
In many larger offices, telephones connect to a private, on-premises switch that interfaces with the telephone company's lines. This switch is called a PBX, or private branch exchange. PBXs are smaller, enterprise-friendly versions of the heavy-duty switches used by the telephone company, and they allow businesses to run their own telephony applications in-house. Unlike with a key system, PBX phones in the office can call other phones in the office without tying up an external telephone line. So several simultaneous conversations between parties in the same office can occur without making use of the PSTN at all. One job of the PBX is to determine how to "route" calls—that is, how to ascertain whether the calling party is trying to reach another person within the same office or trying to reach somebody via the PSTN. Most PBX vendors refer to the call-routing scheme as the
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Limits of Traditional Telephony
The PSTN's capabilities are largely proportional to its physical connections, because every call must have a circuit, or loop, set up at the beginning of the call and torn down at the end. While the PSTN's switching equipment does a great job of this, some hard limitations are associated with its "circuit-switched" nature.
New features can take a while for the phone company to roll out. It took many years to upgrade central office switches to support features like call-waiting and three-way calling. Even now, some parts of the PSTN still don't support caller ID.
Capacity limits are another engineering challenge on traditional telephony networks. The fidelity of a call's sound reproduction is limited to the available bandwidth between the caller and the recipient, and the maximum number of calls between two offices is limited to the availability of voice circuits that exist between them. The problem posed to the enterprise is one of cost: every PSTN circuit used by the enterprise, be it a POTS line or a T1, adds to its telecommunications expenses.
The telephone companies and phone equipment vendors have made great strides to identify and resolve capacity and cost problems. High-density digital circuits like T1s and T3s have brought the cost of high-density telephony down, and PBX features such as least cost routing (LCR) allow the enterprise to minimize its long-distance calling expenditures. Long-distance calling has become cheaper, and the cost of on-premises PBX equipment and feature-rich business telephones has dropped over time, too.
At one time, telephony features were considered a competitive advantage. As businesses adopted them, they became part of the cost of doing business, and users began seeking a new telephony paradigm—one that could inspire big competitive advances again. The question the telecom industry sought to answer was, "Where do we go from here?"
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
VoIP in the Home
A number of companies offer VoIP calling services that can be used in the home, more or less replacing conventional PSTN service. They deliver telephone calling capabilities using a broadband Internet connection. Not all of them permit placing calls to or receiving calls from the PSTN, but almost all allow you to call other users of the same service using the Internet instead of the PSTN. Some providers even have "peering" arrangements that allow you to call subscribers to other providers' services using the Internet.
Some of these services work only with proprietary telephone-calling software and don't allow you to use a hardphone. Certain providers can support the use of a special hardphone that connects to your PC's USB port and uses the PC as a gateway mechanism for accessing the network. Others provide an ATA device so that you can use one or more analog phones to place and receive calls using the service. Still others offer the ability to use IP phones.
Many of these services offer competitive calling rates, decent sound quality, and features that are close to that of the traditional phone company. There are solutions for adding more features and interesting hacks to a home-based VoIP network, too. Some of them are covered in this book.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
VoIP in Business
Many vendors are producing cost-effective VoIP server devices for small Ethernet LANs. These devices connect together endpoints in a small office like a PBX, either through the use of conventional analog and digital phones (more on this later) or new-generation IP phones. In either case, connecting calls to the PSTN and between local phones is usually the responsibility of these server devices—like a PBX or KTS—and there are several ways to make that PSTN connection.
Using VoIP in small business environments is easier when there's some network savvy around the office. Some traditional phone vendors are now implementing VoIP systems, so the availability of third-party networking expertise is accelerating the adoption of VoIP in small businesses.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
VoIP's Changing Reputation
There are potential pitfalls along the path to Voice over IP. Implementing VoIP is like any infrastructural investment—it has hard costs and implications for the enterprise user community. How you deal with these costs and social issues is largely defined by how much VoIP you implement at a time. That's why the concept of migrating is important.
Challenges also arise from using a relatively young technology for a task that has been reliably delivered "the old way" for decades. If the data network hosting the VoIP system isn't provisioned correctly, the results can be disastrous. Security, stability, and call quality in a VoIP system are all tied to their counterparts on the underlying data network. If your network is insecure, unstable, or lossy, your IP-based voice system will be, too.
A leading cause of failed VoIP implementations is poor perceived call quality, which usually stems from administrator misunderstanding of VoIP's requirements. VoIP is more than just call management and voice conversations; it is also a comprehensive set of methods to deal with quality of service. Lack of attention to these aspects of VoIP will doom even the most well-intentioned implementer.
These issues have contributed to IP telephony's reputation as difficult to manage, inferior in quality, and even damaging to corporate image. These perceptions can be avoided, and the opposite outcomes achieved, if VoIP is done right.
This book will help you implement and understand VoIP networking, call management, telephony features, and call accounting within the context of an enterprise data network. Along the way, you'll build a useful, real-world call-management system, a voice mail server, and more. You'll employ next-generation VoIP hardware and software, use open source telephony tools, and leverage traditional telephony components. You'll even be able to use that old residential-style analog phone for VoIP calls across the Internet.
You'll understand the differences between old-school and next-generation telephony and be able to implement a software-based PBX, maximize quality of service, and know many of the standards that govern the world of converged networks. You'll be able to identify situations in which traditional telephony can be integrated with IP telephony, and you'll learn how to provision emergency calling services that have always relied on the public telephone system. This way, your switch to VoIP will be a success.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Key Issues: Voice and Data: Two Separate Worlds
  • The PSTN developed as a result of early telephony pioneers' efforts at building meshed and switched networks.
  • SS7 is the switch-to-switch signaling network using to connect and bill calls placed across the PSTN.
  • POTS, or plain old telephone service, is the basic single-line analog voice service from a phone company.
  • Key systems and PBXs provide businesses a way of operating their own feature-rich voice networks at a lower cost than dealing only with PSTN-provided services.
  • Lines and trunks are links between telephony devices. A line is a link from a switch to a phone. A trunk is a link from a switch to a switch.
  • Voice over IP encompasses a large family of interface technologies, protocols, and standards that enable real-time media applications using IP networks.
  • Traditional telephony isn't scalable like VoIP because it isn't software-driven like VoIP. Its ratio of calling capacity to network infrastructure is fixed, while VoIP's has lots of room for optimization.
  • VoIP is suitable for deployment in homes and businesses, and, thanks to broadband and deregulation, is earning a reputation as a more practical way of delivering telephony services.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 2: Voice over Data: Many Conversations, One Network
Conversations are the basis of human communication. Conversations can be spoken, written, or gestured. Conversations can even be one directional, such as a coach bawling out his star quarterback after an uncharacteristic interception. Conversations may be "one-to-many" (such as a political candidate giving a stump speech) or "many-to-one" (such as a constituency lobbying that candidate after she's in office). Conversations are more than just an analogy for networks—they literally are modern networking.
The underpinnings of enterprise networks are also conversations. IP data networks run on protocols that use a conversational approach to data exchange. The most common protocols for web browsing (HTTP) and email (SMTP) use a two-way "data conversation" in order to communicate. The process is simple: a client host sends an inquiry to a server host or a peer host, and then the server or peer sends a response back to the client.
Conversations between hosts on an Internet Protocol (IP) network are similar to those between people, except that instead of using words, the messages are communicated across the networks using units called datagrams. A datagram is like a letter in an envelope. Once it has the proper markings, namely the recipient's address and return address, and a stamp, the entire letter can be delivered by the postal service. A datagram's markings are called headers , and they contain delivery information, like postal letters: instead of postal addresses, datagrams use something called host addresses . Different networking technologies have different names for datagrams, including cells, frames, and packets. Having a good understanding of IP networks is crucial to your success with Voice over IP. An excellent reference on the subject is TCP/IP Network Administration (O'Reilly).
When voice sounds are transmitted using datagrams on the IP network, telephony gains all the same characteristics as the data network itself. Just like applications for file sharing and printing via the network, software can be made to perform useful tasks using the datagrams of voice streams and signals—tasks like conference calling and voice mail. These tasks are the
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
VoIP or IP Telephony
Are "VoIP" and "IP telephony" two different technologies, or do they both describe the same thing? Well, it really depends on whom you ask. Some vendors prefer IP telephony when referring to their IP-based voice offerings, arguing that VoIP refers to the specific act of transmitting digitized sound data on an IP network and IP telephony refers to the overall technology family. Others give VoIP the broader definition, identifying it as inclusive of IP telephony, and referring to IP telephony only as the act of mimicking traditional telephony applications.
For the purposes of this book, we'll take the latter tack: VoIP refers to the overall technology family, while IP telephony means specific application functions such as call signaling and voice mail. So when we talk about conference calling, we might call it telephony, but when we talk about conference calling, call-waiting, and voice encoding, we will refer to them collectively as VoIP. In general conversation, though, VoIP and IP telephony can be used interchangeably.
VoIP certainly has a few disadvantages when compared to old-school phone hardware. High-utilization service guarantees are harder to deliver with VoIP than with an old-fashioned PBX. The same scalability characteristics that attract people to VoIP can ultimately be the reasons their implementations fail: a VoIP network can be so extensible that service-level guarantees are hard to make, whereas a traditional circuit-switched voice network has hard capacity limits, around which levels of service tolerance can be guaranteed easily. Certain broadcast audio applications, like overhead paging, can be difficult with VoIP, too.
The gains VoIP brings to the table far exceed the few difficulties it imposes, though. There's nothing that old PBX can do that a VoIP telephony system can't, even if VoIP makes a few things tougher.
One thing VoIP makes easier is physical provisioning. While a PBX requires a network of electrical, usually copper wire, loops, VoIP requires an IP network. Since IP networks are a staple of every modern business, the logistics of building a network for voice is largely simplified because the required physical elements are already in place for other common business applications: databases, messaging, Internet access, and so on. VoIP is carried on the network the same way those are.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Distributed Versus Mainframe
In the world of traditional telephony, endpoints and PBXs interact in a manner similar to dumb terminals and mainframe computers. That is, the PBX (or mainframe) has all of the application functionality built in, and the user interface functions of the endpoints (or terminals) are dictated by the PBX.
With IP telephony, voice endpoints are far more programmable, lessening the requirement for centralization. VoIP endpoints don't always have their functions dictated by a particular VoIP server. In fact, VoIP endpoints may interact with many services on many different physical servers: DNS, LDAP, SIP, and RTP are all VoIP-related application protocols that may be facilitated by separate servers or by no servers at all (some operate between two endpoints and don't require a server in between). The IP-to-IP call placed in Project 2.2 is a good example of that.
Compared to a traditional telephone call, which must always be routed through a telephone switch such as a PBX, this is a significant difference. A traditional telephone call is set up, torn down, and accounted for using the same piece of hardware—the PBX. Moreover, the sounds of the conversation are routed through the PBX, because the PBX is the circuit-switching mechanism that provides the voice loop between caller and receiver. This is illustrated in Figure 2-6.
But in a VoIP network, the call-management functions are separated much more from the voice transmission functions. This allows each function to be enabled through separate network resources, as shown in Figure 2-7. Call management could occur over a wide area link, while the voice transmission could occur directly between two endpoints on the same local area link, in order to preserve capacity on the wide area link. The net result is that a single, powerful call-management server could work on behalf of many remote sites, increasing the value of the WAN and possibly saving money that might ordinarily be spent on remote PBX systems to support each site.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Key Issues: Voice over Data: Many Conversations, One Network
  • VoIP can replace traditional telephony, but quality-of-service measures are required in order to make it as reliable as old-school gear.
  • The OSI network model breaks down VoIP in terms of layers. The networking aspects run at the lower layers, and the application aspects run at the higher layers.
  • VoIP media streams are delivered by connectionless UDP datagrams, and not TCP packets. This is because, in telephony and other real-time media applications, there's no point in error correction. VoIP administrators would rather strive for full error abatement. This means designing an IP network to carry voice, not just data.
  • Most IP phones allow simple calls to be made directly to each other, dialed by IP address, without the need for a VoIP PBX server as an intermediary. The job of the server, among other things, is to provide a human-friendly addressing scheme and other features that the phones alone can't provide.
  • Traditional telephony networking is characterized by client/server or mainframe-like tendencies. VoIP networks are characterized by distributed or fat-client tendencies.
  • Most IP endpoints sit at the proverbial "edge" of the network, where PCs and printers also reside.
  • Pure IP voice systems don't use any legacy interfacing or protocols—such as POTS or T1. Rather, they support only VoIP protocols and offload the media conversion required for such interfacing to other devices.
  • IP-enabled, or hybrid IP, voice systems offer server-based interfacing for legacy links while also providing VoIP signaling, usually in one server chassis.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 3: Linux as a PBX
Evaluating VoIP for enterprise or for your home phone setup means a lot of experimentation, and you'll need to build a test server with which to hone your VoIP skills. That test server should be something you can get a lot out of without spending a bundle or committing to a specific vendor's commercial VoIP platform before you've done your homework. Free telephony software lets you do that homework.
If you were learning engine repair instead of VoIP, you probably wouldn't use a Ferrari for your experiments. You would want something more forgiving and easier to work on, like a nice Dodge Omni. Luckily, there's Asterisk PBX software—the very open, roomy-under-the-hood telephony server. Like a Dodge Omni, Asterisk is easy to work on, support is a snap to find, and experimenting is cheap. In fact, Asterisk is free (although its development is supported by Digium, Inc., http.//www.digium.com). So is its source code.
But like a Ferrari, Asterisk is very powerful. Asterisk supports several Voice over IP communication protocols: H.323, SIP, IAX, and others (see Chapter 7 for more on these). Using these protocols, it can support just about any IP telephone, as well as traditional analog and digital telephones. Asterisk has some industrial-strength features like call-queuing, conference calling, voice mail, and caller ID.
Using Asterisk, you can build something as simple as an answering machine that sends its recorded messages to your email address (as we'll do in Chapter 14) or something as sophisticated as a thousand-subscriber corporate communications system with least-cost call routing and advanced call accounting.
Not all PBX solutions bring such a wealth of features. By definition, a PBX is just a private call-routing exchange. In traditional telephony, advanced features such as voice mail and autoattendant are often provided by separate, outboard devices. Figure 3-1 shows a summary of Asterisk's functions.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Free Telephony Software
If you were learning engine repair instead of VoIP, you probably wouldn't use a Ferrari for your experiments. You would want something more forgiving and easier to work on, like a nice Dodge Omni. Luckily, there's Asterisk PBX software—the very open, roomy-under-the-hood telephony server. Like a Dodge Omni, Asterisk is easy to work on, support is a snap to find, and experimenting is cheap. In fact, Asterisk is free (although its development is supported by Digium, Inc., http.//www.digium.com). So is its source code.
But like a Ferrari, Asterisk is very powerful. Asterisk supports several Voice over IP communication protocols: H.323, SIP, IAX, and others (see Chapter 7 for more on these). Using these protocols, it can support just about any IP telephone, as well as traditional analog and digital telephones. Asterisk has some industrial-strength features like call-queuing, conference calling, voice mail, and caller ID.
Using Asterisk, you can build something as simple as an answering machine that sends its recorded messages to your email address (as we'll do in Chapter 14) or something as sophisticated as a thousand-subscriber corporate communications system with least-cost call routing and advanced call accounting.
Not all PBX solutions bring such a wealth of features. By definition, a PBX is just a private call-routing exchange. In traditional telephony, advanced features such as voice mail and autoattendant are often provided by separate, outboard devices. Figure 3-1 shows a summary of Asterisk's functions.
Figure 3-1: The functions of the Asterisk PBX software
With Asterisk and other freely available tools, you can build all kinds of telephony applications. The included Asterisk Gateway Interface allows you to develop computer-aided telephony tools using PHP, Perl, Java, or C, and the Asterisk Management API allows you to build socket-based monitoring and automation applications for your PBX. To bind telephony applications to data, Asterisk has a built-in database that is similar to the Windows registry.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installing Legacy Interface Cards
Using PCI interface cards and USB devices from Digium, VoiceTronix, Quicknet, and others, Asterisk can communicate with POTS, FXO/FXS, and T1/E1 phone lines:
  • Standard analog telephones (Quicknet Internet PhoneJack, Digium TDM400P, VoiceTronix OpenSwitch)
  • Regular analog telephone lines (POTS) from the phone company (Digium X100P and TDM400P VoiceTronix OpenLine)
  • T1 and E1 telephone lines from the phone company (Digium T100P, E100P, TE405P, and TE410P)
Many of the examples in this book use IP telephones, which communicate with the Asterisk server using Ethernet and therefore don't need specialized interface hardware to access the PBX. A legacy interface card is not required in order to use Asterisk for VoIP—in fact, VoIP can supplant all traditional telephony technologies. But since the PSTN will be here for years to come, analog trunks and phones are still important complements to VoIP. Since most phone companies don't yet offer dialtone trunks over IP, you'll need a legacy interface to connect your Asterisk server to the phone company.
Most of the examples in this book use a single analog telephone line (POTS line) to access the telephone company. In order to use this line, your Asterisk server will need to be equipped with a Digium X100P analog trunk interface card, which provides a connector to plug in a single telephone company line.
Just prior to publication of this book, Digium discontinued the X100P card. However a TDM400P card with a single FXO interface will work exactly the same in the examples contained here. The TDM400P is described later. If you'd prefer the X100P, an eBay search yielded dozens of X100P cards available from other sources.

Section 3.2.1.1: The POTS pass-through connector

The X100P card has a second connector, a pass-through that you can connect an analog telephone to. You can't use this telephone with the Asterisk system, but when it's connected to the second interface, you can use it to tell whether the phone line connected to the Asterisk system is active with a phone company dial-tone. The setup of a basic VoIP-enabled telephony network is shown in Figure 3-2.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Compiling and Installing Asterisk
RPM packages are available to simplify Asterisk's installation, but manual compiling is relatively easy. So we are going to download, compile, and install Asterisk the old-fashioned way. Real performance mechanics prefer a manual transmission over an automatic for better command and control, after all.
The development branch you'll download from is stable—though once you get comfortable with Asterisk, you'll want to jump out on the bleeding edge and try the developer releases, too. Each release tends to introduce something new and worthwhile, even if it's not in the stable branch yet.
The easiest place to download the Asterisk software is the CVS repository at Digium, the company responsible for Asterisk and the hardware components that work with it. To access the CVS repository, you'll need to be logged into your Linux computer at a shell prompt as root. Type these commands to run the CVS checkout routine and download the source code:
    # cd /usr/src
    # export CVSROOT=:pserver:anoncvs@cvs.digium.com:/usr/cvsroot
    # cvs login
    # cvs checkout zaptel libpri asterisk
         
Alternatively, you can specify a particular version of Asterisk:
    # cvs checkout -r v1-0 asterisk
         
When prompted, use "anoncvs" as a password. If your Linux distribution doesn't use /usr/src, then substitute the source path that's appropriate. The CVS client you're running here will create the /usr/src/asterisk directory that contains all the Asterisk source code. Once the download completes, you are ready to begin compiling.
Asterisk consists of several software components for Linux. These packages are not all required, as some of them are drivers for Digium's interface cards. If you aren't planning to use Digium's card, you'll need to build only the last of the three, "Asterisk":
LIBPRI
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Monitoring Asterisk
There are several ways to monitor Asterisk. Most notably, the Asterisk CLI console application (asterisk -r) offers a real-time console log. When you launched Asterisk with the -v option, this was enabled. The more v's, the more detail goes into the console log. The same is true of the logfiles that Asterisk puts out.

Section 3.4.1.1: Asterisk's logfiles

In addition to standard output and standard error, which you can redirect using the shell, Asterisk has some important logfiles. They are stored in /var/log/asterisk by default. If you want them to be stored elsewhere, edit /etc/asterisk.conf as such. The three ASCII logfiles enabled upon installation are:
event_log
Stores Asterisk system events, when triggered according to the Asterisk configuration
messages
Stores debugging, error, and warning messages generated by most Asterisk modules
cdr-csv
Stores the Call Detail Record, or CDR, which records the channels, actions, and durations of each call placed through the softPBX
Chapter 10 covers Asterisk's logfiles in much greater detail.

Section 3.4.1.2: Astman

The Asterisk Manager is a text-based socket API that allows management applications to monitor and control the Asterisk server. One such application is Astman, which is included in the Asterisk distribution. Astman allows you to watch a list of calls in progress and allows you to redirect calls and disconnect them.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Key Issues: Linux as a PBX
  • Asterisk is an open source PBX in software that runs on Linux, BSD, and Mac OS X. It's a great test environment for evaluating VoIP; it's also a solid solution for production systems
  • Because Asterisk was written in C on Linux from the ground up, with many POSIX conventions at its heart, a duty-ready version of Asterisk for Windows doesn't exist.
  • Digium, Quicknet, and others make interface cards that allow Linux softPBX servers to connect to the PSTN using POTS and T1/E1 lines
  • The Asterisk CLI is an administrative interface that allows programming of extensions and monitoring of system activity
  • The Asterisk Management socket API allows the Astman application to monitor calls in progress on an Asterisk softPBX. It's also possible to use the API to build your own applications
  • Asterisk, like many softPBX systems, refers to each leg of a voice call as a channel
  • Asterisk is commercially maintained by Digium, Inc., and supported by Digium and other consulting firms
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 4: Circuit-Switched Telephony
Conventional telephone networks, whether public (PSTN) or private, bear several things in common. First, the phones used to make calls across them almost always use one- or two-pair physical connections. Second, the call-management device nearest the end user, be it a key system or a PBX, usually provides a dedicated, single-purpose circuit for each phone. The voice applications delivered by legacy systems are rigidly tied to the lower layers of the network. For instance, you can't get plain old telephone service from a cable company or a satellite provider because they can't provision copper telephone lines to your premises. Finally, the capacity of the data links used to carry traditional telephone calls rarely increases over time. It remains fixed, forever tied to the quantity of cable pathways between one point and the next.
These traits are common among legacy voice setups, whether they consist of heavy-duty TDM-bus PBX systems or just a few analog phones connected to the PSTN. Incidentally, VoIP doesn't exhibit these traits, but since your transition to VoIP may be incremental, it's important to understand the "goods and bads" of traditional circuit-switched telephony.
The organization of the telephone network is a complex international affair. If you're dealing with telephony of anything deeper than a superficial level, you need to understand the players.
In the United States, the public telephone system falls under each state's regulatory jurisdiction. This means that, while the FCC sets the rules for interstate service, it's up to the individual states' communications agencies to enforce and further define local service standards for the PSTN (see Figure 4-1).
Figure 4-1: There are several kinds of network carriers on the PSTN
The FCC communicates with these bodies in order to make sure that the PSTN serves the public interest and is beneficial to consumers, while allowing an atmosphere of economic growth that is conducive to the involvement of private business. Though the PSTN's technologies are governed by the ITU, an international body, state governments and the FCC maintain lawful use of the PSTN in the U.S.A.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Regulation and Organization of the PSTN
The organization of the telephone network is a complex international affair. If you're dealing with telephony of anything deeper than a superficial level, you need to understand the players.
In the United States, the public telephone system falls under each state's regulatory jurisdiction. This means that, while the FCC sets the rules for interstate service, it's up to the individual states' communications agencies to enforce and further define local service standards for the PSTN (see Figure 4-1).
Figure 4-1: There are several kinds of network carriers on the PSTN
The FCC communicates with these bodies in order to make sure that the PSTN serves the public interest and is beneficial to consumers, while allowing an atmosphere of economic growth that is conducive to the involvement of private business. Though the PSTN's technologies are governed by the ITU, an international body, state governments and the FCC maintain lawful use of the PSTN in the U.S.A.
The ITU-T (Telecommunications Standardization Sector) is the ITU's working group charged with governance of global standards for telephony practices and protocols. The ITU-T publishes recommendations that dictate the technologies used in public and private telephony. While the ITU-T has published some packet-based recommendations, like H.323, the majority of its work has focused on legacy, circuit-switched telephony networking. Its standards are categorized into groups by function. Each group is abbreviated using a letter. Here are the most relevant ones:
E
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Components of the PSTN
The Public Switched Telephone Network and its signaling counterpart, SS7, connect, monitor, bill, and disconnect calls. At the edge of the PSTN are large, mainframe-like switches call exchanges, or central offices (COs). The role of each CO switch is to connect calls between channels on that switch and, when necessary, to connect calls to channels on other switches in the PSTN.
Calls travel along temporary pathways through the voice network. Though temporary, these pathways are end-to-end circuits, the root of the catchall moniker for legacy call management: circuit switching.
The CO is the building where the local exchange switch resides. A CO's switch may serve telephone service subscribers in a very narrow geographic area—such as a single large building. Or the CO's switch may serve subscribers for miles around. The CO's scope of service depends on the density of subscribers in its neighborhood and on the capacity of the switch it houses. As with many electronic services, capacity and efficiency have increased over time, so late-model CO switches are generally able to provide more channels and greater utilization ceilings than older ones.
Conventionally, you can tell which central office subscribers belong to by looking at the first three digits of their seven-digit telephone number. This three-digit section is called the prefix. One prefix is usually set aside for one central office, or for groups of small, geographically close COs. This tradition is disappearing, however. Newer signaling protocols and networking standards have made the relationship between the CO and the prefix less of a requirement and more of a historical artifact.
Distribution frames surround the CO. They are high-density cross-connection points where multiple subscribers' loops are tapped into the feed cables (that is, 50 to 800 pairs in a single cable) supplied by the CO. Usually, all connections to a distribution frame are copper. Distribution frames allow the telephone company to use high-density copper cabling that is less susceptible to breakage to feed groups of subscribers on the edge with a connection to the CO.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Customer Premises Equipment
Any equipment installed by the telephone company for use in terminating voice calls or other connections is called customer premises equipment (CPE). In most small offices, CPE isn't used, and the occupant just plugs in a conventional analog phone or two. But in situations in which the telephone company itself manages the customer's PBX or manages a private voice trunk on the customer's behalf, then the PBX is called CPE. The softPBX described in Chapter 3 would be considered CPE if it were managed by the telephone company.
When you hear somebody refer to a switch that resides on the customer premises, that usually means a PBX or a KSU. See Chapter 1 for a refresher on PBXs and KSUs if needed.
The Demarc, or demarcation point, is the point at which telephone company-owned facilities terminate. Usually a cross-connection point or wiring terminal near the exterior of a building or outside it, the demarc is where the phone company's wiring connects to privately owned facilities. Typically, the demarc is where the phone company's troubleshooting stops, as well.
Inside wiring is the privately owned network of communications cabling and wiring terminals located on the customer side of the demarc. Inside wiring could be simple, two-pair wiring that connects a bunch of four-pin phone jacks (as in a house), or it could be a centralized distribution of cabling throughout the building—also called the cable plant .
Any telephone equipment or data networking equipment that exists on the customer's side of the demarc and is maintained by the telephone company is called customer premises equipment (CPE).
Customer premises distribution frames are cross-connect blocks, terminals, or patch panels where endpoint locations are aggregated and centralized. Like the PSTN equivalent, CP distribution frames make it easier to move connections from one tenant to another in the same building or from one desk to another in the same office. These frames are most often used with twisted-pair cabling of Cat3 or Cat5 grades.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Time Division Multiplexing
Traditional PBX systems use a digital bus to carry sound information between interfaces where phones and/or trunks are connected. The signals flowing across this bus are digitized audio that travel in an aggregate form—that is, one bus can carry many separate signals within a single bit stream. The transmission technique is called time division multiplexing (TDM). To understand how all modern telephony solutions work, including VoIP, a basic understanding of TDM is important.
Multiplexing means combining many signals onto a single transport mechanism, such as a T1 or a PBX bus. This bus can be a connection between two points—like a point-to-point T1 circuit, or it can be a large group of digital phones, like a PBX's bus.
Time division is the method of combining, and later dividing, the signals, with the purpose of yielding greater efficiency over the data link, be it a T1 circuit or a PBX backplane. Each signal is given a time slice, a small piece of the total bandwidth of the bus. At a very high rate, a TDM bus transmits a fixed sequence of time slices that are equal in duration. Each time slice contains a digitally sampled representation of the original analog waveform signal.
Each endpoint pulls a particular time slice out of the aggregate TDM bit stream and reassembles it, in real time, into a single cohesive digital signal. Each piece of the time slice used to reassemble that single signal is called a frame, just as pieces of the bit stream on an Ethernet data link or T1 are called frames.
A sampling rate of about 8 KHz is sufficient to adequately record the human voice using analog instruments. When analog sound information is recorded at this rate, its amplitude, or power, is sampled 8,000 times per second. This is only the first step in putting the sound into digital format. It's still analog, because it is still measured on a scale with infinite, analog resolution. Imagine the sampled sound levels are 8,000 points on a line graph. Now draw curves to connect them. This is an analog waveform signal (see Figure 4-7).
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Point-to-Point Trunking
Besides the trunks that supply a PBX with a dial-tone from the telephone company CO, it is common to have trunk connections between multiple PBXs. These types of connections, which are often high-density copper cables if the PBXs are within a few hundred meters, are called point-to-point trunks or private trunks . Often, these trunks are established in order to forego the PSTN, and any associated fees, for calls between disparate business locations, as in Figure 4-9.
Most PSTN traditionalists insist that only one-pair analog phone lines that link two switches can be called trunks. But, as networks have progressed, so has the definition of trunk. Trunks can be T1s or radio links; what makes them trunks is that they connect two switches. Even in Ethernet switches, ports that connect VLAN data (more on this in Chapter 9) between two locations are called trunk ports .
Figure 4-9: A private trunk connects two switches on the same private voice network
When privately owned cable can't be run between locations due to excessive distance, telco-owned facilities, like T1s, T3s, or wireless solutions can be used for private trunking. BRI-ISDN is often used for low-density switch-to-switch trunking across relatively short distances, but its high cost is a discouraging factor. BRI-ISDN allows two voice calls to be carried at once.
T1 circuits are far more abundant than BRI-ISDN in trunking situations, because they offer 12 times the capacity. Even though the cabling used to carry the T1 circuit is the phone company's property, and the phone company charges a fee for the use of that pathway, the T1 circuit used to connect two switches can still be called a private trunk because the voice calls it carries are not considered PSTN traffic.
The ITU's recommendation for T1 technology describes both the transport and data link layers. The physical layer for a T1 circuit tends to be two pairs of copper wiring. The phone company may connect the T1 through its local access transport areas (LATAs) using fiber, but the part of the circuit that connects to the customers' locations is almost always copper.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Legacy Endpoints
In conventional telephony, every endpoint is an analog transducer set with a dial-pad (touch-tone) or a rotary-dial pulse wheel. Rotary-dial phones are a dying breed, of course, as the dominance of DTMF has marginalized them to the degree that many telephone companies don't support them any more. Both rotary and touch-tone phones share support for some variant of FXS signaling—an electrical protocol described earlier—in order to communicate with the CO switch.
While most legacy switches support analog endpoints through onboard analog ports, VoIP systems require additional interfacing in order to use them. SoftPBX vendors support analog endpoints with FXS signaling in the following fashions:
Analog telephone adapter
A device that connects an analog telephone to a softPBX via Ethernet. ATAs usually have one RJ11 port, for the phone, and one RJ45 port, for the Ethernet switch. The ATA accomplishes all the digitizing and packet encoding needed to use the analog phone in a VoIP environment. Generally, pulse-dial phones aren't supported.
Outboard analog media gateway
A device that serves the same purpose as an ATA, but allows more than one analog phone to be used. Some analog media gateways are highly expandable and can support dozens of analog endpoints. Analog media gateways may also have some built-in call-routing functionality.
Onboard analog media interface
An interface port on the softPBX server itself that allows for direct connection of a single analog phone.
Of course, analog endpoints are more than just phones. Sometimes they are modems, fax machines, answering machines, burglary or fire alarm systems, or those automated dialers with prerecorded telemarketing messages that sometimes call and interrupt your dinner. Generally, analog endpoints can be connected to a VoIP network using one of the three mechanisms listed.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Dial-Plan and PBX Design
Content preview·Buy PDF of this chapter|