Google Voice

I’ve been trying to get the new Google Voice support to work, so far I can make calls from extensions out through google voice but not vice versa. With debug set I see the following:
== Starting Gtalk/+18005553333-0e88 at asterisk,lonnie.bates@gmail.com,1 failed so falling back to exten ‘s’
== Starting Gtalk/+18005553333-0e88 at asterisk,s,1 still failed so falling back to context ‘default’
– Executing [s@default:1] NoOp(“Gtalk/+18005553333-0e88”, " Call from Gtalk ") in new stack
– Executing [s@default:2] Set(“Gtalk/+18005553333-0e88”, “CALLERID(name)=“From Google Talk””) in new stack
– Executing [s@default:3] Dial(“Gtalk/+18005553333-0e88”, “SIP/222,”) in new stack
== Using SIP RTP CoS mark 5
– Called 222
== Spawn extension (default, s, 3) exited non-zero on 'Gtalk/+18008884444-0e88’

However the call never rings to extension 222. Extension 222 can call 333 with out any issue…

extensions.conf
[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=DAHDI/G2
TRUNKMSD=1
[default]
exten => s,1,NoOp( Call from Gtalk )
exten => s,n,Set(CALLERID(name)=“From Google Talk”)
exten => s,n,Dial(SIP/222,)

exten => _1XXXXXXXXXX,1,dial(Gtalk/asterisk/+${EXTEN}@voice.google.com,)
exten => _801XXXXXXX,1,dial(Gtalk/asterisk/+1${EXTEN}@voice.google.com,)

exten => 222,1,Dial(SIP/222,)
exten => 333,1,Dial(SIP/333,)

gtalk.conf
[general]
context=default
bindaddr=192.168.0.100
externip=99.99.99.99
allowguest=yes

[guest]
disallow=all
allow=ulaw
context=asterisk

jabber.conf
[general]
debug=no
autoprune=no
autoregister=yes

[asterisk]
type=client
serverhost=talk.google.com
username=username@gmail.com/gmail
secret=secrepassword
port=5222
usetls=yes
usesasl=yes
statusmessage="I am available"
timeout=100

sip.conf
[general]
context=default
allowoverlap=no
udpbindaddr=0.0.0.0
tcpenable=no
tcpbindaddr=0.0.0.0
srvlookup=yes
localnet=192.168.0.0/255.255.255.0
externaddr=99.99.99.99

[222]
type=friend
context=default
username=222
secret=secret
host=dynamic
canreinvite=no
dtfmode=rfc2833
disallow=all
allow=ulaw
subscribecontext=default
mailbox=222@internal
nat=yes
directmedia=no

[333]
type=friend
context=default
username=333
secret=secret
host=dynamic
canreinvite=no
dtfmode=rfc2833
disallow=all
allow=ulaw
subscribecontext=default
mailbox=333@internal

I’ve got both incoming and outgoing calls to work through google voice now, I had to change my dialing plan a bit. I’m not really experienced with asterisks yet, so it was something pretty basic I missed, like the answering the phone part. My current dial plan is extremely basic, I’m sure I’m missing something however it’s working… If there are anything else anyone can add, that would be great.

[default]
exten => s,1,Dial(SIP/222)
exten => s,n,answer()

exten => _1XXXXXXXXXX,1,dial(Gtalk/asterisk/+${EXTEN}@voice.google.com,)
exten => _801XXXXXXX,1,dial(Gtalk/asterisk/+1${EXTEN}@voice.google.com,)

exten => 222,1,Dial(SIP/222)

I am trying to make gtalk work on Asterisk 1.8 as well. Just installed A-1.8 successfully. Now I am try to follow your post to make gtalk work. I have a few questions and hope you can help.

  1. In [gtalk] section, what is the “bindaddr=192.168.0.100”? Is it the ip address of the server with asterisk?
  2. What is the “externip=99.99.99.99”? Is this my web ip address or gtalk’s server address?
  3. in [asterisk] section, do I need to open ip port 5222 on the router?

Thanks in advance.

My asterisks server has a natted private IP address behind my router. The bindaddr=192.168.0.100 is for that private address. The externip=99.99.99.99 is the public IP address that is actually on my router. I didn’t need to forward port 5222 for this to work, I believe once asterisks starts, it initiates the jabber/jingle connection to google that it uses for signaling. I did forward the SIP port 5060 and the UDP port range that is used for RTP.

Enabling debug for jabber and setting verbose and debug on the asterisks server helped quite a bit while troubleshooting.

Thanks. I guess this is what I thought.
For the public address, it seems I can only use the number format, but not the name domain format,e.g. my.domain.com. This this true?
Right now, I can register my softphone to asterisk 1.8 server. However, when I try to make a call, I got: "NOTICE[23498]: chan_sip.c:21187 handle_request_invite: Failed to authenticate device “myname"sip:102@192.168.0.137;tag=a3257664” Do you know what is wrong? (192.168.0.137 is my server internal address and 102 is my SIP phone user number) My sip.conf has three users, i.e., 101, 102, 103. Hope you can give me some suggestions.

Another strange thing is that it always told me that the sip client has wrong password. I was only able to log in once when I got the right result. It then always refuse to connect to the SIP client. This had never been a problem in asterisk 1.4 or 1.6.

Correct, you can only use the an IP address for the externip variable. If you have a dynamic public IP, I believe you may be able to use the stunaddr option. I’m not positive about the sip issue though. If you post your sip.conf and extensions.conf, that may help. Also you can enable debugging and verbose from the asterisk cli with the follwoing:

core set debug 10 core set verbose 10

Let me check and let you know the results.
One issue might be that I am running it on an ARM based device (Dockstar). It compiles a-1.8 well and previously I never have any problem with asterisk 1.4 and 1.6. However, since asterisk 1.8 so new, I don’t know if there’s any issues. Let me try it on an centos based PC to see what happens. BTW, are you using a full CentOS with GUI or just text based version?
Thank you for your response.

We’ve got a Wiki page about Google Voice and Asterisk.

wiki.asterisk.org/wiki/display/ … ing+Google

Cheers.

Great! I will try it out tonight. I have couple of minor questions.

  1. In sip.conf section, your extension is [malcolm], can I use numbers like 102, 103, etc?
  2. Which platform you are using. Is it a PC running CentOS or something else? Is it on VMware or not. I just want to follow exactly you have been successful before venture out.
    Thanks. I will post once I get my hands on it.

[quote=“twinclouds”]Great! I will try it out tonight. I have couple of minor questions.

  1. In sip.conf section, your extension is [malcolm], can I use numbers like 102, 103, etc?
  2. Which platform you are using. Is it a PC running CentOS or something else? Is it on VMware or not. I just want to follow exactly you have been successful before venture out.
    Thanks. I will post once I get my hands on it.[/quote]

Howdy,

  1. Yes.

  2. I’ve used it on Ubuntu 10.04 & 10.10 as well as an extremely old Fedora Core release - so old that I don’t remember.

Cheers.

I’m trying to setup Google Voice with FreePBX with an AsteriskNOW install. I’ve upgraded to Asterisk18 and am still on FreePBX 2.7. I can easily upgrade to FrePBX 2.8, but I was trying to figure out how to do it without editing Asterisk conf files. Anyone else have any experience with FreePBX?

[quote=“malcolmd”]

Howdy,

  1. Yes.

  2. I’ve used it on Ubuntu 10.04 & 10.10 as well as an extremely old Fedora Core release - so old that I don’t remember.

Cheers.[/quote]

Thanks.
I tried it out. In the sip user section, when I edited sip.conf and reloaded it, asterisk complained about the user does not a type. I added “type=friend” asterisk was fine but when the sip softphone try to register, it showed again wrong password. I checked asterisk and sip phone, both passwords are exact match. The same password/sip phone set-up are fine for asterisk 1.6/1.4. The only thing I can think of is asterisk 1.8 may not work for some reason with ARM based Dockstar. I will install it on Ubuntu 10.04 and to see if it works.
Do you have type=xxxxx in your sip.conf?

I noticed there are some differences between your config files and jimylongs’ will both sets work?

You use externhost if you want to use a name.

Howdy,

Use a type of peer for the SIP entry.

Not sure about someone else’s configs, I’d rather not evaluate them if I can get away with it.

Cheers

[quote=“malcolmd”]Howdy,

Use a type of peer for the SIP entry.

Not sure about someone else’s configs, I’d rather not evaluate them if I can get away with it.

Cheers[/quote]

Thanks.
I installed A1.8 on Ubuntu 10.04 late last night. I have not tested it out yet.
It looks like I need to install mysql for some of the features. Is it used at all?

No, the specific mysql db driver shouldn’t be used; you should use the generic odbc driver instead.

No MySQL or relational DB is required to make Google Voice work.

Cheers.

Not sure what happened but I got all sorts of errors. The latest is:
"[Oct 30 07:20:11] ERROR[3171]: rtp_engine.c:325 ast_rtp_instance_new: No RTP engine was found. Do you have one loaded?
[Oct 30 07:20:11] ERROR[3171]: chan_sip.c
:8078 process_sdp: Got SDP but have no RTP session allocated."
Anyone might be able to give hint?
I used malcolmd’s conf files

Now I am might get somewhere but still not work. Below is the error message:
" == Using SIP RTP CoS mark 5
– Executing [18586584251@default:1] Dial(“SIP/192.168.2.135-00000001”, “gtalk/asterisk/+18586584251@voice.google.com”) in new stack
[Oct 29 22:58:31] WARNING[2279]: channel.c:5353 ast_request: No channel type registered for ‘gtalk’
[Oct 29 22:58:31] WARNING[2279]: app_dial.c:2030 dial_exec_full: Unable to create channel of type ‘gtalk’ (cause 66 - Channel not implemented)
== Everyone is busy/congested at this time (1:0/0/1)
– Auto fallthrough, channel ‘SIP/192.168.2.135-00000001’ status is ‘CHANUNAVAIL’"

But I do have gtalk.conf:

[general]
context=default
allowguests=yes
bindaddr=0.0.0.0
externip=my.ip.address.xxx

[guest]
disallow=all
allow=ulaw
context=default
connection=asterisk

Can someone point out what is wrong?

For older versions, I understand is is necessary to install res_jabber.so and chan_gtalk.so separately. For version 1.8, will these modules be installed automatically?