Part 1: Laying groundwork
This guide will start out with the following assumptions:
- A static IP address is assigned to your Raspberry Pi - https://www.modmypi.com/blog/how-to-give-your-raspberry-pi-a-static-ip-address-update
- You are running the latest Raspian version - https://www.raspberrypi.org/documentation/raspbian/updating.md
As we are running the Raspberry Pi (RPi) as a server, assigning it a static IP is a good idea. And running the latest software updates is always smart.
This project requires the following parts:
- A Raspberry Pi 2/3
- 4 GB micro sd card
- An Obi110 Analog Telephone Adapter (ATA)
Banana Phone uses a collection of small Python scripts in conjunction with Asterisk to block robocalls. We will create a user on the RPi that is only for Banana Phone usage to keep all files and scripts in a single place.
After that, create a password for your 'banana' user.
The 'banana' user will need to install other packages, so to make things easier we'll add it to sudoers.
We will be adding our 'banana' user to this file so it can install packages like the root user. Add the following line to this file:
Your sudoers file should now look like this:
At this point, log out of the RPi and log back in as the 'banana' user. We'll be creating a home directory for our user and changing permissions on it.
The 'banana' user's home directory is now made and has appropriate permissions. Now we'll install the main work horse of Banana Phone: Asterisk.
Asterisk is the premier VoIP server package in the Linux world. It's flexible, open source and can do damn near anything with phone calls. In fact, I can guarantee most, if not all, robocall servers are running some version of Asterisk. So it's only fitting that we use it to block them.
In the past, I've done installing from source, but that's a huge pain and there are perfectly good repos that we can just install from and they work fine. Install Asterisk and wait for it to finish.
Once finished, try logging into the Asterisk debug console to make sure it is running. This console will be helpful to us later when we're testing out how Banana Phone handles calls.
If everything went okay, you should now be at the Asterisk console. Check Asterisk's settings by running:
You should see something similar to this if the install went okay.
As of now, Asterisk is running but can't do anything. In the next section, we'll cover the main configuration files needed to get Asterisk to a working call server.