Wednesday, January 25, 2012

The Public Switched Telephony Network (PSTN)



Most of the telephones in the world are connected to a vast network, enabling any telephone to reach any other. This network is called the Public Switched Telephony Network (PSTN). The phones that are on this network are reachable by dialing a number, which may include country codes, area codes, and telephone numbers.
While there are instances in which interconnection with the PSTN is inappropriate, most users of telephones have the expectation that they can reach the world at large. Therefore, we will consider interconnection to the PSTN as a requirement.

Connection Methods

There are a number of different methods to connect to the PSTN. Each has advantages and disadvantages, most of which we will touch on. As pricing varies depending on city or country, exact pricing will not be given. Pricing should be researched based upon the location of the Asterisk server.
We will handle each connection method one at a time.

Plain Old Telephone Service (POTS) Line

Probably the most common connection to the PSTN is a POTS line. This is an analog line provided by a telephone carrier. Each POTS line can carry only one conversation at a time.
For small installations, POTS lines are usually the most cost effective when connecting directly to our Local Exchange Carrier (LEC), a term used to refer to any company providing local telephone service. Eight lines is usually the point at which we should seriously look at another technology for our connection.
POTS lines from our LEC require a Foreign eXchange Office (FXO) interface to be usable in Asterisk. We will focus on Digium's offerings, namely the FXO module on a TDM410. Each TDM410 can use up to four modules. Therefore, if we have one line, we will have three empty module slots on the card.

Integrated Services Digital Network (ISDN)

ISDN is an all-digital network that has been available for over a decade. It is available in two major versions— Basic Rate Interface (BRI) and Primary Rate Interface (PRI).
ISDN divides a line into multiple channels. Each channel can contain either pay load (Bearing, or B channel) or signaling (Data, or D channel). A BRI has three channels—one D channel and two B channels. Therefore, two phone calls can be in progress at a time on a single BRI. A PRI has 24 channels—one D channel and 23 B channels, resulting in up to 23 simultaneous calls.
ISDN is not limited to voice alone. Each channel can carry 64k of data, if so configured with the LEC. This gives ISDN a lot of flexibility over POTS lines, as the channels can be reconfigured between voice and data on the fly.
With its separate D channel, ISDN is able to do things POTS cannot, such as setting custom caller ID, receiving dialed number information, on-the-fly redirection of calls, and a host of other cool features. Of course, all of these features require cooperation from the LEC, which is not always forthcoming.
BRI does not have high penetration in the United States market. Some accuse LECs of vicious pricing, while others claim consumers are to be blamed for fearing new technology. Either way, the result is the same—if we call our LEC and request a BRI, they will assume it is for data.
On the other hand, PRI is widely used in the US. It is the connection of choice for larger installations. PRIs are actually delivered over T1 connections, a proven and usually very reliable technology.

T1 or E1

Technically speaking, when ordering service from an LEC, we order a DS1, which is delivered over a line referred to as T1. However, this detail is usually overlooked. Therefore, we will refer to it in its vernacular—T1.
A T1 is a line with 24 channels. Each channel can contain a call. Therefore, a T1 can contain an additional call when compared with a PRI. In Europe, E1s are more common. In comparison to T1, they have 32 channels instead of 24. T1s signal the call through Robbed Bit Signaling, also referred to as CAS (Channel Associated Signaling) or flat T1. What this means is that a bit is robbed from time to time, as information needs to flow about the connection. While this is usually imperceptible to the human ear, it can be deleterious to data connections.
Using a T1 to deliver both data and voice is common. Some of the 24 channels are designated to be used for data and others are used for voice. There may even be unused channels. LECs are able to offer lower pricing when bundling services in this way, as a few channels may be used for voice, others for an Internet connection, and yet others could be used for a private data connection to another office.
LECs are able to send information about the number that was dialed at the beginning of the call. In this way, one advantage of the PRI has been matched by T1s. If we intend to have about 8 to 12 lines as well as a data connection, a T1 can be a good choice.
An excellent telephony interface card to connect your Asterisk to a T1/E1 connection is the Digium TE122. Today T1 connections can be split to accommodate data and voice. For example, your provider can offer 12 channels of voice as well as a data connection for your computers all on a single T1. The TE122 can support both modes and direct the voice channels to your Asterisk, while separately directing your data connection to the underlying Linux operating system, thus eliminating the need for an external router.

Voice over IP Connections

In recent years, a new way to connect to the PSTN has cropped up. Companies are using PRIs, T1, and other technologies to connect to the PSTN, and then reselling those connections to consumers. The users connect to the companies offering these connections through Voice over IP technologies. By doing so, we can skip dealing with LECs completely.
This service is called origination and termination. Through these services, we can receive a real telephone number with the area code, depending on what the provider has access to. Not all providers can offer numbers in every locality. This means that our number could be long distance from our next-door neighbor, yet local to someone in the next state. However, the advantage of this is that the provider will route most of the calls over their VoIP infrastructure and will then use the PSTN when they get to their most local point at the receiving end. This can mean that long distance charges are dramatically reduced. If we call a variety of countries, states, or cities it can be worthwhile to research a provider that offers local PSTN access to the areas we call the most.
The rates per minute are usually very attractive. Often, long distance is at the same rate as local calls. One thing to watch out for is that some providers charge for incoming minutes much like on a cellular telephone, and some providers also charge for local calls.
Today there are VoIP carriers offering unlimited US packages for those running Asterisk. However, one thing to watch out for with unlimited packages is that the carrier usually restricts the number of simultaneous calls you can make or receive. When you inquire about an unlimited package be sure to ask how many channels you are receiving for origination and termination.
Another thing to be aware of is that some providers require you to use their Analog Terminal Adapter (ATA). This means that they will send you a box that you plug into the Internet, which uses Voice over IP. Then, you have a POTS line to connect a phone (or Asterisk) to. However, today many VSPs (VoIP Service Providers) are offering BYOD (Bring Your Own Device) in which they provide you with the SIP or IAX settings. Once you have these settings you can connect them to your Asterisk deployment.
Voice over IP makes sense in many installations. But for the quality to be acceptable, a reliable Internet connection with low latency is required. Another thing to watch out for is jitter. Jitter refers to the variation in latency from packet to packet. Most protocols can handle latency a lot better if it is constant throughout the call.
A good candidate for Voice over IP is a site where interruptions in service will not endanger life and will not irreparably harm the company. While VoIP providers strive to achieve very high availability, we also have to rely on the Internet at large and our VoIP provider's ISP, as well as our own ISP.
If our telecommunication needs are such that periodic downtime is tolerable, VoIP will probably be our least expensive option. It requires less hardware in our Asterisk system as well, increasing the savings. In order to use VoIP with Asterisk, all we need is a system capable of Internet access. We don't require any specialized telephony hardware.

No comments:

Post a Comment

Popular Posts