mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
add ring groups option to call block (#6285)
* add ring groups option to call block * add ring groups option to call block * add ring groups option to call block * add ring groups option to call block * add ring groups option to call block
This commit is contained in:
@@ -75,6 +75,10 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_block_ring_group";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_block_voicemail";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
|
||||
@@ -284,6 +284,48 @@ $text['label-ivr']['ru-ru'] = "IVR";
|
||||
$text['label-ivr']['sv-se'] = "IVR";
|
||||
$text['label-ivr']['uk-ua'] = "";
|
||||
|
||||
$text['label-ring_groups']['en-us'] = "Ring Groups";
|
||||
$text['label-ring_groups']['en-gb'] = "Ring Groups";
|
||||
$text['label-ring_groups']['ar-eg'] = "مجموعات الرنين";
|
||||
$text['label-ring_groups']['de-at'] = "Ringgruppen"; //copied from de-de
|
||||
$text['label-ring_groups']['de-ch'] = "Ringgruppen"; //copied from de-de
|
||||
$text['label-ring_groups']['de-de'] = "Ringgruppen";
|
||||
$text['label-ring_groups']['es-cl'] = "Grupos de timbre";
|
||||
$text['label-ring_groups']['es-mx'] = "Grupos de timbre"; //copied from es-cl
|
||||
$text['label-ring_groups']['fr-ca'] = "Groupes de sonnerie"; //copied from fr-fr
|
||||
$text['label-ring_groups']['fr-fr'] = "Groupes de sonnerie";
|
||||
$text['label-ring_groups']['he-il'] = "קבוצות טבעת";
|
||||
$text['label-ring_groups']['it-it'] = "Gruppi di suoneria";
|
||||
$text['label-ring_groups']['nl-nl'] = "Belgroepen";
|
||||
$text['label-ring_groups']['pl-pl'] = "Grupy dzwonków";
|
||||
$text['label-ring_groups']['pt-br'] = "Grupos de toque"; //copied from pt-pt
|
||||
$text['label-ring_groups']['pt-pt'] = "Grupos de toque";
|
||||
$text['label-ring_groups']['ro-ro'] = "Grupuri de apeluri";
|
||||
$text['label-ring_groups']['ru-ru'] = "Кольцевые группы";
|
||||
$text['label-ring_groups']['sv-se'] = "Ringgrupper";
|
||||
$text['label-ring_groups']['uk-ua'] = "Кільцеві групи";
|
||||
|
||||
$text['label-ring_group']['en-us'] = "Ring Group";
|
||||
$text['label-ring_group']['en-gb'] = "Ring Group";
|
||||
$text['label-ring_group']['ar-eg'] = "";
|
||||
$text['label-ring_group']['de-at'] = "Rufgruppe"; //copied from de-de
|
||||
$text['label-ring_group']['de-ch'] = "Rufgruppe"; //copied from de-de
|
||||
$text['label-ring_group']['de-de'] = "Rufgruppe";
|
||||
$text['label-ring_group']['es-cl'] = "Grupo de llamado";
|
||||
$text['label-ring_group']['es-mx'] = "Grupo de llamado"; //copied from es-cl
|
||||
$text['label-ring_group']['fr-ca'] = "Groupe de sonnerie"; //copied from fr-fr
|
||||
$text['label-ring_group']['fr-fr'] = "Groupe de sonnerie";
|
||||
$text['label-ring_group']['he-il'] = "קבוצת חיוג";
|
||||
$text['label-ring_group']['it-it'] = "Gruppo di Squillo";
|
||||
$text['label-ring_group']['nl-nl'] = "Belgroep";
|
||||
$text['label-ring_group']['pl-pl'] = "Grupa odbiorców.";
|
||||
$text['label-ring_group']['pt-br'] = "Grupo"; //copied from pt-pt
|
||||
$text['label-ring_group']['pt-pt'] = "Grupo";
|
||||
$text['label-ring_group']['ro-ro'] = "";
|
||||
$text['label-ring_group']['ru-ru'] = "Группа вызовов";
|
||||
$text['label-ring_group']['sv-se'] = "Ringgrupp";
|
||||
$text['label-ring_group']['uk-ua'] = "";
|
||||
|
||||
$text['label-local']['en-us'] = "Local";
|
||||
$text['label-local']['en-gb'] = "Local";
|
||||
$text['label-local']['ar-eg'] = "محلي";
|
||||
|
||||
@@ -283,6 +283,17 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ivr'))
|
||||
$ivrs = $database->select($sql, $parameters);
|
||||
}
|
||||
|
||||
//get the ring groups
|
||||
if (permission_exists('call_block_all') || permission_exists('call_block_ivr')) {
|
||||
$sql = "select ring_group_uuid,ring_group_name, ring_group_extension, ring_group_description from v_ring_groups ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
// $sql .= "and ring_group_enabled = 'true' ";
|
||||
$sql .= "order by ring_group_extension asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$ring_groups = $database->select($sql, $parameters);
|
||||
}
|
||||
|
||||
//get the voicemails
|
||||
$sql = "select voicemail_uuid, voicemail_id, voicemail_description ";
|
||||
$sql .= "from v_voicemails ";
|
||||
@@ -448,6 +459,16 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ivr'))
|
||||
echo " </optgroup>\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('call_block_ring_groups')) {
|
||||
if (is_array($ring_groups) && sizeof($ring_groups) != 0) {
|
||||
echo " <optgroup label='".$text['label-ring_groups']."'>\n";
|
||||
foreach ($ring_groups as &$row) {
|
||||
$selected = ($call_block_app == 'ring_group' && $call_block_data == $row['ring_group_extension']) ? "selected='selected'" : null;
|
||||
echo " <option value='ring_group:".urlencode($row["ring_group_extension"])."' ".$selected.">".escape($row['ring_group_name'])." ".escape($row['ring_group_extension'])."</option>\n";
|
||||
}
|
||||
echo " </optgroup>\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('call_block_voicemail')) {
|
||||
if (is_array($voicemails) && sizeof($voicemails) != 0) {
|
||||
echo " <optgroup label='".$text['label-voicemail']."'>\n";
|
||||
|
||||
@@ -206,6 +206,15 @@
|
||||
freeswitch.consoleLog("notice", "[call_block] caller id number " .. caller_id_number .. " action: extension ".. call_block_data.."\n");
|
||||
end
|
||||
end
|
||||
if (call_block_app == 'ring_group') then
|
||||
if (session:ready()) then
|
||||
session:execute('set', 'call_block_uuid='..call_block_uuid);
|
||||
session:execute('set', 'call_block_app='..call_block_app);
|
||||
session:execute('set', 'call_block_data='..call_block_data);
|
||||
session:execute("transfer", call_block_data..' XML '.. context);
|
||||
freeswitch.consoleLog("notice", "[call_block] caller id number " .. caller_id_number .. " action: extension ".. call_block_data.."\n");
|
||||
end
|
||||
end
|
||||
if (call_block_app == 'voicemail') then
|
||||
if (session:ready()) then
|
||||
session:execute('set', 'call_block_uuid='..call_block_uuid);
|
||||
|
||||
Reference in New Issue
Block a user