diff --git a/lambdas/packages/hrm-form-definitions/form-definitions/usvc/v1/insights/postSurvey.json b/lambdas/packages/hrm-form-definitions/form-definitions/usvc/v1/insights/postSurvey.json index 4da11fecf3..eff8f68cfa 100644 --- a/lambdas/packages/hrm-form-definitions/form-definitions/usvc/v1/insights/postSurvey.json +++ b/lambdas/packages/hrm-form-definitions/form-definitions/usvc/v1/insights/postSurvey.json @@ -1,12 +1,37 @@ [ { "insightsObject": "conversations", - "attributeName": "conversation_measure_6", - "questions": ["was_helpful"] + "attributeName": "conversation_attribute_1", + "questions": ["specialist_knowledge_satisfaction"] }, { "insightsObject": "conversations", - "attributeName": "conversation_measure_7", + "attributeName": "conversation_attribute_2", + "questions": ["will_follow_advice"] + }, + { + "insightsObject": "conversations", + "attributeName": "conversation_attribute_3", "questions": ["would_recommend"] + }, + { + "insightsObject": "conversations", + "attributeName": "conversation_attribute_4", + "questions": ["overall_satisfaction"] + }, + { + "insightsObject": "conversations", + "attributeName": "conversation_attribute_5", + "questions": ["self_or_other"] + }, + { + "insightsObject": "conversations", + "attributeName": "conversation_attribute_6", + "questions": ["victim_service_profesional"] + }, + { + "insightsObject": "conversations", + "attributeName": "conversation_attribute_7", + "questions": ["was_first_time"] } -] \ No newline at end of file +] diff --git a/twilio-iac/helplines/usvc/common.hcl b/twilio-iac/helplines/usvc/common.hcl index 569e943632..cd1b4aff87 100644 --- a/twilio-iac/helplines/usvc/common.hcl +++ b/twilio-iac/helplines/usvc/common.hcl @@ -40,7 +40,7 @@ locals { }, survey : { friendly_name = "Survey Workflow" - templatefile = "/app/twilio-iac/helplines/templates/workflows/lex.tftpl" + templatefile = "/app/twilio-iac/helplines/templates/workflows/survey.tftpl" } } task_queues = { diff --git a/twilio-iac/helplines/usvc/configs/service-configuration/common.json b/twilio-iac/helplines/usvc/configs/service-configuration/common.json index 3ec1a93175..1f67000c48 100644 --- a/twilio-iac/helplines/usvc/configs/service-configuration/common.json +++ b/twilio-iac/helplines/usvc/configs/service-configuration/common.json @@ -18,6 +18,24 @@ "enable_hang_up_by_hrm_saving": true, "enable_custom_links" : true }, + "postStudioFlows": { + "${task_queues.vc}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_en}" + }, + "${task_queues.dcvh}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_en}" + }, + "${task_queues.vc_sp}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_es}" + }, + "${task_queues.dcvh_sp}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_es}" + } + }, "definitionVersion": "usvc-v1", "external_recordings_enabled": false, "helplineLanguage": "en-USVC", diff --git a/twilio-iac/helplines/usvc/configs/service-configuration/staging.json b/twilio-iac/helplines/usvc/configs/service-configuration/staging.json index d6aac7736c..8a53679dcd 100644 --- a/twilio-iac/helplines/usvc/configs/service-configuration/staging.json +++ b/twilio-iac/helplines/usvc/configs/service-configuration/staging.json @@ -1,14 +1,36 @@ { - "attributes": { - "system_down" : false, - "form_definitions_base_url": "https://assets-staging.tl.techmatters.org/form-definitions/", - "resources_base_url": "", - "logo_url" : "https://aselo-logo.s3.amazonaws.com/200+transparent+background+no+TM+staging.png", - "feature_flags": { - "use_twilio_lambda_adjust_capacity": false, - "use_twilio_lambda_janitor": false, - "use_twilio_lambda_to_transition_participants": false, - "use_twilio_lambda_transfers": false - } + "attributes": { + "system_down": false, + "form_definitions_base_url": "https://assets-staging.tl.techmatters.org/form-definitions/", + "resources_base_url": "", + "logo_url": "https://aselo-logo.s3.amazonaws.com/200+transparent+background+no+TM+staging.png", + "feature_flags": { + "use_twilio_lambda_adjust_capacity": false, + "use_twilio_lambda_janitor": false, + "use_twilio_lambda_to_transition_participants": false, + "use_twilio_lambda_transfers": false + }, + "postStudioFlows": { + "${task_queues.vc}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_en}" + }, + "${task_queues.dcvh}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_en}" + }, + "${task_queues.dc_dispatch}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_en}" + }, + "${task_queues.vc_sp}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_es}" + }, + "${task_queues.dcvh_sp}": { + "flowTrigger": "inProgressCall", + "studioFlowSid": "${studio_flow_sids.post_call_survey_es}" + } } + } } \ No newline at end of file diff --git a/twilio-iac/helplines/usvc/production.hcl b/twilio-iac/helplines/usvc/production.hcl index fe036af08c..3c58678938 100644 --- a/twilio-iac/helplines/usvc/production.hcl +++ b/twilio-iac/helplines/usvc/production.hcl @@ -35,6 +35,23 @@ locals { + } + #Post call survey (triggered in-call, wired through postStudioFlows in service-configuration) + studio_flows = { + post_call_survey_en : { + templatefile = "/app/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl" + flow_vars = { + post_survey_assets_url = "https://recordings.tl.techmatters.org/usvc/production/post_call_survey_en" + gather_language = "en-US" + } + }, + post_call_survey_es : { + templatefile = "/app/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl" + flow_vars = { + post_survey_assets_url = "https://recordings.tl.techmatters.org/usvc/production/post_call_survey_es" + gather_language = "es-US" + } + } } //Serverless -- to allow enabling the operating hours check on this staging account. ui_editable = true diff --git a/twilio-iac/helplines/usvc/staging.hcl b/twilio-iac/helplines/usvc/staging.hcl index 1ed248a46c..feefea66a4 100644 --- a/twilio-iac/helplines/usvc/staging.hcl +++ b/twilio-iac/helplines/usvc/staging.hcl @@ -36,6 +36,23 @@ locals { + } + #Post call survey (triggered in-call, wired through postStudioFlows in service-configuration) + studio_flows = { + post_call_survey_en : { + templatefile = "/app/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl" + flow_vars = { + post_survey_assets_url = "https://recordings.tl.techmatters.org/usvc/staging/post_call_survey_en" + gather_language = "en-US" + } + }, + post_call_survey_es : { + templatefile = "/app/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl" + flow_vars = { + post_survey_assets_url = "https://recordings.tl.techmatters.org/usvc/staging/post_call_survey_es" + gather_language = "es-US" + } + } } //Serverless -- to allow enabling the operating hours check on this staging account. ui_editable = true diff --git a/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl b/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl new file mode 100644 index 0000000000..ee30ed1990 --- /dev/null +++ b/twilio-iac/helplines/usvc/templates/studio-flows/post-call-survey.tftpl @@ -0,0 +1,1019 @@ +${ + jsonencode( + { + "initial_state": "Trigger", + "flags": { + "allow_concurrent_calls": true + }, + "description": "${flow_description}", + "states": [ + { + "name": "Trigger", + "type": "trigger", + "transitions": [ + { + "event": "incomingMessage" + }, + { + "next": "gather_input_voice_opt_in", + "event": "incomingCall" + }, + { + "event": "incomingConversationMessage" + }, + { + "event": "incomingRequest" + }, + { + "event": "incomingParent" + } + ], + "properties": { + "offset": { + "x": 0, + "y": 0 + } + } + }, + { + "name": "gather_input_voice_opt_in", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_opt_in", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_opt_in", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_opt_in.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 200 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_opt_in", + "type": "split-based-on", + "transitions": [ + { + "event": "noMatch" + }, + { + "next": "gather_input_voice_specialist_knowledge_satisfaction", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 1", + "arguments": [ + "{{widgets.gather_input_voice_opt_in.Digits}}" + ], + "type": "equal_to", + "value": "1" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_opt_in.Digits}}", + "offset": { + "x": 0, + "y": 420 + } + } + }, + { + "name": "gather_input_voice_specialist_knowledge_satisfaction", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_specialist_knowledge_satisfaction_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_specialist_knowledge_satisfaction_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_specialist_knowledge_satisfaction.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 1350 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_specialist_knowledge_satisfaction_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_specialist_knowledge_satisfaction_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_specialist_knowledge_satisfaction", + "event": "match", + "conditions": [ + { + "friendly_name": "If value matches_any_of 1,2,3,4,5", + "arguments": [ + "{{widgets.gather_input_voice_specialist_knowledge_satisfaction.Digits}}" + ], + "type": "matches_any_of", + "value": "1,2,3,4,5" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_specialist_knowledge_satisfaction.Digits}}", + "offset": { + "x": 0, + "y": 1570 + } + } + }, + { + "name": "set_var_specialist_knowledge_satisfaction_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_will_follow_advice", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "specialist_knowledge_satisfaction" + } + ], + "offset": { + "x": -400, + "y": 1800 + } + } + }, + { + "name": "set_var_specialist_knowledge_satisfaction", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_will_follow_advice", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "{{widgets.gather_input_voice_specialist_knowledge_satisfaction.Digits}}", + "key": "specialist_knowledge_satisfaction" + } + ], + "offset": { + "x": 0, + "y": 1800 + } + } + }, + { + "name": "gather_input_voice_will_follow_advice", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_will_follow_advice_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_will_follow_advice_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_will_follow_advice.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 2050 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_will_follow_advice_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_will_follow_advice_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_will_follow_advice", + "event": "match", + "conditions": [ + { + "friendly_name": "If value matches_any_of 1,2,3,4,5", + "arguments": [ + "{{widgets.gather_input_voice_will_follow_advice.Digits}}" + ], + "type": "matches_any_of", + "value": "1,2,3,4,5" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_will_follow_advice.Digits}}", + "offset": { + "x": 0, + "y": 2270 + } + } + }, + { + "name": "set_var_will_follow_advice_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_would_recommend", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "will_follow_advice" + } + ], + "offset": { + "x": -400, + "y": 2500 + } + } + }, + { + "name": "set_var_will_follow_advice", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_would_recommend", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "{{widgets.gather_input_voice_will_follow_advice.Digits}}", + "key": "will_follow_advice" + } + ], + "offset": { + "x": 0, + "y": 2500 + } + } + }, + { + "name": "gather_input_voice_would_recommend", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_would_recommend_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_would_recommend_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_would_recommend.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 2750 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_would_recommend_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_would_recommend_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_would_recommend", + "event": "match", + "conditions": [ + { + "friendly_name": "If value matches_any_of 1,2,3,4,5", + "arguments": [ + "{{widgets.gather_input_voice_would_recommend.Digits}}" + ], + "type": "matches_any_of", + "value": "1,2,3,4,5" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_would_recommend.Digits}}", + "offset": { + "x": 0, + "y": 2970 + } + } + }, + { + "name": "set_var_would_recommend_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_overall_satisfaction", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "would_recommend" + } + ], + "offset": { + "x": -400, + "y": 3200 + } + } + }, + { + "name": "set_var_would_recommend", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_overall_satisfaction", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "{{widgets.gather_input_voice_would_recommend.Digits}}", + "key": "would_recommend" + } + ], + "offset": { + "x": 0, + "y": 3200 + } + } + }, + { + "name": "gather_input_voice_overall_satisfaction", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_overall_satisfaction_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_overall_satisfaction_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_overall_satisfaction.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 3450 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_overall_satisfaction_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_overall_satisfaction_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_overall_satisfaction", + "event": "match", + "conditions": [ + { + "friendly_name": "If value matches_any_of 1,2,3,4,5", + "arguments": [ + "{{widgets.gather_input_voice_overall_satisfaction.Digits}}" + ], + "type": "matches_any_of", + "value": "1,2,3,4,5" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_overall_satisfaction.Digits}}", + "offset": { + "x": 0, + "y": 3670 + } + } + }, + { + "name": "set_var_overall_satisfaction_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_self_or_other", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "overall_satisfaction" + } + ], + "offset": { + "x": -400, + "y": 3900 + } + } + }, + { + "name": "set_var_overall_satisfaction", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_self_or_other", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "{{widgets.gather_input_voice_overall_satisfaction.Digits}}", + "key": "overall_satisfaction" + } + ], + "offset": { + "x": 0, + "y": 3900 + } + } + }, + { + "name": "gather_input_voice_self_or_other", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_self_or_other_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_self_or_other_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_self_or_other.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 4150 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_self_or_other_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_self_or_other_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_self_or_other_self", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 1", + "arguments": [ + "{{widgets.gather_input_voice_self_or_other.Digits}}" + ], + "type": "equal_to", + "value": "1" + } + ] + }, + { + "next": "set_var_self_or_other_someone_else", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 2", + "arguments": [ + "{{widgets.gather_input_voice_self_or_other.Digits}}" + ], + "type": "equal_to", + "value": "2" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_self_or_other.Digits}}", + "offset": { + "x": 0, + "y": 4370 + } + } + }, + { + "name": "set_var_self_or_other_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_victim_service_profesional", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "self_or_other" + } + ], + "offset": { + "x": -400, + "y": 4600 + } + } + }, + { + "name": "set_var_self_or_other_self", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_victim_service_profesional", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Self", + "key": "self_or_other" + } + ], + "offset": { + "x": 0, + "y": 4600 + } + } + }, + { + "name": "set_var_self_or_other_someone_else", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_victim_service_profesional", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Someone else", + "key": "self_or_other" + } + ], + "offset": { + "x": 400, + "y": 4600 + } + } + }, + { + "name": "gather_input_voice_victim_service_profesional", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_victim_service_profesional_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_victim_service_profesional_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_victim_service_profesional.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 4850 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_victim_service_profesional_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_victim_service_profesional_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_victim_service_profesional_yes", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 1", + "arguments": [ + "{{widgets.gather_input_voice_victim_service_profesional.Digits}}" + ], + "type": "equal_to", + "value": "1" + } + ] + }, + { + "next": "set_var_victim_service_profesional_no", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 2", + "arguments": [ + "{{widgets.gather_input_voice_victim_service_profesional.Digits}}" + ], + "type": "equal_to", + "value": "2" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_victim_service_profesional.Digits}}", + "offset": { + "x": 0, + "y": 5070 + } + } + }, + { + "name": "set_var_victim_service_profesional_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_was_first_time", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "victim_service_profesional" + } + ], + "offset": { + "x": -400, + "y": 5300 + } + } + }, + { + "name": "set_var_victim_service_profesional_yes", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_was_first_time", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Yes", + "key": "victim_service_profesional" + } + ], + "offset": { + "x": 0, + "y": 5300 + } + } + }, + { + "name": "set_var_victim_service_profesional_no", + "type": "set-variables", + "transitions": [ + { + "next": "gather_input_voice_was_first_time", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "No", + "key": "victim_service_profesional" + } + ], + "offset": { + "x": 400, + "y": 5300 + } + } + }, + { + "name": "gather_input_voice_was_first_time", + "type": "gather-input-on-call", + "transitions": [ + { + "next": "split_was_first_time_response", + "event": "keypress" + }, + { + "event": "speech" + }, + { + "next": "split_was_first_time_response", + "event": "timeout" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/gather_input_voice_was_first_time.mp3", + "number_of_digits": 1, + "speech_timeout": "5", + "offset": { + "x": 0, + "y": 5550 + }, + "loop": 1, + "finish_on_key": "#", + "stop_gather": true, + "gather_language": "${flow_vars.gather_language}", + "speech_model": "default", + "timeout": 5 + } + }, + { + "name": "split_was_first_time_response", + "type": "split-based-on", + "transitions": [ + { + "next": "set_var_was_first_time_unrecognized", + "event": "noMatch" + }, + { + "next": "set_var_was_first_time_yes", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 1", + "arguments": [ + "{{widgets.gather_input_voice_was_first_time.Digits}}" + ], + "type": "equal_to", + "value": "1" + } + ] + }, + { + "next": "set_var_was_first_time_no", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to 2", + "arguments": [ + "{{widgets.gather_input_voice_was_first_time.Digits}}" + ], + "type": "equal_to", + "value": "2" + } + ] + } + ], + "properties": { + "input": "{{widgets.gather_input_voice_was_first_time.Digits}}", + "offset": { + "x": 0, + "y": 5770 + } + } + }, + { + "name": "set_var_was_first_time_unrecognized", + "type": "set-variables", + "transitions": [ + { + "next": "f_savePostSurvey", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Unrecognized or no input", + "key": "was_first_time" + } + ], + "offset": { + "x": -400, + "y": 6000 + } + } + }, + { + "name": "set_var_was_first_time_yes", + "type": "set-variables", + "transitions": [ + { + "next": "f_savePostSurvey", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "Yes", + "key": "was_first_time" + } + ], + "offset": { + "x": 0, + "y": 6000 + } + } + }, + { + "name": "set_var_was_first_time_no", + "type": "set-variables", + "transitions": [ + { + "next": "f_savePostSurvey", + "event": "next" + } + ], + "properties": { + "variables": [ + { + "type": "string", + "value": "No", + "key": "was_first_time" + } + ], + "offset": { + "x": 400, + "y": 6000 + } + } + }, + { + "name": "f_savePostSurvey", + "type": "make-http-request", + "transitions": [ + { + "next": "play_message_voice_post_survey_complete", + "event": "success" + }, + { + "next": "play_message_voice_post_survey_complete", + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 0, + "y": 6250 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "add_twilio_auth": false, + "body": "{\n \"contactId\": \"{{trigger.call.contactId}}\",\n \"contactTaskSid\": \"{{trigger.call.taskSid}}\",\n \"postSurveyAnswers\": {\n \"specialist_knowledge_satisfaction\": \"{{flow.variables.specialist_knowledge_satisfaction}}\",\n \"will_follow_advice\": \"{{flow.variables.will_follow_advice}}\",\n \"would_recommend\": \"{{flow.variables.would_recommend}}\",\n \"overall_satisfaction\": \"{{flow.variables.overall_satisfaction}}\",\n \"self_or_other\": \"{{flow.variables.self_or_other}}\",\n \"victim_service_profesional\": \"{{flow.variables.victim_service_profesional}}\",\n \"was_first_time\": \"{{flow.variables.was_first_time}}\"\n }\n}", + "url": "${lambda_twilio_account_scoped_url}/hrm/savePostSurvey" + } + }, + { + "name": "play_message_voice_post_survey_complete", + "type": "say-play", + "transitions": [ + { + "event": "audioComplete" + } + ], + "properties": { + "play": "${flow_vars.post_survey_assets_url}/play_message_voice_post_survey_complete.mp3", + "offset": { + "x": 0, + "y": 6500 + }, + "loop": 1 + } + } + ] + } + ) +} diff --git a/twilio-iac/helplines/usvc/templates/studio-flows/voice-dcvh-sd.tftpl b/twilio-iac/helplines/usvc/templates/studio-flows/voice-dcvh-sd.tftpl index 09b8d42f4a..0feb5c9cb0 100644 --- a/twilio-iac/helplines/usvc/templates/studio-flows/voice-dcvh-sd.tftpl +++ b/twilio-iac/helplines/usvc/templates/studio-flows/voice-dcvh-sd.tftpl @@ -331,63 +331,6 @@ ${ "y": 1830 } } - }, - { - "name": "run_subflow_debug", - "type": "run-subflow", - "transitions": [ - { - "event": "completed" - }, - { - "event": "failed" - } - ], - "properties": { - "flow_sid": "${debug_studio_subflow_sid}", - "flow_revision": "LatestPublished", - "offset": { - "x": -120, - "y": 2620 - }, - "parameters": [ - { - "type": "json_object", - "value": "{{flow}}", - "key": "flow" - }, - { - "type": "string", - "value": "widget_failures", - "key": "debug_mode" - }, - { - "type": "json_object", - "value": "{{widgets}}", - "key": "widgets" - }, - { - "type": "json_object", - "value": "{{trigger}}", - "key": "trigger" - }, - { - "type": "string", - "value": "{{flow.flow_sid}}", - "key": "flow_sid" - }, - { - "type": "string", - "value": "{{flow.sid}}", - "key": "execution_sid" - }, - { - "type": "string", - "value": "${channel_attributes.default}", - "key": "task_attributes" - } - ] - } } ], "initial_state": "Trigger", diff --git a/twilio-iac/helplines/usvc/templates/studio-flows/voice-vc-sd.tftpl b/twilio-iac/helplines/usvc/templates/studio-flows/voice-vc-sd.tftpl index 02cbdfa013..a16b29a4e0 100644 --- a/twilio-iac/helplines/usvc/templates/studio-flows/voice-vc-sd.tftpl +++ b/twilio-iac/helplines/usvc/templates/studio-flows/voice-vc-sd.tftpl @@ -266,63 +266,6 @@ ${ "y": 2030 } } - }, - { - "name": "run_subflow_debug", - "type": "run-subflow", - "transitions": [ - { - "event": "completed" - }, - { - "event": "failed" - } - ], - "properties": { - "flow_sid": "${debug_studio_subflow_sid}", - "flow_revision": "LatestPublished", - "offset": { - "x": 50, - "y": 2640 - }, - "parameters": [ - { - "type": "json_object", - "value": "{{flow}}", - "key": "flow" - }, - { - "type": "string", - "value": "widget_failures", - "key": "debug_mode" - }, - { - "type": "json_object", - "value": "{{widgets}}", - "key": "widgets" - }, - { - "type": "json_object", - "value": "{{trigger}}", - "key": "trigger" - }, - { - "type": "string", - "value": "{{flow.flow_sid}}", - "key": "flow_sid" - }, - { - "type": "string", - "value": "{{flow.sid}}", - "key": "execution_sid" - }, - { - "type": "string", - "value": "${channel_attributes.default}", - "key": "task_attributes" - } - ] - } } ], "initial_state": "Trigger",