Exotel has Call detail API (here) which provides detail call duration, call status everything. we are using this API to fetch call details but the problem with this API is it provides the call detail after sometime (within 2 minutes).
So, what should be the cron job run to get accurate call details after each call ends?
have tried multiple logic but none is working.
The recommended way would be to consume the information using
StatusCallback
(webhook) documented here. This would push the call details to your endpoint immediately after the call. As per Rest Hooks, polling is not encouraged as 98.5% of polls are wasted.However, if it needs to be done depending on the use-case and other limitations, the logic of polling the API should be with exponential backoff.