Asterisk 1.8.1 and google voice voicemail

I have successfully configured a two trunk Google Voice system with Freepbx 2.8.0.4 and Asterisk 1.8.1 on Ubuntu Server 10.04.1. Everything works except for one nagging problem. There is a 25 second rule in GV that makes GV voicemail kick in if the line is not answered in time. I had set my ring length to be longer than this, but GV voicemail never picked up. Eventually the call just dropped after about 45 seconds. Has anyone else experienced this?

I ended up having to set up a temp voicemail box on my Asterisk server so that people would have some place to leave messages. If I turn Google Chat forwarding off, all is well. I can attach conf files if necessary, but something tells me this is a GV interaction problem, and I wanted to check with anyone else who might have this working. After all I have read about setting this up, nothing tells me that I need something special to interact with GV voicemail.

Howdy,

Sorry, you’re trying to do what?

Receive a call from one GV account and then forward it back to another GV account’s GV voicemail?

You should have your GV setup to send your calls to your GoogleChat account. Asterisk should be logged in as that account. The first thing Asterisk should do in its dialplan is to Answer() the call. After that, you’ll want to have Asterisk SendDTMF(1) back to Google, so that we tell Google we’re actually going to answer the call - otherwise, it will go to GV Voicemail.

Cheers.

This is indeed what I have done, minus the forward back to GV part. Except that after the 1 DTMF tone is sent back and the call rings for about 45 seconds, GV voicemail will NOT pick up. This is what I want to to investigate. GV voicemail should pick up, but it never does. Should GV pick up after 25 seconds on its own, or do I have to route the call back to GV through the “Destination if no answer” portion of the Inbound Route Ring Group I have? If the latter is the case, then how?

I just did a test where the GV incoming route dumps into a SIP extension and rings for 70 seconds. I called in and rang for about that long. I tested with Asterisk not logged into jabber and me being signed into Chat through the Gmail interface. I called and the phone rang about four times, and then my GV voicemail picked up. Shouldn’t GV voicemail also pick up from a ringing Asterisk extension after 25 seconds or so? The GV forward to chat was the constant in both of these tests.

Howdy,

Once you Answer the call and once you’ve sent the DTMF 1 back to Google Voice, you’ve indicated that you’ve answered the call, you can’t put it back through to the same accounts Google Voice voicemail - as far as Google knows, you really did “answer” the call, so there’s no reason for them to put it to Voicemail, they can’t.

If you want to achieve this sort of capability, where Asterisk answers it but you can still use Google Voice voicemail, you’ have to use a second Google Voice account and put the call through to the Google Voice voicemail there.

Answer the call
Send the DTMF
Dial an internal phone for some period of time
Send the call to another Google Voice number / account.

I understand now. So, the “1” is like akin to a real phone answering the call, but in this case, the “phone” is Asterisk and then it handles it however I define. I just played with it, and if I don’t send the “1” in the dialplan, I have to enter a “1” from the extension I answer from to actually answer the call. Is there a way to automate the sending of a “1” ONLY if I actually pick up at an extension?

Here is the relevant code:

