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.