- Asterisk 1.6
- Barrie Dempster, David Gomillion, David Merel
- 2241字
- 2021-04-01 14:03:36
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.
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.

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 payload (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.
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.

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.
Determining our needs
Now that we have examined some of the options, we need to determine what our needs are. Requirements will vary quite a bit from site to site. Something to keep in mind is that, although the previous choices are distinct, they can be mixed in an Asterisk installation. We can have VoIP providers and POTS lines, as well as a PRI if we desire. It's very common to have this type of setup. For example, if we have an office in another country, we can call them using VoIP but all local calls could use POTS. It is important to understand the calls our system will be making and where they will be going, so that we can arrange for the necessary services and ensure that the calls are routed accordingly. If we have an existing telephony system, we can take a look at the calls it's making just now and our current costs so that we can determine what technologies will be of most use to our system's users.
Now is the time to begin documenting what our plan is. If Asterisk is to replace an existing system, then we should start by writing down all the current lines coming into our incumbent PBX. Once that is done, we need to look at our requirements.
First, we need to determine how many lines are needed. Telephone providers can generate a usage report that will tell us the maximum concurrent connections we have experienced in the last month. While they are able to do this, many providers are not very happy to run such a report. However, without that information we have nothing to gauge our needs other than gut feelings.
If we need more channels than we have, someone will get a busy/congested signal. Therefore, we should plan to have the maximum number of channels we have used plus a reasonable cushion. 125 percent of our current maximum is usually a reasonable cushion, this allows for instant 20-25 percent growth so that we can accommodate a sudden increase in calls without the system failing over, causing busy signals. If we do increase calling to this level for a relatively long period, we must consider an increase in lines to prevent congestion. These numbers are a guideline and they can change depending on circumstances. In a call center where the main business purpose is to make and receive calls, 150 percent may be a more satisfactory figure. We also should take into account the time it takes to get new lines set up from our local operator. If a significant event that generates a large number of calls occurs, we should have the capacity to handle this or be able to increase the capacity quickly.
Now that we have a number of lines, we need to determine the technology to use for each line. VoIP is usually the cheapest, especially for long-distance calls. PRI is usually the most reliable, and for incoming calls is often cheaper than VoIP.
While pricing the options, we need to remember that POTS lines usually have a single phone number only, while a PRI can have hundreds of phone numbers. If we are a business that receives only a few calls, but needs the calls to have different phone numbers, then a PRI probably makes the most sense. Also, with a PRI we can trunk more effectively, which may become essential.
Although a PRI can have hundreds of phone numbers, there is a charge for each number each month. Called DID (Directed Inward Dialing) numbers, these virtual numbers are usually sold in blocks of 10-20. If we do not order enough to begin with, it is usually not difficult to get new DIDs ordered. Often they can be available the same week, depending on the phone company. We assign these numbers to individual devices or groups of devices ourselves, once we have them allocated.
This means we can decommission or reallocate numbers as necessary. We may have campaign DIDs that are reassigned to different groups depending on the current campaign, personal DIDs for key staff, or our main DID, which would probably be assigned to a group of people responsible for handling these calls.
We should take this opportunity to write down what lines we want, what phone numbers we need, and get quotes if it differs from the currently installed PSTN connections.