[googlein1]
exten => s,1,Wait(1)
exten => s,n,Set(ALERTNAME=NAMETAKENOUT@gmail.com)
;exten => _X.,n,Set(STATUS=${JABBER_STATUS(asterisk,${ALERTN AME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => s,n,JABBERSend(asterisk,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(name)=${CALLERID(number)})
exten => s,n,Answer
exten => s,n,Wait(2)
;exten => s,n,SendDTMF(1)
exten => s,n,Goto(from-trunk,19191234567,1)

[quote=“zanophol”]I understand now. So, the “1” is like akin to a real phone answering the call[quote]

Yes. If you were forwarding back to your mobile or forwarding to a regular Google Chat client, you can disable the “1” requirement. But, if it’s Asterisk answering the call, Google requires you to send the “1,” even if you told the Google Voice web interface to not require it. So, it’s confusing.

Correct. Once you’ve Answered it and sent the “1” back to Google, the call is handled by Asterisk. Google considers that it’s been answered and keeps the call up now until Asterisk disconnects it.

[quote=“zanophol”]
Hmm, what are the implications of not sending the “1”? Does that mean to answer an incoming call, I will have to press a “1” manually if I want to answer at whatever extension I pick up on? Any other implications I need to be aware of? Gotchas with this approach?[/quote][/quote][/quote]

If you don’t send the “1”," then Google will never consider that you answer the call. So, if you don’t do that, the call won’t make its way into Asterisk, it’ll just ring, and ring, and ring until Google Voice voicemail kicks in.

For the approach of having Asterisk answer it, acknowledge it (with the 1), and then go back to a second Google Voice account, I’m not aware of any Gotchas. The trouble, I suppose, is that once you send it back to a second Google Voice account, it’s going to do its normal ring-through process, which could take a while.

Asterisk has its own voicemail application, so you could use that instead…the difference being that Google’s converts the voicemail to text (with some degree of success based on the speech recognition).

Cheers

You must have just answered, as I was editing my last reply:

Is there a way to automate the sending of a “1” ONLY if I actually pick up at an extension?

Check out the D option for the Dial command:

wiki.asterisk.org/wiki/display/ … ation_Dial

I have been searching for a way to implement this without resorting to python scripting. I would like to handle it within the asterisk configuration outlined below. All of the examples I find are for either the old way of using asterisk 1.6 and using call bridging for outbound calls, or for doing something else with outbound. It seems I am one of the few trying to use 1.8 and have a need to keep the voicemail on GV. The most elegant way I can think to do it is to avoid having asterisk accept the call until the extension actually picks up. This would seem to necessitate a call bridge of some sort. However, I need an example to go with since writing my own is above my pay grade at this time (still searching to no avail thus far). Can anyone offer a link or example of how to do this?

I appreciate the help.

[googlein1]
exten => s,1,Wait(1)
exten => s,n,Set(ALERTNAME=NAMETAKENOUT@gmail.com)
;exten => _X.,n,Set(STATUS=${JABBER_STATUS(asterisk,${ALERTN AME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => s,n,JABBERSend(asterisk,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(name)=${CALLERID(number)})
exten => s,n,Answer
exten => s,n,Wait(2)
;exten => s,n,SendDTMF(1)
exten => s,n,Goto(from-trunk,19191234567,1)

Howdy,

Circling back, you could do this:

[google-in]
exten => s,1,Dial(SIP/mypeer,20,D(:1))

That means that Asterisk won’t answer the call, there’s no Answer() application, and it means Asterisk will dial the peer and, when answered by the peer thus creating a bridge, send a DTMF 1 to the calling party (that’s the D(:1) bit).

Cheers.

Can this be adapted for a ring group instead of a particular extension? And if so, can you post a code snippet?

In that case, it would be like:

[google-in]
exten => s,1,Dial(SIP/mypeer&SIP/mypeer2&SIP/mypeer3,20,D(:1))

So, in my dialplan, I have this as the operative line for a two line GV incoming (including the commented out DTMF line):
;exten => s,n,SendDTMF(1)
exten => s,n,Goto(from-trunk,gv-incoming-${CUT(ALERTNAME,@,1)},1)

To adapt this new logic, I am stumped. I have two GV incoming lines that will ring a ring group for either line. The ring groups have two extensions each.
exten => s,1,Dial(SIP/mypeer&SIP/mypeer2&SIP/mypeer3,20,D(:1))

Here is my newly created extensions_custom.conf (pulled from a PIAF forum post):

[googlein]
exten => blah@gmail.com,1,Wait(1)
exten => blah@gmail.com,n,Set(ALERTNAME=blah@gmail.com)
exten => blah@gmail.com,n,JABBERSend(asterisk,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => blah@gmail.com,n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => blah@gmail.com,n,Set(CALLERID(name)=${CALLERID(number)})
exten => blah@gmail.com,n,GotoIf(${DB_EXISTS(gv_dialout_account1/channel)}?bridged)
exten => blah@gmail.com,n,Goto(s,regcall)
exten => blah@gmail.com,n(bridged),Bridge(${DB_DELETE(gv_dialout_account1/channel)})
exten => blah2@gmail.com,1,Wait(1)
exten => blah2@gmail.com,n,Set(ALERTNAME=blah2@gmail.com)
exten => blah2@gmail.com,n,JABBERSend(asterisk2,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => blah2@gmail.com,n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => blah2@gmail.com,n,Set(CALLERID(name)=${CALLERID(number)})
exten => blah2@gmail.com,n,GotoIf(${DB_EXISTS(gv_dialout_account2/channel)}?bridged)
exten => blah2@gmail.com,n,Goto(s,regcall)
exten => blah2@gmail.com,n(bridged),Bridge(${DB_DELETE(gv_dialout_account2/channel)})
exten => s,1,Wait(1)
exten => s,n,Set(ALERTNAME=blah@gmail.com)
;exten => _X.,n,Set(STATUS=${JABBER_STATUS(asterisk,${ALERTNAME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => s,n,JABBERSend(asterisk,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(name)=${CALLERID(number)})
exten => s,n(regcall),Answer
;exten => blah@gmail.com,n,Dial(SIP/101,60, D(:1))
;exten => blah@gmail.com,n,Hangup()
;exten => s,n,SendDTMF(1)
exten => s,n,Goto(from-trunk,gv-incoming-${CUT(ALERTNAME,@,1)},1)

Howdy,

If you’re running PIAF, best to ask those guys - I’m not intimately familiar with all of their dialplan construction.

Cheers.

I am not running PIAF, but I did borrow some of their magic. Mine is a roll-your-own server.

Where’s your ring group in that dialplan snippet?

I don’t see one.

Also, it’s no good to send jabber status messages to the same google account that’s the one receiving the call. If you’re logged into the google web interface that will always receive the call instead of Asterisk.

Cheers.

All fixed:
michigantelephone.wordpress.com/ … mment-2562

Great :smile: