From ed5527bba09f97957a45c0676cb3c00d3bfa1e08 Mon Sep 17 00:00:00 2001 From: janorivera Date: Fri, 12 Jun 2026 12:52:39 -0400 Subject: [PATCH] updates --- .../src/operatingInfo/usnm.json | 24 ++ .../voice-blocking-no-op-hours-rec-sd.tftpl | 232 ++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 lambdas/account-scoped/src/operatingInfo/usnm.json create mode 100644 twilio-iac/helplines/usnm/templates/studio-flows/voice-blocking-no-op-hours-rec-sd.tftpl diff --git a/lambdas/account-scoped/src/operatingInfo/usnm.json b/lambdas/account-scoped/src/operatingInfo/usnm.json new file mode 100644 index 0000000000..4f549e28b9 --- /dev/null +++ b/lambdas/account-scoped/src/operatingInfo/usnm.json @@ -0,0 +1,24 @@ +{ + "timezone": "America/New_York", + "holidays": {}, + "operatingHours": { + "sms": { + "1": [{ "open": 1000, "close": 2200 }], + "2": [{ "open": 1000, "close": 2200 }], + "3": [{ "open": 1000, "close": 2200 }], + "4": [{ "open": 1000, "close": 2200 }], + "5": [{ "open": 1000, "close": 2200 }], + "6": [], + "7": [] + }, + "voice": { + "1": [{ "open": 1000, "close": 2200 }], + "2": [{ "open": 1000, "close": 2200 }], + "3": [{ "open": 1000, "close": 2200 }], + "4": [{ "open": 1000, "close": 2200 }], + "5": [{ "open": 1000, "close": 2200 }], + "6": [], + "7": [] + } + } +} \ No newline at end of file diff --git a/twilio-iac/helplines/usnm/templates/studio-flows/voice-blocking-no-op-hours-rec-sd.tftpl b/twilio-iac/helplines/usnm/templates/studio-flows/voice-blocking-no-op-hours-rec-sd.tftpl new file mode 100644 index 0000000000..af94c8871e --- /dev/null +++ b/twilio-iac/helplines/usnm/templates/studio-flows/voice-blocking-no-op-hours-rec-sd.tftpl @@ -0,0 +1,232 @@ +${ + jsonencode({ + "description": "${flow_description}", + "states": [ + { + "name": "Trigger", + "type": "trigger", + "transitions": [ + { + "event": "incomingMessage" + }, + { + "next": "run_subflow_system_down", + "event": "incomingCall" + }, + { + "event": "incomingConversationMessage" + }, + { + "event": "incomingRequest" + }, + { + "event": "incomingParent" + } + ], + "properties": { + "offset": { + "x": 0, + "y": -10 + } + } + }, + + { + "name": "run_subflow_system_down", + "type": "run-subflow", + "transitions": [ + { + "next": "f_getProfileFlagsForIdentifier", + "event": "completed" + }, + { + "next": "f_getProfileFlagsForIdentifier", + "event": "failed" + } + ], + "properties": { + "flow_sid": "${system_down_studio_subflow_sid}", + "flow_revision": "LatestPublished", + "offset": { + "x": 110, + "y": -270 + }, + "parameters": [ + { + "type": "string", + "value": "true", + "key": "system_down" + } + ] + } + }, + { + "name": "f_getProfileFlagsForIdentifier", + "type": "make-http-request", + "transitions": [ + { + "next": "split_contact_routing", + "event": "success" + }, + { + "next": "play_message_voice_prequeue", + "event": "failed" + } + ], + "properties": { + "offset": { + "x": -350, + "y": -280 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "add_twilio_auth": false, + "body": "{ \"trigger\": {{trigger | to_json}}}", + "url": "${lambda_twilio_account_scoped_url}/getProfileFlagsForIdentifier" + } + }, + { + "name": "split_contact_routing", + "type": "split-based-on", + "transitions": [ + { + "next": "play_message_voice_prequeue", + "event": "noMatch" + }, + { + "next": "play_message_voice_blocked", + "event": "match", + "conditions": [ + { + "friendly_name": "If value contains blocked", + "arguments": [ + "{{widgets.f_getProfileFlagsForIdentifier.parsed.flags}}" + ], + "type": "contains", + "value": "blocked" + } + ] + } + ], + "properties": { + "input": "{{widgets.f_getProfileFlagsForIdentifier.parsed.flags}}", + "offset": { + "x": -690, + "y": -60 + } + } + }, + { + "name": "play_message_voice_blocked", + "type": "say-play", + "transitions": [ + { + "event": "audioComplete" + } + ], + "properties": { + "offset": { + "x": -640, + "y": 210 + }, + "voice": "Polly.Mia-Neural", + "say": "${channel_flow_vars.play_message_voice_blocked}", + "language": "en-US" + } + }, + { + "name": "send_to_queue", + "type": "send-to-flex", + "transitions": [ + { + "event": "callComplete" + }, + { + "name": "webhook_notify_failed_to_enqueue", + "event": "failedToEnqueue" + }, + { + "event": "callFailure" + } + ], + "properties": { + "offset": { + "x": 80, + "y": 460 + }, + "attributes": "${channel_attributes.default}", + "workflow": "${workflow_sids.master}", + "channel": "${task_channel_sids.voice}" + } + }, + { + "name": "play_message_voice_prequeue", + "type": "say-play", + "transitions": [ + { + "next": "send_to_queue", + "event": "audioComplete" + } + ], + "properties": { + "offset": { + "x": 80, + "y": 210 + }, + "loop": 1, + "play": "${channel_flow_vars.play_message_voice_prequeue}" + } + }, + { + "name": "http_post_webhook_notify_failed_to_enqueue", + "type": "make-http-request", + "transitions": [ + { + "event": "success" + }, + { + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 540, + "y": 1250 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "body": "{ \"text\": \"Issue detected [Failed to Enqueue] on ${short_helpline} ${short_environment} Flow SID: {{flow.flow_sid}} Execution SID: {{flow.sid}} \" }", + "url": "${webhook_url_studio_errors}" + } + }, + { + "name": "f_operatingHours", + "type": "make-http-request", + "transitions": [ + { + "event": "success" + }, + { + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 0, + "y": 600 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "add_twilio_auth": false, + "body": "{\"channel\": \"voice\", \"includeMessageTextInResponse\": \"true\", \"language\": \"${task_language}\"}", + "url": "${get_profile_flags_for_identifier_base_url}/operatingHours" + } + } + + ], + "initial_state": "Trigger", + "flags": { + "allow_concurrent_calls": true + } +}) +}