Thursday, December 9, 2010

Outbound Google Voice dialing "proper" fix

As I mentioned in http://supermario-world.blogspot.com/2010/12/nov-30th-break-of-asterisk-18-w-gv.html, proper Google Voice outbound dialing got busted at the start of the month because of a protocol change on Google's servers.

While upstream worked on the patch (as detailed in https://issues.asterisk.org/view.php?id=18412), I had a workaround that used an AGI call back for the dialer.

Well a final patch has been developed now that accounts for the protocol changes and accepted into 1.8.x svn (https://issues.asterisk.org/file_download.php?file_id=27904&type=bug).  I expect there will eventually be a 1.8.1 maintenance release that includes this patch.

In the interim, i've rev'ed my packages to 1.8.0-2 and include this patch now.  You just need to opkg upgrade and you should receive the updates.

# opkg update
# opkg upgrade

You should undo any AGI dialer hacks that were added and revert to the original outbound google talk dialer.  If you have been using my dialplan, this should just be a two line change to comment out the AGI line and uncomment the Talk line.

so the outbound section of your extensions.conf should look like this:


[outbound]
include => seven-digit
include => local-devices
include => tollfree
include => talk-gmail-outbound
include => talk-numeric-outbound
include => dial-uri


As always, you can view my dialplan and settings at http://www.arctangent.net/~superm1/gv_configs/ in case you are missing something or joining in late.

And thanks to everyone who helped to make this patch happen!

Thursday, December 2, 2010

The Nov 30th break of Asterisk 1.8 w/ GV

On November 30th, Asterisk GV outbound dialing started breaking for people.  The cause was unknown, and it became more prevalent the next two days.

The symptoms are a continuous ringing for the outbound call with the following type of stuff in the logs:


[Dec  3 00:54:00] NOTICE[18023]: chan_gtalk.c:1942 gtalk_parser: Remote peer reported an error, trying to establish the call anyway

Inbound calls (including those initiated from the website) are still functional.  It's not clear what the cause is, but an issue has been filed with Asterisk upstream at https://issues.asterisk.org/view.php?id=18412

In the interim, I've come up with a way to fix the problem by reviving the old AGI dialer originally used with Asterisk 1.6, but reworking it to use Talk instead of Gizmo.

This involves some modifications to the dialplan to support using AGI instead.  If you don't already have AGI setup, here's the basics for that:

1) Install AGI support for Asterisk:

opkg install asterisk18-res-agi

2) Create the AGI directory

mkdir -p /usr/lib/asterisk/agi-bin/

3) Fetch the updated AGI script from http://arctangent.net/~superm1/agi/google-voice-dialout.agi and save it in /usr/lib/asterisk/agi-bin.  Modify it to include your login information for google.

cd /usr/lib/asterisk/agi-bin
chmod +x google-voice-dialout.agi

4) Modify your dialplan.

outbound
Instead of 
exten => _1NXXNXXXXXX,1,Dial(Gtalk/superm1/${EXTEN}@voice.google.com)
Make the line
exten => _+1NXXNXXXXXX,1,AGI(google-voice-dialout.agi)

inbound
Add the following two rules:
exten => superm1@gmail.com, 1, GotoIf(${DB_EXISTS(gv_dialout/channel)}?bridged)
exten => superm1@gmail.com, n(bridged),Bridge(${DB_DELETE(gv_dialout/channel)}, p)

This will bridge outgoing calls with an incoming dialback handler.

As previously, i'll post my updated configs to http://www.arctangent.net/~superm1/gv_configs/.  The way that i've implemented it is actually just a different AGI handler that's included.  So when regular talk support is restored (as mentioned in https://issues.asterisk.org/view.php?id=18412) then it's a one line change to re-enable the standard outbound talk handler.

Thursday, November 18, 2010

Better support for sipdroid on Android

For a while I've wanted to use my fancy Asterisk setup with my HTC Evo 4G, but i've always been getting horrible performance from sipdroid as well as any other clients I was trying on the phone.

