Integrated Services Digital Network
ISDN is a twisted-pair, digital multiplexing standard for PSTN and data applications. Although used widely around the world, it is not well known in North America. For most data applications, ISDN has been displaced by ADSL, coaxial cable, and FTTH (fiber-to-the-home) technologies, which offer much larger bandwidth at competitive rates. It remains in use for voice and video applications. We’ll look at those here.
ISDN itself is a giant topic, and because it is an older technology, it is well covered in other texts. Do not expect much depth here. We discuss ISDN only in the context of its relevance to Asterisk.
An ISDN connection provides two basic channel types: B and D. (More specialized channel types exist but are not in wide use, and are not covered here.) A single B (bearer) channel can be equated, roughly, with a single analog telephone line: You can carry on one conversation on that channel. Where it differs is that a single physical line pair can carry multiple B channels, making better use of the existing wiring. The data is transported in digital and not analog format, which means you can’t connect an analog telephone to the line and expect to hear anything. The digital transport usually delivers better sound quality when everything is properly configured.
The entry-level ISDN service is called basic rate interface, or BRI, and is used in homes (in the world outside of North America) and small businesses. It provides two 64kbps B channels and one 16kbps D channel (which is why some refer to it as 2B+D) over a single line pair (two wires). You can attach ISDN phones, BRI ports on PBX devices, ISDN-BRI terminal adapters (which provide FXS ports for analog telephones), or ISDN-BRI adapter cards to a BRI.
ISDN never really caught on at the subscriber level in North America. Although there are many opinions why, the most common explanation given is that the size of the existing network made implementing ISDN to the suburbs prohibitively expensive. In North America, average loop lengths are much longer when compared to Europe, where ISDN circuits now make up more than 80% of installations.
Still, sometimes BRI makes sense, and in most jurisdictions it is a tariffed service, which means that some carrier (usually the incumbent telephone company) must provide it if it is technically feasible. Here are some reasons why you might consider BRI:
Features such as Explicit Call Transfer, DNIS (Dialed Number Identification Service), and COLP (COnnected Line identification Presentation) are ISDN services that can’t easily be replicated on analog lines. If you need these but don’t need more than six to ten channels, BRI is a real option. One thing is beyond dispute: In the circuit-switched, PSTN world, ISDN offers unparalleled sound quality.
Of course, the economics will vary depending on your location and the carrier. Be warned that most carriers that offer BRI don’t actively market it, so you may face challenges in getting anyone in the sales department to acknowledge that the service exists.
You can think of the PRI as the bigger, flashier brother of the BRI. In North America, PRI is provided over a T1 (23 B channels, 1 64kbps D channel) with 2 or 3 pairs (4 or 6 wires); in Europe, the E1 (30 B channels, 1 64kbps D channel). Again, you can only connect ISDN devices to a PRI circuit. Examples include the PRI interface on a PBX, a channel bank (which provides FXS ports for analog telephones), or an ISDN-PRI interface card. The PRI is intended for larger installations.
PRI always implies ISDN. PRI service is supplied via a T1, but not all T1 circuits are PRI. Non-ISDN T1 circuits (also called in-band T1) can still be found in North America. In such circuits, call setup and teardown signaling is sent in the channel (CAS, or channel associated signaling) instead of via a separate D channel. This steals some bandwidth from each channel but makes all 24 channels available.
- Support quality is subjective.
Actually using an ISDN card in an Asterisk server is really quite simple, even if installation and configuration aren’t always trivial. There are a few different ways to get an ISDN card running with Asterisk. We touch on a few variations below.
All the installation examples in this book use a Debian Linux system. The installation procedure will differ on other Linux systems and may not work at all on BSD systems. If you are starting out, we recommend you follow the instructions completely and begin with a fresh Debian installation.
Determining Your Quality Needs
Most private Asterisk users are not hung up on sound quality and availability. Cost is likely the primary consideration here. If you aren’t planning to fax over the card, and you only need two B channels, any generic HFC-based BRI card will do. The cards are cheap and widely available. You’ve been warned, however: Installation can be challenging with these cards, and you shouldn’t expect amazing sound quality. If you can live with these limitations, this is a real option.
For business systems, the bar rises substantially. If you are replacing an older system you must at least match it in quality, unless you like doing battle with users and clients. If you value your career in this business, you’d best steer clear of generic cards.
Sadly, the echo problem remains. Any professional system connected to the outside world must have the highest-quality echo cancellation available, and this is generally achieved through a hardware echo canceler integrated into the card itself. The advantage over software echo cancellation is clear: The performance of hardware echo cancelers is historically better, and they don’t need to steal CPU cycles to achieve it.
Because echo cancellation is not easy to do well, these modules are accordingly more expensive. Nevertheless, in business applications, hardware echo cancellation is not negotiable for any system you intend to connect to the PSTN. Cards providing PRI to internal servers can get away without it because echo in local trunks is rare, but if you’re buying a card anyway, spend the extra money. You never know how you might need to use the card in the future.
Tail length is a performance parameter to consider when evaluating hardware echo cancelers. It determines the length of the reference sample when calculating echo cancellation. The rule of thumb is that the longer the tail length, the better the echo cancellation. In practice, it’s difficult to hear a difference beyond 128 milliseconds.
In the early years of Asterisk, there was no affordable echo cancellation, so Mark Spencer and others wrote software to perform the cancellation. This necessitated breaking the in- and outbound audio streams into 1ms chunks. For this reason, all the standard ISDN cards in use today set interrupts at 1ms intervals for each B channel.
This historical artifact can lead to problems in some applications. You probably won’t notice this if you use a single PRI or BRI connected to modern server hardware. If you’re using a compact, embedded system, however, even a simple BRI with two B channels can cause problems under load. If you have a large system with multiple PRIs and interface cards, similar problems can occur. Enough interrupts can bring the most powerful system to its knees.
If you’re connected to the PSTN via an ISDN connection but still use analog fax devices internally, you might run into another timing problem, particularly with long faxes. This is caused by different clock timings on the audio channels. The ISDN cards use the PSTN for their clock source; the analog interface cards use their own, usually internal (and often cheap and unstable) clock source. The result is a clock differential that is managed using a buffer. After two pages (on average), the buffer empties, and you lose a bit of audio, often enough to overwhelm the fax error correction. The result is usually a black line or gap in the fax image. In the best case, nothing is visible; in the worst case, the transmission ends prematurely.
There seem to be as many ISDN card manufacturers as people with an opinion about them. The products described here are a subjective selection, but have been chosen because they are used widely. Further exploration of the subject could fill another book.
Hardware and driver information provided here was current at the time of printing. Check this book’s website (www.the-asterisk-book.com), where we will post updates.
As the parent company and home of Asterisk, Digium (www.digium.com) has offered digital interface cards for several years now. (The early cards were analog only.) The advantage for the Digium cards is obvious: You always have drivers updated for the most current Asterisk release. In the past, these drivers have been middling in quality and there have been problems. With the new DAHDI driver generation, Digium is promising better performance.
Sangoma (www.sangoma.com) is a popular alternative manufacturer in North America, and was, until recently, purely a hardware company. They make both analog and ISDN interface cards and have a reputation for good technical support.
Open source purists may take exception to Sangoma’s use of a binary-only ISDN stack (for BRI). Sangoma’s response is that the commercial stack is certified for ISDN and has demonstrably fewer issues than the open source mISDN stack.
These cards have been sold in Europe for many years now, usually at bargain-basement prices. Support is rarely if ever provided, and at $100 to $150, it can hardly be expected. They are almost always used with mISDN.
Just as you might use an ATA in place of an analog interface card for regular phones, you could use a “media gateway” for ISDN connections. This gateway converts an ISDN connection into one or more SIP accounts and vice versa. These are usually “black box” solutions, which are configured via a web GUI or over SSH.
Purely analog media gateways are simply ATAs (analog telephone adapters).
One major advantage is that a media gateway is often easier to configure than an interface card. You don’t have to open up the server and install the card, either. Configuring Asterisk is simpler because you only have to configure SIP. Finally, you don’t have to run telephone lines of any kind to the server; you install the gateway device in the wire room, connect it to the network patch panel, and put the server anywhere on the network that is practical.
Media gateways are generally sold on price and not on the quality of installed components, so manufacturers are tempted to use lower-quality interface cards, which can be problematic. Asterisk works best when using the ISDN clock; the clock signal is very stable, and a stable clock signal is vital, especially for conferencing. A media gateway does not pass this signal over Ethernet; the Asterisk server must rely on the system clock, which will vary in stability. Updating a media gateway is also more difficult, if it’s possible at all.
Whether one should choose an interface card or a media gateway is a regular topic of discussion in the Asterisk community. Both sides make good arguments, and you can run a successful system with either. What is best for you depends on the circumstances. If you need stable clock (you are conferencing or you have existing ISDN cards in your system), you’ll need an ISDN card. If you have physical access problems, or you need to maximize the simplicity of the system, go with a media gateway.