i intend use twilio's taskrouter handle incoming calls , assign them workers in system. question have is, if worker handling call , need transfer worker, correct way go this? assume need ensure target worker becomes unavailable task assignment, , current worker becomes available @ least. create task , somehow assign specific worker? couldn't find in docs assigning task specific worker, or updating worker's status, may have overlooked it.
i think you'll want have closer @ these 2 entities in rest api.
workers: https://www.twilio.com/docs/api/taskrouter/workers#resource-properties
tasks: https://www.twilio.com/docs/api/taskrouter/tasks#task-attributes
specifically, updating workers available
attribute 'true' or 'false' depending on workers assignment.
# download python helper library twilio.com/docs/python/install twilio.rest import twiliotaskrouterclient # account sid , auth token twilio.com/user/account account_sid = "acxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" auth_token = "your_auth_token" workspace_sid = "wsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" worker_sid = "wkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" client = twiliotaskrouterclient(account_sid, auth_token) activity = client.workers(workspace_sid).update(worker_sid, available="false") print(activity.friendly_name)
i'd suggest taking @ taskrouter tutorial see end-to-end example.
please let me know if can expand upon @ further.
Comments
Post a Comment