hatestheinternet
post image is DSC04332 by Neil Rickards

You need an answering machine

This whole thing could be easily solved by spending $25 down t' thu WalMart (or 7.99 at ValuVillage), but shame on you for even suggesting that because that just wouldn't be any fun at all. How often have you heard that? For me, the answer is often enough for it to become an annoyance. You see, years ago, when I struck out on my own I had DSL and it didn't cost that much more to have a full-fledged phone line instead of just a dry loop. Consequently, I have a very basic line: No call display, no call waiting and, to the chagrin of some, no call answer. In fact, the only way those home phone services could save me $30 a month is if they paid me 7.

I know this whole thing could be easily solved by spending $25 down t' thu WalMart (or 7.99 at ValuVillage), but shame on you for even suggesting that because it just wouldn't be any fun at all. No, friends, the answer to this problem can be found as usual in the world of open source software: Asterisk. Yup, the PBX.

Starting Out

While there are numerous solutions out there that you can throw in to the optical drive of an old machine or use to boot a VM, I didn’t want another computer running and, in my house, virtualization is a four letter work. I opted instead to download the source and built it myself on my trusty Slackware box. As a nod to how much the Linux ecosystem has changed over the years, I had no issues and managed to get the demo config up and running in no time.

For managing the beast, I decided to go with the FreePBX front end. As the Apache installation on that box also hosts the various projects I have rolling around the half bakery, I couldn't dedicate the entire installation to it so instead I set up a virtual host accessible only from internal IPs. The only stumbling block here was FreePBX's myriad PHP scripts expect the interpreter to live in /usr/bin instead of /usr/local/bin where I keep it, but that's nothing a symbolic link couldn't fix. I had all the extensions and ring groups for the setup I envisioned up and running in very short order. I even managed to rig up a simple IVR for some lols.

Ring, Ring

Although the software was working perfectly and doing everything I wanted, it was still ultimately useless without and phones connected to it. I overcame this hurdle using a couple non-descript looking boxes made by Linksisco.

The first is a nifty piece of business they call the SPA3102. Billed as a VOIP router, this little guy works as both an FXS and FXO, but the neat thing is it's default failure mode is to act as a straight passthrough. I configured the PSTN side of it as a SIP trunk in Asterisk and connected the ATA side to the existing wiring for my house phones.

The next little toy is the Linksys PAP2T-NA. This device sports 2 ATA ports and I bought it first to see how well Asterisk played with POTS phones. Since the phone jack in my home office isn't wired properly and I have no intentions of fixing it, I kept one port connected to a simple speakerphone I bought ages ago and set the other port up for the printer's fax capabilities. I haven't completely finished hooking this up yet mostly because, truthfully, I have even less use for a fax machine than I do for an answering machine.

The Ins and Outs

As previously mentioned, all my house phones are on the same extension, so I made a ring group containing them as well as the extension in my office and the soft extension I use via X-Lite (which, naturally, is number 31337). I configured Asterisk's default inbound route to ring this group, then forward to the house phone’s voicemail if there’s no answer. This setup means that as I accumulate DIDs by default they’ll probably wind up doing the right thing by default.

As I don't have call display on my Bell line, the FXS side of the 3102 is configured to use the name "PSTN" and my analog line’s phone number for inbound caller ID. The 3102 seems to pick up fast enough there aren't any double or half rings from the caller's perspective, although outside calls are considered answered as soon as Asterisk picks up. Most importantly, the FXS portion of the 3102 allows me to crank up the gain on the line to compensate for my shitty service so now I can actually hear people.

For outbound calling, I threw together a quick and simple dial plan: Toll free, special (411, 911, etc) and any numbers in the local Guelph calling area are all routed through the PSTN trunk. If that trunk is busy for whatever reason or the call will result in Bell charging me for something it’ll be passed through the IAX2 trunk I have set up with the pay-as-you-go VOIP provider voip.ms.

How's It Working?

In a word? Perfectly. At first I was a little worried as I'd heard from many sources that the 3102 was an echo chamber, but whatever caused that seems to have been fixed in the newer devices even with ridiculous amounts of gain on the line. Most of our telephone usage involves using both it's FXS and FXO simultaneously and we haven't had so much as a hiccup.

On the VOIP side of things, Asterisk seems to be routing calls properly and we haven't had any quality issues. In fact, most of the people we've called have been surprised when we told them we weren't using our landline.

From a setup perspective, it only took about 10 or 15 minutes to get each box going and about as long to figure out to make FreePBX do my bidding. Setting up voip.ms was easy as creating an account and loading $25 credit. They even provide a sample configuration for Asterisk (make sure you remove the comment about the password from the sample configuration, though) which aren't too hard to wedge in to something FreePBX friendly.

So there. I got a damn machine.