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 "
\n";
+ echo "| \n";
+ echo " ".$text['label-context']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-enter-context']."\n";
+ echo " | \n";
+ echo "
\n";
+ }
+
echo "\n";
echo "| \n";
echo " ".$text['label-description']."\n";
diff --git a/app/conferences/app_config.php b/app/conferences/app_config.php
index 6d7c5d4443..dea9990528 100644
--- a/app/conferences/app_config.php
+++ b/app/conferences/app_config.php
@@ -42,6 +42,7 @@
$apps[$x]['destinations'][$y]['field']['destination'] = "conference_extension";
$apps[$x]['destinations'][$y]['field']['extension'] = "conference_extension";
$apps[$x]['destinations'][$y]['field']['description'] = "conference_description";
+ $apps[$x]['destinations'][$y]['field']['context'] = "conference_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}";
@@ -86,6 +87,9 @@
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
+ $apps[$x]['permissions'][$y]['name'] = "conference_context";
+ $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+ $y++;
$apps[$x]['permissions'][$y]['name'] = "conference_email_address";
$y++;
$apps[$x]['permissions'][$y]['name'] = "conference_account_code";
@@ -169,6 +173,10 @@
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
$z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_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'] = "conference_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the conference.";
diff --git a/app/conferences/conference_edit.php b/app/conferences/conference_edit.php
index 50930439ef..df1d31c32e 100644
--- a/app/conferences/conference_edit.php
+++ b/app/conferences/conference_edit.php
@@ -72,6 +72,14 @@
$conference_description = $_POST["conference_description"];
$conference_enabled = $_POST["conference_enabled"] ?? 'false';
+ //set the context for users that do not have the permission
+ if (permission_exists('conference_context')) {
+ $conference_context = $_POST["conference_context"];
+ }
+ else if ($action == 'add') {
+ $conference_context = $_SESSION['domain_name'];
+ }
+
//sanitize the conference name
$conference_name = preg_replace("/[^A-Za-z0-9\- ]/", "", $conference_name);
//$conference_name = str_replace(" ", "-", $conference_name);
@@ -199,6 +207,7 @@
}
$array['conferences'][0]['conference_order'] = $conference_order;
$array['conferences'][0]['conference_description'] = $conference_description;
+ $array['conferences'][0]['conference_context'] = $conference_context;
$array['conferences'][0]['conference_enabled'] = $conference_enabled;
//conference pin number
@@ -220,11 +229,13 @@
$array['dialplans'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][0]['dialplan_name'] = $conference_name;
$array['dialplans'][0]['dialplan_number'] = $conference_extension;
+ if (isset($conference_context)) {
+ $array['dialplans'][0]["dialplan_context"] = $conference_context;
+ }
$array['dialplans'][0]['app_uuid'] = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
$array['dialplans'][0]['dialplan_xml'] = $dialplan_xml;
$array['dialplans'][0]['dialplan_continue'] = 'false';
$array['dialplans'][0]['dialplan_order'] = '333';
- $array['dialplans'][0]['dialplan_context'] = $_SESSION['domain_name'];
$array['dialplans'][0]['dialplan_enabled'] = $conference_enabled;
$array['dialplans'][0]['dialplan_description'] = $conference_description;
@@ -295,6 +306,7 @@
$conference_account_code = $row["conference_account_code"];
$conference_order = $row["conference_order"];
$conference_description = $row["conference_description"];
+ $conference_context = $row["conference_context"];
$conference_enabled = $row["conference_enabled"];
$conference_name = str_replace("-", " ", $conference_name);
}
@@ -302,6 +314,7 @@
}
//set the defaults
+ if (empty($conference_context)) { $conference_context = $_SESSION['domain_name']; }
if (empty($conference_enabled)) { $conference_enabled = 'true'; }
//get the conference profiles
@@ -524,6 +537,19 @@
echo " | \n";
echo "
\n";
+ if (permission_exists('conference_context')) {
+ echo "\n";
+ echo "| \n";
+ echo " ".$text['label-context']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-enter-context']."\n";
+ echo " | \n";
+ echo "
\n";
+ }
+
echo "\n";
echo "| \n";
echo " ".$text['table-enabled']."\n";
|