Google voice. extension rings, answer ok but called continues to ring... no connection

I finally got GV working, well almost.
The call from GV rings the extension. I answer the extension and it says connected. however the calling party is still hearing the ring and is never connected.

here are the logs and confs:

Jan 31 08:39:44] VERBOSE[10432] app_macro.c: == Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘Gtalk/+17753380648-0108’ in macro ‘exten-vm’
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: == Spawn extension (from-did-direct, 300, 1) exited non-zero on ‘Gtalk/+17753380648-0108’
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Executing [h@from-did-direct:1] Macro(“Gtalk/+17753380648-0108”, “hangupcall,”) in new stack
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Executing [s@macro-hangupcall:1] GotoIf(“Gtalk/+17753380648-0108”, “1?skiprg”) in new stack
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Goto (macro-hangupcall,s,4)
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Executing [s@macro-hangupcall:4] GotoIf(“Gtalk/+17753380648-0108”, “1?skipblkvm”) in new stack
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Goto (macro-hangupcall,s,7)
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Executing [s@macro-hangupcall:7] GotoIf(“Gtalk/+17753380648-0108”, “1?theend”) in new stack
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Goto (macro-hangupcall,s,9)
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: – Executing [s@macro-hangupcall:9] Hangup(“Gtalk/+17753380648-0108”, “”) in new stack
[Jan 31 08:39:44] VERBOSE[10432] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘Gtalk/+17753380648-0108’ in macro ‘hangupcall’
[Jan 31 08:39:44] VERBOSE[10432] pbx.c: == Spawn extension (from-did-direct, h, 1) exited non-zero on ‘Gtalk/+17753380648-0108’
[Jan 31 08:39:44] VERBOSE[10432] res_jabber.c:
JABBER: mworsnop OUTGOING:
[Jan 31 08:39:44] VERBOSE[10143] res_jabber.c:
JABBER: mworsnop INCOMING: If set, the ‘from’ attribute must be set to the user’s full JID.

[Jan 31 08:39:46] VERBOSE[9998] res_jabber.c:
JABBER: nutridroid INCOMING: <ses:session type=“terminate” id="[email protected]" initiator="[email protected]/srvres-MTAuMTMuOTIuMTc6OTgwMQ==" xmlns:ses=“http://www.google.com/session”><pho:call-ended xmlns:pho=“http://www.google.com/session/phone”>Call cancelled</pho:call-ended></ses:session>
[Jan 31 08:39:46] NOTICE[9998] chan_gtalk.c: Whoa, didn’t find call during hangup!
[Jan 31 08:39:46] VERBOSE[9998] res_jabber.c:
JABBER: mworsnop OUTGOING:
[Jan 31 08:40:07] VERBOSE[9998] res_jabber.c:
JABBER: nutridroid INCOMING:
~

jabber

[general]
debug=yes
autoprune=no
autoregister=yes

[mworsnop]
type=client
serverhost=talk.google.com
[email protected]/Talk
secret=xxxx
port=5222
usetls=yes
usesasl=yes
status=Available
statusmessage="I am an Asterisk Server"
timeout=100
keepalive=yes

gtalk

[general]
debug=yes
allowguest=yes
context=googlein
stunaddr=stun01.sipphone.com

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

extension

[googlein]
exten => _[@Xa-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => _[@Xa-z].,n,GotoIf($["${CALLERID(name):0:2}" != “+1”]?notrim)
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _[@Xa-z].,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => _[@Xa-z].,n,Answer
exten => _[@Xa-z].,n,Wait(1)
exten => _[@Xa-z].,n,SendDTMF(1)
exten => _[@Xa-z].,n,Goto(from-trunk,gv-incoming-${CUT(EXTEN,@,1)},1)
exten => h,1,Macro(hangupcall,)

[gvoice-mworsnop]
exten => _X.,1,Dial(Gtalk/mworsnop/+${EXTEN}@voice.google.com)
exten => _X.,n,Noop(GVoice Call to ${EXTEN} failed)
exten => h,1,Macro(hangupcall,)

~

I got it working!!! thank you very much for the conf files they helped a lot!

Also forgot to mention, to make outgoing calls do the following

In Trunks
Create a CUSTOM trunk named google

custom dial string local/$OUTNUM$@googleout

Create another CUSTOM trunk with your GV number ex 5556661212
custom dial string local/$OUTNUM$@5556661212

Outbound Routes
select google

Now you will also be able to make outgoing calls using your GV number.

Try this:

nano gtalk.conf

[general]
context=googlein
allowguest=yes

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

[5556661212] ;CALLER ID SET IN EXTENSIONS
disallow=all
allow=ulaw
[email protected]
context=5556661212
connection=5556661212

nano jabber.conf

[general]
autoprune=no
autoregister=yes

[5556661212]
type=client
serverhost=talk.google.com
[email protected]/Talk
secret=password
port=5222
usetls=yes
usesasl=yes
status=Available
statusmessage="WTN"
timeout=100

nano extensions_custom.conf

;SET IN FREEPBX INCOMING ROUTE $EXTEN VALUE and point to extension

[googlein]
exten => _[@Xa-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
exten => _[@Xa-z].,n,Set(dst=${CUT(EXTEN,@,1)})
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => _[@Xa-z].,n,GotoIf($["${CALLERID(name):0:2}" != “+1”]?notrim)
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _[@Xa-z].,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => _[@Xa-z].,n,Answer
exten => _[@Xa-z].,n,Wait(1)
exten => _[@Xa-z].,n,SendDTMF(1)
exten => _[@Xa-z].,n,Goto(from-trunk,${dst},1)

[googleout]
exten => _X.,1,Noop(If this line is run, something is very wrong)
exten => _X.,n(${CALLERID(number)}),Set(ALERTNAME=${CALLERID(number)})
exten => _X.,n,Goto(user)
exten => _X.,n(alert),Set(STATUS=${JABBER_STATUS(${CALLERID(number)},${ALERTNAME})});
exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => _X.,n(user),JABBERSend(${CALLERID(number)},${ALERTNAME},Placing GVoice Call: ${EXTEN})
exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"=“10”]?us:other)
exten => _X.,n(us),Dial(Gtalk/${CALLERID(number)}/+1${EXTEN}@voice.google.com)
exten => _X.,n,Goto(done)
exten => _X.,n(other),Dial(Gtalk/${CALLERID(number)}/+${EXTEN}@voice.google.com)
exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed)

[5556661212]
exten => _X.,1,Wait(1)
exten => _X.,n,Set([email protected])
exten => _X.,n,JABBERSend(${CUT(ALERTNAME,@,1)},${ALERTNAME},Placing GVoice Call: ${EXTEN})
exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"=“10”]?us:other)
exten => _X.,n(us),Dial(Gtalk/${CUT(ALERTNAME,@,1)}/+1${EXTEN}@voice.google.com)
exten => _X.,n,Goto(done)
exten => _X.,n(other),Dial(Gtalk/${CUT(ALERTNAME,@,1)}/+${EXTEN}@voice.google.com)
exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed)

IN FREEPBX goto INBOUND ROUTES and for the route put the first part of your [email protected] for example username as the DID and point it to an extension.

It should work! dont forget to reload asterisk.