Roll Your Own: Part 1 – Installation

(previous)

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.

  1. 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
  2. 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
  3. Run ./configure and resolve any dependency issues that come up.
    # cd /usr/src/asterisk-1.6.2.6
    # ./configure
  4. Run make menuselect and select the options you want.
    # make menuselect
    I’d highly recommend setting the DONT_OPTIMIZE option from the Compiler Flags menu, as this will allow you to get a useful backtrace if you need to do any serious debugging.
    I’d also select the ULAW, ALAW, and GSM sound packages for your language from both the Core Sound Packages and Extras Sound Packages menus. 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.
  5. Once you’ve saved your options from make menuselect, run make, and then make install
    # make
    # make install
  6. 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.

  1. Make sure you have Python 2.3 or newer. You should also have the Python easy_install utility available (part of the Python setuptools package). If you’re using Python <2.6, you’ll also need the simplejson package.
    # easy_install simplejson
  2. 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.

  1. We’ll start asterisk in the foreground (rather than as a daemon) and make sure there are no errors.
    # asterisk -cvvv
  2. This will start Asterisk with a Verbosity level of 3 and should bring you to the Asterisk CLI prompt:
    hostname*CLI>
  3. 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)

Posted in Computers and other Gadgety-Type Things | Leave a comment

Roll Your Own: Part 2 – sipgate/Google Voice Configuration

(previous)

Now that we’ve got Asterisk installed, we need to get your sipgate one and Google Voice accounts configured for our setup.

SIP Phone
The first thing you’ll need is a SIP phone. You can get either a hardware phone (hard phone) like the Polycom SoundPoint IP 321, or a software phone (softphone) like Telephone for Mac OS X. It will probably be easiest to work with a softphone for now. If you need some help finding one take a look at this list at Voip-Info.org, or this list at Wikipedia. Whichever phone you choose, be sure it supports SIP.

