diff --git a/twilio-iac/helplines/ca/common.hcl b/twilio-iac/helplines/ca/common.hcl index dc82faab6d..5550202afd 100644 --- a/twilio-iac/helplines/ca/common.hcl +++ b/twilio-iac/helplines/ca/common.hcl @@ -27,15 +27,15 @@ locals { "target_workers" = "routing.skills HAS 'KHP English' OR routing.skills HAS 'KHPEN'", "friendly_name" = "KHP English" }, - khp_fr : { "target_workers" = "routing.skills HAS 'KHP French'", + khp_fr : { "target_workers" = "routing.skills HAS 'KHP French' OR routing.skills HAS 'KHPFRsk'", "friendly_name" = "KHP French" }, ab211_en : { - "target_workers" = "routing.skills HAS 'AB211En'", + "target_workers" = "routing.skills HAS 'AB211En' OR routing.skills HAS 'AB211ENsk'", "friendly_name" = "AB211 English" }, ab211_fr : { - "target_workers" = "routing.skills HAS 'AB211Fr'", + "target_workers" = "routing.skills HAS 'AB211Fr' OR routing.skills HAS 'AB211FRsk'", "friendly_name" = "AB211 French" }, g2t_ns_en : { @@ -55,15 +55,15 @@ locals { "friendly_name" = "Good2Talk ON French" }, g2t_int : { - "target_workers" = "routing.skills HAS 'G2TONTr'", + "target_workers" = "routing.skills HAS 'G2TONTr' OR routing.skills HAS 'G2TONTRsk'", "friendly_name" = "Good2Talk Interpreter" }, interpreter_en : { - "target_workers" = "routing.skills HAS 'KHP Interpreter' ", + "target_workers" = "routing.skills HAS 'KHP Interpreter' OR routing.skills HAS 'KHPINTsk'", "friendly_name" = "KHP Interpreter" }, interpreter_fr : { - "target_workers" = "routing.skills HAS 'French Interpreter' ", + "target_workers" = "routing.skills HAS 'French Interpreter' OR routing.skills HAS 'FRINTsk'", "friendly_name" = "French Interpreter" }, supervisor : { @@ -75,15 +75,15 @@ locals { "friendly_name" = "Training" }, chat_en : { - "target_workers" = "routing.skills HAS 'Chat English'", + "target_workers" = "routing.skills HAS 'Chat English' OR routing.skills HAS 'CHATENsk'", "friendly_name" = "Chat English" }, chat_fr : { - "target_workers" = "routing.skills HAS 'Chat French'", + "target_workers" = "routing.skills HAS 'Chat French' OR routing.skills HAS 'CHATFRsk'", "friendly_name" = "Chat French" }, indigenous : { - "target_workers" = "routing.skills HAS 'Indigenous/Interpreter'", + "target_workers" = "routing.skills HAS 'Indigenous/Interpreter' OR routing.skills HAS 'INDINTsk'", "friendly_name" = "Indigenous/Interpreter" }, "988_en" : { diff --git a/twilio-iac/helplines/ca/templates/workflows/master.tftpl b/twilio-iac/helplines/ca/templates/workflows/master.tftpl index 483c772c90..ca120c900b 100644 --- a/twilio-iac/helplines/ca/templates/workflows/master.tftpl +++ b/twilio-iac/helplines/ca/templates/workflows/master.tftpl @@ -72,14 +72,16 @@ "expression": "((to IN [${join(", ", formatlist("'%s'", phone_numbers.khp))}] OR to IN [${join(", ", formatlist("'%s'", phone_numbers.ab211))}] OR to IN [${join(", ", formatlist("'%s'", phone_numbers.g2tns))}]) AND interpreter CONTAINS \"fr\")", "targets": [ { - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)", - "priority": 4, - "timeout": 1500, - "queue": "${task_queues.interpreter_fr}" + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND (worker.routing.levels.FRINTsk > 4) AND ('Hold for Transfers' NOT IN worker.routing.skills)", + "order_by": "worker.routing.levels.FRINTsk DESC", + "timeout": 210, + "priority": 4, + "queue": "${task_queues.interpreter_fr}" }, { "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)", "priority": 4, + "order_by": "worker.routing.levels.FRINTsk DESC", "queue": "${task_queues.interpreter_fr}" } ] @@ -89,14 +91,16 @@ "expression": "(to IN [${join(", ", formatlist("'%s'", phone_numbers.khp))}] AND interpreter CONTAINS \"indigenous\")", "targets": [ { - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)", - "priority": 4, - "timeout": 30, + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND (worker.routing.levels.INDINTsk > 4) AND ('Hold for Transfers' NOT IN worker.routing.skills)", + "order_by": "worker.routing.levels.INDINTsk DESC", + "timeout": 210, + "priority": 4, "queue": "${task_queues.indigenous}" }, { "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)", "priority": 4, + "order_by": "worker.routing.levels.INDINTsk DESC", "queue": "${task_queues.indigenous}" } ] @@ -152,15 +156,10 @@ "filter_friendly_name": "KHP French", "expression": "((to IN [${join(", ", formatlist("'%s'", phone_numbers.khp))}]) AND language CONTAINS \"fr-CA\")", "targets": [ - { - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)", - "priority": 5, - "timeout": 1500, - "queue": "${task_queues.khp_fr}" - }, { "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)", - "priority": 5, + "priority": 8, + "order_by": "worker.routing.levels.KHPFRsk DESC", "queue": "${task_queues.khp_fr}" } ] @@ -170,14 +169,16 @@ "expression": "(to IN [${join(", ", formatlist("'%s'", phone_numbers.khp))}] AND interpreter CONTAINS \"main\")", "targets": [ { - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)", - "priority": 4, - "timeout": 30, + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND (worker.routing.levels.KHPINTsk > 4) AND ('Hold for Transfers' NOT IN worker.routing.skills)", + "priority": 4, + "order_by": "worker.routing.levels.KHPINTsk DESC", + "timeout": 210, "queue": "${task_queues.interpreter_en}" }, { "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)", "priority": 4, + "order_by": "worker.routing.levels.KHPINTsk DESC", "queue": "${task_queues.interpreter_en}" } ] @@ -219,13 +220,15 @@ "targets": [ { "queue": "${task_queues.g2t_int}", - "priority": 5, - "timeout": 30, - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)" + "priority": 4, + "timeout": 210, + "order_by": "worker.routing.levels.G2TONTRsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND (worker.routing.levels.G2TONTRsk > 4) AND ('Hold for Transfers' NOT IN worker.routing.skills)" }, { "queue": "${task_queues.g2t_int}", - "priority": 5, + "priority": 4, + "order_by": "worker.routing.levels.G2TONTRsk DESC", "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)" } ] @@ -267,7 +270,15 @@ { "queue": "${task_queues.ab211_en}", "priority": 3, - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)" + "timeout": 210, + "order_by": "worker.routing.levels.AB211ENsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND (worker.routing.levels.AB211ENsk > 4) AND ('Hold for Transfers' NOT IN worker.routing.skills)" + }, + { + "queue": "${task_queues.ab211_en}", + "priority": 3, + "order_by": "worker.routing.levels.AB211ENsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND 'Hold for Transfers' NOT IN worker.routing.skills" } ] }, @@ -278,6 +289,7 @@ { "queue": "${task_queues.ab211_fr}", "priority": 6, + "order_by": "worker.routing.levels.AB211FRsk DESC", "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)" } ] @@ -299,13 +311,22 @@ { "queue": "${task_queues.chat_en}", "priority": 1, - "timeout": 600, - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)" + "timeout": 210, + "order_by": "worker.routing.levels.CHATENsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND (worker.routing.levels.CHATENsk > 4) AND ('Hold for Transfers' NOT IN worker.routing.skills)" + }, + { + "queue": "${task_queues.chat_en}", + "priority": 1, + "timeout": 390, + "order_by": "worker.routing.levels.CHATENsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)" }, { "queue": "${task_queues.chat_en}", "priority": 2, - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)" + "order_by": "worker.routing.levels.CHATENsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)" } ] }, @@ -316,7 +337,8 @@ { "queue": "${task_queues.chat_fr}", "priority": 5, - "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Priority 988/Int' NOT IN worker.routing.skills AND 'Hold for Transfers' NOT IN worker.routing.skills)" + "order_by": "worker.routing.levels.CHATFRsk DESC", + "expression": "((worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)) AND ('Hold for Transfers' NOT IN worker.routing.skills)" } ] }