Transfer to Google Voice number on timeout

My Setup

Asterisk 1.8, SIP registration - Sipgate UK and Google Voice.

All incoming calls from/to SIP URI and Google voice are working fine. I’m trying to transfer / forward a call to my google voice number after 30 seconds timeout on my Sipgate voip extension. I can’t find a dial plan to use. Can someone help me with the dial plan.

If DIal fails,the dialplan will continue at the next priority. You can set a timeout on the Dial application call.

Is this correct?

[301]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/301,30)
exten => _X.,3,Set(MOBIL=mygvnumber)
exten => _X.,4,Dial(Motif/motif-mysparegvaccount/${MOBIL}@voice.google.com,60)
exten => _X.,5,Hangup

You don’t need the Hangup, and almost certainly don’t need the Answer, but it should be OK. You will need to test DIALSTATUS and/or HANGUPCAUSE if you want to distinguish between busy and no reply.

Thanks David. Will test and see if this works…