Occassional posts about VoIP, SIP, WebRTC and Bitcoin.
Updated 25 Jan 2010: Adjusted for the new parameters required when using the sys.GoogleVoiceCall method in the sipsorcery dialplan.
The “hacked” up Google Voice App on sipsorcery appears to have attracted some new people to the site. To help them I’m writing a quick tutorial about how they can quickly get up and running to place a call with the Google Voice app.
Warning: People new to sipsorcery will probably be fine until they get to the dialplan configuration and will then start cursing in frustration: “why is this thing so *#!@ hard all I want to do is make a telephone call!”. The reason is that sipsorcery and mysipswitch before it were designed for people to be able to experiment with SIP stuff and try weird and wonderful things. The price for that power and flexibility has so far been ease of use. One day the plan is to re-create something like the dialplan wizard to make it simpler but so far it just hasn’t made it to the top of the list.
Back to the promised tutorial.
Following are the minimum steps you need to take to be able to place a call from sipsorcery to terminate with Google Voice.
Goog Voice - Phone
SIP Provider Details - Gizmo
Google Voice - Minimal Dial Plan
And so you can actually read it:
[sourcecode language=”ruby”]
sys.Log("starting dialplan…")
sys.GoogleVoiceCall("emailaddress@gmail.com", "password", "1747612xxxx", "1132701859", ".*", 7)
sys.Log("Sorry, Google Voice Call failed.")
[/sourcecode]
Here’s what each of the parameters mean:
Once you have taken those 4 steps you need to configure your ATA, IP Phone or soft phone to use the sipsorcery SIP account and then place a call. If all goes according to plan you will get the following:
That’s it, Easy 🙂.
Caveats. Google obviously didn’t intend for people to be able to hook up their SIP devices to make free calls. I assume free calls via the Callback mechanism on the Google Voice web site pays off by driving web traffic to the site. With a SIP call there is no such pay off. As such the sipsorcery solution and other solutions around the web are hacks. That means they are susceptible to breaking or being blocked it Google get annoyed with the SIP calls. On the mysipswitch Forums there are already reports of the occassional call failing with a HTTP 500 Server Error. Watching the sipsorcery logs I have seen a few calls getting the same. That error maybe because there was something about the call request Google didn’t like, you can test that by using the same values in a Callback from the Google Voice page, or it may be that the HTTP requests that are sent from sipsorcery to Google are occassionally going to get rejected for some reason (the 500 Server Error was caused by a bug in the sipsorcery code). The point is if you want to use this sort of solution on sipsorcery or elsewhere you will probably need to accept that not every call is going to work (that being said none of my own test calls have failed yet).
Finally if you would like to get a little bit more adventurous with your dialplan and have it send the number you called in on as the destination for your Google Voice call you can use the one shown below.
Google Voice Call - Advanced Dial Plan
[sourcecode language=”ruby”]
sys.Log("starting dialplan…")
sys.GoogleVoiceCall("emailaddress@gmail.com", "password", "1747612xxxx", "#{req.URI.user}", ".*", 7)
sys.Log("Sorry, Google Voice Call failed.")
[/sourcecode]