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}@voice.google.com)

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

asterisk google voice

So I decided to try this script :
pmarks.net/posted_links/goog … ialout.agi

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

./google-voice-dialout.agi
agi_channel:
agi_dnid: 157537626##

and I got :

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

answer

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

Anyone could help me please ?

Thank you very much,

Vincent.

These are the instructions I followed and worked perfectly for me:
Just replace:
username
password
google voice number

iksemel.googlecode.com/files/iksemel-1.4.tar.gz
yum install gnutls-devel

cd iksemel-1.4
./configure
make
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/ld.so.conf.d/iksemel.conf --> add a new library location
ldconfig --> update the library cache
ldconfig -p | grep semel

libiksemel.so.3 (libc6,x86-64) => /usr/local/lib/libiksemel.so.3
libiksemel.so (libc6,x86-64) => /usr/local/lib/libiksemel.so

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

Recompile Asterisk if needed

voipcomsolutions.com/wiki/index. … tion_ready

asterisk -rx “module show” | grep res_jabber

res_jabber.so AJI - Asterisk Jabber Interface 0

asterisk -rx “module show” | grep chan_gtalk

chan_gtalk.so Gtalk Channel Driver 0

jabber.conf

[general]
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.
[asterisk]
type=client ; Client or Component connection
serverhost=talk.google.com ; Route to server for example, talk.google.com
;pubsub_node=pubsub.astjab.org ; Node to use for publishing events via PubSub
username=@gmail.com/asterisk ; 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
timeout=100
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
[general]
context=googlein ; Context to dump call into
bindaddr=0.0.0.0 ; Address to bind to
;externip=asterisk.public.com ; Set your external ip if you are behind a NAT.
;stunaddr=mystunserver.com ; 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
disallow=all
allow=ulaw
context=googlein
connection=asterisk

extensions_custom.conf

[googlein]
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

gtalk/asterisk/+$OUTNUM$@voice.google.com

HTH

Hi,

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 :

gtalk/asterisk/+$OUTNUM$@voice.google.com

and here is what I get :

JABBER: gtalk_account INCOMING:

-- Gtalk/+15753762664@voice.google.com-fbf7 is ringing

JABBER: gtalk_account INCOMING: <iq from="+15753762664@voice.google.com/srvres"to=“xxx/TalkACC50C33” type=“error” id=“aaaad”><session type="candidates"id="258180e15baabfed"initiator=“xxxx/TalkACC50C33” xmlns=“http://www.google.com/session”>

[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

issues.asterisk.org/view.php?id=18412

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

More generally, look at category Channels/chan_talk on issues.asterisk.org.

phsultan looks like they may be the gtalk expert.

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

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

Cheers.

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

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

[quote]username=@gmail.com/asterisk ; Username with optional resource.
[/quote]

Mine is username=<email>@gmail.com/Talk"

Also, I noticed your Dial is:

[quote]gtalk/asterisk/+$OUTNUM$@voice.google.com
[/quote]

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 1.8.1.1 or 1.8.2, though.

Sending the + character shouldn’t be the problem.