It seems that i've identified the problem as actually being a codec problem.


I looked a little closer at the verbose logs in asterisk and saw messages like this:
[Nov 19 02:57:44] WARNING[9373] chan_gtalk.c: Asked to transmit frame type alaw, while native formats is 0x4 (ulaw) (read/write = ulaw/ulaw)


It seems that whenever I was making calls, the formats kept on flipping from ulaw to alaw and vice versa.  When it did work, only one end could hear the other.  To make matters worse, I couldn't get G722 to work whenever I tried to force it.

Comparing the OpenWRT Asterisk 1.8.x install to a standard install on Ubuntu, it looks like the codec files for G722 weren't even getting installed.  I modified the packaging and republished additional packages at my repository for Asterisk on arctangent.net (http://arctangent.net/~superm1/openwrt)

Now there is two more packages available, one for alaw and the other for g722.  You should be able to update your opkg list and install them:

# opkg install asterisk18-codec-alaw asterisk18-codec-g722

After they're installed, modify sip.conf to make sure you explicitly mention that you now support G722:

[101]
username=101
secret=101
type=friend
callerid="Mario"
host=dynamic
context=outgoing
outgoinglimit=1
incominglimit=1
canreinvite=no
disallow=all
allow=g722
allow=alaw
allow=ulaw
allow=gsm
Now restart Asterisk and Sipdroid should be able to use G722 for some much better audio.

Sunday, November 14, 2010

Caller ID with Google Voice and Asterisk 1.8

Previously it was possible to do a lookup of your contact's name against the numbers in your GMail/Google Voice contact list and apply that to your CallerID via John Baab's method outlined on his blog.

I've since then discovered that since updating to Asterisk 1.8 with native Google Voice this no longer functions.  This is because the format of the CallerID string that is sent from incoming calls is now different.

The entire string is sent in the "Name" field of the caller ID.
For Voice Calls, this is what it looks like:
+18475551212@voice.google.com/srvres-MTAuMTIuMTM4LjI2OjD4NdM=
For calls coming in from Talk or GMail, this is what it looks like:
user@gmail.com/gmail.424BF12F

Fortunately, this entire field can be processed using built in asterisk functions to extract the data we need, restoring the functionality of John Baab's script.

Here's all the steps that i've taken to add Caller ID support:

1) Install python, python-expat, python-openssl
opkg install python python-expat python-openssl

2) Fetch John Baab's script and place it somewhere useful.
wget http://www.baablogic.net/googlecontacts.py


3) Download gdata-python from http://code.google.com/p/gdata-python-client/
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.12.tar.gz


4) Manually install it.  The setup.py script doesn't work on OpenWRT, so this method can be used:

