Redirecting a twilio task to a new TwiML after task/reservation timeout

Viewed 1096

Currently using Twilio TaskRouter to build a telephony call center to route the calls.

My target was:

  1. When a task kept pending for a certain time(i.e: no workers are available for reservation), redirect it to voicemail
  2. When a task is reserved but the the worker didn't response to it, redirect it to voicemail

My Current Implementation was:

  1. Specify both task timeout and reservation timeout
  2. When task timeout / reservation timeout callback is triggered, query the Redirect Instruction reservation api to redirect it to a TwiML of recording voicemail.

But the problem was:

  1. When a task is in pending status, no reservation was created so that I could not access the reservation to perform a redirect
  2. When a reservation is timed out, trying to perform a redirect would receive an execption from Twilio saying that the reservation was nolonger available for redirecting
1 Answers
Related