Search code examples
twiliotwilio-twimlincoming-call

Twilio | How can I modify call after X duration of dialed?


Suppose a customer is calling and at the application side staff members(softphone) are busy with some other stuff. I want to play call later text when nobody will answer after X seconds.

I've used a timeout attribute of a Dial verb. But that directly ends the call.

Any help will make my day.

Thanks in advance.


Solution

  • When the Dial timeout is completed, it will either hit the Dial action URL or if there is no action URL, the TwiML after the Dial (which isn't preferred since the TwiML after the Dial will play even if the dialed party answers).

    Use the Dial action URL and the DialCallStatus to determine if the call was not answered during the timeout period, no-answer, and act accordingly.