Currently using Twilio TaskRouter to build a telephony call center to route the calls.
My target was:
- When a task kept pending for a certain time(i.e: no workers are available for reservation), redirect it to voicemail
- When a task is reserved but the the worker didn't response to it, redirect it to voicemail
My Current Implementation was:
- Specify both task timeout and reservation timeout
- 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:
- When a task is in
pendingstatus, no reservation was created so that I could not access the reservation to perform a redirect - 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