Add destination ringback
This commit is contained in:
parent
e692dc35c4
commit
9e2ab9b8c3
|
|
@ -137,6 +137,9 @@
|
|||
$apps[$x]['permissions'][$y]['name'] = "destination_distinctive_ring";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "destination_ringback";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "destination_accountcode";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
|
|
@ -324,6 +327,10 @@
|
|||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to set distinctive ring.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_ringback";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to set the ringback.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_accountcode";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
|
|
|
|||
|
|
@ -1015,6 +1015,32 @@ $text['label-destination_distinctive_ring']['zh-cn'] = "特色戒指";
|
|||
$text['label-destination_distinctive_ring']['ja-jp'] = "特徴的なリング";
|
||||
$text['label-destination_distinctive_ring']['ko-kr'] = "독특한 반지";
|
||||
|
||||
$text['label-destination_ringback']['en-us'] = "Ringback";
|
||||
$text['label-destination_ringback']['en-gb'] = "Ringback";
|
||||
$text['label-destination_ringback']['ar-eg'] = "العودة";
|
||||
$text['label-destination_ringback']['de-at'] = "Wählton";
|
||||
$text['label-destination_ringback']['de-ch'] = "Wählton";
|
||||
$text['label-destination_ringback']['de-de'] = "Wählton";
|
||||
$text['label-destination_ringback']['el-gr'] = "Καλώ πίσω";
|
||||
$text['label-destination_ringback']['es-cl'] = "Retorno de llamado";
|
||||
$text['label-destination_ringback']['es-mx'] = "Retorno de llamado";
|
||||
$text['label-destination_ringback']['fr-ca'] = "Retour de Sonnerie";
|
||||
$text['label-destination_ringback']['fr-fr'] = "Retour de Sonnerie";
|
||||
$text['label-destination_ringback']['he-il'] = "טבעת בחזרה";
|
||||
$text['label-destination_ringback']['it-it'] = "Ring Back";
|
||||
$text['label-destination_ringback']['nl-nl'] = "Terug bellen";
|
||||
$text['label-destination_ringback']['pl-pl'] = "Rodzaj sygnału w słuchawce dzwoniącego";
|
||||
$text['label-destination_ringback']['pt-br'] = "Tom de chamada";
|
||||
$text['label-destination_ringback']['pt-pt'] = "Tom de Chamada";
|
||||
$text['label-destination_ringback']['ro-ro'] = "Suna inapoi";
|
||||
$text['label-destination_ringback']['ru-ru'] = "Контроль посылки вызова (КПВ)";
|
||||
$text['label-destination_ringback']['sv-se'] = "Ring Tillbaka";
|
||||
$text['label-destination_ringback']['uk-ua'] = "Кільце назад";
|
||||
$text['label-destination_ringback']['tr-tr'] = "Geri Çal";
|
||||
$text['label-destination_ringback']['zh-cn'] = "回电";
|
||||
$text['label-destination_ringback']['ja-jp'] = "リングバック";
|
||||
$text['label-destination_ringback']['ko-kr'] = "링백";
|
||||
|
||||
$text['label-destination_record']['en-us'] = "Record";
|
||||
$text['label-destination_record']['en-gb'] = "Record";
|
||||
$text['label-destination_record']['ar-eg'] = "السجل";
|
||||
|
|
@ -2135,6 +2161,32 @@ $text['description-destination_distinctive_ring']['zh-cn'] = "为独特的铃声
|
|||
$text['description-destination_distinctive_ring']['ja-jp'] = "特徴的な呼び出し音を選択します。";
|
||||
$text['description-destination_distinctive_ring']['ko-kr'] = "독특한 벨소리에 대한 사운드를 선택합니다.";
|
||||
|
||||
$text['description-destination_ringback']['en-us'] = "Defines what the caller will hear while the destination is being called.";
|
||||
$text['description-destination_ringback']['en-gb'] = "Defines what the caller will hear while the destination is being called.";
|
||||
$text['description-destination_ringback']['ar-eg'] = "يحدد ما سيسمعه المتصل بينما يتم استدعاء الوجهة";
|
||||
$text['description-destination_ringback']['de-at'] = "Definiert was der Anrufer hört wenn das Ziel angerufen wird.";
|
||||
$text['description-destination_ringback']['de-ch'] = "Definiert was der Anrufer hört wenn das Ziel angerufen wird.";
|
||||
$text['description-destination_ringback']['de-de'] = "Definiert was der Anrufer hört wenn das Ziel angerufen wird.";
|
||||
$text['description-destination_ringback']['el-gr'] = "Καθορίζει τι θα ακούσει ο καλών ενώ καλείται ο προορισμός.";
|
||||
$text['description-destination_ringback']['es-cl'] = "Define qué va a escuchar quien llama mientras el destino es llamado.";
|
||||
$text['description-destination_ringback']['es-mx'] = "Define qué va a escuchar quien llama mientras el destino es llamado.";
|
||||
$text['description-destination_ringback']['fr-ca'] = "Défini ce que l'appelant entendra lorsque la destination sera en sonnerie.";
|
||||
$text['description-destination_ringback']['fr-fr'] = "Défini ce que l'appelant entendra lorsque la destination sera en sonnerie.";
|
||||
$text['description-destination_ringback']['he-il'] = "תגדירו מה קוראן ישמע בזמן שהייעד נקרא.";
|
||||
$text['description-destination_ringback']['it-it'] = "Specificare cosa sentirà il chiamante mentre viene chiamata la destinazione.";
|
||||
$text['description-destination_ringback']['nl-nl'] = "Deinieert wat de beller zal horen als de bestemming gekozen wordt.";
|
||||
$text['description-destination_ringback']['pl-pl'] = "Zdefiniuj jaki sygnał słyszy dzwoniący podczas łączenia z numerem docelowym.";
|
||||
$text['description-destination_ringback']['pt-br'] = "Defina o áudio que o destino estará ouvindo enquando estiver na linha";
|
||||
$text['description-destination_ringback']['pt-pt'] = "Defina o que é que o chamador ouve enquanto o destino estiver a ser chamado.";
|
||||
$text['description-destination_ringback']['ro-ro'] = "Definește ce va auzi apelantul în timp ce destinația este apelată.";
|
||||
$text['description-destination_ringback']['ru-ru'] = "Определяет, что будет слышать собеседник во время вызова адресата.";
|
||||
$text['description-destination_ringback']['sv-se'] = "Definierar vad inringande kommer att höra under tiden som destinationen rings upp.";
|
||||
$text['description-destination_ringback']['uk-ua'] = "Захищаючи те, що дзвоник почнеться в той час як називається пункт призначення.";
|
||||
$text['description-destination_ringback']['tr-tr'] = "Hedef aranırken arayanın ne duyacağını tanımlar.";
|
||||
$text['description-destination_ringback']['zh-cn'] = "定义呼叫目的地时呼叫者将听到的内容。";
|
||||
$text['description-destination_ringback']['ja-jp'] = "宛先への通話中に発信者に聞こえる内容を定義します。";
|
||||
$text['description-destination_ringback']['ko-kr'] = "목적지가 호출되는 동안 발신자가 듣게 될 내용을 정의합니다.";
|
||||
|
||||
$text['description-destination_record']['en-us'] = "Save the recording.";
|
||||
$text['description-destination_record']['en-gb'] = "Save the recording.";
|
||||
$text['description-destination_record']['ar-eg'] = "وفر التسجيل";
|
||||
|
|
|
|||
|
|
@ -41,6 +41,15 @@
|
|||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//initialize the database
|
||||
$database = new database;
|
||||
|
||||
//initialize the destinations object
|
||||
$destination = new destinations;
|
||||
|
||||
//initialize the ringbacks object
|
||||
$ringbacks = new ringbacks;
|
||||
|
||||
//action add or update
|
||||
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
|
|
@ -65,7 +74,6 @@
|
|||
if (!empty($_SESSION['limit']['destinations']['numeric'])) {
|
||||
$sql = "select count(*) from v_destinations where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$total_destinations = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
|
|
@ -115,6 +123,7 @@
|
|||
$destination_hold_music = $_POST["destination_hold_music"];
|
||||
$destination_distinctive_ring = $_POST["destination_distinctive_ring"];
|
||||
$destination_record = $_POST["destination_record"];
|
||||
$destination_ringback = $_POST["destination_ringback"];
|
||||
$destination_accountcode = $_POST["destination_accountcode"];
|
||||
$destination_type_voice = $_POST["destination_type_voice"] ?? null;
|
||||
$destination_type_fax = $_POST["destination_type_fax"] ?? null;
|
||||
|
|
@ -146,7 +155,6 @@
|
|||
if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||
|
||||
//initialize the destinations object
|
||||
$destination = new destinations;
|
||||
if (permission_exists('destination_domain') && !empty($domain_uuid) && is_uuid($domain_uuid)) {
|
||||
$destination->domain_uuid = $domain_uuid;
|
||||
}
|
||||
|
|
@ -177,7 +185,6 @@
|
|||
$sql = "select destination_number from v_destinations ";
|
||||
$sql .= "where destination_uuid = :destination_uuid ";
|
||||
$parameters['destination_uuid'] = $destination_uuid;
|
||||
$database = new database;
|
||||
$destination_number = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters, $num_rows);
|
||||
}
|
||||
|
|
@ -196,7 +203,6 @@
|
|||
$sql .= "where (destination_number = :destination_number or destination_prefix || destination_number = :destination_number) ";
|
||||
$sql .= "and destination_type = 'inbound' ";
|
||||
$parameters['destination_number'] = $destination_number;
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
if ($num_rows > 0) {
|
||||
$msg .= $text['message-duplicate']."<br>\n";
|
||||
|
|
@ -228,7 +234,6 @@
|
|||
$sql = "select * from v_destinations ";
|
||||
$sql .= "where destination_uuid = :destination_uuid ";
|
||||
$parameters['destination_uuid'] = $destination_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
|
@ -297,6 +302,9 @@
|
|||
if (!permission_exists('destination_distinctive_ring')) {
|
||||
$destination_distinctive_ring = $row["destination_distinctive_ring"] ?? null;
|
||||
}
|
||||
if (!permission_exists('destination_ringback')) {
|
||||
$destination_ringback = $row["destination_ringback"] ?? null;
|
||||
}
|
||||
if (!permission_exists('destination_accountcode')) {
|
||||
$destination_accountcode = $row["destination_accountcode"] ?? null;
|
||||
}
|
||||
|
|
@ -361,7 +369,6 @@
|
|||
//}
|
||||
$parameters['fax_uuid'] = $fax_uuid;
|
||||
//$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (!empty($row)) {
|
||||
$fax_extension = $row["fax_extension"];
|
||||
|
|
@ -395,7 +402,6 @@
|
|||
if (isset($destination_number) && !empty($destination_number)) {
|
||||
$destination_numbers['destination_number'] = $destination_number;
|
||||
}
|
||||
$destination = new destinations;
|
||||
$destination_number_regex = $destination->to_regex($destination_numbers);
|
||||
unset($destination_numbers);
|
||||
|
||||
|
|
@ -536,6 +542,10 @@
|
|||
if (!empty($destination_distinctive_ring)) {
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"export\" data=\"sip_h_Alert-Info=".xml::sanitize($destination_distinctive_ring)."\" inline=\"true\"/>\n";
|
||||
}
|
||||
if (!empty($destination_ringback) && $ringbacks->valid($destination_ringback)) {
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"export\" data=\"ringback=".$destination_ringback."\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"export\" data=\"transfer_ringback=".$destination_ringback."\" inline=\"true\"/>\n";
|
||||
}
|
||||
if (!empty($destination_accountcode)) {
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"export\" data=\"accountcode=".xml::sanitize($destination_accountcode)."\" inline=\"true\"/>\n";
|
||||
}
|
||||
|
|
@ -646,7 +656,7 @@
|
|||
}
|
||||
else {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $row['condition_field'];
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = '^'.$condition_expression.'$';
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = '^'.$condition_expression.'$';
|
||||
}
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = $dialplan_detail_group;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order;
|
||||
|
|
@ -756,6 +766,37 @@
|
|||
$dialplan_detail_order = $dialplan_detail_order + 10;
|
||||
}
|
||||
|
||||
//set the ringback
|
||||
if (!empty($destination_ringback) && $ringbacks->valid($destination_ringback)) {
|
||||
//set the ringback
|
||||
$dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_uuid"] = $dialplan_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "ringback=".$destination_ringback;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_inline"] = "true";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = $dialplan_detail_group;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order;
|
||||
$y++;
|
||||
|
||||
//increment the dialplan detail order
|
||||
$dialplan_detail_order = $dialplan_detail_order + 10;
|
||||
|
||||
//set the transfer ringback
|
||||
$dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_uuid"] = $dialplan_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "transfer_ringback=".$destination_ringback;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_inline"] = "true";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = $dialplan_detail_group;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order;
|
||||
$y++;
|
||||
|
||||
//increment the dialplan detail order
|
||||
$dialplan_detail_order = $dialplan_detail_order + 10;
|
||||
}
|
||||
|
||||
//set the call accountcode
|
||||
if (!empty($destination_accountcode)) {
|
||||
$dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid;
|
||||
|
|
@ -1005,7 +1046,6 @@
|
|||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
$parameters['dialplan_uuid'] = $dialplan_uuid;
|
||||
$database = new database;
|
||||
$database->execute($sql, $parameters);
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
|
@ -1050,6 +1090,9 @@
|
|||
$array['destinations'][$x]["destination_distinctive_ring"] = $destination_distinctive_ring;
|
||||
}
|
||||
$array['destinations'][$x]["destination_record"] = $destination_record;
|
||||
if (!empty($destination_ringback) && $ringbacks->valid($destination_ringback)) {
|
||||
$array['destinations'][$x]["destination_ringback"] = $destination_ringback;
|
||||
}
|
||||
$array['destinations'][$x]["destination_accountcode"] = $destination_accountcode;
|
||||
$array['destinations'][$x]["destination_type_voice"] = $destination_type_voice ? 1 : null;
|
||||
$array['destinations'][$x]["destination_type_fax"] = $destination_type_fax ? 1 : null;
|
||||
|
|
@ -1103,7 +1146,6 @@
|
|||
$p->add("dialplan_detail_edit", 'temp');
|
||||
|
||||
//save the dialplan
|
||||
$database = new database;
|
||||
$database->app_name = 'destinations';
|
||||
$database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139';
|
||||
$database->save($array);
|
||||
|
|
@ -1168,7 +1210,6 @@
|
|||
}
|
||||
|
||||
//save the destination
|
||||
$database = new database;
|
||||
$database->app_name = 'destinations';
|
||||
$database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139';
|
||||
$database->save($array);
|
||||
|
|
@ -1208,6 +1249,7 @@
|
|||
$destination_hold_music = $destination_hold_music ?? '';
|
||||
$destination_distinctive_ring = $destination_distinctive_ring ?? '';
|
||||
$destination_record = $destination_record ?? '';
|
||||
$destination_ringback = $destination_ringback ?? '';
|
||||
$destination_accountcode = $destination_accountcode ?? '';
|
||||
$destination_type_voice = $destination_type_voice ?? '';
|
||||
$destination_type_fax = $destination_type_fax ?? '';
|
||||
|
|
@ -1237,7 +1279,6 @@
|
|||
$sql = "select * from v_destinations ";
|
||||
$sql .= "where destination_uuid = :destination_uuid ";
|
||||
$parameters['destination_uuid'] = $destination_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (!empty($row)) {
|
||||
$domain_uuid = $row["domain_uuid"];
|
||||
|
|
@ -1254,6 +1295,7 @@
|
|||
$destination_hold_music = $row["destination_hold_music"];
|
||||
$destination_distinctive_ring = $row["destination_distinctive_ring"];
|
||||
$destination_record = $row["destination_record"];
|
||||
$destination_ringback = $row["destination_ringback"];
|
||||
$destination_accountcode = $row["destination_accountcode"];
|
||||
$destination_type_voice = $row["destination_type_voice"];
|
||||
$destination_type_fax = $row["destination_type_fax"];
|
||||
|
|
@ -1305,7 +1347,6 @@
|
|||
$sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['dialplan_uuid'] = $dialplan_uuid;
|
||||
$database = new database;
|
||||
$dialplan_details = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
|
|
@ -1366,7 +1407,6 @@
|
|||
if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; }
|
||||
|
||||
//initialize the destinations object
|
||||
$destination = new destinations;
|
||||
if (permission_exists('destination_domain') && is_uuid($domain_uuid)) {
|
||||
$destination->domain_uuid = $domain_uuid;
|
||||
}
|
||||
|
|
@ -1381,7 +1421,6 @@
|
|||
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= "and provider_enabled = true ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$providers = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
|
@ -1393,7 +1432,6 @@
|
|||
$sql .= "and user_enabled = 'true' ";
|
||||
$sql .= "order by username asc ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$users = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
|
@ -1404,7 +1442,6 @@
|
|||
$sql .= "where (domain_uuid is null or domain_uuid = :domain_uuid) ";
|
||||
$sql .= "order by group_name asc ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$groups = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
|
@ -1721,7 +1758,6 @@
|
|||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "order by fax_name asc ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result)) {
|
||||
echo "<tr id='tr_fax_detection'>\n";
|
||||
|
|
@ -1894,6 +1930,21 @@
|
|||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
//distinctive ringback
|
||||
if (permission_exists("destination_ringback")) {
|
||||
echo "<tr>\n";
|
||||
echo "<tr id='tr_destination_ringback'>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-destination_ringback']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo $ringbacks->select('destination_ringback', $destination_ringback);
|
||||
echo "<br />\n";
|
||||
echo $text['description-destination_ringback']." \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
//account code
|
||||
if (permission_exists("destination_accountcode")) {
|
||||
echo "<tr id='tr_account_code'>\n";
|
||||
|
|
@ -2047,4 +2098,4 @@
|
|||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
Loading…
Reference in New Issue