Search code examples
twiliotwilio-programmable-voicetwilio-taskrouter

Prevent worker from receiving voice tasks by updating their voice channel capacity


I'm currently using task router to route calls to my workers and I want to temporarily prevent certain workers from getting assigned voice tasks. I thought by updating the worker channel capacity for voice to 0 or marking the voice worker channel as unavailable would mean that while the worker remains a part of the queues (based on their custom attributes), if there are any voice tasks coming in, they would not be assigned to that worker. That does not seem to be the case, my worker still receives reservations for voice tasks.

I tried to update my queue to only include workers that have voice capacity by adding this check to the Queue expression '... AND worker.channel.voice.configured_capacity > 0', however when saving the queue in the Console, I get an error saying 'Worker channel capacity expressions not allowed in TargetWorkersExpression on TaskQueue' which leads me to believe that this is not the right thing to do.

The only other solution I can see is to add the worker channel capacity check mentioned above to the target expression at every step of my workflow but that would be harder to maintain.

I can't help but feel that there's something I've missed or misunderstood about how the worker channel capacity works or what it is used for. For what is worth, multitasking is disabled for my workspace.


Solution

  • Twilio developer evangelist here.

    Adjusting the capacity when you are not using multitasking won't make a difference.

    I would recommend using a custom attribute on the worker and then filtering based on that within the target workers expression instead.