Skip to content

Commit

Permalink
Merge pull request #2581 from techmatters/dee_ca_1029
Browse files Browse the repository at this point in the history
KHP IVR changes
  • Loading branch information
dee-luo authored Nov 8, 2024
2 parents a4b4371 + afa3d2c commit 279f97e
Show file tree
Hide file tree
Showing 2 changed files with 227 additions and 27 deletions.
238 changes: 216 additions & 22 deletions twilio-iac/helplines/ca/templates/studio-flows/khp_main.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ ${
"type": "split-based-on",
"transitions": [
{
"event": "noMatch"
"event": "noMatch",
"next": "split_Inflight_retry"
},
{
"next": "Msg60011E-Inflight",
Expand Down Expand Up @@ -1219,7 +1220,7 @@ ${
"stop_gather": true,
"gather_language": "en",
"profanity_filter": "true",
"timeout": 2
"timeout": 5
}
},
{
Expand Down Expand Up @@ -1249,7 +1250,7 @@ ${
"type": "split-based-on",
"transitions": [
{
"next": "main_disconnect",
"next": "Msg10006E-Info",
"event": "noMatch"
},
{
Expand All @@ -1262,7 +1263,7 @@ ${
"{{flow.variables.retry_counter}}"
],
"type": "less_than",
"value": "3"
"value": "2"
}
]
}
Expand Down Expand Up @@ -1293,23 +1294,6 @@ ${
"loop": 1
}
},
{
"name": "main_disconnect",
"type": "say-play",
"transitions": [
{
"event": "audioComplete"
}
],
"properties": {
"play": channel_flow_vars["en_disconnect_url"],
"offset": {
"x": -1840,
"y": -1540
},
"loop": 1
}
},
{
"name": "sendToQ6004_FrInterpreter",
"type": "send-to-flex",
Expand Down Expand Up @@ -1359,7 +1343,8 @@ ${
"type": "split-based-on",
"transitions": [
{
"event": "noMatch"
"event": "noMatch",
"next": "retry_split_Inflight_2"
},
{
"next": "sendToQ6001_English",
Expand Down Expand Up @@ -1423,7 +1408,216 @@ ${
"attributes": "{\"language\": \"en-CA\",\n\"type\": \"inbound\", \"name\": \"{{trigger.call.From}}\",\"ignoreAgent\":\"\", \"transferTargetType\":\"\",\"channelType\":\"voice\", \"interpreter\": \"indigenous\"}",
"waitUrlMethod": "GET"
}
},
{
"name": "MainMenuB_Retry",
"type": "gather-input-on-call",
"transitions": [
{
"next": "retry_split_main_menu",
"event": "keypress"
},
{
"event": "speech"
},
{
"next": "split_main_menu",
"event": "timeout"
}
],
"properties": {
"play": "https://twilio-service-4854.twil.io/MSG10000B.mp3",
"number_of_digits": 1,
"speech_timeout": "auto",
"offset": {
"x": -1070,
"y": -1810
},
"loop": 1,
"finish_on_key": "#",
"stop_gather": true,
"gather_language": "en",
"profanity_filter": "true",
"timeout": 5
}
},
{
"name": "retry_split_main_menu",
"type": "split-based-on",
"transitions": [
{
"next": "main_set_retry",
"event": "noMatch"
},
{
"next": "Msg10006E-Info",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains en_number",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "equal_to",
"value": "1"
}
]
},
{
"next": "Msg10006E-InfoOtherLanguages",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains tr_number",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "equal_to",
"value": "4"
}
]
},
{
"next": "Msg10006F-InfoMessage2",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains fr_number",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "equal_to",
"value": "2"
}
]
},
{
"next": "Msg10006E-Info",
"event": "match",
"conditions": [
{
"friendly_name": "If value equal_to 4",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "equal_to",
"value": "3"
}
]
}
],
"properties": {
"input": "{{widgets.MainMenuB_Retry.Digits}}",
"offset": {
"x": -1700,
"y": -1730
}
}
},
{
"name": "split_Inflight_retry",
"type": "split-based-on",
"transitions": [
{
"next": "Msg60011E-Inflight",
"event": "noMatch"
},
{
"next": "Msg60011E-Inflight",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains 2",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "contains",
"value": "1"
}
]
},
{
"next": "Msg60011I-Inflight",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains 3",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "contains",
"value": "4"
}
]
},
{
"next": "SubIntro_Indigenous",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains 4",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "contains",
"value": "3"
}
]
}
],
"properties": {
"input": "{{widgets.MainMenuB_Retry.Digits}}",
"offset": {
"x": -2310,
"y": 0
}
}
},
{
"name": "retry_split_Inflight_2",
"type": "split-based-on",
"transitions": [
{
"next": "sendToQ6001_English",
"event": "noMatch"
},
{
"next": "sendToQ6001_English",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains 2",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "contains",
"value": "1"
}
]
},
{
"next": "sendToQ6005_Indigenous",
"event": "match",
"conditions": [
{
"friendly_name": "If value contains 4",
"arguments": [
"{{widgets.MainMenuB_Retry.Digits}}"
],
"type": "contains",
"value": "3"
}
]
}
],
"properties": {
"input": "{{widgets.MainMenuB_Retry.Digits}}",
"offset": {
"x": -2550,
"y": 1120
}
}
}
],
"initial_state": "Trigger",
"flags": {
Expand Down
16 changes: 11 additions & 5 deletions twilio-iac/helplines/ca/templates/workflows/master.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,23 @@
"queue": "${task_queues.khp_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 (worker.department =='english') AND ('Priority 988/Int' NOT IN worker.routing.skills)",
"timeout": 600
"timeout": 480
},
{
"queue": "${task_queues.khp_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 ('Priority 988/Int' NOT IN worker.routing.skills)",
"timeout": 300
"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))",
"timeout": 420
},
{
"queue": "${task_queues.khp_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 ('Priority 988/Int' NOT IN worker.routing.skills)",
"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))",
"timeout": 300,
"priority": 4
},
{
"queue": "${task_queues.khp_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 ('Priority 988/Int' NOT IN worker.routing.skills)",
"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))",
"timeout": 300,
"priority": 5
},
Expand Down Expand Up @@ -301,6 +301,12 @@
"expression": "channelType=='web' AND (language CONTAINS \"en-CA\" OR language=='')",
"targets": [
{
"queue": "${task_queues.chat_en}",
"priority": 1,
"timeout": 300,
"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)"
},
{
"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)"
Expand Down

0 comments on commit 279f97e

Please sign in to comment.