Listen to task canceled event in the browser

152 Views Asked by At

I am using Twilio Taskrouter for making reservations for a video call. What I want is to notify the user that all workers are currently busy, with a message displayed for the user on the browser. So I wanted to know how can one catch the task.canceled event in the browser so that I can notify the user about the task getting canceled due to the task timeout. I have seen the JS SDK for Twilio but I only saw events for Workers, Workspace and Task Queues and couldn't find any such events for Tasks, so is there anyway I can listen to the task's events on the browser side?

1

There are 1 best solutions below

0
On

I think there is a way to get the assignment status of the task, more details can be found here: TaskRouter Task Resource. On this page look for assignmentStatus resource property. The current status of the Task's assignment. Can be: pending, reserved, assigned, canceled, wrapping, or completed

let me know what you think.