2012-06-04 16:58:40 +02:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2023-05-27 21:06:32 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2023
|
2012-06-04 16:58:40 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2017-12-14 07:25:22 +01:00
|
|
|
|
2022-10-11 00:35:14 +02:00
|
|
|
//includes files
|
2023-06-15 19:28:23 +02:00
|
|
|
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
2017-12-14 07:25:22 +01:00
|
|
|
require_once "resources/check_auth.php";
|
|
|
|
|
|
|
|
|
|
//check permissions
|
|
|
|
|
if (permission_exists('var_add') || permission_exists('var_edit')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2013-05-30 00:27:04 +02:00
|
|
|
//add multi-lingual support
|
2015-01-18 11:04:43 +01:00
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
2013-05-30 00:27:04 +02:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//set the action as an add or an update
|
2023-05-27 21:06:32 +02:00
|
|
|
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$action = "update";
|
2019-08-14 21:38:18 +02:00
|
|
|
$var_uuid = $_REQUEST["id"];
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$action = "add";
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-27 21:06:32 +02:00
|
|
|
//define the variables
|
|
|
|
|
$var_category = '';
|
|
|
|
|
$var_name = '';
|
|
|
|
|
$var_value = '';
|
|
|
|
|
$var_command = '';
|
|
|
|
|
$var_hostname = '';
|
|
|
|
|
$var_enabled = '';
|
|
|
|
|
$var_order = '';
|
|
|
|
|
$var_description = '';
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//set http values as php variables
|
2023-05-27 21:06:32 +02:00
|
|
|
if (!empty($_POST)) {
|
2019-08-14 21:38:18 +02:00
|
|
|
$var_category = trim($_POST["var_category"]);
|
|
|
|
|
$var_name = trim($_POST["var_name"]);
|
|
|
|
|
$var_value = trim($_POST["var_value"]);
|
|
|
|
|
$var_command = trim($_POST["var_command"]);
|
|
|
|
|
$var_hostname = trim($_POST["var_hostname"]);
|
2023-06-07 00:05:05 +02:00
|
|
|
$var_enabled = trim($_POST["var_enabled"] ?? 'false');
|
2019-08-14 21:38:18 +02:00
|
|
|
$var_order = trim($_POST["var_order"]);
|
|
|
|
|
$var_description = trim($_POST["var_description"]);
|
2018-03-25 19:03:24 +02:00
|
|
|
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($_POST["var_category_other"])) {
|
2019-08-14 21:38:18 +02:00
|
|
|
$var_category = trim($_POST["var_category_other"]);
|
2018-03-25 19:03:24 +02:00
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2017-12-14 07:25:22 +01:00
|
|
|
//process the post
|
2023-05-27 21:06:32 +02:00
|
|
|
if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
2017-12-14 07:25:22 +01:00
|
|
|
|
|
|
|
|
//get the uuid
|
|
|
|
|
if ($action == "update") {
|
2019-08-14 21:38:18 +02:00
|
|
|
$var_uuid = $_POST["var_uuid"];
|
2017-12-14 07:25:22 +01:00
|
|
|
}
|
|
|
|
|
|
2019-09-19 15:40:32 +02:00
|
|
|
//validate the token
|
|
|
|
|
$token = new token;
|
|
|
|
|
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
|
|
|
|
message::add($text['message-invalid_token'],'negative');
|
|
|
|
|
header('Location: vars.php');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-14 07:25:22 +01:00
|
|
|
//check for all required data
|
|
|
|
|
$msg = '';
|
2023-06-09 19:27:55 +02:00
|
|
|
if (empty($var_category)) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($var_name)) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
|
|
|
|
|
//if (empty($var_value)) { $msg .= $text['message-required'].$text['label-value']."<br>\n"; }
|
|
|
|
|
//if (empty($var_command)) { $msg .= $text['message-required'].$text['label-command']."<br>\n"; }
|
|
|
|
|
if (empty($var_enabled)) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
|
|
|
|
|
if (empty($var_order)) { $msg .= $text['message-required'].$text['label-order']."<br>\n"; }
|
|
|
|
|
if (!empty($msg) && empty($_POST["persistformvar"])) {
|
2017-12-14 07:25:22 +01:00
|
|
|
require_once "resources/header.php";
|
|
|
|
|
require_once "resources/persist_form_var.php";
|
|
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table><tr><td>\n";
|
|
|
|
|
echo $msg."<br />";
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
|
persistformvar($_POST);
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
require_once "resources/footer.php";
|
2014-02-21 06:06:46 +01:00
|
|
|
return;
|
2017-12-14 07:25:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add or update the database
|
2023-06-09 19:27:55 +02:00
|
|
|
if (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true") {
|
2017-12-14 07:25:22 +01:00
|
|
|
if ($action == "add" && permission_exists('var_add')) {
|
2019-08-14 21:38:18 +02:00
|
|
|
//begin insert array
|
2017-12-14 07:25:22 +01:00
|
|
|
$var_uuid = uuid();
|
2019-08-14 21:38:18 +02:00
|
|
|
$array['vars'][0]['var_uuid'] = $var_uuid;
|
|
|
|
|
//set message
|
2018-08-31 05:09:01 +02:00
|
|
|
message::add($text['message-add']);
|
2019-08-14 21:38:18 +02:00
|
|
|
}
|
2017-12-14 07:25:22 +01:00
|
|
|
|
|
|
|
|
if ($action == "update" && permission_exists('var_edit')) {
|
2019-08-14 21:38:18 +02:00
|
|
|
//begin update array
|
|
|
|
|
$array['vars'][0]['var_uuid'] = $var_uuid;
|
|
|
|
|
//set message
|
|
|
|
|
message::add($text['message-update']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_array($array) && @sizeof($array) != 0) {
|
|
|
|
|
//add common fields to array
|
|
|
|
|
$array['vars'][0]['var_category'] = $var_category;
|
|
|
|
|
$array['vars'][0]['var_name'] = $var_name;
|
|
|
|
|
$array['vars'][0]['var_value'] = $var_value;
|
|
|
|
|
$array['vars'][0]['var_command'] = $var_command;
|
2023-05-27 21:06:32 +02:00
|
|
|
$array['vars'][0]['var_hostname'] = !empty($var_hostname) ? $var_hostname : null;
|
2019-08-14 21:38:18 +02:00
|
|
|
$array['vars'][0]['var_enabled'] = $var_enabled;
|
|
|
|
|
$array['vars'][0]['var_order'] = $var_order;
|
2023-05-27 21:06:32 +02:00
|
|
|
$array['vars'][0]['var_description'] = $var_description;
|
2019-08-14 21:38:18 +02:00
|
|
|
|
|
|
|
|
//execute insert/update
|
|
|
|
|
$database = new database;
|
|
|
|
|
$database->app_name = 'vars';
|
|
|
|
|
$database->app_uuid = '54e08402-c1b8-0a9d-a30a-f569fc174dd8';
|
|
|
|
|
$database->save($array);
|
|
|
|
|
unset($array);
|
2017-12-14 07:25:22 +01:00
|
|
|
|
|
|
|
|
//unset the user defined variables
|
|
|
|
|
$_SESSION["user_defined_variables"] = "";
|
|
|
|
|
|
|
|
|
|
//synchronize the configuration
|
|
|
|
|
save_var_xml();
|
|
|
|
|
|
2019-08-14 21:38:18 +02:00
|
|
|
//redirect
|
2017-12-14 07:25:22 +01:00
|
|
|
header("Location: vars.php");
|
2019-08-14 21:38:18 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//pre-populate the form
|
2023-05-27 21:06:32 +02:00
|
|
|
if (!empty($_GET["id"]) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$var_uuid = $_GET["id"];
|
2012-11-24 02:24:13 +01:00
|
|
|
$sql = "select * from v_vars ";
|
2019-08-14 21:38:18 +02:00
|
|
|
$sql .= "where var_uuid = :var_uuid ";
|
2019-08-18 06:18:51 +02:00
|
|
|
$parameters['var_uuid'] = $var_uuid;
|
2019-08-14 21:38:18 +02:00
|
|
|
$database = new database;
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
|
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
2018-03-25 19:03:24 +02:00
|
|
|
$var_category = $row["var_category"];
|
2012-06-04 16:58:40 +02:00
|
|
|
$var_name = $row["var_name"];
|
|
|
|
|
$var_value = $row["var_value"];
|
2018-03-25 19:03:24 +02:00
|
|
|
$var_command = $row["var_command"];
|
2018-03-25 18:26:50 +02:00
|
|
|
$var_hostname = $row["var_hostname"];
|
2012-06-04 16:58:40 +02:00
|
|
|
$var_enabled = $row["var_enabled"];
|
|
|
|
|
$var_order = $row["var_order"];
|
2023-05-27 21:06:32 +02:00
|
|
|
$var_description = $row["var_description"];
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2019-08-14 21:38:18 +02:00
|
|
|
unset($sql, $parameters);
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-17 22:21:41 +01:00
|
|
|
//set the defaults
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($var_enabled)) { $var_enabled = 'true'; }
|
2023-02-17 22:21:41 +01:00
|
|
|
|
2019-09-19 15:40:32 +02:00
|
|
|
//create token
|
|
|
|
|
$object = new token;
|
|
|
|
|
$token = $object->create($_SERVER['PHP_SELF']);
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//include header
|
2020-01-06 20:37:01 +01:00
|
|
|
$document['title'] = $text['title-variable'];
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//show contents
|
2020-03-05 18:02:25 +01:00
|
|
|
echo "<form method='post' name='frm' id='frm'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2020-02-11 05:59:02 +01:00
|
|
|
echo "<div class='action_bar' id='action_bar'>\n";
|
|
|
|
|
echo " <div class='heading'><b>".$text['header-variable']."</b></div>\n";
|
|
|
|
|
echo " <div class='actions'>\n";
|
2020-03-05 08:05:45 +01:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'vars.php']);
|
|
|
|
|
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save']);
|
2020-02-11 05:59:02 +01:00
|
|
|
echo " </div>\n";
|
|
|
|
|
echo " <div style='clear: both;'></div>\n";
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
2024-09-05 01:51:23 +02:00
|
|
|
echo "<div class='card'>\n";
|
2020-02-11 05:59:02 +01:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2020-02-11 05:59:02 +01:00
|
|
|
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2018-03-25 19:03:24 +02:00
|
|
|
echo " ".$text['label-category']."\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo "</td>\n";
|
2020-02-11 05:59:02 +01:00
|
|
|
echo "<td width='70%' class='vtable' align='left'>\n";
|
2019-08-29 01:53:34 +02:00
|
|
|
$table_name = 'v_vars';
|
|
|
|
|
$field_name = 'var_category';
|
|
|
|
|
$sql_where_optional = "";
|
|
|
|
|
$field_current_value = $var_category;
|
2023-06-09 19:27:55 +02:00
|
|
|
echo html_select_other($table_name, $field_name, $sql_where_optional, $field_current_value, $field_name.' asc', $text['label-other']);
|
2018-03-25 19:03:24 +02:00
|
|
|
echo $text['description-category']."\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 07:50:00 +01:00
|
|
|
echo " ".$text['label-name']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2018-08-28 04:27:42 +02:00
|
|
|
echo " <input class='formfld' type='text' name='var_name' maxlength='255' value=\"".escape($var_name)."\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2013-05-30 00:27:04 +02:00
|
|
|
echo $text['description-name']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2015-03-25 19:30:18 +01:00
|
|
|
echo "<tr>\n";
|
2023-06-09 19:27:55 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-03-25 21:30:17 +01:00
|
|
|
echo " ".$text['label-value']."\n";
|
2015-03-25 19:30:18 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2023-08-23 00:58:47 +02:00
|
|
|
echo " <textarea class='formfld' name='var_value'>".escape($var_value)."</textarea>\n";
|
2015-03-25 19:30:18 +01:00
|
|
|
echo "<br />\n";
|
2015-03-25 21:30:17 +01:00
|
|
|
echo $text['description-value']."\n";
|
2015-03-25 19:30:18 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr>\n";
|
2018-03-25 19:03:24 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-command']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2018-03-25 19:03:24 +02:00
|
|
|
echo " <select class='formfld' name='var_command'>\n";
|
|
|
|
|
if ($var_command == "set") {
|
|
|
|
|
echo " <option value='set' selected='selected'>".$text['option-set']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='set'>".$text['option-set']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($var_command == "exec-set") {
|
|
|
|
|
echo " <option value='exec-set' selected='selected'>".$text['option-exec-set']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='exec-set'>".$text['option-exec-set']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2018-03-25 19:03:24 +02:00
|
|
|
echo $text['description-command']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2018-03-25 19:03:24 +02:00
|
|
|
echo " ".$text['label-hostname']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2018-08-28 04:27:42 +02:00
|
|
|
echo " <input class='formfld' type='text' name='var_hostname' maxlength='255' value=\"".escape($var_hostname)."\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2018-03-25 19:03:24 +02:00
|
|
|
echo $text['description-hostname']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 07:50:00 +01:00
|
|
|
echo " ".$text['label-enabled']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2023-02-14 02:02:01 +01:00
|
|
|
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
|
|
|
|
|
echo " <label class='switch'>\n";
|
|
|
|
|
echo " <input type='checkbox' id='var_enabled' name='var_enabled' value='true' ".($var_enabled == 'true' ? "checked='checked'" : null).">\n";
|
|
|
|
|
echo " <span class='slider'></span>\n";
|
|
|
|
|
echo " </label>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2023-02-14 02:02:01 +01:00
|
|
|
echo " <select class='formfld' id='var_enabled' name='var_enabled'>\n";
|
|
|
|
|
echo " <option value='true' ".($var_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
|
2023-02-14 19:19:02 +01:00
|
|
|
echo " <option value='false' ".($var_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
|
2023-02-14 02:02:01 +01:00
|
|
|
echo " </select>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo "<br />\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo $text['description-enabled']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 07:50:00 +01:00
|
|
|
echo " ".$text['label-order']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2014-04-27 10:55:39 +02:00
|
|
|
echo " <select name='var_order' class='formfld'>\n";
|
2019-08-14 21:38:18 +02:00
|
|
|
$i = 0;
|
|
|
|
|
while ($i <= 999) {
|
2018-03-25 18:26:50 +02:00
|
|
|
$selected = ($var_order == $i) ? "selected='selected'" : null;
|
2014-04-27 10:55:39 +02:00
|
|
|
if (strlen($i) == 1) {
|
|
|
|
|
echo " <option value='00$i' ".$selected.">00$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($i) == 2) {
|
|
|
|
|
echo " <option value='0$i' ".$selected.">0$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($i) == 3) {
|
|
|
|
|
echo " <option value='$i' ".$selected.">$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
$i++;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2014-04-27 10:55:39 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " <br />\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo $text['description-order']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 07:50:00 +01:00
|
|
|
echo " ".$text['label-description']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2019-08-28 07:46:51 +02:00
|
|
|
echo " <textarea class='formfld' name='var_description' rows='17'>".$var_description."</textarea>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2018-03-25 18:26:50 +02:00
|
|
|
echo $text['description-description']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2024-09-05 01:51:23 +02:00
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//if variable is a code then show the codec info
|
|
|
|
|
if ($var_name == "global_codec_prefs" || $var_name == "outbound_codec_prefs") {
|
2024-09-05 01:51:23 +02:00
|
|
|
echo "<div class='card'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2013-05-30 00:27:04 +02:00
|
|
|
echo "<b>".$text['label-codec_information']."</b><br><br>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "Module must be compiled and loaded. codecname[@8000h|16000h|32000h[@XXi]]<br />\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo "XX is the frame size must be multples allowed for the codec<br />\n";
|
|
|
|
|
echo "10-120ms is supported on some codecs.<br />\n";
|
|
|
|
|
echo "We do not support exceeding the MTU of the RTP packet.<br />\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
|
|
|
|
|
echo " <table>\n";
|
|
|
|
|
echo " <tr>\n";
|
2017-12-14 07:25:22 +01:00
|
|
|
echo " <tr><td width='200'>opus@48000h@10i</td><td>Opus 48khz using 10 ms ptime (mono and stereo)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@48000h@20i</td><td>Opus 48khz using 20 ms ptime (mono and stereo)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@48000h@40i</td><td>Opus 48khz using 40 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@16000h@10i</td><td>Opus 16khz using 10 ms ptime (mono and stereo)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@16000h@20i</td><td>Opus 16khz using 20 ms ptime (mono and stereo)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@16000h@40i</td><td>Opus 16khz using 40 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@10i</td><td>Opus 8khz using 10 ms ptime (mono and stereo)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@20i</td><td>Opus 8khz using 20 ms ptime (mono and stereo)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@40i</td><td>Opus 8khz using 40 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@60i</td><td>Opus 8khz using 60 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@80i</td><td>Opus 8khz using 80 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@100i</td><td>Opus 8khz using 100 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>opus@8000h@120i</td><td>Opus 8khz using 120 ms ptime</td></tr>\n";
|
|
|
|
|
echo " <tr><td>iLBC@30i</td><td>iLBC using mode=30 which will win in all cases.</td></tr>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr><td>DVI4@8000h@20i</td><td>IMA ADPCM 8kHz using 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>DVI4@16000h@40i</td><td>IMA ADPCM 16kHz using 40ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>speex@8000h@20i</td><td>Speex 8kHz using 20ms ptime.</td></tr>\n";
|
|
|
|
|
echo " <tr><td>speex@16000h@20i</td><td>Speex 16kHz using 20ms ptime.</td></tr>\n";
|
|
|
|
|
echo " <tr><td>speex@32000h@20i</td><td>Speex 32kHz using 20ms ptime.</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G7221@16000h</td><td>G722.1 16kHz (aka Siren 7)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G7221@32000h</td><td>G722.1C 32kHz (aka Siren 14)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>CELT@32000h</td><td>CELT 32kHz, only 10ms supported</td></tr>\n";
|
|
|
|
|
echo " <tr><td>CELT@48000h</td><td>CELT 48kHz, only 10ms supported</td></tr>\n";
|
|
|
|
|
echo " <tr><td>GSM@40i</td><td>GSM 8kHz using 40ms ptime. (GSM is done in multiples of 20, Default is 20ms)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G722</td><td>G722 16kHz using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>PCMU</td><td>G711 8kHz ulaw using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>PCMA</td><td>G711 8kHz alaw using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G726-16</td><td>G726 16kbit adpcm using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G726-24</td><td>G726 24kbit adpcm using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G726-32</td><td>G726 32kbit adpcm using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G726-40</td><td>G726 40kbit adpcm using default 20ms ptime. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>AAL2-G726-16</td><td>Same as G726-16 but using AAL2 packing. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>AAL2-G726-24</td><td>Same as G726-24 but using AAL2 packing. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>AAL2-G726-32</td><td>Same as G726-32 but using AAL2 packing. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>AAL2-G726-40</td><td>Same as G726-40 but using AAL2 packing. (multiples of 10)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>LPC</td><td>LPC10 using 90ms ptime (only supports 90ms at this time)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>L16</td><td>L16 isn't recommended for VoIP but you can do it. L16 can exceed the MTU rather quickly.</td></tr>\n";
|
|
|
|
|
echo " <tr><td colspan='2'><br /></td></tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " <tr><td colspan='2'>These are the passthru audio codecs:</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G729</td><td>G729 in passthru mode. (mod_g729)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>G723</td><td>G723.1 in passthru mode. (mod_g723_1)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>AMR</td><td>AMR in passthru mode. (mod_amr)</td></tr>\n";
|
|
|
|
|
echo " <tr><td colspan='2'><br /></td></tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " <tr><td colspan='2'>These are the passthru video codecs: (mod_h26x)</td></tr>\n";
|
|
|
|
|
echo " <tr><td>H261</td><td>H.261 Video</td></tr>\n";
|
|
|
|
|
echo " <tr><td>H263</td><td>H.263 Video</td></tr>\n";
|
|
|
|
|
echo " <tr><td>H263-1998</td><td>H.263-1998 Video</td></tr>\n";
|
|
|
|
|
echo " <tr><td>H263-2000</td><td>H.263-2000 Video</td></tr>\n";
|
|
|
|
|
echo " <tr><td>H264</td><td>H.264 Video</td></tr>";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo " </table>\n";
|
2024-09-05 01:51:23 +02:00
|
|
|
echo "</div>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2015-02-15 08:59:02 +01:00
|
|
|
echo "<br><br>";
|
2020-02-11 05:59:02 +01:00
|
|
|
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
echo "<input type='hidden' name='var_uuid' value='".escape($var_uuid)."'>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
//include header
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2017-12-14 07:25:22 +01:00
|
|
|
|
2023-02-14 02:02:01 +01:00
|
|
|
?>
|