How We Use Asterisk: An Overview
Asterisk is an open-source telecommunications toolkit. With over 2 million downloads a year, it’s the most widely used open source PBX platform in the world (technically, Asterisk is a lot more than a PBX, but it’s most commonly used for building PBXs). This means we have a lot of flexibility for how things connect to our Asterisk system and what we can do with them. I also happen to be a frequent contributor to the Asterisk project, so I’m familiar with Asterisk from both a user and development perspective, which has made it possible to add new capabilities that better serve our community.
To connect our phones to the Asterisk system, we use an ATA (analog telephone adapter). The ATA provides an analog interface (more properly, a Foreign Exchange Station or FXS port) that the phone plugs into, and the device itself talks to the Asterisk system using the SIP (Session Initiation Protocol) protocol, the most common VoIP (Voice over Internet Protocol) protocol around today. Asterisk acts as what is known as a back-to-back user agent (B2BUA). The phone never talks to the PSTN (Plain Switched Telephone Network) or other systems directly; instead, the ATA talks to Asterisk, and Asterisk can bridge it with other things as directed: other phones, a PSTN provider, another Asterisk system, or something locally on the system itself, such as a voicemail system, for example. In other words, Asterisk is responsible for “switching” calls, just like traditional telephone switches.
The ATA we’re using at the moment is a Grandstream HT 801, which provides a single FXS port. The 8xx series is the current generation of Grandstream ATAs, and these are typically the best for hobbyist or sophisticated telephone users that just want a simple SIP gateway device (as opposed to using a full-blown TDM (Time-Division Multiplexing) solution like a channel bank, which requires a direct T1 connection to an Asterisk server). Grandstream ATAs support pulse dialing (used by rotary phones), and they also have mature provisioning and remote management capabilities, making them ideal for our use. One nice thing we can do is set the ATA to “off-hook auto-dial” the server as soon as the FXS interface goes off hook. This means when you pick a PhilTel handset, the dial tone you hear isn’t coming from the ATA; it’s actually coming directly from Asterisk! So, you can be sure that if you have a dial tone, that you’re connected to the switch and your line is working properly.
Because the ATA acts as user device, it “registers” to the Asterisk system so that Asterisk is able to locate it and send inbound calls to it. Think of it as opening some ports in the firewall so that Asterisk can send it traffic and information whenever it needs to, regardless of what IP address or port the ATA might be using currently. In contrast, we use IP authentication with our PSTN carrier, since both our Asterisk system and our PSTN provider have static IP addresses; we can initiate outbound calls simply by sending them using the SIP protocol, and we can receive inbound calls directly into our Asterisk system as well.
SIP is the most common VoIP protocol today, but it’s not the only one. Another protocol we use is the IAX2 (Inter-Asterisk eXchange version 2) protocol (pronounced “eeks 2”). IAX2 is a protocol commonly used for trunking calls between Asterisk systems: think of these as virtual long distance circuits that can be built up between different telephone switches as needed. Unlike SIP, IAX2 is very firewall friendly and also very bandwidth-efficient, making it ideal for trunking large numbers of calls between Asterisk systems. While IAX2 doesn’t see much use outside of this use case, there are even a couple VoIP providers out there that support IAX2 in addition to SIP. But, for the most part, don’t expect to use IAX2 for anything besides trunking calls between Asterisk servers.
So, what other Asterisk systems are we connected to? PhilTel is also connected to PhreakNet, a hobbyist VoIP telephone network that basically emulates the old North American telephone network. While you probably can’t blue box, red box, or talk to operators on the PSTN today, you can (legally!) do all of these things (and more!) using PhreakNet, which is essentially a bunch of different Asterisk switches connected to each other using IAX2. In fact, PhilTel is also a PhreakNet node, reachable from PhreakNet and allowing calls to PhreakNet using the 400 pseudo area code (dialed as 1-400-NNX-XXXX
). Unlike the PSTN, PhreakNet calls all use secure, encrypted VoIP, so we don’t have to pay anything for transit: all calls are completely free to both the sender and receiver (although there is a mock billing system from the ’70s if you want to see what your calls would have cost then!)