From fa607d4bba2a460a3a2e21ec303d936d5ed0c6a2 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Wed, 29 Nov 2023 13:26:48 -0700 Subject: [PATCH] Add context field to conference and call center queue (#6836) * Update conference_edit.php * Update app_config.php * Update app_config.php * Update call_center_queue_edit.php * Update call_center_queue_edit.php --- app/call_centers/app_config.php | 10 +++++++- app/call_centers/call_center_queue_edit.php | 28 ++++++++++++++++++++- app/conferences/app_config.php | 8 ++++++ app/conferences/conference_edit.php | 28 ++++++++++++++++++++- 4 files changed, 71 insertions(+), 3 deletions(-) diff --git a/app/call_centers/app_config.php b/app/call_centers/app_config.php index 2ae199426d..5f5ab2595a 100644 --- a/app/call_centers/app_config.php +++ b/app/call_centers/app_config.php @@ -42,6 +42,7 @@ $apps[$x]['destinations'][$y]['field']['destination'] = "queue_extension"; $apps[$x]['destinations'][$y]['field']['extension'] = "queue_extension"; $apps[$x]['destinations'][$y]['field']['description'] = "queue_description"; + $apps[$x]['destinations'][$y]['field']['context'] = "queue_context"; $apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}"; $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}"; $apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name} \${description}"; @@ -66,6 +67,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "call_center_queue_context"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "call_center_all"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; @@ -205,7 +209,7 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "hold_music"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Pass through hold_music variable."; - + //cache details $apps[$x]['cache']['key'] = "dialplan.\${domain_name}"; @@ -480,6 +484,10 @@ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_context"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_description"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 9cb2bc32e1..0155f9b4b2 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -116,6 +116,14 @@ $queue_email_address = $_POST["queue_email_address"] ?? null; $queue_description = $_POST["queue_description"]; + //set the context for users that do not have the permission + if (permission_exists('call_center_queue_context')) { + $queue_context = $_POST["queue_context"]; + } + else if ($action == 'add') { + $queue_context = $_SESSION['domain_name']; + } + //remove invalid characters $queue_cid_prefix = str_replace(":", "-", $queue_cid_prefix); $queue_cid_prefix = str_replace("\"", "", $queue_cid_prefix); @@ -316,6 +324,7 @@ if (permission_exists('call_center_email_address')) { $array['call_center_queues'][0]['queue_email_address'] = $queue_email_address; } + $array['call_center_queues'][0]['queue_context'] = $queue_context; $array['call_center_queues'][0]['queue_description'] = $queue_description; $array['call_center_queues'][0]['call_center_queue_uuid'] = $call_center_queue_uuid; $array['call_center_queues'][0]['dialplan_uuid'] = $dialplan_uuid; @@ -397,7 +406,9 @@ $array['dialplans'][0]["dialplan_uuid"] = $dialplan_uuid; $array['dialplans'][0]["dialplan_name"] = $queue_name; $array['dialplans'][0]["dialplan_number"] = $queue_extension; - $array['dialplans'][0]["dialplan_context"] = $_SESSION['domain_name']; + if (isset($queue_context)) { + $array['dialplans'][0]["dialplan_context"] = $queue_context; + } $array['dialplans'][0]["dialplan_continue"] = "false"; $array['dialplans'][0]["dialplan_xml"] = $dialplan_xml; $array['dialplans'][0]["dialplan_order"] = "230"; @@ -544,6 +555,7 @@ $queue_announce_frequency = $row["queue_announce_frequency"]; $queue_cc_exit_keys = $row["queue_cc_exit_keys"]; $queue_email_address = $row["queue_email_address"]; + $queue_context = $row["queue_context"]; $queue_description = $row["queue_description"]; } } @@ -617,6 +629,7 @@ if (empty($queue_tier_rule_no_agent_no_wait)) { $queue_tier_rule_no_agent_no_wait = "true"; } if (empty($queue_discard_abandoned_after)) { $queue_discard_abandoned_after = "900"; } if (empty($queue_abandoned_resume_allowed)) { $queue_abandoned_resume_allowed = "false"; } + if (empty($queue_context)) { $queue_context = $_SESSION['domain_name']; } //create token $object = new token; @@ -1370,6 +1383,19 @@ echo "\n"; } + if (permission_exists('call_center_queue_context')) { + echo "