tar xzzf gdata-2.0.12.tar.gz
cp -r gdata-2.0.12/src/* /usr/lib/python2.6/site-packages/
rm -rf gdata-2.0.12*

5) Modify John's script to include your gmail login information.  Run it once manually to populate your database
./google-contacts.py

6) Modify your [google-in] context to process the number properly and do a database lookup:

[google-in]
exten => superm1@gmail.com, 1, NoOp(Callerid  ${CALLERID(name)})
exten => superm1@gmail.com, n, Set(CALLERID(num)=${SHIFT(CALLERID(name),@)})
exten => superm1@gmail.com, n, Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
exten => superm1@gmail.com, n, Dial(SIP/101, 180, D(:1))

7) (optionally) Add this to your crontab so that it will sync new numbers on a regular basis.  John's script will actually redo the database on every run, so it will also get updates then for every removal too.
crontab -e

This will only take effect for calls routed in through google voice or talk because we only modify the google-in context.  If there is no data available, the name field will just remain empty and the number will be shown on Caller ID instead.


Thursday, November 4, 2010

Updating the squashfs with an external rootfs

If it ain't broke don't fix it

We've all heard the phrase at least a dozen times in our life. Yet knowingly it's disobeyed over and over because of shiny new features that we don't need.

It was brought to my attention that there have been a ton of ath9k fixes pulled into the 10.03.1-rc3 interim candidate that should improve wifi performance.  I've had some wifi problems, but it's hard to assess if they'd really be fixed by these patches.  I figured I didn't have much to lose and decided to svn up and rebuild my squashfs image to upgrade on the router.

Normally, this is supposed to be a rather straightforward process (http://wiki.openwrt.org/toh/d-link/dir-825#upgrading.openwrt)

1) svn up
2) make
3) scp bin/ar71xx/openwrt-ar71xx-dir-825-b1-squashfs-sysupgrade.bin root@192.168.1.1:/tmp
4) ssh root@192.168.1.1
5) sysupgrade -v /tmp/openwrt-ar71xx-dir-825-b1-squashfs-sysupgrade.bin
6) Profit

Unfortunately I ran into lots of problems along the way, that eventually stemmed to the contents of the external rootfs being out of sync with what was on the jffs2 partition.  Running an opkg upgrade caused the router to not boot anymore with the flash drive plugged in.

Consequently, I've discovered when you have an external rootfs, you need to follow a bit of a different process when flashing new ROMs.

1) Update svn
svn up
2) Refresh config
make menuconfig
3) Examine the contents of /overlay/etc/ on the router.  In your source tree, you will want to make a files/etc directory and copy in all the relevant configs that you need to persist after you flash.  They'll be baked directly into the ROM image itself.  Over time you should eventually not even need much of overlay configs in /overlay/etc as they'll be in your home rolled roms.
4) Record a list of all packages you have installed that you care about.
4) Power off the router and plug the flash drive into a computer.  Format it.
5) build the new ROM
make
6) follow the regular steps to scp the ROM over and load it.  Don't plug in your flash drive yet.
7) Reboot the router and make sure it comes up
8) Now insert the flash drive and reboot
9) Lastly, install any relevant packages you previously recorded a list of.

All of your configuration should already be on the ROM, so you won't need to reconfigure anything.


Monday, November 1, 2010

Asterisk 1.8 and native Google Voice support

Last week the Asterisk development team announced Asterisk 1.8's release with native support for Google Talk / Gmail calling.  By doing so, a lot of the hackery that was previously done with bridging and AGI dialers in my earlier posts can be axed.

Even though Asterisk 1.8 was released, I didn't see any developers jumping on creating OpenWRT packages, so I decided to do so myself.  I've produced packages for both ar71xx devices (like the one I detailed in earlier posts) as well as brcm-2.4 devices that the market is flooded with.

These packages can be found at http://www.arctangent.net/~superm1/openwrt/.
I've also submitted the packaging changes to a ticket for inclusion in a future OpenWRT release at https://dev.openwrt.org/ticket/8132.

So for an ar71xx device, you would add this line to your /etc/opkg.conf:

  src/gz asterisk1.8 http://www.arctangent.net/~superm1/openwrt/ar71xx

If you've got asterisk 1.6 installed, you'll need to remove all of the associated packages for it before proceeding.

opkg remove asterisk16-sounds asterisk16-res-musiconhold asterisk16-res-agi asterisk16-func-db asterisk16-format-g726 asterisk16-form
at-g729 asterisk16-codec-g726 asterisk16-codec-a-mu asterisk16-app-system asterisk16

For Asterisk 1.8, I think these are the only packages you'll need:

opkg install asterisk18 asterisk18-func-db asterisk18-res-musiconhold asterisk18-chan-gtalk asterisk18-res-rtp-asterisk

Configuration Files

Once installed, you need to add your google information to /etc/asterisk/gtalk.conf.  This configuration will dump my incoming gtalk calls directly to a context that will be defined as 'google-in'.


[general]
context=google-in ; Context to dump call into

[guest] ; special account for options on guest account
disallow=all
allow=ulaw
;context=guest

[superm1-gtalk]
username=superm1@gmail.com
disallow=all
allow=ulaw
context=google-in
connection=superm1


Next configure jabber information in /etc/asterisk/jabber.conf.  This setup will cause you to always be signed into jabber, so make sure to set yourself away and give an informative message to know that it's a computer signed in, not a human.


[superm1] 
type=client
serverhost=talk.google.com
username=superm1@gmail.com
secret=(your password)
statusmessage=I am asterisk [*]
status=xaway

Lastly configure your /etc/asterisk/extensions.conf dialplan for the new inbound and outbound features.  This is built upon my previous dialplan.  It will support incoming sip or google talk/voice as well as outgoing SIP, toll free, and GV.



; --
; Inbound Calls
; --


; * This extension is where any external SIP calls should route to
[default]
exten => s,1,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
exten => s,n,Dial(SIP/101,10)
exten => s,n, Hangup
exten => 101, 1, Dial(SIP/101, 10)


; * From Google (superm1)
[google-in]
exten => superm1@gmail.com, 1, Dial(SIP/101, 180, D(:1))


; --
; Outbound Calls
; --


; * Default starting context for internal SIP devices
[mario-default]
include => local-devices
include => tollfree
include => gv-outbound
include => dial-uri


; * These are for any local extensions we should be supporting
[local-devices]
exten => _1, 1, Dial(SIP/101,10)


; * Toll free numbers (don't use GV for these)
[tollfree]
exten => _411, 1, Dial(SIP/18004664411@proxy.ideasip.com,60)
exten => _1800NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60) 
exten => _1888NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60) 
exten => _1877NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60) 
exten => _1866NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)


; * Route the call using the google voice bridge
[gv-outbound]
;append an area code if necessary
exten => _NXXXXXX,1,Set(CALLERID(dnid)=1512${CALLERID(dnid)})
exten => _NXXXXXX,n,Goto(1512${EXTEN},1)
;append a 1 if necessary
exten => _NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
exten => _NXXNXXXXXX,n,Goto(1${EXTEN},1)
;do our real dialing
exten => _1NXXNXXXXXX,1,Dial(Gtalk/superm1/${EXTEN}@voice.google.com)
exten => _+1NXXNXXXXXX,1,Dial(Gtalk/superm1/${EXTEN}@voice.google.com)


; * Dialing by SIP URL eg foo@domain.com
[dial-uri] 
exten => _[a-z].,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
exten => _[A-Z].,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
exten => _X.,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)

Advantages / Disadvantages
Advantages
  • This configuration is far quicker and more like a real phone.  When you dial a number, it will be connected within seconds rather than 30's of seconds.
  • The quality seems better than the old way (and in theory should be less hops, and less latency)
Disadvantages
  • You have to always be signed into Google Talk/Chat with this solution.  If people IM you and you aren't on a computer, then the IM is lost in your gmail history.
  • If you are signed into Gmail Chat and the computer supports video (has the plugin installed) then your SIP phone won't ring.
Thanks
Thanks to Paul Jennings for helping to provide a quite functional configuration to get started here for me, as well as AST/Calling+using+Google for detailing all the options actually available to configure.

Updates
11/23:
This post seems to be the post that people are linking to and reading mostly when setting up Asterisk 1.8.  Just want to make sure I mention, there have been improvements since this post (as detailed in other future blog postings).  To avoid having to relive the learning experience I did with my other improvements, my (scrubbed for passwords) configs are available at http://www.arctangent.net/~superm1/gv_configs/

Monday, June 21, 2010

Improvements to an asterisk dialplan

After using my previously posted solution for a little bit, I've discovered some deficiencies in it.

  • I can't URI dial (in or out)
  • I can't call additional extensions from one extension to another
  • Google Voice voicemail wasn't kicking in
  • I can't 7 digit dial for my local area code
  • Only one extension will ring at a time for incoming calls

So here is an improved dialplan setup, more modular and should be able to account for all of those deficiencies:


New Dialplan

[default]
exten => s,1,GotoIf(${DB_EXISTS(gv_dialout/channel)}?bridged)
exten => s,n,Dial(SIP/101&SIP/102,10)
exten => s,n, Hangup
exten => s,n(bridged),Bridge(${DB_DELETE(gv_dialout/channel)}, p)
exten => 101, 1, Dial(SIP/101, 10)
exten => 102, 1, Dial(SIP/102, 10)


;
; Default starting context for internal SIP devices
;


[outbound]
include => local-devices
include => tollfree
include => gv-outbound
include => dial-uri


;
; These are for any local extensions we should be supporting
;
[local-devices]
exten => _101, 1, Dial(SIP/101,10)
exten => _102, 1, Dial(SIP/102,10)


;
; These are for outbound toll free numbers we support
;


[tollfree]
exten => _411, 1, Dial(SIP/18004664411@proxy.ideasip.com,60)
exten => _1800NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60) 
exten => _1888NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60) 
exten => _1877NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60) 
exten => _1866NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)


;
; Route the call using the google voice bridge
;


[gv-outbound]
;append an area code (512) if necessary
exten => _NXXXXXX,1,Set(CALLERID(dnid)=1512${CALLERID(dnid)})
exten => _NXXXXXX,n,Goto(1512${EXTEN},1)
;append a 1 if necessary
exten => _NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
exten => _NXXNXXXXXX,n,Goto(1${EXTEN},1)
;do our real dialing
exten => _1NXXNXXXXXX,1,AGI(google-voice-dialout.agi)
exten => _+1NXXNXXXXXX,1,AGI(google-voice-dialout.agi)




;
; Dialing by SIP URL eg foo@domain.com
;


[dial-uri] 
exten => _[a-z].,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
exten => _[A-Z].,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
exten => _X.,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)

Tuesday, June 1, 2010

Google Voice / SIP Solutions

For this project I was to have a Google Voice / Gizmo5 SIP solution.
I put for the the following requirements for myself:
  1. No dedicated server.
  2. Could work with existing HW SIP adapters as well as SW softphones
  3. Could dial out 800 numbers w/o involving GV
  4. Could dial out 411 w/o involving GV
  5. Could receive GV calls
  6. Ability to initiate GV calls
Not having a dedicated server instantly rules out any FreePBX, Trixbox, or PBX in a flash type solutions. So this meant I had to adapt bits and pieces from a lot of solutions that were already out in the open. Surely others want to do solutions similar to mine, so here's how!

I've already got a Gizmo5 account and linked it to my GV account. Directions on how to do this can be found at: http://www.jrin.net/2009_07_26/use-gizmo5-for-free-calls-with-google-voice. If you don't have a Gizmo5 account, there are other solutions out there that will route over a different trunk like ipkall or sipgate, but I imagine they will introduce additional latency to the equation due to the additional hops from PSTN to SIP and back.

Not having a dedicated server means that I likely needed to install Asterisk directly onto a router. Asterisk is a bit of a beast space wise though, and the flash on my old router was a bit tiny. Being that I was overdue for a new one and wanted Wireless N and USB anyhow, I ended up purchasing a Dlink DIR-825 instead.

Flash Firmware
The DIR-825 is supported by OpenWRT's current release, "backfire". Unfortunately I had a little bit of trouble getting it flashed in the first place. The existing backfire images are not properly building the headers to allow it to be flashed. This has been fixed in trunk (images newer than April 26th). To workaround the issue in backfire, the headers can be crafted as follows, using the original firmware image and a backfire image respectively:

dd if=dir825_revB_firmware_202NA.bin of=new.bin
dd if=/dev/zero of=new.bin bs=4194304 count=1 conv=notrunc
dd if=openwrt-ar71xx-dir-825-b1-squashfs-backup-loader.bin of=new.bin bs=2424836 count=1 conv=notrunc







Once the initial firmware is loaded, the device still won't support a USB overlay - so don't install Asterisk yet.

Prepare External Rootfs
You'll have to follow the directions at http://wiki.openwrt.org/doc/howto/rootfsonexternalstorage for information on how to build your own firmware image with support for externalstorage overlays. I found the documentation on how to configure the new /etc/config/fstab horrible, so here's the one I finally came up with:

config global automount
option from_fstab 1
option anon_mount 1

config mount
option target /overlay
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0
option is_rootfs 1

Reboot the system and make sure that you actually are using the external rootfs before you proceed to install Asterisk. You'll notice that your flash drive is mounted on /overlay.

root@router:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 1.9M 1.9M 0 100% /rom
tmpfs 30.3M 1.3M 29.0M 4% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock4 3.3M 264.0K 3.0M 8% /tmp/overlay
/dev/sda1 3.7G 95.4M 3.4G 3% /overlay
mini_fo:/overlay 1.9M 1.9M 0 100% /

Now that you have tons of space, configure the general stuff on the router to your liking. 





Install Python

Python is needed for the AGI script that connects to the GV website.


opkg install python python-openssl

Install Asterisk
I purposely didn't mention to install Asterisk yet. The Asterisk 1.6 that comes with backfire doesn't support AGI, which we'll need for the dialer. What you'll want to do is grab the one from trunk instead. The easiest way to do this is to comment out the backfire repository in /etc/opkg.conf and add the trunk one temporarily.

src/gz packages http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages

Now you can go and install Asterisk 1.6.

opkg install asterisk16 asterisk16-app-system asterisk16-codec-a-mu asterisk16-codec-g726 asterisk16-format-g726 asterisk16-format-g729 asterisk16-func-db asterisk16-res-agi asterisk16-sounds

Revert the repositories back to backfire now. You don't want to be pulling anything else from Trunk.

Next we need to configure Asterisk, the dialplans, and the sip settings. First thing you need to do is make sure it is set to use the proper directories.

Configure Asterisk
Modify the first line in /etc/asterisk/asterisk.conf from:

[directories](!) ; remove the (!) to enable this

to

[directories] ; remove the (!) to enable this

Configure SIP Settings
In the [general] section of /etc/asterisk/sip.conf add a registration for the G5 server:

register => 1747000000:secretpassword@proxy01.sipphone.com

Now, add a new section for the account's inbound connections. If you plan to use G5 for outbound as well, change the type to friend.

[proxy01.sipphone.com]
type=user
context=default
disallow=all
allow=gsm
allow=ulaw
allow=ilbc
dtmfmode=rfc2833
host=proxy01.sipphone.com
insecure=port,invite
username=1747000000
secret=secretpassword
canreinvite=no

Next we add a section for our HW device or softphone.
[101]
username=101
secret=101
type=friend
callerid="Mario"
host=dynamic
context=outgoing
outgoinglimit=1
incominglimit=1
canreinvite=no

Configure Dialplan Settings
The dialplan is stored in /etc/asterisk/extensions.conf.
We're going to have two separate starting contexts - for outgoing and incoming calls. For the outgoing context, we route all 411 and 800 numbers to a free 800 terminator like ideasip. For anything else that looks like a regular number we're going to use a google voice AGI script (which we'll get to later).

[outgoing]
exten => _411, 1, Dial(SIP/18004664411@proxy.ideasip.com,60)
exten => _1800NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1888NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1877NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1866NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1NXXNXXXXXX,1,AGI(google-voice-dialout.agi)

For the incoming context we need to check whether or not we are coming from a GV bridge or a regular SIP call. If it's a GV bridge we bridge the calls together, otherwise we forward it to our extension.

[default]
exten => s,1,GotoIf(${DB_EXISTS(gv_dialout/channel)}?bridged)
exten => s,n,Dial(SIP/101,10)
exten => s,n,Hangup
exten => s,n(bridged),Bridge(${DB_DELETE(gv_dialout/channel)}, p)

Google Voice AGI
Now fetch the google voice AGI script from Paul Marks at http://www.pmarks.net/posted_links/google-voice-dialout.agi. Configure your info at the top of it, and throw it in /usr/lib/asterisk/agi-bin.

Start it out and Test
To start asterisk run it's init script

/etc/init.d/asterisk start

I think that should cover everything. You should be able to add your info to your softphone or SIP adapter now.