- Why do I receive a "completed" event callback before a "cancelled"?
- Why do I receive a "completed" event callback before a "failed"?
- Why do I receive a "ringing event" before the "started" callback?
- Why do I receive Voice API event callbacks in the wrong order?
Voice API calls that have not received a "rejected" event callback should expect to receive a "completed" event at the end of the call.
Calls start with a "started" and then a "ringing" callback event, which are commonly created simultaneously. You may receive these in a different order to that which you expect if latency is experienced between the Vonage API platform and your webhook or if you process one callback ahead of the other. You may experience this between a failed call reason ("busy", "cancelled", "timeout", etc.) and the "completed" event callback also.
If you are using a Connect with Fallback NCCO, you will not receive a "completed" event callback until the Connect action has finished. For example, if you timeout on a Connect to a PSTN number and return an NCCO to Connect to a different PSTN number, you will not receive a "completed" event callback until the second attempt has finished.
If you need to receive the event callbacks in a set order, we recommend queuing callbacks until you receive the expected callback has been received.