I use Twilio to make phone calls during which the user can reply by pressing key. My problem is that I want to manage 4 cases:
1) the user answer and press 1
2) the user answer and press another key than 1
3) the user answer and press no key
4) the user don't answer
For cases 1, 2 and 3, everything is OK: I have a "Gather" in my XML, with an "action" URL, a time-out and a actionOnEmptyResult="true"
For managing case 4, I use a statusCallback url, with 'statusCallbackEvent' => ['answered','completed']
What I notice in my Log is that I receive exactly the same data in case 3 (user answer but press nothing) and in case 4 (user don't answer the call). Maybe this came from the fact after a few "rings" the call fall in voice-box, fooling Twilio which believe it's an "answer" event.
In my LOG I see (case 3 or 4) this 3 events:
Call to my statusCallback with CallStatus = in-progress
Call to my return hook with msg = Gather End and Digits = ""
Call to my statusCallback with CallStatus = completed
So my question is: how can I know the difference between "answer the call and press nothing" and "don't answer the call" ?
Edit: if I refuse the call, result is the same. So I get the same "hook" and statusCallback call, with same data if the user pick-up and give no reply, if he doesn't pick up or if he refuses the call...