This is a companion to the blog post, the Spam Eliminator Telephone System.
To set up this system, first get a raspberry pi with at least 8GB SD card, you’ll also need a monitor and a keyboard to set it up with a hardwired ethernet connection to the internet. Â The next step is to follow the steps laid out here:Â http://www.raspberry-asterisk.org/downloads/ to download a raspberry pi image with asterisk and freepbx to your computer, you’ll then have to burn a disk image from your computer to an SD card to boot in the raspberry pi. Â Here is a tutorial for a MAC, your on your won for a PC: Â http://www.raspberrypi.org/documentation/installation/installing-images/mac.md
Once you have an image from raspberry-asterisk burned onto an SD card, you can follow these steps to get it up and running: Â http://www.raspberry-asterisk.org/documentation/ this should get your PBX up and running.
Make sure you use a Static IP address for the raspberry pi, not the default dynamic IP address, since lots of devices will be looking for the pbx, it should have a known address.
Next plug in the OBI110. Â This device has the weirdest configuration I’ve ever encountered. Â First off you need a telephone connected to it as part of the configuration. Â You’ll need to plug the OBI110 into an ethernet port connected to the internet. Â Some parameters of the OBI110 are set from obihai.com and some are locally configured. Â Google ‘use obi110 as fxo for freepbx’ to find info on how to configure it. Â Here is a good starting place:Â http://wiki.freepbx.org/pages/viewpage.action?pageId=4161594
I had a lot of trouble configuring a local configuration only to have the device clobbered with the default config 5 minutes later that was downloaded from Obihai. Â The user interface is very not intuitive, especially how and where the configuration gets set.
From the info above you can configure the Freepbx to connect to the OBI110.
Now connect a VOIP phone. Â you’ll need to configure the phone to connect to the pbx, and on the pbx, you’ll need to configure and extension. Â Search google for your phone type and freepbx. Â Cisco phones are VERY complicated to configure. Â The first problem is finding them on your network, each SPA phone has a menu which you can access by the handset to figure out what IP address was configured by default, once you have this you can configure the phone with your browser.
Once you have an extension configured and working, you can configure the rest of the PBX using the freepbx interface. Â using a cell phone keep dialing and listen to the obi110 and watch what happens.
You’ll need to configure incoming and outgoing trunks, and set up an IVR with the new phone extension. Â Mine says “Hi You’ve reached the kellys, press 1 for bill or 2 for lisa”. Â The IVR has a setup where you then point #1 to the extension that is bill and 2 to the extension that is lisa. Â Configure voicemail for both of these extensions, and you can have the voicemail emailed to a specific email address.
I also signed up for vitelity.com and paid $35 for measured outgoing calls. Â The pbx can be programmed using outgoing trunks to route emergency calls out the OBI110 (therefore the landline) and everything else with a Called ID of the landline to vitelity.com. Â It’s been a few years and I haven’t used much of the $35.
Once everything was up and running, I moved both the PI and the OBI110 to my garage where in the internet and my phone lines originate. Â This keeps me from bumping the PI and taking it offline.
Things not to repeat:
1. Â After running for 6 months, my pi crashed without a backup. Â I needed to remember everything I did. Â It would have taken me a few hours of pbx downtime to copy the image and have a backup. Â Now I do.
2. Â For a while I opened a hole in my internet firewall and installed fail2ban in the pi. Â What I found was hundreds of port scanners where trying to reach my pbx. Â I scrapped this idea (I wanted remote extensions on my iphone), and I built a VPN gateway instead on a separate raspberry pi.
1. Â The PBX keeps a call log in mysql. Â I wrote a daily report that emails me who was calling every morning. Â I did this for my mom and it’s an amazing thing to see the spammers knocking.
Modifications I made for my mother:
1. You can create lists of phone numbers that trigger different paths in the PBX. Â By default if you call my mother, you end up hitting and IVR which says “Hi you’ve reached <name> please press 1” this routes to extension #150 which immediately goes to voicemail and says “<name> is not avaible please leave a voicemail” this immediately routes to my email inbox. Â If You are on the ‘list’ of approved numbers she has two working extensions #100 which is her answering machine and portable phone and #101 which is a phone by her bed. Â I linked the two in a ring group and if you are on the list of 35 numbers you go directly to the ring group. Â If she’s not available her answering machine kicks in.