Skip to content

sundarnagarajan/googlevoice-appliance

Repository files navigation

Asterisk with PJSIP Google Voice support on Raspberry Pi 3 Model B/B+ on Ubuntu Bionic

This repository contains scripts to automate the steps to:

  • Create a bootable SD card with Ubuntu Bionic that can be booted on a Raspberry Pi 3 Model B/B+
  • Update raspberrypi packages and kernel for Paspberry Pi 3 Model B/B+
  • Install pre-requisites for compiling asterisk
  • Fetch and compile asterisk (15) from naf419's asterisk repository
  • Create a DEB file with Requires set to (subsequently) install without having to compile asterisk
  • Use a template file included in /etc/asterisk/pjsip.conf to enter your secret Google Voice OAuth details
  • Do all the above from the command line, without needing Apache2, PHP, FreePBX etc
  • At the end, if you have entered your Google Voice credentials correctly in a single file, asterisk should be running, registered to Google Voice, visible with pjsip show registration
  • No SIP client credentials, inward call routing rules or outward calling rules or dial plans are created, but this repository contains some (basic) tips for doing this.

News

Working on following:

License, code of conduct, goals and policies

Though this is 'non-technical', please familiarize yourself with the following:

  • The LICENSE (GPLv3) used for everything on this repository, unless otherwise explicitly indicated
  • Code of conduct
  • Please read the FAQ before reporting an issue
  • If you are a beginner or are not experienced with operating at the Linux command line, please see: FAQ #1

Credits

For the impatient

Who needs this

You will probably find this repository useful if you meet MOST of the criteria below:

  • You are comfortable using Linux on the command line
  • You use or want to use asterisk - a leading open source PBX
  • You (probably) already use asterisk and are fairly comfortable configuring asterisk using files from the command line. If you are new to asterisk, see FAQ #2
  • You prefer to configure asterisk using configuration files under /etc/asterisk using the command line, rather than using a web-GUI like FreePBX
  • You use or want to use Google Voice. This probably also means:
    • You make or receive a lot of calls to / from US and Canadian numbers
    • You (probably) live in the US
  • You are interested in installing a GoogleVoice-compatible version of asterisk on a Raspberry Pi. These scripts are a bit specific to using a Raspberry Pi 3 Model B/B+, but most of the scripts will work for a Raspberry Pi 2 also
  • You already have asterisk configured with a lot of custom dialplans, calling rules and incoming call routing rules, and want to avoid porting these to FreePBX by provisioning a second asterisk server dedicated to routing incoming and outgoing Google Voice calls.
  • Your knowledge of Linux is between moderate to expert - the documentation on this repository is not expected to be a guide for users new to Linux. See FAQ #1

Contributions

See contributions.md

Why did I create this repository

My situation:

  • I have been using asterisk since 2011 (late entrant !)
  • I have a multi-site setup with multiple asterisk instances connecting on IAX2 over VPN
  • I have quite a bit of custom calling rules, dial plans, DID rules, custom macros and external web applications integrating through AMI/originate to initiate multi-way calls, dial into conference calls for work etc
  • I have done extensive work on organizing extensions.conf and other asterisk configuration files using #include and templates
  • My asterisk instances already ran on Raspberry pi / Ubuntu xenial
  • I am very comfortable with working on the command line in Linux and configuring asterisk in this way. In fact, I prefer setting up my Linux box and asterisk form the command line.
  • I was already using GoogleVoice integrated with asterisk using Bill Simon's Google Voice Gateway service
  • I wanted to setup a separate asterisk instance to connect to Google Voice, installing and configuring asterisk from the ground up, preferably compiling asterisk from source, allowing me a clear path to migrate to future versions of asterisk as they come out.
  • I did not want to use an asterisk instance hosted in the cloud, nor did I want to use a web GUI that would either constrain the configuration I could do using asterisk configuration files, overwrite my changes when I used the web GUI or both. That ruled out using FreePBX

I looked around for guides to get asterisk working (again) with Google Voice working using the new PJSIP-OAuth2 interface, but all the guides I could find explained hot to install FreePBX and make all configuration changes in the web GUI.

I found this excellent HOWTO for compiling and installing asterisk with patches from naf419's asterisk repository and installing and configuring Google Voice trunks using FreePBX. I initially tried this in an AMD64 Ubuntu Bionic VirtualBox VM, and found it worked.

I found How-To: Ubuntu Server 18.04.01 (Bionic Beaver) on the Raspberry Pi 3 B+ and managed to follow it to get Ubuntu 18.04 Bionic on my Raspberry Pi 3 Model B+. I then used the HOWTO above to get asterisk compiled and working with Google Voice

I wanted to automate most of the steps, so that I could perform them multiple times. One thing led to the next, and the result is this repository, which I hope will be useful to people with similar needs to mine.

Limitations

  • When using Ubuntu 18.04 Bionic, libspeex1 package (wrongly?) conflicts with asterisk package with version > 13. Solution in THAT case is to rename package name in DEB that we build to 'asterisk-gvsip'. See Issue 2
  • DEB file generated on Ubuntu 18.04 Bionic cannot be installed on Raspbian Stretch minimal and vice versa because I generate a DEB file with dependencies strictly bound to minimum required package versions - and these dependencies (probably) will not be met in the other operating system. Solution is to build from source on each operating system.
  • Current scripts do not include support for Opus - required / beneficial for Google Voice. Working on integrating Opus patches from traud/asterisk-opus. Have tries the patches, and Opus support works. See Issue 6

Getting started

Installation

There is no installation. Just clone the repo, and use the scripts under the scripts directory.

Steps

About

Asterisk with PJSIP Google Voice support on Raspberry Pi 3 Model B/B+

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages