Reputation: 931
I have a Twilio number which accepts incoming phone calls. If the caller hangs up all of a sudden, how do I determine in my application the end time of the call? And how do I determine the status of the call at that point? I have a webhook configured for Twilio to make POST calls to. When a caller suddenly hangs up, can I have Twilio make a POST call to this webhook and send the call end time and status as parameters in the POST? Is this possible? If so, how? Thanks.
Upvotes: 0
Views: 199
Reputation: 1116
Since you setup the webhook already, you will receive a "completed" event when the call is ended that will include a Timestamp. The full list of parameters returned to your webhook is shown on the StatusCallBack Reference page of the Twilio Docs. The Timestamp is the time the call ended. If you want to determine if the caller or the callee hung-up you will need to use a Conference.
CallStatus - "completed" will trigger when the call ended normally.
Timestamp - The timestamp when the event fired, given as UTC in RFC 2822 format.
The available CallStatus values are shown in this table.
Upvotes: 0