Company
Date Published
Author
Alan Klein
Word count
1281
Language
English
Hacker News points
None

Summary

Twilio Studio allows for the creation of interactive IVR experiences, but sometimes external APIs may take more than 10 seconds to respond. To extend this response time, a solution using a Twilio conference with music on hold and asynchronous operations can be implemented. Ngrok is used to tunnel local servers to receive requests from the internet, allowing communication between Twilio Studio and the Express server hosting the API request. The Express server simulates long-running asynchronous tasks using the `setTimeout` method, while the Twilio conference provides a music-on-hold experience for customers during this time. Once the operation is complete, the response is sent back to Twilio Studio, allowing it to continue with the flow and retrieve the results from the API request. This solution allows for a more engaging user experience by avoiding awkward silences during long-running operations.