Configuring sipgate
Now that you’ve got a SIP phone, we’ll get it setup to connect to sipgate. Later your phones will connect through your Asterisk PBX, but for now we need a phone directly connected to sipgate.

  1. Login to your sipgate account at http://sipgate.com and click the settings button. You should see something like this:
    sipgate settings screen
  2. Click on the SIP Credentials link on the left. You’ll see a new box like this:
    sipgate credentials box
    Where your SIP-ID is something like 9999999e1 (your account # followed by e1) and your SIP-Password is something like AAAA1A
  3. Use these settings to configure your SIP phone. You may want to look at this sipgate FAQ entry for some more info.
  4. Once you’ve configured your SIP phone, and it is successfully registering to sipgate, call your sipgate Phone Number to verify your SIP phone rings.

Configuring Google Voice
Now we need to configure Google Voice to work properly with our Asterisk setup.

  1. Log in to Google Voice and go to Settings > Calls. You need to make sure Call Screening and Presentation are turned off and Caller ID (in) is set to Display caller’s number. Your Calls settings should look like this:
    Google Voice calls settings
  2. Go to Phones in the Google Voice settings and click Add another phone. Enter a Name like sipgate, enter your sipgate phone number, and select Home as the Phone Type. When you click Save, Google Voice will take you through the steps to verify the phone number you entered.
  3. Once your sipgate number is verified, give you Google Voice number a call. Your SIP phone should now be ringing.

Be sure to do a reality check on your Google Voice forwarding settings. If you’re using this setup to give yourself a Home phone that multiple people would answer, you’ll likely want to be sure that it only forwards to your sipgate number, but there may be situations where you want forwarding to stay on for other phones.

Now we get to the fun part: Configuring Asterisk… (continue)

Posted in Computers and other Gadgety-Type Things | Leave a comment

Roll Your Own: Part 3.1 – Asterisk Configuration Continued

(previous)

Now that we’ve got SIP configured in Asterisk, there are two more things we need to configure before we get to the dial plan: Voicemail (voicemail.conf) and Call Parking (features.conf)

voicemail.conf
Asterisk’s built-in voicemail system is quite possibly the easiest piece of this puzzle for us to configure.

  1. Create /etc/asterisk/voicemail.conf in the text editor of your choice.
  2. Add the following block to the new file:
    [general]

    [default]
    1000 => 1234,Your Name

    This creates voicemail box 1000 in the default context with a PIN of 1234. The name set here can be used for the dial-by-name directory functionality available in Asterisk.

  3. Reload the voicemail configuration from the Asterisk CLI
    asterisk*CLI> voicemail reload
    That’s it. All there is to it.

features.conf
Call parking is a means of putting calls on hold so they can be transferred to other extensions. We’re going to use call parking to help us make outgoing calls with Google Voice, but first we need to setup our “Parking Lot”.

  1. Create /etc/asterisk/features.conf in the text editor of your choice.
  2. Add the following block to the new file:
    [general]
    parkext => 7000
    parkpos => 7001-7100
    context => parkedcalls
    findslot => first

    This sets up a parking lot over extensions 7001 through 7100, putting them into the parkedcalls context.
  3. Reload the features configuration from the Asterisk CLI
    asterisk*CLI> features reload

Dialplan Planning
Before we go ahead with configuring our dialplan, we need to decide exactly what we will do in the dialplan.

  • Dialing 1000-1008 connects to an internal phone
  • Dialing 1009 connects to voicemail
  • Dialing 1010-1019 performs a special action, like a speed dial
  • Dialing 3000-3010 performs a test action
  • Dialing 911 plays an error message
  • Dialing a 7-digit telephone number makes an outbound call, using a pre-defined area code
  • Dialing a 10- or 11-digit telephone number makes an outbound call

Outbound Calling
You’re probably still wondering how we are going to be able to make outbound calls when our sipgate account only gives us free incoming calls. The solution is to turn an outbound call into an incoming call, at least as far as sipgate sees things. When you make an outbound call, this is what really happens:

  1. Asterisk recognizes that a 7-, 10-, or 11-digit number has been dialed and starts processing it as an external call.
  2. The call is parked on a designated extension.
  3. PyGoogleVoice is used to originate a Google Voice call to the dialed number
  4. Google Voice sets up the call and connects it to our sipgate phone number
  5. Asterisk sees that the incoming call is a ringback from Google Voice and connects the incoming call to the previously parked call

Now we’ll go ahead and configure our dialplan… (continue)

Posted in Computers and other Gadgety-Type Things | Leave a comment

How I Got a Home Phone

I’m currently finishing up SAT4240 – VoIP Engineering as part of the Computer Network and System Administration program at Michigan Tech. This has probably been the most interesting course I’ve had so far in the program, and it’s made me seriously look at Voice Engineering as a career path when I graduate in December.

In our lab we use Asterisk, a free (as in beer), open-source PBX that runs on *nix systems. It’s highly configurable and customizable, but also very lightweight. In fact, as part of our course project – where my group and I created a simulated voice network for a nation-wide development company – we had Asterisk 1.4 running in OpenWRT on a Linksys WRT54GL. Obviously, not every feature is available on such an embedded system, but simply by “outsourcing” the voicemail functions for that location to one of our other PBX’s, we were able to create a system with consistent functionality for all users. Pretty cool ‘eh?

The class also got me thinking about something I’ve wanted to work out for a while now: a home phone. Mostly I was looking for a way to get ahold of people at the house when they don’t have their cell phone handy – like me on a lazy Sunday, when my iPhone never leaves the nightstand. However, since I’d still be using my cell mostly, I didn’t want to go with a traditional landline or the VoIP offering from Charter because it wouldn’t be worth the cost. I wanted something that wouldn’t cost me anymore than I was already paying for internet service.
Continue reading

Posted in Computers and other Gadgety-Type Things | 3 Comments

Full-time job? [UPDATED]

Though it’s been discussed for a while now, I got an actual full-time job offer from Up and Running yesterday. I’m still really torn about what to do, but now I at least have numbers to look at. If you’d like to help in the pondering, let me know and I can fill you in on the details.

[Update: 09-10-2008] I’ve officially declined the offer. In the end, I decided I’d be giving up more than I was willing to give up for what the offer was. Wasn’t a bad offer, but just not right for me at this point in time.

Posted in School, Work | 2 Comments