mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-21 18:36:31 +00:00
Merge branch 'master' into intercept_load_balance
# Conflicts: # resources/install/scripts/intercept_group.lua
This commit is contained in:
@@ -25,22 +25,18 @@
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "29295c90-b1b9-440b-9c7E-c8363c6e8975";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_block_add";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_block_edit";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_block_delete";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
|
||||
@@ -16,8 +16,7 @@ $apps[$x]['menu'][0]['uuid'] = "29295c90-b1b9-440b-9c7E-c8363c6e8975";
|
||||
$apps[$x]['menu'][0]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
|
||||
$apps[$x]['menu'][0]['category'] = "internal";
|
||||
$apps[$x]['menu'][0]['path'] = "/app/call_block/call_block.php";
|
||||
$apps[$x]['menu'][0]['groups'][] = "user";
|
||||
$apps[$x]['menu'][0]['groups'][] = "admin";
|
||||
$apps[$x]['menu'][0]['groups'][] = "superadmin";
|
||||
$apps[$x]['menu'][0]['groups'][] = "admin";
|
||||
|
||||
?>
|
||||
@@ -86,6 +86,7 @@ if (count($_GET)>0) {
|
||||
|
||||
//synchronize configuration
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
//redirect the browser
|
||||
$_SESSION["message"] = $text['message-delete'];
|
||||
|
||||
@@ -264,6 +264,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
$_SESSION["message"] = $text['message-add'];
|
||||
header("Location: call_center_agents.php");
|
||||
@@ -291,7 +292,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
unset($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
header("Location: call_center_agents.php");
|
||||
|
||||
@@ -87,9 +87,11 @@ if (strlen($id) > 0) {
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("dialplan:".$_SESSION["context"]);
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
//synchronize configuration
|
||||
save_dialplan_xml();
|
||||
save_call_center_xml();
|
||||
|
||||
//apply settings reminder
|
||||
$_SESSION["reload_xml"] = true;
|
||||
|
||||
@@ -257,6 +257,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//syncrhonize the configuration
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
//delete the dialplan context from memcache
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
@@ -326,6 +327,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//synchronize the configuration
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
@@ -393,6 +395,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
}
|
||||
|
||||
//redirect
|
||||
|
||||
@@ -111,7 +111,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
unset($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
save_call_center_xml();
|
||||
remove_config_from_cache('configuration:callcenter.conf');
|
||||
|
||||
//look up queue uuid by queue name (ugh)
|
||||
$sql = "select call_center_queue_uuid from v_call_center_queues where queue_name = '".$queue_name."'";
|
||||
|
||||
@@ -101,17 +101,6 @@ $text['label-on-busy']['sv-se'] = "Vid Upptaget ";
|
||||
$text['label-on-busy']['uk'] = "Якщо зайнято";
|
||||
$text['label-on-busy']['de-at'] = "Bei Besetzt";
|
||||
|
||||
$text['label-ignore-busy']['en-us'] = "Ignore Busy";
|
||||
$text['label-ignore-busy']['es-cl'] = "";
|
||||
$text['label-ignore-busy']['pt-pt'] = "";
|
||||
$text['label-ignore-busy']['fr-fr'] = "";
|
||||
$text['label-ignore-busy']['it-it'] = "";
|
||||
$text['label-ignore-busy']['pt-br'] = "";
|
||||
$text['label-ignore-busy']['pl'] = "";
|
||||
$text['label-ignore-busy']['sv-se'] = "";
|
||||
$text['label-ignore-busy']['uk'] = "";
|
||||
$text['label-ignore-busy']['de-at'] = "";
|
||||
|
||||
$text['label-number']['en-us'] = "Number";
|
||||
$text['label-number']['es-cl'] = "Número";
|
||||
$text['label-number']['pt-pt'] = "Número";
|
||||
@@ -133,6 +122,17 @@ $text['label-no_answer']['sv-se'] = "Inget Svar ";
|
||||
$text['label-no_answer']['uk'] = "Без відповіді";
|
||||
$text['label-no_answer']['de-at'] = "Keine Antwort";
|
||||
|
||||
$text['label-ignore-busy']['en-us'] = "Ignore Busy";
|
||||
$text['label-ignore-busy']['es-cl'] = "";
|
||||
$text['label-ignore-busy']['pt-pt'] = "";
|
||||
$text['label-ignore-busy']['fr-fr'] = "";
|
||||
$text['label-ignore-busy']['it-it'] = "";
|
||||
$text['label-ignore-busy']['pt-br'] = "";
|
||||
$text['label-ignore-busy']['pl'] = "";
|
||||
$text['label-ignore-busy']['sv-se'] = "";
|
||||
$text['label-ignore-busy']['uk'] = "";
|
||||
$text['label-ignore-busy']['de-at'] = "Ignorieren bei Besetzt";
|
||||
|
||||
$text['label-follow-me']['en-us'] = "Follow Me";
|
||||
$text['label-follow-me']['es-cl'] = "Sígueme";
|
||||
$text['label-follow-me']['pt-pt'] = "Segue-me";
|
||||
@@ -141,7 +141,7 @@ $text['label-follow-me']['pt-br'] = "Siga-me";
|
||||
$text['label-follow-me']['pl'] = "Podążaj za mną";
|
||||
$text['label-follow-me']['sv-se'] = "Följ Mig ";
|
||||
$text['label-follow-me']['uk'] = "";
|
||||
$text['label-follow-me']['de-at'] = "Follow Me";
|
||||
$text['label-follow-me']['de-at'] = "Anrufweiterschaltung";
|
||||
|
||||
$text['label-enabled']['en-us'] = "Enabled";
|
||||
$text['label-enabled']['es-cl'] = "Activo";
|
||||
@@ -311,7 +311,7 @@ $text['label-call-forward']['pt-br'] = "Encaminhamento de chamadas";
|
||||
$text['label-call-forward']['pl'] = "Przekierowanie";
|
||||
$text['label-call-forward']['sv-se'] = "Vidarekoppling ";
|
||||
$text['label-call-forward']['uk'] = "Переадресація";
|
||||
$text['label-call-forward']['de-at'] = "Ruf Weiterleitung";
|
||||
$text['label-call-forward']['de-at'] = "Rufumleitung";
|
||||
|
||||
$text['description-on-busy']['en-us'] = "If enabled, it overrides the value of voicemail enabling in extension.";
|
||||
$text['description-on-busy']['es-cl'] = "Si está habilitada, anula el valor del correo de voz que permite en la extensión.";
|
||||
@@ -383,7 +383,7 @@ $text['description-2']['pt-br'] = "A informação contem a origem, destino, dura
|
||||
$text['description-2']['pl'] = "Za pomocą poniższych linków można skonfigurować przekierowania, usługę „Podążaj z mną” lub „Nie przeszkadzać” (DnD).";
|
||||
$text['description-2']['sv-se'] = "Använd länkarna för att konfigurera Vidarekoppling, Följ Mig och Stör Ej. ";
|
||||
$text['description-2']['uk'] = "";
|
||||
$text['description-2']['de-at'] = "Benutzen Sie die Funktionen um Weiterleitung, Follow Me oder Bitte nicht stören zu konfigurieren.";
|
||||
$text['description-2']['de-at'] = "Benutzen Sie die Funktionen um Rufumleitung, Anrufweiterschaltung oder Nicht stören zu konfigurieren.";
|
||||
|
||||
$text['description']['en-us'] = "Directs incoming calls for extension:";
|
||||
$text['description']['es-cl'] = "Dirige las llamadas entrantes hacia una extensión:";
|
||||
|
||||
@@ -536,7 +536,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
if (permission_exists('follow_me_cid_set')) {
|
||||
echo " ";
|
||||
$sql_forward = "select destination_uuid, destination_number, destination_description from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
|
||||
$sql_forward = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
|
||||
$prep_statement_forward = $db->prepare(check_sql($sql_forward));
|
||||
$prep_statement_forward->execute();
|
||||
$result_forward = $prep_statement_forward->fetchAll(PDO::FETCH_ASSOC);
|
||||
@@ -546,7 +546,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <option value='' disabled='disabled'></option>\n";
|
||||
foreach ($result_forward as &$row_forward) {
|
||||
$selected = $row_forward["destination_uuid"] == $forward_caller_id_uuid ? "selected='selected' " : '';
|
||||
echo "<option value='".$row_forward["destination_uuid"]."' ".$selected.">".format_phone($row_forward["destination_number"])." : ".$row_forward["destination_description"]."</option>\n";
|
||||
$caller_id_number = $row_forward['destination_caller_id_number'];
|
||||
if(strlen($caller_id_number) == 0){
|
||||
$caller_id_number = $row_forward['destination_number'];
|
||||
}
|
||||
$caller_id_name = $row_forward['destination_caller_id_name'];
|
||||
if(strlen($caller_id_name) == 0){
|
||||
$caller_id_name = $row_forward['destination_description'];
|
||||
}
|
||||
echo "<option value='".$row_forward["destination_uuid"]."' ".$selected.">".format_phone($caller_id_number)." : ".$caller_id_name."</option>\n";
|
||||
}
|
||||
echo "</select>\n";
|
||||
}
|
||||
@@ -603,7 +611,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
if (permission_exists('follow_me_cid_set')) {
|
||||
echo " ";
|
||||
$sql_follow_me = "select destination_uuid, destination_number, destination_description from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
|
||||
$sql_follow_me = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
|
||||
$prep_statement_follow_me = $db->prepare(check_sql($sql_follow_me));
|
||||
$prep_statement_follow_me->execute();
|
||||
$result_follow_me = $prep_statement_follow_me->fetchAll(PDO::FETCH_ASSOC);
|
||||
@@ -613,7 +621,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <option value='' disabled='disabled'></option>\n";
|
||||
foreach ($result_follow_me as &$row_follow_me) {
|
||||
$selected = $row_follow_me["destination_uuid"] == $follow_me_caller_id_uuid ? "selected='selected'" : '';
|
||||
echo "<option value='".$row_follow_me["destination_uuid"]."' ".$selected.">".format_phone($row_follow_me["destination_number"])." : ".$row_follow_me["destination_description"]."</option>\n";
|
||||
|
||||
$caller_id_number = $row_follow_me['destination_caller_id_number'];
|
||||
if(strlen($caller_id_number) == 0){
|
||||
$caller_id_number = $row_follow_me['destination_number'];
|
||||
}
|
||||
$caller_id_name = $row_follow_me['destination_caller_id_name'];
|
||||
if(strlen($caller_id_name) == 0){
|
||||
$caller_id_name = $row_follow_me['destination_description'];
|
||||
}
|
||||
|
||||
echo "<option value='".$row_follow_me["destination_uuid"]."' ".$selected.">".format_phone($caller_id_number)." : ".$caller_id_name."</option>\n";
|
||||
}
|
||||
echo "</select>\n";
|
||||
}
|
||||
@@ -749,11 +767,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo $text['label-ignore-busy'];
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='follow_me_ignore_busy'>\n";
|
||||
echo " <option value='true' " . ($follow_me_ignore_busy == 'true' ? "selected='selected'" : '') . ">True</option>\n";
|
||||
echo " <option value='false'" . ($follow_me_ignore_busy == 'true' ? '' : "selected='selected'") . ">False</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " <br> Interrupt call if one of destination are busy\n";
|
||||
echo " <label for='follow_me_ignore_busy'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy' value='false' onclick=\"\" ".(($follow_me_ignore_busy == "false" || $follow_me_ignore_busy == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
|
||||
echo " <label for='follow_me_ignore_busy'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy' value='true' onclick=\"$on_click\" ".(($follow_me_ignore_busy == "true") ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n";
|
||||
echo " <br />\n";
|
||||
echo $text['description-ignore-busy']." \n";
|
||||
//echo " <br> Interrupt call if one of destination are busy\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
|
||||
@@ -84,17 +84,27 @@ include "root.php";
|
||||
}
|
||||
|
||||
if (strlen($this->forward_caller_id_uuid) > 0){
|
||||
$sql_caller = "select destination_number, destination_description from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->forward_caller_id_uuid'";
|
||||
$sql_caller = "select destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->forward_caller_id_uuid'";
|
||||
$prep_statement_caller = $db->prepare($sql_caller);
|
||||
if ($prep_statement_caller) {
|
||||
$prep_statement_caller->execute();
|
||||
$row_caller = $prep_statement_caller->fetch(PDO::FETCH_ASSOC);
|
||||
if (strlen($row_caller['destination_description']) > 0) {
|
||||
$dial_string_caller_id_name = $row_caller['destination_description'];
|
||||
|
||||
$caller_id_number = $row_caller['destination_caller_id_number'];
|
||||
if(strlen($caller_id_number) == 0){
|
||||
$caller_id_number = $row_caller['destination_number'];
|
||||
}
|
||||
$caller_id_name = $row_caller['destination_caller_id_name'];
|
||||
if(strlen($caller_id_name) == 0){
|
||||
$caller_id_name = $row_caller['destination_description'];
|
||||
}
|
||||
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
$dial_string_caller_id_name = $caller_id_name;
|
||||
$dial_string .= ",origination_caller_id_name=$dial_string_caller_id_name";
|
||||
}
|
||||
if (strlen($row_caller['destination_number']) > 0) {
|
||||
$dial_string_caller_id_number = $row_caller['destination_number'];
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
$dial_string_caller_id_number = $caller_id_number;
|
||||
$dial_string .= ",origination_caller_id_number=$dial_string_caller_id_number";
|
||||
$dial_string .= ",outbound_caller_id_number=$dial_string_caller_id_number";
|
||||
}
|
||||
|
||||
@@ -299,16 +299,26 @@ include "root.php";
|
||||
$dial_string_caller_id_number = "\${caller_id_number}";
|
||||
|
||||
if (strlen($this->follow_me_caller_id_uuid) > 0){
|
||||
$sql_caller = "select destination_number, destination_description from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->follow_me_caller_id_uuid'";
|
||||
$sql_caller = "select destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->follow_me_caller_id_uuid'";
|
||||
$prep_statement_caller = $db->prepare($sql_caller);
|
||||
if ($prep_statement_caller) {
|
||||
$prep_statement_caller->execute();
|
||||
$row_caller = $prep_statement_caller->fetch(PDO::FETCH_ASSOC);
|
||||
if (strlen($row_caller['destination_description']) > 0) {
|
||||
$dial_string_caller_id_name = $row_caller['destination_description'];
|
||||
|
||||
$caller_id_number = $row_caller['destination_caller_id_number'];
|
||||
if(strlen($caller_id_number) == 0){
|
||||
$caller_id_number = $row_caller['destination_number'];
|
||||
}
|
||||
if (strlen($row_caller['destination_number']) > 0) {
|
||||
$dial_string_caller_id_number = $row_caller['destination_number'];
|
||||
$caller_id_name = $row_caller['destination_caller_id_name'];
|
||||
if(strlen($caller_id_name) == 0){
|
||||
$caller_id_name = $row_caller['destination_description'];
|
||||
}
|
||||
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
$dial_string_caller_id_name = $caller_id_name;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
$dial_string_caller_id_number = $caller_id_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,18 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_mac_address';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_label';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_template';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "device_extension_view";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
@@ -105,6 +117,15 @@
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_domain';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_username_password';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_alternate';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "device_profile_view";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
@@ -127,6 +148,25 @@
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_all';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_vendor';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_model';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_firmware';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_enable';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'device_description';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
|
||||
@@ -128,10 +128,25 @@ require_once "resources/require.php";
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST) > 0) {
|
||||
//device mac address
|
||||
if (permission_exists('device_mac_address')) {
|
||||
$device_mac_address = check_str($_POST["device_mac_address"]);
|
||||
$device_mac_address = strtolower(preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address));
|
||||
$_POST["device_mac_address"] = $device_mac_address;
|
||||
}
|
||||
else {
|
||||
$orm = new orm;
|
||||
$orm->name('devices');
|
||||
$orm->uuid($device_uuid);
|
||||
$result = $orm->find()->get();
|
||||
//$message = $orm->message;
|
||||
foreach ($result as &$row) {
|
||||
$device_mac_address = $row["device_mac_address"];
|
||||
$_POST["device_mac_address"] = $device_mac_address;
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
//devices
|
||||
$device_mac_address = check_str($_POST["device_mac_address"]);
|
||||
$device_mac_address = strtolower(preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address));
|
||||
$_POST["device_mac_address"] = $device_mac_address;
|
||||
$device_label = check_str($_POST["device_label"]);
|
||||
$device_vendor = check_str($_POST["device_vendor"]);
|
||||
$device_uuid_alternate = check_str($_POST["device_uuid_alternate"]);
|
||||
@@ -288,7 +303,7 @@ require_once "resources/require.php";
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
if (strlen($_SESSION['switch']['provision']['dir']) > 0) {
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
require_once "app/provision/provision_write.php";
|
||||
}
|
||||
|
||||
@@ -514,7 +529,7 @@ require_once "resources/require.php";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' align='right' valign='top'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='devices.php'\" value='".$text['button-back']."'>\n";
|
||||
if ($action != "add") {
|
||||
if (permission_exists('device_add') && $action != "add") {
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"var new_mac = prompt('".$text['message_device']."'); if (new_mac != null) { window.location='device_copy.php?id=".$device_uuid."&mac=' + new_mac; }\" value='".$text['button-copy']."'>\n";
|
||||
}
|
||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
@@ -526,195 +541,211 @@ require_once "resources/require.php";
|
||||
echo " ".$text['label-device_mac_address']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_mac_address' id='device_mac_address' maxlength='255' value=\"$device_mac_address\">\n";
|
||||
if (permission_exists('device_mac_address')) {
|
||||
echo " <input class='formfld' type='text' name='device_mac_address' id='device_mac_address' maxlength='255' value=\"$device_mac_address\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_mac_address']."\n";
|
||||
}
|
||||
else {
|
||||
echo $device_mac_address;
|
||||
}
|
||||
echo " <div style='display: none;' id='duplicate_mac_response'></div>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_mac_address']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_label']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_label' maxlength='255' value=\"$device_label\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_label']."\n";
|
||||
if (permission_exists('device_label')) {
|
||||
echo " <input class='formfld' type='text' name='device_label' maxlength='255' value=\"$device_label\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_label']."\n";
|
||||
}
|
||||
else {
|
||||
echo $device_label;
|
||||
}
|
||||
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_template']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
$device = new device;
|
||||
$template_dir = $device->get_template_dir();
|
||||
if (permission_exists('device_template')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_template']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
$device = new device;
|
||||
$template_dir = $device->get_template_dir();
|
||||
|
||||
echo "<select id='device_template' name='device_template' class='formfld'>\n";
|
||||
echo "<option value=''></option>\n";
|
||||
echo "<select id='device_template' name='device_template' class='formfld'>\n";
|
||||
echo "<option value=''></option>\n";
|
||||
|
||||
if (is_dir($template_dir)) {
|
||||
$templates = scandir($template_dir);
|
||||
foreach($templates as $dir) {
|
||||
if($file != "." && $dir != ".." && $dir[0] != '.') {
|
||||
if(is_dir($template_dir . "/" . $dir)) {
|
||||
echo "<optgroup label='$dir'>";
|
||||
$dh_sub=$template_dir . "/" . $dir;
|
||||
if(is_dir($dh_sub)) {
|
||||
$templates_sub = scandir($dh_sub);
|
||||
foreach($templates_sub as $dir_sub) {
|
||||
if($file_sub != '.' && $dir_sub != '..' && $dir_sub[0] != '.') {
|
||||
if(is_dir($template_dir . '/' . $dir .'/'. $dir_sub)) {
|
||||
if ($device_template == $dir."/".$dir_sub) {
|
||||
echo "<option value='".$dir."/".$dir_sub."' selected='selected'>".$dir."/".$dir_sub."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo "<option value='".$dir."/".$dir_sub."'>".$dir."/".$dir_sub."</option>\n";
|
||||
if (is_dir($template_dir)) {
|
||||
$templates = scandir($template_dir);
|
||||
foreach($templates as $dir) {
|
||||
if($file != "." && $dir != ".." && $dir[0] != '.') {
|
||||
if(is_dir($template_dir . "/" . $dir)) {
|
||||
echo "<optgroup label='$dir'>";
|
||||
$dh_sub=$template_dir . "/" . $dir;
|
||||
if(is_dir($dh_sub)) {
|
||||
$templates_sub = scandir($dh_sub);
|
||||
foreach($templates_sub as $dir_sub) {
|
||||
if($file_sub != '.' && $dir_sub != '..' && $dir_sub[0] != '.') {
|
||||
if(is_dir($template_dir . '/' . $dir .'/'. $dir_sub)) {
|
||||
if ($device_template == $dir."/".$dir_sub) {
|
||||
echo "<option value='".$dir."/".$dir_sub."' selected='selected'>".$dir."/".$dir_sub."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo "<option value='".$dir."/".$dir_sub."'>".$dir."/".$dir_sub."</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh_sub);
|
||||
}
|
||||
closedir($dh_sub);
|
||||
echo "</optgroup>";
|
||||
}
|
||||
echo "</optgroup>";
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
echo "</select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_template']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-lines']."</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
echo " <table width='100%' border='0' cellpadding='0' cellspacing='3'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-line']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-server_address']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-outbound_proxy']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-display_name']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-user_id']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-auth_id']."</td>\n";
|
||||
if (permission_exists('device_line_password')) {
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-password']."</td>\n";
|
||||
echo "</select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_template']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-sip_port']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-sip_transport']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-register_expires']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-enabled']."</td>\n";
|
||||
echo " <td> </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
$x = 0;
|
||||
foreach($device_lines as $row) {
|
||||
//determine whether to hide the element
|
||||
if (strlen($device_line_uuid) == 0) {
|
||||
$element['hidden'] = false;
|
||||
$element['visibility'] = "visibility:visible;";
|
||||
}
|
||||
else {
|
||||
$element['hidden'] = true;
|
||||
$element['visibility'] = "visibility:hidden;";
|
||||
}
|
||||
//add the primary key uuid
|
||||
if (strlen($row['device_line_uuid']) > 0) {
|
||||
echo " <input name='device_lines[".$x."][device_line_uuid]' type='hidden' value=\"".$row['device_line_uuid']."\">\n";
|
||||
}
|
||||
//show each row in the array
|
||||
echo " <tr>\n";
|
||||
echo " <td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
$selected = "selected=\"selected\" ";
|
||||
echo " <select class='formfld' style='width: 45px;' name='device_lines[".$x."][line_number]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
echo " <option value='1' ".($row['line_number'] == "1" ? $selected:"").">1</option>\n";
|
||||
echo " <option value='2' ".($row['line_number'] == "2" ? $selected:"").">2</option>\n";
|
||||
echo " <option value='3' ".($row['line_number'] == "3" ? $selected:"").">3</option>\n";
|
||||
echo " <option value='4' ".($row['line_number'] == "4" ? $selected:"").">4</option>\n";
|
||||
echo " <option value='5' ".($row['line_number'] == "5" ? $selected:"").">5</option>\n";
|
||||
echo " <option value='6' ".($row['line_number'] == "6" ? $selected:"").">6</option>\n";
|
||||
echo " <option value='7' ".($row['line_number'] == "7" ? $selected:"").">7</option>\n";
|
||||
echo " <option value='8' ".($row['line_number'] == "8" ? $selected:"").">8</option>\n";
|
||||
echo " <option value='9' ".($row['line_number'] == "9" ? $selected:"").">9</option>\n";
|
||||
echo " <option value='10' ".($row['line_number'] == "10" ? $selected:"").">10</option>\n";
|
||||
echo " <option value='11' ".($row['line_number'] == "11" ? $selected:"").">11</option>\n";
|
||||
echo " <option value='12' ".($row['line_number'] == "12" ? $selected:"").">12</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " <input class='formfld' style='width: 125px;' type='text' name='device_lines[".$x."][server_address]' maxlength='255' value=\"".$row['server_address']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 125px;' type='text' name='device_lines[".$x."][outbound_proxy]' maxlength='255' value=\"".$row['outbound_proxy']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 95px;' type='text' name='device_lines[".$x."][display_name]' maxlength='255' value=\"".$row['display_name']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][user_id]' maxlength='255' value=\"".$row['user_id']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][auth_id]' maxlength='255' value=\"".$row['auth_id']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
if (permission_exists('device_line_password')) {
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 90px;' type='password' name='device_lines[".$x."][password]' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" autocomplete=\"off\" maxlength='255' value=\"".$row['password']."\">\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][sip_port]' maxlength='255' value=\"".$row['sip_port']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <select class='formfld' style='width: 60px;' name='device_lines[".$x."][sip_transport]'>\n";
|
||||
echo " <option value='tcp' ".(($row['sip_transport'] == 'tcp') ? "selected" : null).">TCP</option>\n";
|
||||
echo " <option value='udp' ".(($row['sip_transport'] == 'udp') ? "selected" : null).">UDP</option>\n";
|
||||
echo " <option value='tls' ".(($row['sip_transport'] == 'tls') ? "selected" : null).">TLS</option>\n";
|
||||
echo " <option value='dns srv' ".(($row['sip_transport'] == 'dns srv') ? "selected" : null).">DNS SRV</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][register_expires]' maxlength='255' value=\"".$row['register_expires']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <select class='formfld' name='device_lines[".$x."][enabled]'>\n";
|
||||
echo " <option value='true' ".(($row['enabled'] == "true") ? "selected='selected'" : null).">".$text['label-true']."</option>\n";
|
||||
echo " <option value='false' ".(($row['enabled'] == "false") ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td>\n";
|
||||
if (strlen($row['device_line_uuid']) > 0) {
|
||||
if (permission_exists('device_delete')) {
|
||||
echo " <a href='device_line_delete.php?device_uuid=".$row['device_uuid']."&id=".$row['device_line_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
if (permission_exists('device_line_view')) {
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-lines']."</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
echo " <table width='100%' border='0' cellpadding='0' cellspacing='3'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-line']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-server_address']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-outbound_proxy']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-display_name']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-user_id']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-auth_id']."</td>\n";
|
||||
if (permission_exists('device_line_password')) {
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-password']."</td>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-sip_port']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-sip_transport']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-register_expires']."</td>\n";
|
||||
echo " <td class='vtable' nowrap='nowrap'>".$text['label-enabled']."</td>\n";
|
||||
echo " <td> </td>\n";
|
||||
echo " </tr>\n";
|
||||
$x++;
|
||||
}
|
||||
echo " </table>\n";
|
||||
if (strlen($text['description-lines']) > 0) {
|
||||
echo " <br>".$text['description-lines']."\n";
|
||||
}
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
|
||||
if (permission_exists('device_key_add') || permission_exists('device_key_edit')) {
|
||||
$x = 0;
|
||||
foreach($device_lines as $row) {
|
||||
//determine whether to hide the element
|
||||
if (strlen($device_line_uuid) == 0) {
|
||||
$element['hidden'] = false;
|
||||
$element['visibility'] = "visibility:visible;";
|
||||
}
|
||||
else {
|
||||
$element['hidden'] = true;
|
||||
$element['visibility'] = "visibility:hidden;";
|
||||
}
|
||||
//add the primary key uuid
|
||||
if (strlen($row['device_line_uuid']) > 0) {
|
||||
echo " <input name='device_lines[".$x."][device_line_uuid]' type='hidden' value=\"".$row['device_line_uuid']."\">\n";
|
||||
}
|
||||
//show each row in the array
|
||||
echo " <tr>\n";
|
||||
echo " <td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
$selected = "selected=\"selected\" ";
|
||||
echo " <select class='formfld' style='width: 45px;' name='device_lines[".$x."][line_number]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
echo " <option value='1' ".($row['line_number'] == "1" ? $selected:"").">1</option>\n";
|
||||
echo " <option value='2' ".($row['line_number'] == "2" ? $selected:"").">2</option>\n";
|
||||
echo " <option value='3' ".($row['line_number'] == "3" ? $selected:"").">3</option>\n";
|
||||
echo " <option value='4' ".($row['line_number'] == "4" ? $selected:"").">4</option>\n";
|
||||
echo " <option value='5' ".($row['line_number'] == "5" ? $selected:"").">5</option>\n";
|
||||
echo " <option value='6' ".($row['line_number'] == "6" ? $selected:"").">6</option>\n";
|
||||
echo " <option value='7' ".($row['line_number'] == "7" ? $selected:"").">7</option>\n";
|
||||
echo " <option value='8' ".($row['line_number'] == "8" ? $selected:"").">8</option>\n";
|
||||
echo " <option value='9' ".($row['line_number'] == "9" ? $selected:"").">9</option>\n";
|
||||
echo " <option value='10' ".($row['line_number'] == "10" ? $selected:"").">10</option>\n";
|
||||
echo " <option value='11' ".($row['line_number'] == "11" ? $selected:"").">11</option>\n";
|
||||
echo " <option value='12' ".($row['line_number'] == "12" ? $selected:"").">12</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " <input class='formfld' style='width: 125px;' type='text' name='device_lines[".$x."][server_address]' maxlength='255' value=\"".$row['server_address']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 125px;' type='text' name='device_lines[".$x."][outbound_proxy]' maxlength='255' value=\"".$row['outbound_proxy']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 95px;' type='text' name='device_lines[".$x."][display_name]' maxlength='255' value=\"".$row['display_name']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][user_id]' maxlength='255' value=\"".$row['user_id']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][auth_id]' maxlength='255' value=\"".$row['auth_id']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
if (permission_exists('device_line_password')) {
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 90px;' type='password' name='device_lines[".$x."][password]' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" autocomplete=\"off\" maxlength='255' value=\"".$row['password']."\">\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][sip_port]' maxlength='255' value=\"".$row['sip_port']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <select class='formfld' style='width: 60px;' name='device_lines[".$x."][sip_transport]'>\n";
|
||||
echo " <option value='tcp' ".(($row['sip_transport'] == 'tcp') ? "selected" : null).">TCP</option>\n";
|
||||
echo " <option value='udp' ".(($row['sip_transport'] == 'udp') ? "selected" : null).">UDP</option>\n";
|
||||
echo " <option value='tls' ".(($row['sip_transport'] == 'tls') ? "selected" : null).">TLS</option>\n";
|
||||
echo " <option value='dns srv' ".(($row['sip_transport'] == 'dns srv') ? "selected" : null).">DNS SRV</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' style='width: 75px;' type='text' name='device_lines[".$x."][register_expires]' maxlength='255' value=\"".$row['register_expires']."\">\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td align='left'>\n";
|
||||
echo " <select class='formfld' name='device_lines[".$x."][enabled]'>\n";
|
||||
echo " <option value='true' ".(($row['enabled'] == "true") ? "selected='selected'" : null).">".$text['label-true']."</option>\n";
|
||||
echo " <option value='false' ".(($row['enabled'] == "false") ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td>\n";
|
||||
if (strlen($row['device_line_uuid']) > 0) {
|
||||
if (permission_exists('device_delete')) {
|
||||
echo " <a href='device_line_delete.php?device_uuid=".$row['device_uuid']."&id=".$row['device_line_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
$x++;
|
||||
}
|
||||
echo " </table>\n";
|
||||
if (strlen($text['description-lines']) > 0) {
|
||||
echo " <br>".$text['description-lines']."\n";
|
||||
}
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
|
||||
if (permission_exists('device_profile_edit')) {
|
||||
//device profile
|
||||
$sql = "select * from v_device_profiles ";
|
||||
$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
|
||||
@@ -738,7 +769,9 @@ require_once "resources/require.php";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
}
|
||||
|
||||
if (permission_exists('device_key_edit')) {
|
||||
$vendor_count = 0;
|
||||
foreach($device_keys as $row) {
|
||||
if ($previous_vendor != $row['device_key_vendor']) {
|
||||
@@ -1065,7 +1098,7 @@ require_once "resources/require.php";
|
||||
}
|
||||
|
||||
//device settings
|
||||
if (permission_exists('device_setting_add')) {
|
||||
if (permission_exists('device_setting_edit')) {
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-settings']."</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
@@ -1153,75 +1186,85 @@ require_once "resources/require.php";
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_username' id='device_username' autocomplete=\"off\" maxlength='255' placeholder=\"".$text['label-device_username']."\" value=\"$device_username\">\n";
|
||||
echo " <input class='formfld' type='text' name='device_password' id='device_password' autocomplete=\"off\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" maxlength='255' placeholder=\"".$text['label-device_password']."\" value=\"$device_password\">\n";
|
||||
echo " <div style='display: none;' id='duplicate_username_response'></div>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_uuid_alternate']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left' nowrap='nowrap'>\n";
|
||||
if (strlen($device_uuid_alternate) == 0) {
|
||||
echo " <input class='formfld' type='text' name='device_uuid_alternate' id='device_uuid_alternate' maxlength='255' value=\"$device_uuid_alternate\">";
|
||||
if (permission_exists('device_username_password')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_username' id='device_username' autocomplete=\"off\" maxlength='255' placeholder=\"".$text['label-device_username']."\" value=\"$device_username\">\n";
|
||||
echo " <input class='formfld' type='text' name='device_password' id='device_password' autocomplete=\"off\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" maxlength='255' placeholder=\"".$text['label-device_password']."\" value=\"$device_password\">\n";
|
||||
echo " <div style='display: none;' id='duplicate_username_response'></div>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
else {
|
||||
$label = $device_alternate[0]['device_label'];
|
||||
if (strlen($label) == 0) { $label = $device_alternate[0]['device_description']; }
|
||||
if (strlen($label) == 0) { $label = $device_alternate[0]['device_mac_address']; }
|
||||
echo " <table>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td><a href='?id=$device_uuid_alternate' id='device_uuid_alternate_link'>$label</a><input class='formfld' type='hidden' name='device_uuid_alternate' id='device_uuid_alternate' maxlength='255' value=\"$device_uuid_alternate\"> </td>";
|
||||
echo " <td><a href='#' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.getElementById('device_uuid_alternate').value = ''; document.getElementById('device_uuid_alternate_link').hidden = 'true'; document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>$v_link_label_delete</a></td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
unset($label);
|
||||
|
||||
if (permission_exists('device_alternate')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_uuid_alternate']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left' nowrap='nowrap'>\n";
|
||||
if (strlen($device_uuid_alternate) == 0) {
|
||||
echo " <input class='formfld' type='text' name='device_uuid_alternate' id='device_uuid_alternate' maxlength='255' value=\"$device_uuid_alternate\">";
|
||||
}
|
||||
else {
|
||||
$label = $device_alternate[0]['device_label'];
|
||||
if (strlen($label) == 0) { $label = $device_alternate[0]['device_description']; }
|
||||
if (strlen($label) == 0) { $label = $device_alternate[0]['device_mac_address']; }
|
||||
echo " <table>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td><a href='?id=$device_uuid_alternate' id='device_uuid_alternate_link'>$label</a><input class='formfld' type='hidden' name='device_uuid_alternate' id='device_uuid_alternate' maxlength='255' value=\"$device_uuid_alternate\"> </td>";
|
||||
echo " <td><a href='#' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.getElementById('device_uuid_alternate').value = ''; document.getElementById('device_uuid_alternate_link').hidden = 'true'; document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>$v_link_label_delete</a></td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
unset($label);
|
||||
}
|
||||
echo $text['description-device_uuid_alternate']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo $text['description-device_uuid_alternate']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_vendor']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_vendor' maxlength='255' value=\"$device_vendor\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_vendor']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
if (permission_exists('device_vendor')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_vendor']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_vendor' maxlength='255' value=\"$device_vendor\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_vendor']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_model']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_model' maxlength='255' value=\"$device_model\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_model']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
if (permission_exists('device_model')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_model']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_model' maxlength='255' value=\"$device_model\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_model']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_firmware_version']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_firmware_version' maxlength='255' value=\"$device_firmware_version\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_firmware_version']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
if (permission_exists('device_firmware')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_firmware_version']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_firmware_version' maxlength='255' value=\"$device_firmware_version\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_firmware_version']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('device_domain')) {
|
||||
echo "<tr>\n";
|
||||
@@ -1253,38 +1296,46 @@ require_once "resources/require.php";
|
||||
echo " <input type='hidden' name='domain_uuid' id='domain_uuid' value=\"".$_SESSION['domain_uuid']."\">\n";
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_provision_enable']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='device_provision_enable'>\n";
|
||||
if ($device_provision_enable == "true" || strlen($device_provision_enable) == 0) {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
if (permission_exists('device_enable')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_provision_enable']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='device_provision_enable'>\n";
|
||||
if ($device_provision_enable == "true" || strlen($device_provision_enable) == 0) {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($device_provision_enable == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_provision_enable']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($device_provision_enable == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_provision_enable']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-device_description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_description' maxlength='255' value=\"$device_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_description']."\n";
|
||||
if (permission_exists('device_description')) {
|
||||
echo " <input class='formfld' type='text' name='device_description' maxlength='255' value=\"$device_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-device_description']."\n";
|
||||
}
|
||||
else {
|
||||
echo $device_description."\n";
|
||||
}
|
||||
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
|
||||
@@ -138,7 +138,7 @@ require_once "resources/require.php";
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
if (strlen($_SESSION['switch']['provision']['dir']) > 0) {
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
require_once "app/provision/provision_write.php";
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,9 @@
|
||||
$apps[$x]['permissions'][$y]['name'] = "extension_user_context";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "extension_absolute_codec_string";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
@@ -384,6 +387,14 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "absolute_codec_string";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
|
||||
|
||||
|
||||
$y = 1; //table array index
|
||||
$z = 0; //field array index
|
||||
|
||||
@@ -468,6 +468,19 @@ $text['label-sip_bypass_media']['ro'] = "SIP Bypass Media";
|
||||
$text['label-sip_bypass_media']['ar-eg'] = "";
|
||||
$text['label-sip_bypass_media']['he'] = "";
|
||||
|
||||
$text['label-absolute_codec_string']['en-us'] = "Absolute Codec String";
|
||||
$text['label-absolute_codec_string']['es-cl'] = "";
|
||||
$text['label-absolute_codec_string']['pt-pt'] = "";
|
||||
$text['label-absolute_codec_string']['fr-fr'] = "";
|
||||
$text['label-absolute_codec_string']['pt-br'] = "";
|
||||
$text['label-absolute_codec_string']['pl'] = "";
|
||||
$text['label-absolute_codec_string']['uk'] = "";
|
||||
$text['label-absolute_codec_string']['sv-se'] = "";
|
||||
$text['label-absolute_codec_string']['de-at'] = "";
|
||||
$text['label-absolute_codec_string']['ro'] = "";
|
||||
$text['label-absolute_codec_string']['ar-eg'] = "";
|
||||
$text['label-absolute_codec_string']['he'] = "";
|
||||
|
||||
$text['label-rewrite_tls_contact_port']['en-us'] = "Rewrite TLS Contact Port";
|
||||
$text['label-rewrite_tls_contact_port']['es-cl'] = "Reescribir Contacto Puerto TLS";
|
||||
$text['label-rewrite_tls_contact_port']['pt-pt'] = "Reescreva Contacto Porto TLS";
|
||||
@@ -1339,6 +1352,19 @@ $text['description-mwi_account']['ro'] = "Contul MWI cu utilizator@domeniu al me
|
||||
$text['description-mwi_account']['ar-eg'] = "";
|
||||
$text['description-mwi_account']['he'] = "";
|
||||
|
||||
$text['description-absolute_codec_string']['en-us'] = "Absolute Codec String for the extension";
|
||||
$text['description-absolute_codec_string']['es-cl'] = "";
|
||||
$text['description-absolute_codec_string']['pt-pt'] = "";
|
||||
$text['description-absolute_codec_string']['fr-fr'] = "";
|
||||
$text['description-absolute_codec_string']['pt-br'] = "";
|
||||
$text['description-absolute_codec_string']['pl'] = "";
|
||||
$text['description-absolute_codec_string']['uk'] = "";
|
||||
$text['description-absolute_codec_string']['sv-se'] = "";
|
||||
$text['description-absolute_codec_string']['de-at'] = "";
|
||||
$text['description-absolute_codec_string']['ro'] = "";
|
||||
$text['description-absolute_codec_string']['ar-eg'] = "";
|
||||
$text['description-absolute_codec_string']['he'] = "";
|
||||
|
||||
$text['description-missed_call']['en-us'] = "Select the notification type, and enter the appropriate destination.";
|
||||
$text['description-missed_call']['es-cl'] = "Seleccione el tipo de notificación, y entrar en el destino apropiado.";
|
||||
$text['description-missed_call']['pt-pt'] = "Selecione o tipo de notificação e digite o destino apropriado.";
|
||||
@@ -1793,4 +1819,4 @@ $text['button-add']['ro'] = "Adaugă";
|
||||
$text['button-add']['ar-eg'] = "اضافة";
|
||||
$text['button-add']['he'] = "הוספה";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -135,6 +135,7 @@ else {
|
||||
$nibble_account = check_str($_POST["nibble_account"]);
|
||||
$mwi_account = check_str($_POST["mwi_account"]);
|
||||
$sip_bypass_media = check_str($_POST["sip_bypass_media"]);
|
||||
$absolute_codec_string = check_str($_POST["absolute_codec_string"]);
|
||||
$dial_string = check_str($_POST["dial_string"]);
|
||||
$enabled = check_str($_POST["enabled"]);
|
||||
$description = check_str($_POST["description"]);
|
||||
@@ -462,6 +463,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$sql .= "mwi_account, ";
|
||||
}
|
||||
$sql .= "sip_bypass_media, ";
|
||||
if (permission_exists('extension_absolute_codec_string')) {
|
||||
$sql .= "absolute_codec_string, ";
|
||||
}
|
||||
if (permission_exists('extension_dial_string')) {
|
||||
$sql .= "dial_string, ";
|
||||
}
|
||||
@@ -527,6 +531,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$sql .= "'$mwi_account', ";
|
||||
}
|
||||
$sql .= "'$sip_bypass_media', ";
|
||||
if (permission_exists('extension_absolute_codec_string')) {
|
||||
$sql .= "'$absolute_codec_string', ";
|
||||
}
|
||||
if (permission_exists('extension_dial_string')) {
|
||||
$sql .= "'$dial_string', ";
|
||||
}
|
||||
@@ -680,6 +687,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
$sql .= "mwi_account = '$mwi_account', ";
|
||||
$sql .= "sip_bypass_media = '$sip_bypass_media', ";
|
||||
if (permission_exists('extension_absolute_codec_string')) {
|
||||
$sql .= "absolute_codec_string = '$absolute_codec_string', ";
|
||||
}
|
||||
if (permission_exists('extension_dial_string')) {
|
||||
$sql .= "dial_string = '$dial_string', ";
|
||||
}
|
||||
@@ -841,6 +851,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$nibble_account = $row["nibble_account"];
|
||||
$mwi_account = $row["mwi_account"];
|
||||
$sip_bypass_media = $row["sip_bypass_media"];
|
||||
$absolute_codec_string = $row["absolute_codec_string"];
|
||||
$dial_string = $row["dial_string"];
|
||||
$enabled = $row["enabled"];
|
||||
$description = $row["description"];
|
||||
@@ -1368,11 +1379,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <select name='outbound_caller_id_name' id='outbound_caller_id_name' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach ($destinations as &$row) {
|
||||
if ($outbound_caller_id_name == $row["destination_caller_id_name"]) {
|
||||
echo " <option value='".$row["destination_caller_id_name"]."' selected='selected'>".$row["destination_caller_id_name"]."</option>\n";
|
||||
$tmp = $row["destination_caller_id_name"];
|
||||
if(strlen($tmp) == 0){
|
||||
$tmp = $row["destination_description"];
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$row["destination_caller_id_name"]."'>".$row["destination_caller_id_name"]."</option>\n";
|
||||
if(strlen($tmp) > 0){
|
||||
if ($outbound_caller_id_name == $tmp) {
|
||||
echo " <option value='".$tmp."' selected='selected'>".$tmp."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$tmp."'>".$tmp."</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo " </select>\n";
|
||||
@@ -1401,11 +1418,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <select name='outbound_caller_id_number' id='outbound_caller_id_number' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach ($destinations as &$row) {
|
||||
if ($outbound_caller_id_number == $row["destination_caller_id_number"]) {
|
||||
echo " <option value='".$row["destination_caller_id_number"]."' selected='selected'>".$row["destination_caller_id_number"]."</option>\n";
|
||||
$tmp = $row["destination_caller_id_number"];
|
||||
if(strlen($tmp) == 0){
|
||||
$tmp = $row["destination_number"];
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$row["destination_caller_id_number"]."'>".$row["destination_caller_id_number"]."</option>\n";
|
||||
if(strlen($tmp) > 0){
|
||||
if ($outbound_caller_id_number == $tmp) {
|
||||
echo " <option value='".$tmp."' selected='selected'>".$tmp."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$tmp."'>".$tmp."</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo " </select>\n";
|
||||
@@ -1867,6 +1890,19 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (permission_exists('extension_absolute_codec_string')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-absolute_codec_string']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='absolute_codec_string' maxlength='255' value=\"$absolute_codec_string\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-absolute_codec_string']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('extension_domain')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
@@ -1968,4 +2004,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
public $nibble_account;
|
||||
public $mwi_account;
|
||||
public $sip_bypass_media;
|
||||
public $absolute_codec_string;
|
||||
public $dial_string;
|
||||
public $enabled;
|
||||
public $description;
|
||||
@@ -360,6 +361,9 @@
|
||||
$xml .= " <variable name=\"proxy_media\" value=\"true\"/>\n";
|
||||
break;
|
||||
}
|
||||
if (strlen($row['absolute_codec_string']) > 0) {
|
||||
$xml .= " <variable name=\"absolute_codec_string\" value=\"" . $row['absolute_codec_string'] . "\"/>\n";
|
||||
}
|
||||
if (strlen($row['forward_all_enabled']) > 0) {
|
||||
$xml .= " <variable name=\"forward_all_enabled\" value=\"" . $row['forward_all_enabled'] . "\"/>\n";
|
||||
}
|
||||
@@ -494,4 +498,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -103,6 +103,13 @@
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'path';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'voicemail_number';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '*97';
|
||||
|
||||
@@ -822,8 +822,8 @@ include "root.php";
|
||||
//$file_size = round(filesize($new_path)/1024, 2);
|
||||
//echo $this->template_dir."/".$device_template."/".$file_name." $file_size\n";
|
||||
//write the configuration to the directory
|
||||
if (strlen($_SESSION['switch']['provision']['dir']) > 0) {
|
||||
$dir_array = explode(";", $_SESSION['switch']['provision']['dir']);
|
||||
if (strlen($provision["path"]) > 0) {
|
||||
$dir_array = explode(";", $provision["path"]);
|
||||
foreach($dir_array as $directory) {
|
||||
|
||||
if (file_exists($this->template_dir."/".$device_template."/".$file_name)) {
|
||||
|
||||
@@ -3,54 +3,68 @@
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define holiday presets
|
||||
$preset[] = json_encode(array("new_years_day" => array("mday" => "1", "mon" => "1")));
|
||||
$preset[] = json_encode(array("martin_luther_king_jr_day" => array("wday" => "2", "mon" => "1", "mweek" => "3")));
|
||||
$preset[] = json_encode(array("presidents_day" => array("wday" => "2", "mon" => "2", "mweek" => "3")));
|
||||
$preset[] = json_encode(array("memorial_day" => array("mday" => "25-31", "wday" => "2", "mon" => "5")));
|
||||
$preset[] = json_encode(array("independence_day" => array("mday" => "4", "mon" => "7")));
|
||||
$preset[] = json_encode(array("labor_day" => array("wday" => "2", "mon" => "9", "mweek" => "1")));
|
||||
$preset[] = json_encode(array("columbus_day" => array("wday" => "2", "mon" => "10", "mweek" => "2")));
|
||||
$preset[] = json_encode(array("veterans_day" => array("mday" => "11", "mon" => "11")));
|
||||
$preset[] = json_encode(array("thanksgiving_day" => array("wday" => "5-6", "mon" => "11", "mweek" => "4")));
|
||||
$preset[] = json_encode(array("christmas_day" => array("mday" => "25", "mon" => "12")));
|
||||
$preset['usa'][] = json_encode(array("new_years_day" => array("mday" => "1", "mon" => "1")));
|
||||
$preset['usa'][] = json_encode(array("martin_luther_king_jr_day" => array("wday" => "2", "mon" => "1", "mweek" => "3")));
|
||||
$preset['usa'][] = json_encode(array("presidents_day" => array("wday" => "2", "mon" => "2", "mweek" => "3")));
|
||||
$preset['usa'][] = json_encode(array("memorial_day" => array("mday" => "25-31", "wday" => "2", "mon" => "5")));
|
||||
$preset['usa'][] = json_encode(array("independence_day" => array("mday" => "4", "mon" => "7")));
|
||||
$preset['usa'][] = json_encode(array("labor_day" => array("wday" => "2", "mon" => "9", "mweek" => "1")));
|
||||
$preset['usa'][] = json_encode(array("columbus_day" => array("wday" => "2", "mon" => "10", "mweek" => "2")));
|
||||
$preset['usa'][] = json_encode(array("veterans_day" => array("mday" => "11", "mon" => "11")));
|
||||
$preset['usa'][] = json_encode(array("thanksgiving_day" => array("wday" => "5-6", "mon" => "11", "mweek" => "4")));
|
||||
$preset['usa'][] = json_encode(array("christmas_day" => array("mday" => "25", "mon" => "12")));
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
foreach ($preset as $json) {
|
||||
$array[$x]['default_setting_category'] = 'time_conditions';
|
||||
$array[$x]['default_setting_subcategory'] = 'preset';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = $json;
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Holiday';
|
||||
$x++;
|
||||
}
|
||||
$preset['england'][] = json_encode(array("new_years_day" => array("mday" => "1", "mon" => "1")));
|
||||
$preset['england'][] = json_encode(array("christmas_day" => array("mday" => "25", "mon" => "12")));
|
||||
$preset['england'][] = json_encode(array("boxing_day" => array("mday" => "26", "mon" => "12")));
|
||||
$preset['england'][] = json_encode(array("may_day" => array("mon" => "5", "mweek" => "1", "wday" => "2")));
|
||||
$preset['england'][] = json_encode(array("spring_bank_holiday" => array("mon" => "5", "mday" => "25-31", "wday" => "2")));
|
||||
$preset['england'][] = json_encode(array("august_bank_holiday" => array("mon" => "8", "mday" => "25-31", "wday" => "2")));
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
//iterate and migrate old presets first
|
||||
$sql = "update v_default_settings ";
|
||||
$sql .= "set default_setting_subcategory = 'preset_usa' ";
|
||||
$sql .= ", default_setting_description = 'usa Holiday' ";
|
||||
$sql .= "where default_setting_category = 'time_conditions' ";
|
||||
$sql .= "and default_setting_subcategory = 'preset' ";
|
||||
$sql .= "and default_setting_name = 'array' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$x = 0;
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
$missing[$x] = $setting;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_value']) == trim($setting['default_setting_value'])) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
unset ($prep_statement, $sql);
|
||||
}
|
||||
|
||||
//iterate and add each, if necessary
|
||||
$x = 0;
|
||||
foreach ($preset as $region => $data) {
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'time_conditions' ";
|
||||
$sql .= "and default_setting_subcategory = 'preset_$region' ";
|
||||
$sql .= "and default_setting_name = 'array' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
foreach ($data as $json) {
|
||||
$found = false;
|
||||
$missing[$x]['default_setting_category'] = 'time_conditions';
|
||||
$missing[$x]['default_setting_subcategory'] = "preset_$region";
|
||||
$missing[$x]['default_setting_name'] = 'array';
|
||||
$missing[$x]['default_setting_value'] = $json;
|
||||
$missing[$x]['default_setting_enabled'] = 'true';
|
||||
$missing[$x]['default_setting_description'] = "$region Holiday";
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_value']) == trim($json)) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
@@ -63,6 +77,39 @@ if ($domains_processed == 1) {
|
||||
}
|
||||
unset($missing);
|
||||
|
||||
$array[$x]['default_setting_category'] = 'time_conditions';
|
||||
$array[$x]['default_setting_subcategory'] = 'region';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'usa';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'What region to use by default when choosing Time Conditions';
|
||||
$x++;
|
||||
|
||||
//iterate and add each, if necessary
|
||||
foreach ($array as $index => $default_settings) {
|
||||
|
||||
//add the default setting
|
||||
$sql = "select count(*) as num_rows from v_default_settings ";
|
||||
$sql .= "where default_setting_category = '".$default_settings['default_setting_category']."' ";
|
||||
$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";
|
||||
$sql .= "and default_setting_name = '".$default_settings['default_setting_name']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($array[$index]);
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//unset the array variable
|
||||
unset($array);
|
||||
}
|
||||
|
||||
@@ -44,10 +44,12 @@ require_once "resources/header.php";
|
||||
$destination = new destinations;
|
||||
|
||||
//load available presets
|
||||
foreach ($_SESSION['time_conditions']['preset'] as $json) {
|
||||
$preset_region = "preset_".$_SESSION['time_conditions']['region']['text'];
|
||||
foreach ($_SESSION['time_conditions'][$preset_region] as $json) {
|
||||
$available_presets[] = json_decode($json, true);
|
||||
}
|
||||
|
||||
unset($preset_region);
|
||||
|
||||
//set the action as an add or an update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
|
||||
@@ -48,6 +48,13 @@ if ($domains_processed == 1) {
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Define whether to keep voicemail files on the local system after sending attached via email.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'storage_type';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'base64';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Define which storage type (base_64 stores in the database).';
|
||||
$x++;
|
||||
|
||||
//iterate and add each, if necessary
|
||||
foreach ($array as $index => $default_settings) {
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
if ($result_count > 0) {
|
||||
foreach($result as &$row) {
|
||||
//set the greeting directory
|
||||
$path = $_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
|
||||
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
|
||||
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.wav')) {
|
||||
$row['file_path'] = $path.'/msg_'.$row['voicemail_message_uuid'].'.wav';
|
||||
}
|
||||
@@ -239,7 +239,7 @@
|
||||
}
|
||||
|
||||
//delete the recording
|
||||
$file_path = $_SESSION['switch']['storage']['dir']."/voicemail/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
||||
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
||||
foreach (glob($file_path."/msg_".$this->voicemail_message_uuid.".*") as $file_name) {
|
||||
unlink($file_name);
|
||||
}
|
||||
@@ -278,7 +278,7 @@
|
||||
session_cache_limiter('public');
|
||||
|
||||
//set source folder path
|
||||
$path = $_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$this->voicemail_id;
|
||||
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$this->voicemail_id;
|
||||
|
||||
//prepare base64 content from db, if enabled
|
||||
if ($_SESSION['voicemail']['storage_type']['text'] == 'base64') {
|
||||
|
||||
@@ -131,6 +131,9 @@ if ($domains_processed == 1) {
|
||||
if (strlen($_SESSION['switch']['sounds']['dir']) > 0) {
|
||||
$tmp .= correct_path(" sounds_dir = [[".$_SESSION['switch']['sounds']['dir']."]];\n");
|
||||
}
|
||||
if (strlen($_SESSION['switch']['phrases']['dir']) > 0) {
|
||||
$tmp .= correct_path(" phrases_dir = [[".$_SESSION['switch']['phrases']['dir']."]];\n");
|
||||
}
|
||||
if (strlen($_SESSION['switch']['db']['dir']) > 0) {
|
||||
$tmp .= correct_path(" database_dir = [[".$_SESSION['switch']['db']['dir']."]];\n");
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ $text['title-user_dashboard']['pl'] = "Panel użytkowników";
|
||||
$text['title-user_dashboard']['he'] = "ממשק משתמש";
|
||||
$text['title-user_dashboard']['uk'] = "Панель користувача";
|
||||
$text['title-user_dashboard']['sv-se'] = "Användarpanel";
|
||||
$text['title-user_dashboard']['de-at'] = "Benutzer-Übersichtsseite";
|
||||
$text['title-user_dashboard']['de-at'] = "Benutzerübersicht";
|
||||
$text['title-user_dashboard']['ro'] = "Panou control utilizator";
|
||||
$text['title-user_dashboard']['fa'] = "";
|
||||
$text['title-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
|
||||
@@ -359,7 +359,7 @@ $text['label-followme']['pl'] = "Podążaj za mną";
|
||||
$text['label-followme']['he'] = "עקוב אחרי";
|
||||
$text['label-followme']['uk'] = "Follow Me";
|
||||
$text['label-followme']['sv-se'] = "Följ Mig";
|
||||
$text['label-followme']['de-at'] = "Follow Me";
|
||||
$text['label-followme']['de-at'] = "Anrufweiterschaltung";
|
||||
$text['label-followme']['ro'] = "Urmează-mă";
|
||||
$text['label-followme']['fa'] = "";
|
||||
$text['label-followme']['ar-eg'] = "خدمة اتبعني";
|
||||
@@ -457,7 +457,7 @@ $text['label-callforward']['pl'] = "Przekierowanie rozmowy";
|
||||
$text['label-callforward']['he'] = "עקוב אחרי";
|
||||
$text['label-callforward']['uk'] = "Переадресація дзвінків";
|
||||
$text['label-callforward']['sv-se'] = "Vidarekoppling";
|
||||
$text['label-callforward']['de-at'] = "Anrufweiterleitung";
|
||||
$text['label-callforward']['de-at'] = "Rufumleitung";
|
||||
$text['label-callforward']['ro'] = "Redirecționare apel";
|
||||
$text['label-callforward']['fa'] = "";
|
||||
$text['label-callforward']['ar-eg'] = "تحويل المكالمات";
|
||||
@@ -471,7 +471,7 @@ $text['header-user_dashboard']['pl'] = "Panel użytkowników";
|
||||
$text['header-user_dashboard']['he'] = "ממשק משתמש";
|
||||
$text['header-user_dashboard']['uk'] = "Панель користувача";
|
||||
$text['header-user_dashboard']['sv-se'] = "Användarpanel";
|
||||
$text['header-user_dashboard']['de-at'] = "Benutzer-Übersichtsseite";
|
||||
$text['header-user_dashboard']['de-at'] = "Benutzerübersicht";
|
||||
$text['header-user_dashboard']['ro'] = "Panou control utilizator";
|
||||
$text['header-user_dashboard']['fa'] = "";
|
||||
$text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
|
||||
|
||||
@@ -29,7 +29,7 @@ $apps[$x]['menu'][1]['title']['pl'] = "Panel użytkowników";
|
||||
$apps[$x]['menu'][1]['title']['he'] = "ממשק משתמש";
|
||||
$apps[$x]['menu'][1]['title']['uk'] = "Панель користувача";
|
||||
$apps[$x]['menu'][1]['title']['sv-se'] = "Användarpanel";
|
||||
$apps[$x]['menu'][1]['title']['de-at'] = "Benutzer-Übersichtsseite";
|
||||
$apps[$x]['menu'][1]['title']['de-at'] = "Benutzerübersicht";
|
||||
$apps[$x]['menu'][1]['title']['ro'] = "Panou control utilizator";
|
||||
$apps[$x]['menu'][1]['title']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
|
||||
$apps[$x]['menu'][1]['uuid'] = "92c8ffdb-3c82-4f08-aec0-82421ec41bb5";
|
||||
|
||||
@@ -38,7 +38,7 @@ local log = require "resources.functions.log".ring_group
|
||||
require "resources.functions.explode";
|
||||
require "resources.functions.base64";
|
||||
require "resources.functions.file_exists";
|
||||
require "resources.functions.explode";
|
||||
require "resources.functions.channel_utils"
|
||||
|
||||
--get the variables
|
||||
domain_name = session:getVariable("domain_name");
|
||||
@@ -439,34 +439,10 @@ local log = require "resources.functions.log".ring_group
|
||||
extension_uuid = trim(api:executeString(cmd));
|
||||
--send to user
|
||||
local dial_string_to_user = "[sip_invite_domain="..domain_name..","..group_confirm.."leg_timeout="..destination_timeout..","..delay_name.."="..destination_delay..",dialed_extension=" .. row.destination_number .. ",extension_uuid="..extension_uuid .. row.record_session .. "]user/" .. row.destination_number .. "@" .. domain_name;
|
||||
if (ring_group_skip_active ~= nil) then
|
||||
if (ring_group_skip_active == "true") then
|
||||
cmd = "show channels like "..destination_number;
|
||||
reply = trim(api:executeString(cmd));
|
||||
--freeswitch.consoleLog("notice", "[ring group] reply "..cmd.." " .. reply .. "\n");
|
||||
exploded_reply = {};
|
||||
exploded_reply = explode(",",reply);
|
||||
|
||||
if (reply == "0 total.") then
|
||||
dial_string = dial_string_to_user
|
||||
else
|
||||
idle_extension=true;
|
||||
|
||||
if (exploded_reply ~= nil) then
|
||||
for i,v in ipairs(exploded_reply) do
|
||||
if(v==destination_number.."@"..domain_name) then
|
||||
idle_extension=false;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if(idle_extension) then
|
||||
dial_string = dial_string_to_user;
|
||||
end
|
||||
end
|
||||
else
|
||||
--look inside the reply to check for the correct domain_name
|
||||
dial_string = dial_string_to_user;
|
||||
if (ring_group_skip_active == "true") then
|
||||
local channels = channels_by_number(destination_number, domain_name)
|
||||
if (not channels) or #channels == 0 then
|
||||
dial_string = dial_string_to_user
|
||||
end
|
||||
else
|
||||
dial_string = dial_string_to_user;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
--send the message waiting event
|
||||
local event = freeswitch.Event("message_waiting");
|
||||
if (row["message_count"] == "0") then
|
||||
if (new_messages == "0") then
|
||||
event:addHeader("MWI-Messages-Waiting", "no");
|
||||
else
|
||||
event:addHeader("MWI-Messages-Waiting", "yes");
|
||||
|
||||
@@ -244,6 +244,7 @@
|
||||
sip_force_expires = row.sip_force_expires;
|
||||
nibble_account = row.nibble_account;
|
||||
sip_bypass_media = row.sip_bypass_media;
|
||||
absolute_codec_string = row.absolute_codec_string;
|
||||
forward_all_enabled = row.forward_all_enabled;
|
||||
forward_all_destination = row.forward_all_destination;
|
||||
forward_busy_enabled = row.forward_busy_enabled;
|
||||
@@ -445,9 +446,13 @@
|
||||
if (string.len(nibble_account) > 0) then
|
||||
table.insert(xml, [[ <variable name="nibble_account" value="]] .. nibble_account .. [["/>]]);
|
||||
end
|
||||
if (string.len(absolute_codec_string) > 0) then
|
||||
table.insert(xml, [[ <variable name="absolute_codec_string" value="]] .. absolute_codec_string .. [["/>]]);
|
||||
end
|
||||
if (sip_bypass_media == "bypass-media") then
|
||||
table.insert(xml, [[ <variable name="bypass_media" value="true"/>]]);
|
||||
end
|
||||
|
||||
if (sip_bypass_media == "bypass-media-after-bridge") then
|
||||
table.insert(xml, [[ <variable name="bypass_media_after_bridge" value="true"/>]]);
|
||||
end
|
||||
|
||||
@@ -144,14 +144,14 @@
|
||||
|
||||
--read root xml language file, parse included xml files
|
||||
local xml_file_paths = {}
|
||||
local file_handle = io.open("/usr/local/freeswitch/conf/lang/"..language.."/"..language..".xml", "r");
|
||||
local file_handle = io.open(phrases_dir.."/"..language.."/"..language..".xml", "r");
|
||||
if (file_handle ~= nil) then
|
||||
for file_line in file_handle:lines() do
|
||||
if (string.find(file_line, 'cmd="include" data="', 0, true) ~= nil) then
|
||||
pos_beg = string.find(file_line, 'cmd="include" data="', 0, true) + 20;
|
||||
pos_end = string.find(file_line, '"/>', 0, true) - 1;
|
||||
xml_file_path = string.sub(file_line, pos_beg, pos_end);
|
||||
table.insert(xml_file_paths, "/usr/local/freeswitch/conf/lang/"..language.."/"..xml_file_path);
|
||||
table.insert(xml_file_paths, lang_path.."/"..language.."/"..xml_file_path);
|
||||
--freeswitch.consoleLog("notice", "file path = "..xml_file_path.."\n");
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
|
||||
local log = require "resources.functions.log".call_flow
|
||||
|
||||
local presence_in = require "resources.functions.presence_in"
|
||||
|
||||
if (session:ready()) then
|
||||
--get the variables
|
||||
domain_name = session:getVariable("domain_name");
|
||||
@@ -51,11 +55,9 @@ if (session:ready()) then
|
||||
if (not default_voice) then default_voice = 'callie'; end
|
||||
|
||||
--get the extension list
|
||||
sql = [[SELECT * FROM v_call_flows
|
||||
where call_flow_uuid = ']]..call_flow_uuid..[[']]
|
||||
--and call_flow_enabled = 'true'
|
||||
--freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n");
|
||||
app_data = "";
|
||||
sql = "SELECT * FROM v_call_flows where call_flow_uuid = '"..call_flow_uuid.."'"
|
||||
-- .. "and call_flow_enabled = 'true'"
|
||||
--log.notice("SQL: %s", sql);
|
||||
|
||||
x = 0;
|
||||
dbh:query(sql, function(row)
|
||||
@@ -68,17 +70,15 @@ if (session:ready()) then
|
||||
call_flow_label = row.call_flow_label;
|
||||
call_flow_anti_label = row.call_flow_anti_label;
|
||||
|
||||
if (string.len(call_flow_status) == 0) then
|
||||
if #call_flow_status == 0 then
|
||||
call_flow_status = "true";
|
||||
end
|
||||
if (call_flow_status == "true") then
|
||||
app = row.call_flow_app;
|
||||
data = row.call_flow_data
|
||||
else
|
||||
if (call_flow_status == "true") then
|
||||
app = row.call_flow_app;
|
||||
data = row.call_flow_data
|
||||
else
|
||||
app = row.call_flow_anti_app;
|
||||
data = row.call_flow_anti_data
|
||||
end
|
||||
app = row.call_flow_anti_app;
|
||||
data = row.call_flow_anti_data
|
||||
end
|
||||
end);
|
||||
|
||||
@@ -99,70 +99,34 @@ if (session:ready()) then
|
||||
end
|
||||
|
||||
--feature code - toggle the status
|
||||
if (string.len(call_flow_status) == 0) then
|
||||
toggle = "false";
|
||||
else
|
||||
if (call_flow_status == "true") then
|
||||
toggle = "false";
|
||||
else
|
||||
toggle = "true";
|
||||
end
|
||||
end
|
||||
if (toggle == "true") then
|
||||
--set the presence to terminated - turn the lamp off:
|
||||
event = freeswitch.Event("PRESENCE_IN");
|
||||
event:addHeader("proto", "sip");
|
||||
event:addHeader("event_type", "presence");
|
||||
event:addHeader("alt_event_type", "dialog");
|
||||
event:addHeader("Presence-Call-Direction", "outbound");
|
||||
event:addHeader("state", "Active (1 waiting)");
|
||||
event:addHeader("from", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("login", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("unique-id", call_flow_uuid);
|
||||
event:addHeader("answer-state", "terminated");
|
||||
event:fire();
|
||||
--answer and play a tone
|
||||
session:answer();
|
||||
if (string.len(call_flow_label) > 0) then
|
||||
api = freeswitch.API();
|
||||
reply = api:executeString("uuid_display "..session:get_uuid().." "..call_flow_label);
|
||||
end
|
||||
session:execute("sleep", "2000");
|
||||
session:execute("playback", "tone_stream://%(200,0,500,600,700)");
|
||||
--show in the console
|
||||
freeswitch.consoleLog("notice", "Call Flow: label="..call_flow_label..",status=true,uuid="..call_flow_uuid.."\n");
|
||||
else
|
||||
--set presence in - turn lamp on
|
||||
event = freeswitch.Event("PRESENCE_IN");
|
||||
event:addHeader("proto", "sip");
|
||||
event:addHeader("login", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("from", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("status", "Active (1 waiting)");
|
||||
event:addHeader("rpid", "unknown");
|
||||
event:addHeader("event_type", "presence");
|
||||
event:addHeader("alt_event_type", "dialog");
|
||||
event:addHeader("event_count", "1");
|
||||
event:addHeader("unique-id", call_flow_uuid);
|
||||
event:addHeader("Presence-Call-Direction", "outbound")
|
||||
event:addHeader("answer-state", "confirmed");
|
||||
event:fire();
|
||||
--answer and play a tone
|
||||
session:answer();
|
||||
if (string.len(call_flow_anti_label) > 0) then
|
||||
api = freeswitch.API();
|
||||
reply = api:executeString("uuid_display "..session:get_uuid().." "..call_flow_anti_label);
|
||||
end
|
||||
session:execute("sleep", "2000");
|
||||
session:execute("playback", "tone_stream://%(500,0,300,200,100,50,25)");
|
||||
--show in the console
|
||||
freeswitch.consoleLog("notice", "Call Flow: label="..call_flow_anti_label..",status=false,uuid="..call_flow_uuid.."\n");
|
||||
toggle = (call_flow_status == "true") and "false" or "true"
|
||||
|
||||
-- turn the lamp
|
||||
presence_in.turn_lamp( toggle == "false",
|
||||
call_flow_feature_code.."@"..domain_name,
|
||||
call_flow_uuid
|
||||
);
|
||||
|
||||
local active_flow_label = (toggle == "true") and call_flow_label or call_flow_anti_label
|
||||
--answer and play a tone
|
||||
session:answer();
|
||||
if #active_flow_label > 0 then
|
||||
api = freeswitch.API();
|
||||
reply = api:executeString("uuid_display "..session:get_uuid().." "..active_flow_label);
|
||||
end
|
||||
session:execute("sleep", "2000");
|
||||
session:execute("playback", "tone_stream://%(200,0,500,600,700)");
|
||||
|
||||
--show in the console
|
||||
log.noticef("label=%s,status=%s,uuid=%s", active_flow_label, toggle, call_flow_uuid);
|
||||
|
||||
--store in database
|
||||
dbh:query("UPDATE v_call_flows SET call_flow_status = '"..toggle.."' WHERE call_flow_uuid = '"..call_flow_uuid.."'");
|
||||
|
||||
--hangup the call
|
||||
session:hangup();
|
||||
else
|
||||
--app_data
|
||||
freeswitch.consoleLog("notice", "Call Flow: " .. app .. " " .. data .. "\n");
|
||||
log.notice("execute " .. app .. " " .. data);
|
||||
|
||||
--exucute the application
|
||||
session:execute(app, data);
|
||||
|
||||
@@ -38,9 +38,11 @@
|
||||
require "resources.functions.file_exists";
|
||||
require "resources.functions.mkdir";
|
||||
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
|
||||
local log = require "resources.functions.log".call_flow_monitor
|
||||
|
||||
local presence_in = require "resources.functions.presence_in"
|
||||
|
||||
--make sure the scripts/run dir exists
|
||||
mkdir(scripts_dir .. "/run");
|
||||
@@ -61,69 +63,52 @@
|
||||
--used to stop the lua service
|
||||
local file = assert(io.open(run_file, "w"));
|
||||
file:write("remove this file to stop the script");
|
||||
file:close()
|
||||
|
||||
log.notice("Start")
|
||||
--monitor the call flows status
|
||||
x = 0
|
||||
local sql = "select d.domain_name, f.call_flow_uuid, f.call_flow_extension, f.call_flow_feature_code," ..
|
||||
"f.call_flow_status, f.call_flow_label, f.call_flow_anti_label "..
|
||||
"from v_call_flows as f, v_domains as d " ..
|
||||
"where f.domain_uuid = d.domain_uuid " -- and call_flow_enabled = 'true'
|
||||
while true do
|
||||
--get the extension list
|
||||
sql = [[select d.domain_name, f.call_flow_uuid, f.call_flow_extension, f.call_flow_feature_code, f.call_flow_status, f.call_flow_label, f.call_flow_anti_label
|
||||
from v_call_flows as f, v_domains as d
|
||||
where f.domain_uuid = d.domain_uuid]]
|
||||
--and call_flow_enabled = 'true'
|
||||
-- debug print
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n");
|
||||
log.notice("SQL:" .. sql);
|
||||
end
|
||||
x = 0;
|
||||
dbh:query(sql, function(row)
|
||||
domain_name = row.domain_name;
|
||||
call_flow_uuid = row.call_flow_uuid;
|
||||
--call_flow_name = row.call_flow_name;
|
||||
call_flow_extension = row.call_flow_extension;
|
||||
call_flow_feature_code = row.call_flow_feature_code;
|
||||
--call_flow_context = row.call_flow_context;
|
||||
call_flow_status = row.call_flow_status;
|
||||
--pin_number = row.call_flow_pin_number;
|
||||
call_flow_label = row.call_flow_label;
|
||||
call_flow_anti_label = row.call_flow_anti_label;
|
||||
|
||||
if (call_flow_status == "true") then
|
||||
--set the presence to terminated - turn the lamp off:
|
||||
event = freeswitch.Event("PRESENCE_IN");
|
||||
event:addHeader("proto", "sip");
|
||||
event:addHeader("event_type", "presence");
|
||||
event:addHeader("alt_event_type", "dialog");
|
||||
event:addHeader("Presence-Call-Direction", "outbound");
|
||||
event:addHeader("state", "Active (1 waiting)");
|
||||
event:addHeader("from", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("login", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("unique-id", call_flow_uuid);
|
||||
event:addHeader("answer-state", "terminated");
|
||||
event:fire();
|
||||
--show in the console
|
||||
if (debug["log"]) then
|
||||
freeswitch.consoleLog("notice", "Call Flow: label="..call_flow_label..",status=true,uuid="..call_flow_uuid.."\n");
|
||||
end
|
||||
else
|
||||
--set presence in - turn lamp on
|
||||
event = freeswitch.Event("PRESENCE_IN");
|
||||
event:addHeader("proto", "sip");
|
||||
event:addHeader("login", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("from", call_flow_feature_code.."@"..domain_name);
|
||||
event:addHeader("status", "Active (1 waiting)");
|
||||
event:addHeader("rpid", "unknown");
|
||||
event:addHeader("event_type", "presence");
|
||||
event:addHeader("alt_event_type", "dialog");
|
||||
event:addHeader("event_count", "1");
|
||||
event:addHeader("unique-id", call_flow_uuid);
|
||||
event:addHeader("Presence-Call-Direction", "outbound");
|
||||
event:addHeader("answer-state", "confirmed");
|
||||
event:fire();
|
||||
--show in the console
|
||||
if (debug["log"]) then
|
||||
freeswitch.consoleLog("notice", "Call Flow: label="..call_flow_anti_label..",status=false,uuid="..call_flow_uuid.."\n");
|
||||
end
|
||||
end
|
||||
end);
|
||||
--connect to the database
|
||||
local dbh = database_handle('system');
|
||||
|
||||
--get the extension list
|
||||
if dbh:connected() then
|
||||
dbh:query(sql, function(row)
|
||||
local domain_name = row.domain_name;
|
||||
local call_flow_uuid = row.call_flow_uuid;
|
||||
--local call_flow_name = row.call_flow_name;
|
||||
--local call_flow_extension = row.call_flow_extension;
|
||||
local call_flow_feature_code = row.call_flow_feature_code;
|
||||
--local call_flow_context = row.call_flow_context;
|
||||
local call_flow_status = row.call_flow_status;
|
||||
--local pin_number = row.call_flow_pin_number;
|
||||
local call_flow_label = row.call_flow_label;
|
||||
local call_flow_anti_label = row.call_flow_anti_label;
|
||||
|
||||
-- turn the lamp
|
||||
presence_in.turn_lamp( call_flow_status == "false",
|
||||
call_flow_feature_code.."@"..domain_name,
|
||||
call_flow_uuid
|
||||
);
|
||||
|
||||
if (debug["log"]) then
|
||||
local label = (call_flow_status == "true") and call_flow_label or call_flow_anti_label
|
||||
log.noticef("label=%s,status=%s,uuid=%s", label, call_flow_status, call_flow_uuid);
|
||||
end
|
||||
end);
|
||||
end
|
||||
|
||||
-- release dbh
|
||||
dbh:release()
|
||||
|
||||
--exit the loop when the file does not exist
|
||||
if (not file_exists(run_file)) then
|
||||
@@ -132,4 +117,6 @@
|
||||
|
||||
--sleep a moment to prevent using unecessary resources
|
||||
freeswitch.msleep(sleep*1000);
|
||||
end
|
||||
end
|
||||
|
||||
log.notice("Stop")
|
||||
|
||||
@@ -358,8 +358,7 @@
|
||||
pos = string.find(ivr_menu_greet_long, ":", 0, true);
|
||||
if (pos ~= nil and string.sub(ivr_menu_greet_long, 0, pos-1) == 'phrase') then
|
||||
freeswitch.consoleLog("notice", "[ivr_menu] phrase detected\n");
|
||||
session:playAndGetDigits(min_digits, ivr_menu_digit_len, 1, ivr_menu_timeout, ivr_menu_confirm_key, ivr_menu_greet_long, "", ".*");
|
||||
dtmf_digits = session:getVariable("dtmf_digits");
|
||||
dtmf_digits = session:playAndGetDigits(min_digits, ivr_menu_digit_len, 1, ivr_menu_timeout, ivr_menu_confirm_key, ivr_menu_greet_long, "", ".*");
|
||||
session:setVariable("slept", "false");
|
||||
else
|
||||
dtmf_digits = session:playAndGetDigits(min_digits, ivr_menu_digit_len, 1, ivr_menu_timeout, ivr_menu_confirm_key, ivr_menu_greet_long, "", ".*");
|
||||
|
||||
@@ -10,6 +10,13 @@ require "resources.functions.trim";
|
||||
|
||||
local api = api or freeswitch.API();
|
||||
|
||||
local function send_event(action, key)
|
||||
local event = freeswitch.Event("MEMCACHE", action);
|
||||
event:addHeader("API-Command", "memcache");
|
||||
event:addHeader("API-Command-Argument", action .. " " .. key);
|
||||
event:fire()
|
||||
end
|
||||
|
||||
local Cache = {}
|
||||
|
||||
local function check_error(result)
|
||||
@@ -57,6 +64,7 @@ function Cache.set(key, value, expire)
|
||||
end
|
||||
|
||||
function Cache.del(key)
|
||||
send_event('delete', key)
|
||||
local result, err = check_error(api:execute("memcache", "delete " .. key))
|
||||
if not result then
|
||||
if err == 'NOT FOUND' then
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
require 'resources.functions.config'
|
||||
require 'resources.functions.trim'
|
||||
|
||||
local Database = require 'resources.functions.database'
|
||||
|
||||
local api = api or freeswitch.API()
|
||||
|
||||
@@ -18,3 +22,38 @@ function channel_evalute(uuid, cmd)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
local _switchname
|
||||
local function switchname()
|
||||
if _switchname then return _switchname end
|
||||
|
||||
local result = api:executeString("switchname")
|
||||
|
||||
if result:sub(1, 4) == '-ERR' then return nil, result end
|
||||
if result == '_undef_' then return false end
|
||||
|
||||
_switchname = result
|
||||
return result
|
||||
end
|
||||
|
||||
function channels_by_number(number, domain)
|
||||
local hostname = assert(switchname())
|
||||
local dbh = Database.new('switch')
|
||||
|
||||
local full_number = number .. '@' .. (domain or '%')
|
||||
|
||||
local sql = ([[select * from channels where hostname='%s' and (
|
||||
(context = '%s' and (cid_name = '%s' or cid_num = '%s'))
|
||||
or name like '%s' or presence_id like '%s' or presence_data like '%s'
|
||||
)
|
||||
order by created_epoch
|
||||
]]):format(hostname,
|
||||
domain, number, number,
|
||||
full_number, full_number, full_number
|
||||
)
|
||||
|
||||
local rows = assert(dbh:fetch_all(sql))
|
||||
|
||||
dbh:release()
|
||||
return rows
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require 'resources.config'
|
||||
require 'resources.functions.config'
|
||||
require 'resources.functions.file_exists'
|
||||
require 'resources.functions.database_handle'
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
local function turn_lamp(on, user, uuid)
|
||||
local event = freeswitch.Event("PRESENCE_IN");
|
||||
event:addHeader("proto", "sip");
|
||||
event:addHeader("event_type", "presence");
|
||||
event:addHeader("alt_event_type", "dialog");
|
||||
event:addHeader("Presence-Call-Direction", "outbound");
|
||||
event:addHeader("from", user);
|
||||
event:addHeader("login", user);
|
||||
event:addHeader("unique-id", uuid);
|
||||
event:addHeader("status", "Active (1 waiting)");
|
||||
if on then
|
||||
event:addHeader("answer-state", "confirmed");
|
||||
event:addHeader("rpid", "unknown");
|
||||
event:addHeader("event_count", "1");
|
||||
else
|
||||
event:addHeader("answer-state", "terminated");
|
||||
end
|
||||
event:fire();
|
||||
end
|
||||
|
||||
return {
|
||||
turn_lamp = turn_lamp;
|
||||
}
|
||||
@@ -158,6 +158,15 @@ function byte_convert($bytes, $decimals = 2) {
|
||||
return $formattedbytes;
|
||||
}
|
||||
|
||||
function remove_config_from_cache($name) {
|
||||
$cache = new cache;
|
||||
$cache->delete($name);
|
||||
$hostname = trim(event_socket_request_cmd('api switchname'));
|
||||
if($hostname){
|
||||
$cache->delete($name . ':' . $hostname);
|
||||
}
|
||||
}
|
||||
|
||||
function ListFiles($dir) {
|
||||
if($dh = opendir($dir)) {
|
||||
$files = Array();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
These entries will be pre-pended to the LUA_PATH environment variable
|
||||
-->
|
||||
<!-- <param name="script-directory" value="/usr/local/lua/?.lua"/> -->
|
||||
<param name="script-directory" value="$${base_dir}/scripts/?.lua"/>
|
||||
<param name="script-directory" value="$${script_dir}/?.lua"/>
|
||||
|
||||
<param name="xml-handler-script" value="app.lua xml_handler"/>
|
||||
<param name="xml-handler-bindings" value="configuration,dialplan,directory"/>
|
||||
|
||||
@@ -121,7 +121,7 @@ time_format_24hr: "0"
|
||||
#services_url: "http://{$domain_name}/app/provision/?file=services.php"
|
||||
|
||||
# URL for external Directory location
|
||||
#directory_url: "http://{$domain_name}/app/provision/?file=directory.php"
|
||||
directory_url: "http://{$domain_name}/app/provision/?file=directory.php"
|
||||
|
||||
# URL for branding logo
|
||||
#logo_url: "http://{$domain_name}/app/provision/logo.bmp"
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
<CiscoIPPhoneMenu>
|
||||
<Title>Speed Dials</Title>
|
||||
<Title>Enterprise</Title>
|
||||
<Prompt>Please choose...</Prompt>
|
||||
<SoftKeyItem>
|
||||
<Name>Dial</Name>
|
||||
<URL>SoftKey:Select</URL>
|
||||
<Position>1</Position>
|
||||
</SoftKeyItem>
|
||||
<MenuItem>
|
||||
<Name>First Last Name (Ext) Type</Name>
|
||||
<URL>Dial:5551231234#</URL>
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<Name>First Last Name (Ext) Type</Name>
|
||||
<URL>Dial:5551231234#</URL>
|
||||
</MenuItem>
|
||||
{assign var=x value=1}
|
||||
{foreach $contacts as $row}
|
||||
{if $row.contact_category == "enterprise"}
|
||||
<MenuItem>
|
||||
{if $row.contact_name_given != ""}
|
||||
<Name>{$row.contact_name_given} {$row.contact_name_family}</Name>
|
||||
{else}
|
||||
<Name>{$row.contact_organization}</Name>
|
||||
{/if}
|
||||
{if $row.phone_number != ""}
|
||||
<URL>Dial:{$row.phone_number}#</URL>
|
||||
{else}
|
||||
<URL>Dial:{$row.phone_extension}#</URL>
|
||||
{/if}
|
||||
</MenuItem>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<SoftKeyItem>
|
||||
<Name>Exit</Name>
|
||||
<URL>SoftKey:Exit</URL>
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
<CiscoIPPhoneMenu>
|
||||
<Title>Speed Dials</Title>
|
||||
<Title>Personal</Title>
|
||||
<Prompt>Please choose...</Prompt>
|
||||
<SoftKeyItem>
|
||||
<Name>Dial</Name>
|
||||
<URL>SoftKey:Select</URL>
|
||||
<Position>1</Position>
|
||||
</SoftKeyItem>
|
||||
<MenuItem>
|
||||
<Name>First Last Name (Ext) Type</Name>
|
||||
<URL>Dial:5551231234#</URL>
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<Name>First Last Name (Ext) Type</Name>
|
||||
<URL>Dial:5551231234#</URL>
|
||||
</MenuItem>
|
||||
{assign var=x value=1}
|
||||
{foreach $contacts as $row}
|
||||
{if $row.contact_category == "personal"}
|
||||
<MenuItem>
|
||||
{if $row.contact_name_given != ""}
|
||||
<Name>{$row.contact_name_given} {$row.contact_name_family}</Name>
|
||||
{else}
|
||||
<Name>{$row.contact_organization}</Name>
|
||||
{/if}
|
||||
{if $row.phone_number != ""}
|
||||
<URL>Dial:{$row.phone_number}#</URL>
|
||||
{else}
|
||||
<URL>Dial:{$row.phone_extension}#</URL>
|
||||
{/if}
|
||||
</MenuItem>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<SoftKeyItem>
|
||||
<Name>Exit</Name>
|
||||
<URL>SoftKey:Exit</URL>
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
<CiscoIPPhoneMenu>
|
||||
<Title>Speed Dials</Title>
|
||||
<Title>Speed Dial</Title>
|
||||
<Prompt>Please choose...</Prompt>
|
||||
<SoftKeyItem>
|
||||
<Name>Dial</Name>
|
||||
<URL>SoftKey:Select</URL>
|
||||
<Position>1</Position>
|
||||
</SoftKeyItem>
|
||||
<MenuItem>
|
||||
<Name>First Last Name (Ext) Type</Name>
|
||||
<URL>Dial:5551231234#</URL>
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<Name>First Last Name (Ext) Type</Name>
|
||||
<URL>Dial:5551231234#</URL>
|
||||
</MenuItem>
|
||||
{assign var=x value=1}
|
||||
{foreach $contacts as $row}
|
||||
{if $row.contact_category == "speed dial"}
|
||||
<MenuItem>
|
||||
{if $row.contact_name_given != ""}
|
||||
<Name>{$row.contact_name_given} {$row.contact_name_family}</Name>
|
||||
{else}
|
||||
<Name>{$row.contact_organization}</Name>
|
||||
{/if}
|
||||
{if $row.phone_number != ""}
|
||||
<URL>Dial:{$row.phone_number}#</URL>
|
||||
{else}
|
||||
<URL>Dial:{$row.phone_extension}#</URL>
|
||||
{/if}
|
||||
</MenuItem>
|
||||
{/if}
|
||||
{assign var=x value=$x+1}
|
||||
{/foreach}
|
||||
<SoftKeyItem>
|
||||
<Name>Exit</Name>
|
||||
<URL>SoftKey:Exit</URL>
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<CiscoIPPhoneMenu>
|
||||
<Title>Contacts</Title>
|
||||
<Prompt>Please choose...</Prompt>
|
||||
<!--
|
||||
<MenuItem>
|
||||
<Name>Personal</Name>
|
||||
<URL>http://{$domain_name}/app/provision?file=directory-personal.xml&mac={$mac}</URL>
|
||||
</MenuItem>
|
||||
-->
|
||||
<MenuItem>
|
||||
<Name>Enterprise</Name>
|
||||
<URL>http://{$domain_name}/app/provision?file=directory-enterprise&mac={$mac}</URL>
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<Name>Speed Dials</Name>
|
||||
<Name>Speed Dial</Name>
|
||||
<URL>http://{$domain_name}/app/provision/?file=directory-speed_dial&mac={$mac}</URL>
|
||||
</MenuItem>
|
||||
<SoftKeyItem>
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.user_id}"
|
||||
reg.{$row.line_number}.address="{$row.user_id}"
|
||||
reg.{$row.line_number}.label="{$row.user_id}"
|
||||
reg.{$row.line_number}.type="private"
|
||||
reg.{$row.line_number}.auth.userId="{$row.user_id}"
|
||||
reg.{$row.line_number}.auth.password="{$row.password}"
|
||||
reg.{$row.line_number}.lineKeys="{$line_key_value_{$row.line_number}}"
|
||||
{if isset($row.outbound_proxy)}reg.{$row.line_number}.outboundProxy.address = "{$row.outbound_proxy}"{/if}
|
||||
|
||||
{if isset($row.sip_port)}reg.{$row.line_number}.outboundProxy.port="{$row.sip_port}"{else}reg.{$row.line_number}.server.1.port="5060"{/if}
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.user_id}"
|
||||
reg.{$row.line_number}.address="{$row.user_id}"
|
||||
reg.{$row.line_number}.label="{$row.user_id}"
|
||||
reg.{$row.line_number}.type="private"
|
||||
reg.{$row.line_number}.auth.userId="{$row.user_id}"
|
||||
reg.{$row.line_number}.auth.password="{$row.password}"
|
||||
reg.{$row.line_number}.lineKeys="{$line_key_value_{$row.line_number}}"
|
||||
{if isset($row.outbound_proxy)}reg.{$row.line_number}.outboundProxy.address = "{$row.outbound_proxy}"{/if}
|
||||
|
||||
{if isset($row.sip_port)}reg.{$row.line_number}.outboundProxy.port="{$row.sip_port}"{else}reg.{$row.line_number}.server.1.port="5060"{/if}
|
||||
|
||||
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
|
||||
account.1.nat.stun_port = 3478
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 1
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time = 30
|
||||
|
||||
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
|
||||
account.1.nat.stun_port = 3478
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 1
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time = 30
|
||||
|
||||
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
|
||||
account.1.nat.stun_port = 3478
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 1
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time = 30
|
||||
|
||||
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
|
||||
account.1.nat.stun_port = 3478
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 1
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time = 30
|
||||
|
||||
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
|
||||
account.1.nat.stun_port = 3478
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 1
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time = 30
|
||||
|
||||
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
|
||||
account.1.nat.stun_port = 3478
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 1
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time = 30
|
||||
|
||||
@@ -253,8 +253,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
@@ -147,8 +147,8 @@ account.1.nat.stun_server =
|
||||
#Configure the STUN server port, the default value is 3478.
|
||||
account.1.nat.stun_port =
|
||||
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
|
||||
account.1.nat.udp_update_enable =
|
||||
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
|
||||
account.1.nat.udp_update_enable = 3
|
||||
|
||||
#Specify the keep-alive interval (in seconds), the default value is 30.
|
||||
account.1.nat.udp_update_time =
|
||||
|
||||
Reference in New Issue
Block a user