Every now and then, (like I said in #91), we get unhandled rejections. Also, in the above example, it can happen (although rarely) that people hang up DURING the API call of answer, causing bridge create/the adding of channels to fail (because the channel does not exist anymore).
In short: what do you recommend? Make API calls wait for each other and continue dial plan logic in callbacks, or execute the dial plan like in the examples?
Our ARI application uses callbacks for most ARI methods, like the following:
We do this throughout our entire application. Another example, stopping a playback:
However, when I look at this example (for instance): https://github.com/asterisk/ari-examples/blob/master/bridge-dial/example.js
I see that it's done like this:
Or:
Every now and then, (like I said in #91), we get unhandled rejections. Also, in the above example, it can happen (although rarely) that people hang up DURING the API call of answer, causing bridge create/the adding of channels to fail (because the channel does not exist anymore).
In short: what do you recommend? Make API calls wait for each other and continue dial plan logic in callbacks, or execute the dial plan like in the examples?
Hopefully this makes sense.