I have been testing the Google Voice setup on Asterisk for some time now and I have been consistently having problems with answering calls reliably. Outbound appears to work fine.
I have tried the wait(8) and dial(1,1500) options that work for some time but also fail if google takes more then 8 seconds to setup the RTP session. On the off chance google takes less then 8 seconds the end caller is waiting for no reason.
I was wondering if it would be possible to modify the Answer() function to return after a successful RTP session has been established? I do not know exactly what answer does but it seems logical for it to check that the call was actually answered or it should fail instead of blindly moving to the next instruction that might fail such as sending DTMF to a RTP session that may not be established yet. I noticed this by turning RTP debugging on and watching while I adjusted the wait timer.
Or is their a function that can already do this?