Alright, first thing’s first, we need to download and install Asterisk and PyGoogleVoice.
Installing Asterisk
First, we need to download the Asterisk source files. I’m using Asterisk 1.6.2.6, which is the latest stable version as of this writing. You can choose to go with another 1.6 branch, or the 1.4 branch, but things may now work out as well as you’d like.
- Log into your Linux Box as root (or get root privileges with sudo) and download the Asterisk source tarball
# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.6.tar.gz - Extract the Asterisk source files (in this case we’re extracting to
/usr/src/, feel free to change to your liking.)
# tar -xzf asterisk-1.6.2.6.tar.gx -C /usr/src - Run
./configureand resolve any dependency issues that come up.
# cd /usr/src/asterisk-1.6.2.6
# ./configure - Run
make menuselectand select the options you want.
# make menuselect
I’d highly recommend setting theDONT_OPTIMIZEoption from theCompiler Flagsmenu, as this will allow you to get a useful backtrace if you need to do any serious debugging.
I’d also select theULAW,ALAW, andGSMsound packages for your language from both theCore Sound PackagesandExtras Sound Packagesmenus. This will prevent most transcoding you’ll run into with clients using different audio codes. You should pick the Core and Extra sound packages for at least one codec. - Once you’ve saved your options from
make menuselect, runmake, and thenmake install
# make
# make install - Finally, install the sample configuration files for Asterisk by running
make samples
# make samples
Installing PyGogleVoice
Now we’ll install PyGoogleVoice. This is a Python API and command-line utility for accessing the Google Voice API.
- Make sure you have Python 2.3 or newer. You should also have the Python
easy_installutility available (part of the Python setuptools package). If you’re using Python <2.6, you’ll also need the simplejson package.
# easy_install simplejson - Once you’ve verified you’ve got everything you need for PyGoogleVoice, install it
# easy_install -U pygooglevoice
Quick Test
Before we move on, let’s make sure we’ve got Asterisk installed properly.
- We’ll start asterisk in the foreground (rather than as a daemon) and make sure there are no errors.
# asterisk -cvvv - This will start Asterisk with a Verbosity level of 3 and should bring you to the Asterisk CLI prompt:
hostname*CLI> - f you’re seeing that, and you don’t see any errors as you scroll back through the asterisk messages, go ahead and stop Asterisk for now:
hostname*CLI> core stop now
Next we’ll get things configured with your sipgate and Google Voice Accounts… (continue)