Search code examples
twiliotwilio-twimltwilio-taskrouter

TaskRouter: Leaving a queue


I'm building a call center and I need a way for people to "get out of the queue" to leave a voicemail OR be redirected to an emergency contact. I want them to have that option every 2 minutes or so (This is a medical hotline).

The best I could think of is using a waitUrl on top of the <Enqueue> verb, which periodically offers the caller to press 1 for voicemail or 2 for an emergency.

If I just needed one or another I could simply use <Leave /> and have the verbs after the <Enqueue> redirect somewhere or capture a recording.

Unfortunately since I <Gather> (digits 1 or 2) during the waitUrl I need the <Leave /> verb to take me to a specific URL/Action based on the digits - which is impossible.

Any creative solutions to this?

Thank you


Solution

  • Twilio developer evangelist here.

    Rather than using <Leave> when you get the result of the <Gather> you could use the REST API to redirect the call.

    Does that help?