We are having a hard time trying to get data on timestamps
and delays
on each point of:
- User making a call to Twilio Number,
- Invoking of the TWiML URL,
- Sending and Receiving of Bi-Directional Stream data,
- Sending data back to user.
Now, Twilio does provide logs on 2nd point as serverless API logs and top level events inside it. But there are no further information apart from that.
Is there a way to get this or is there something inside Twilio already to achieve this?
I have tried going through their docs and their youtube Signal videos. But I am not able to find a direct or in-direct way to achieve this.
Twilio makes available Custom Parameters to Share Information Between Your Applications.
For example, if you append a URL query parameter to a Twilio REST API request, Twilio will return that parameter in the response.
In the above example, when your Twiml endpoint https://website.com/instructions is called by Twilio, these parameters will also be included:
This will allow your application and Twilio to stay in sync.
For your question about Timestamps, you could pass a parameter such as "OriginatedTimestamp=2023-10-22T10:12:07.5980142Z"
Then when you receive a response, Twilio will include its own Timestamp and you can compare your OriginatedTimestamp with the Twimlio Timestamp parameter. This page lists all the properties for a Call resource.
If you haven't set it up already, Ngrok makes it very easy to view the properties returned by Twilio - Twilio explains this in a blog post about using Ngrok in 2022. A tool like Fiddler will allow you to view your outgoing requests to Twilio while Ngrok will allow you to view the corresponding replies from Twilio.