Asterisk and Google Voice Dial out

Hi guys,

I would like to make Asterisk works with google voice to call US and Canada for free. I have a gmail account and I can call from the browser.

I configured my jabber account and I can call using the email adress.

I first used that to dial out :

exten => _1XXXXXXXXXX,1,Dial(gtalk/asterisk/+${EXTEN}

It didn’t work I had an error like this one :

asterisk google voice

So I decided to try this script : … ialout.agi

It didn’t work so I tried to run it from the cmd line doing :

agi_dnid: 157537626##

and I got :

{‘agi_dnid’: ‘157537626##’, ‘agi_channel’: ‘’}
database put gv_dialout channel


Getting login page.
Logging in.
Calling 157537626## via
Dial response: {“ok”:false,“data”:{“code”:20}}
Logged out.

Anyone could help me please ?

Thank you very much,


These are the instructions I followed and worked perfectly for me:
Just replace:
google voice number
yum install gnutls-devel

cd iksemel-1.4
make check --> runs 8 tests
make install
ldconfig -p | grep semel --> should return nothing, because the library cache is not yet updated with the new libraries installed in non-standard locations.
echo “/usr/local/lib” > /etc/ --> add a new library location
ldconfig --> update the library cache
ldconfig -p | grep semel (libc6,x86-64) => /usr/local/lib/ (libc6,x86-64) => /usr/local/lib/

Now the libraries are found in cache file /etc/ as shown above.

Recompile Asterisk if needed … tion_ready

asterisk -rx “module show” | grep res_jabber AJI - Asterisk Jabber Interface 0

asterisk -rx “module show” | grep chan_gtalk Gtalk Channel Driver 0


debug=yes ; Enable debugging (disabled by default).
autoprune=yes ; Auto remove users from buddy list. Depending on your
; setup (ie, using your personal Gtalk account for a test)
; you might lose your contacts list. Default is ‘no’.
autoregister=yes ; Auto register users from buddy list.
;collection_nodes=yes ; Enable support for XEP-0248 for use with
; distributed device state. Default is ‘no’.
;pubsub_autocreate=yes ; Whether or not the PubSub server supports/is using
; auto-create for nodes. If it is, we have to
; explicitly pre-create nodes before publishing them.
; Default is ‘no’.
;auth_policy=accept ; Auto accept users’ subscription requests (default).
; Set to deny for auto denial.
type=client ; Client or Component connection ; Route to server for example,
; ; Node to use for publishing events via PubSub ; Username with optional resource.
secret= ; Password
;priority=1 ; Resource priority
port=5222 ; Port to use defaults to 5222
usetls=yes ; Use tls or not
usesasl=yes ; Use sasl or not
status=available ; One of: chat, available, away, xaway, or dnd
statusmessage=“I am an Asterisk Server” ; Have custom status message for Asterisk
keepalive=yes ; Timeout (in seconds) on the message stack, defaults to 5.
; Messages stored longer than this value will be deleted by Asterisk.
; This option applies to incoming messages only, which are intended to
; be processed by the JABBER_RECEIVE dialplan function.

[root@maradona asterisk]# more gtalk.conf
context=googlein ; Context to dump call into
bindaddr= ; Address to bind to
; ; Set your external ip if you are behind a NAT.
; ; Get your external ip from a STUN server.
; Note, if the STUN query is successful, this will
; replace any value placed in externip;
allowguest=yes ; Allow calls from people not in list of peers

[guest] ; special account for options on guest account


exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,SendDTMF(1)
exten => s,n,Set(CALLERID(num)=${CUT(CALLERID(name),@,1)})
exten => s,n,Set(CALLERID(name)=${CUT(CALLERID(name),/,1)})
exten => s,n,Goto(from-trunk,<googlenumber example 14081112222>,1)
exten => s,h,Hangup

For external calls I use a custom trunk in FreePBX and just added under: Custom Dial String




Thank you for your fast and complete answer. I didn’t specify that my server is located in France (Maybe that’s why I get these problems). I just need to enjoy free call to US and Canada so I tried the last part :


and here is what I get :

JABBER: gtalk_account INCOMING:

-- Gtalk/ is ringing

JABBER: gtalk_account INCOMING: <iq from=""to=“xxx/TalkACC50C33” type=“error” id=“aaaad”><session type="candidates"id="258180e15baabfed"initiator=“xxxx/TalkACC50C33” xmlns=“”>

[Jan 11 13:36:44] NOTICE[18784]: chan_gtalk.c:1942 gtalk_parser: Remote peer reported an error , trying to establish the call anyway

JABBER: gtalk_account OUTGOING:

I can hear it ringing but no connection :frowning:

Thank you for your help again.

Hi again guys,

Anybody could help me ?

Your basic problem is that there are less than about a dozen people who regularly read these forums, and most or all of those will be interested in SIP or dahdi channels, or the higher level functions, like queueing or conferences.

I’ll probably find that a jabber expert pipes in now, but I rather suspect there aren’t any here!

You probably need to try and work out who provided the jabber support and then look at all the support channels (mailing lists, IRC, etc.) to see if you can spot them. Note, even if you can work out a direct email address, they may not like direct approaches.

You might want to check

If it applies, you will need Asterisk 1.8 or to do your own backport.

More generally, look at category Channels/chan_talk on

phsultan looks like they may be the gtalk expert.

Looks like you’re using something prior to Try that version of Asterisk.

There’s a wiki article here ( … ing+Google) that covers calling using Google.


It’s working for me. I’m using 1.8.2, but worked also.

A previous poster posted his jabber.conf file. I noticed what I think is a key difference:

[quote] ; Username with optional resource.

Mine is username=<email>"

Also, I noticed your Dial is:


The word “asterisk” in your example should be the gmail username, not literally “asterisk”.

Finally, you added a “+” sign to your number. Not sure this works, since I think this is considered the “international prefix.” Remember that you are calling from within the United States. You should just have 1, the area code, and the local number, like 13605551212.

I would try or 1.8.2, though.

Sending the + character shouldn’t be the problem.