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>
|
2013-09-22 00:10:39 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2013
|
2012-06-04 16:58:40 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2012-12-23 09:18:15 +01:00
|
|
|
require_once "root.php";
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 07:50:55 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2012-12-23 09:18:15 +01:00
|
|
|
if (permission_exists('gateway_add') || permission_exists('gateway_edit')) {
|
2012-06-04 16:58:40 +02:00
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
//add multi-lingual support
|
|
|
|
|
require_once "app_languages.php";
|
|
|
|
|
foreach($text as $key => $value) {
|
|
|
|
|
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//action add or update
|
2012-06-04 16:58:40 +02:00
|
|
|
if (isset($_REQUEST["id"])) {
|
|
|
|
|
$action = "update";
|
|
|
|
|
$gateway_uuid = check_str($_REQUEST["id"]);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$action = "add";
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
//get http post variables and set them to php variables
|
2013-09-22 00:10:39 +02:00
|
|
|
if (count($_POST) > 0) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$gateway = check_str($_POST["gateway"]);
|
|
|
|
|
$username = check_str($_POST["username"]);
|
|
|
|
|
$password = check_str($_POST["password"]);
|
|
|
|
|
$distinct_to = check_str($_POST["distinct_to"]);
|
|
|
|
|
$auth_username = check_str($_POST["auth_username"]);
|
|
|
|
|
$realm = check_str($_POST["realm"]);
|
|
|
|
|
$from_user = check_str($_POST["from_user"]);
|
|
|
|
|
$from_domain = check_str($_POST["from_domain"]);
|
|
|
|
|
$proxy = check_str($_POST["proxy"]);
|
|
|
|
|
$register_proxy = check_str($_POST["register_proxy"]);
|
|
|
|
|
$outbound_proxy = check_str($_POST["outbound_proxy"]);
|
|
|
|
|
$expire_seconds = check_str($_POST["expire_seconds"]);
|
|
|
|
|
$register = check_str($_POST["register"]);
|
|
|
|
|
$register_transport = check_str($_POST["register_transport"]);
|
|
|
|
|
$retry_seconds = check_str($_POST["retry_seconds"]);
|
|
|
|
|
$extension = check_str($_POST["extension"]);
|
|
|
|
|
$ping = check_str($_POST["ping"]);
|
2013-09-25 22:14:33 +02:00
|
|
|
$channels = check_str($_POST["channels"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
$caller_id_in_from = check_str($_POST["caller_id_in_from"]);
|
|
|
|
|
$supress_cng = check_str($_POST["supress_cng"]);
|
|
|
|
|
$sip_cid_type = check_str($_POST["sip_cid_type"]);
|
2013-09-24 19:26:48 +02:00
|
|
|
$codec_prefs = check_str($_POST["codec_prefs"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
$extension_in_contact = check_str($_POST["extension_in_contact"]);
|
|
|
|
|
$context = check_str($_POST["context"]);
|
|
|
|
|
$profile = check_str($_POST["profile"]);
|
|
|
|
|
$enabled = check_str($_POST["enabled"]);
|
|
|
|
|
$description = check_str($_POST["description"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
|
|
|
|
$msg = '';
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
$gateway_uuid = check_str($_POST["gateway_uuid"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//check for all required data
|
2012-12-23 09:18:15 +01:00
|
|
|
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
|
|
|
|
|
if (strlen($gateway) == 0) { $msg .= $text['message-required']." ".$text['label-gateway']."<br>\n"; }
|
2012-06-04 16:58:40 +02:00
|
|
|
if ($register == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
if (strlen($username) == 0) { $msg .= $text['message-required']." ".$text['label-username']."<br>\n"; }
|
|
|
|
|
if (strlen($password) == 0) { $msg .= $text['message-required']." ".$text['label-password']."<br>\n"; }
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2012-12-23 09:18:15 +01:00
|
|
|
//if (strlen($distinct_to) == 0) { $msg .= $text['message-required']." ".$text['label-distinct_to']."<br>\n"; }
|
|
|
|
|
//if (strlen($auth_username) == 0) { $msg .= $text['message-required']." ".$text['label-auth_username']."<br>\n"; }
|
|
|
|
|
//if (strlen($realm) == 0) { $msg .= $text['message-required']." ".$text['label-realm']."<br>\n"; }
|
|
|
|
|
//if (strlen($from_user) == 0) { $msg .= $text['message-required']." ".$text['label-from_user']."<br>\n"; }
|
|
|
|
|
//if (strlen($from_domain) == 0) { $msg .= $text['message-required']." ".$text['label-from_domain']."<br>\n"; }
|
|
|
|
|
//if (strlen($proxy) == 0) { $msg .= $text['message-required']." ".$text['label-proxy']."<br>\n"; }
|
|
|
|
|
//if (strlen($register_proxy) == 0) { $msg .= $text['message-required']." ".$text['label-register_proxy']."<br>\n"; }
|
|
|
|
|
//if (strlen($outbound_proxy) == 0) { $msg .= $text['message-required']." ".$text['label-outbound_proxy']."<br>\n"; }
|
|
|
|
|
if (strlen($expire_seconds) == 0) { $msg .= $text['message-required']." ".$text['label-expire_seconds']."<br>\n"; }
|
|
|
|
|
if (strlen($register) == 0) { $msg .= $text['message-required']." ".$text['label-register']."<br>\n"; }
|
|
|
|
|
//if (strlen($register_transport) == 0) { $msg .= $text['message-required']." ".$text['label-register_transport']."<br>\n"; }
|
|
|
|
|
if (strlen($retry_seconds) == 0) { $msg .= $text['message-required']." ".$text['label-retry_seconds']."<br>\n"; }
|
|
|
|
|
//if (strlen($extension) == 0) { $msg .= $text['message-required']." ".$text['label-extension']."<br>\n"; }
|
|
|
|
|
//if (strlen($ping) == 0) { $msg .= $text['message-required']." ".$text['label-ping']."<br>\n"; }
|
2013-09-25 22:14:33 +02:00
|
|
|
if (strlen($channels) == 0) {
|
|
|
|
|
//$msg .= $text['message-required']." ".$text['label-channels']."<br>\n";
|
|
|
|
|
$channels = 0;
|
2013-09-24 19:26:48 +02:00
|
|
|
}
|
2012-12-23 09:18:15 +01:00
|
|
|
//if (strlen($caller_id_in_from) == 0) { $msg .= $text['message-required']." ".$text['label-caller_id_in_from']."<br>\n"; }
|
|
|
|
|
//if (strlen($supress_cng) == 0) { $msg .= $text['message-required']." ".$text['label-supress_cng']."<br>\n"; }
|
|
|
|
|
//if (strlen($sip_cid_type) == 0) { $msg .= $text['message-required']." ".$text['label-sip_cid_type']."<br>\n"; }
|
2013-09-24 19:26:48 +02:00
|
|
|
//if (strlen($codec_prefs) == 0) { $msg .= $text['message-required']." ".$text['label-codec_prefs']."<br>\n"; }
|
2012-12-23 09:18:15 +01:00
|
|
|
//if (strlen($extension_in_contact) == 0) { $msg .= $text['message-required']." ".$text['label-extension_in_contact']."<br>\n"; }
|
|
|
|
|
if (strlen($context) == 0) { $msg .= $text['message-required']." ".$text['label-context']."<br>\n"; }
|
|
|
|
|
if (strlen($profile) == 0) { $msg .= $text['message-required']." ".$text['label-profile']."<br>\n"; }
|
|
|
|
|
if (strlen($enabled) == 0) { $msg .= $text['message-required']." ".$text['label-enabled']."<br>\n"; }
|
|
|
|
|
//if (strlen($description) == 0) { $msg .= $text['message-required']." ".$text['label-description']."<br>\n"; }
|
2012-06-04 16:58:40 +02:00
|
|
|
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2013-07-06 08:21:12 +02:00
|
|
|
require_once "resources/persist_form_var.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table><tr><td>\n";
|
|
|
|
|
echo $msg."<br />";
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
|
persistformvar($_POST);
|
|
|
|
|
echo "</div>\n";
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//remove the invalid characters from the gateway name
|
|
|
|
|
$gateway = str_replace(" ", "_", $gateway);
|
|
|
|
|
$gateway = str_replace("/", "", $gateway);
|
|
|
|
|
|
|
|
|
|
//add or update the database
|
|
|
|
|
if ($_POST["persistformvar"] != "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
if ($action == "add" && permission_exists('gateway_add')) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$gateway_uuid = uuid();
|
|
|
|
|
$sql = "insert into v_gateways ";
|
|
|
|
|
$sql .= "(";
|
|
|
|
|
$sql .= "domain_uuid, ";
|
|
|
|
|
$sql .= "gateway_uuid, ";
|
|
|
|
|
$sql .= "gateway, ";
|
|
|
|
|
$sql .= "username, ";
|
|
|
|
|
$sql .= "password, ";
|
|
|
|
|
$sql .= "distinct_to, ";
|
|
|
|
|
$sql .= "auth_username, ";
|
|
|
|
|
$sql .= "realm, ";
|
|
|
|
|
$sql .= "from_user, ";
|
|
|
|
|
$sql .= "from_domain, ";
|
|
|
|
|
$sql .= "proxy, ";
|
|
|
|
|
$sql .= "register_proxy, ";
|
|
|
|
|
$sql .= "outbound_proxy, ";
|
|
|
|
|
$sql .= "expire_seconds, ";
|
|
|
|
|
$sql .= "register, ";
|
|
|
|
|
$sql .= "register_transport, ";
|
|
|
|
|
$sql .= "retry_seconds, ";
|
|
|
|
|
$sql .= "extension, ";
|
|
|
|
|
$sql .= "ping, ";
|
2013-09-25 22:14:33 +02:00
|
|
|
$sql .= "channels, ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql .= "caller_id_in_from, ";
|
|
|
|
|
$sql .= "supress_cng, ";
|
|
|
|
|
$sql .= "sip_cid_type, ";
|
2013-09-24 19:26:48 +02:00
|
|
|
$sql .= "codec_prefs, ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql .= "extension_in_contact, ";
|
|
|
|
|
$sql .= "context, ";
|
|
|
|
|
$sql .= "profile, ";
|
|
|
|
|
$sql .= "enabled, ";
|
|
|
|
|
$sql .= "description ";
|
|
|
|
|
$sql .= ")";
|
|
|
|
|
$sql .= "values ";
|
|
|
|
|
$sql .= "(";
|
|
|
|
|
$sql .= "'$domain_uuid', ";
|
|
|
|
|
$sql .= "'$gateway_uuid', ";
|
|
|
|
|
$sql .= "'$gateway', ";
|
|
|
|
|
$sql .= "'$username', ";
|
|
|
|
|
$sql .= "'$password', ";
|
|
|
|
|
$sql .= "'$distinct_to', ";
|
|
|
|
|
$sql .= "'$auth_username', ";
|
|
|
|
|
$sql .= "'$realm', ";
|
|
|
|
|
$sql .= "'$from_user', ";
|
|
|
|
|
$sql .= "'$from_domain', ";
|
|
|
|
|
$sql .= "'$proxy', ";
|
|
|
|
|
$sql .= "'$register_proxy', ";
|
|
|
|
|
$sql .= "'$outbound_proxy', ";
|
|
|
|
|
$sql .= "'$expire_seconds', ";
|
|
|
|
|
$sql .= "'$register', ";
|
|
|
|
|
$sql .= "'$register_transport', ";
|
|
|
|
|
$sql .= "'$retry_seconds', ";
|
|
|
|
|
$sql .= "'$extension', ";
|
|
|
|
|
$sql .= "'$ping', ";
|
2013-09-25 22:14:33 +02:00
|
|
|
$sql .= "'$channels', ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql .= "'$caller_id_in_from', ";
|
|
|
|
|
$sql .= "'$supress_cng', ";
|
|
|
|
|
$sql .= "'$sip_cid_type', ";
|
2013-09-24 19:26:48 +02:00
|
|
|
$sql .= "'$codec_prefs', ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql .= "'$extension_in_contact', ";
|
|
|
|
|
$sql .= "'$context', ";
|
|
|
|
|
$sql .= "'$profile', ";
|
|
|
|
|
$sql .= "'$enabled', ";
|
|
|
|
|
$sql .= "'$description' ";
|
|
|
|
|
$sql .= ")";
|
|
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
|
|
|
|
|
} //if ($action == "add")
|
|
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
if ($action == "update" && permission_exists('gateway_edit')) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql = "update v_gateways set ";
|
|
|
|
|
$sql .= "gateway = '$gateway', ";
|
|
|
|
|
$sql .= "username = '$username', ";
|
|
|
|
|
$sql .= "password = '$password', ";
|
|
|
|
|
$sql .= "distinct_to = '$distinct_to', ";
|
|
|
|
|
$sql .= "auth_username = '$auth_username', ";
|
|
|
|
|
$sql .= "realm = '$realm', ";
|
|
|
|
|
$sql .= "from_user = '$from_user', ";
|
|
|
|
|
$sql .= "from_domain = '$from_domain', ";
|
|
|
|
|
$sql .= "proxy = '$proxy', ";
|
|
|
|
|
$sql .= "register_proxy = '$register_proxy', ";
|
|
|
|
|
$sql .= "outbound_proxy = '$outbound_proxy', ";
|
|
|
|
|
$sql .= "expire_seconds = '$expire_seconds', ";
|
|
|
|
|
$sql .= "register = '$register', ";
|
|
|
|
|
$sql .= "register_transport = '$register_transport', ";
|
|
|
|
|
$sql .= "retry_seconds = '$retry_seconds', ";
|
|
|
|
|
$sql .= "extension = '$extension', ";
|
|
|
|
|
$sql .= "ping = '$ping', ";
|
2013-09-25 22:14:33 +02:00
|
|
|
$sql .= "channels = '$channels', ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql .= "caller_id_in_from = '$caller_id_in_from', ";
|
|
|
|
|
$sql .= "supress_cng = '$supress_cng', ";
|
|
|
|
|
$sql .= "sip_cid_type = '$sip_cid_type', ";
|
2013-09-24 19:26:48 +02:00
|
|
|
$sql .= "codec_prefs = '$codec_prefs', ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql .= "extension_in_contact = '$extension_in_contact', ";
|
|
|
|
|
$sql .= "context = '$context', ";
|
|
|
|
|
$sql .= "profile = '$profile', ";
|
|
|
|
|
$sql .= "enabled = '$enabled', ";
|
|
|
|
|
$sql .= "description = '$description' ";
|
|
|
|
|
$sql .= "where domain_uuid = '$domain_uuid' ";
|
|
|
|
|
$sql .= "and gateway_uuid = '$gateway_uuid'";
|
|
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
} //if ($action == "update")
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
//syncrhonize configuration
|
|
|
|
|
save_gateway_xml();
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
//synchronize the xml config
|
|
|
|
|
save_dialplan_xml();
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2013-01-16 01:26:48 +01:00
|
|
|
//delete the sip profiles from memcache
|
|
|
|
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
|
|
|
|
if ($fp) {
|
|
|
|
|
$switch_cmd = "memcache delete configuration:sofia.conf";
|
|
|
|
|
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//rescan the external profile to look for new or stopped gateways
|
|
|
|
|
//create the event socket connection
|
|
|
|
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
|
|
|
|
$tmp_cmd = 'api sofia profile external rescan';
|
|
|
|
|
$response = event_socket_request($fp, $tmp_cmd);
|
|
|
|
|
unset($tmp_cmd);
|
|
|
|
|
usleep(1000);
|
|
|
|
|
//close the connection
|
|
|
|
|
fclose($fp);
|
|
|
|
|
//clear the apply settings reminder
|
|
|
|
|
$_SESSION["reload_xml"] = false;
|
|
|
|
|
} //if ($_POST["persistformvar"] != "true")
|
|
|
|
|
|
|
|
|
|
//redirect the user
|
|
|
|
|
if (isset($action)) {
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2012-11-24 01:59:49 +01:00
|
|
|
echo "<meta http-equiv=\"refresh\" content=\"2;url=gateways.php\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
if ($action == "add") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['message-add']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($action == "update") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['message-update']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo "</div>\n";
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
|
|
|
|
|
|
|
|
|
//pre-populate the form
|
|
|
|
|
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
$gateway_uuid = check_str($_GET["id"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql = "select * from v_gateways ";
|
2012-12-23 09:18:15 +01:00
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and gateway_uuid = '".$gateway_uuid."' ";
|
2012-06-04 16:58:40 +02:00
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
foreach ($result as &$row) {
|
|
|
|
|
$gateway = $row["gateway"];
|
|
|
|
|
$username = $row["username"];
|
|
|
|
|
$password = $row["password"];
|
|
|
|
|
$distinct_to = $row["distinct_to"];
|
|
|
|
|
$auth_username = $row["auth_username"];
|
|
|
|
|
$realm = $row["realm"];
|
|
|
|
|
$from_user = $row["from_user"];
|
|
|
|
|
$from_domain = $row["from_domain"];
|
|
|
|
|
$proxy = $row["proxy"];
|
|
|
|
|
$register_proxy = $row["register_proxy"];
|
|
|
|
|
$outbound_proxy = $row["outbound_proxy"];
|
|
|
|
|
$expire_seconds = $row["expire_seconds"];
|
|
|
|
|
$register = $row["register"];
|
|
|
|
|
$register_transport = $row["register_transport"];
|
|
|
|
|
$retry_seconds = $row["retry_seconds"];
|
|
|
|
|
$extension = $row["extension"];
|
|
|
|
|
$ping = $row["ping"];
|
2013-09-25 22:14:33 +02:00
|
|
|
$channels = $row["channels"];
|
2012-06-04 16:58:40 +02:00
|
|
|
$caller_id_in_from = $row["caller_id_in_from"];
|
|
|
|
|
$supress_cng = $row["supress_cng"];
|
|
|
|
|
$sip_cid_type = $row["sip_cid_type"];
|
2013-09-24 19:26:48 +02:00
|
|
|
$codec_prefs = $row["codec_prefs"];
|
2012-06-04 16:58:40 +02:00
|
|
|
$extension_in_contact = $row["extension_in_contact"];
|
|
|
|
|
$context = $row["context"];
|
|
|
|
|
$profile = $row["profile"];
|
|
|
|
|
$enabled = $row["enabled"];
|
|
|
|
|
$description = $row["description"];
|
|
|
|
|
}
|
|
|
|
|
unset ($prep_statement);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-28 18:42:07 +02:00
|
|
|
//set defaults
|
|
|
|
|
if (strlen($enabled) == 0) { $enabled = "true"; }
|
2013-11-15 04:49:18 +01:00
|
|
|
if (strlen($register) == 0) { $register = "true"; }
|
2013-11-15 05:05:34 +01:00
|
|
|
if (strlen($retry_seconds) == 0) { $retry_seconds = "30"; }
|
2013-09-28 18:42:07 +02:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//show the header
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//show the content
|
|
|
|
|
echo "<script type=\"text/javascript\" language=\"JavaScript\">\n";
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "function enable_change(enable_over) {\n";
|
|
|
|
|
echo " var endis;\n";
|
|
|
|
|
echo " endis = !(document.iform.enable.checked || enable_over);\n";
|
|
|
|
|
echo " document.iform.range_from.disabled = endis;\n";
|
|
|
|
|
echo " document.iform.range_to.disabled = endis;\n";
|
|
|
|
|
echo "}\n";
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "function show_advanced_config() {\n";
|
|
|
|
|
echo " document.getElementById(\"show_advanced_box\").innerHTML='';\n";
|
|
|
|
|
echo " aodiv = document.getElementById('show_advanced');\n";
|
|
|
|
|
echo " aodiv.style.display = \"block\";\n";
|
|
|
|
|
echo "}\n";
|
|
|
|
|
echo "\n";
|
|
|
|
|
echo "function hide_advanced_config() {\n";
|
|
|
|
|
echo " document.getElementById(\"show_advanced_box\").innerHTML='';\n";
|
|
|
|
|
echo " aodiv = document.getElementById('show_advanced');\n";
|
|
|
|
|
echo " aodiv.style.display = \"block\";\n";
|
|
|
|
|
echo "}\n";
|
|
|
|
|
echo "</script>";
|
|
|
|
|
|
|
|
|
|
echo "<div align='center'>";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
|
|
|
|
echo "<tr class='border'>\n";
|
|
|
|
|
echo " <td align=\"left\">\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <br>";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
echo "<form method='post' name='frm' action=''>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td colspan='2'>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td align='left' width=\"50%\">\n";
|
2013-09-22 00:11:50 +02:00
|
|
|
echo " <span class=\"title\">".$text['title-gateway']."</span><br>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>";
|
|
|
|
|
echo " <td width='50%' align='right'>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
2013-04-28 05:51:39 +02:00
|
|
|
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"if (confirm('".$text['confirm-copy']."')){window.location='gateway_copy.php?id=".$gateway_uuid."';}\" value='".$text['button-copy']."'>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='gateways.php'\" value='".$text['button-back']."'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td align='left' colspan='2'>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['description-gateway-edit']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td width=\"30%\" class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-26 17:26:20 +01:00
|
|
|
echo " ".$text['label-gateway'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td width=\"70%\" class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='gateway' maxlength='255' value=\"$gateway\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-gateway-name']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-username'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2012-12-07 19:57:36 +01:00
|
|
|
echo " <input class='formfld' type='text' name='username' maxlength='255' autocomplete='off' value=\"$username\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-username']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-password'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2012-12-07 19:57:36 +01:00
|
|
|
echo " <input class='formfld' type='password' name='password' id='password' autocomplete='off' maxlength='255' onfocus=\"document.getElementById('show_password').innerHTML = 'Password: '+document.getElementById('password').value;\" value=\"$password\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo "<span onclick=\"document.getElementById('show_password').innerHTML = ''\">".$text['description-password']."</span><span id='show_password'></span>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-from_user'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='from_user' maxlength='255' value=\"$from_user\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-from_user']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-from_domain'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='from_domain' maxlength='255' value=\"$from_domain\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-from_domain']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-proxy'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='proxy' maxlength='255' value=\"$proxy\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-proxy']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-realm'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='realm' maxlength='255' value=\"$realm\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-realm']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-expire_seconds'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
if (strlen($expire_seconds) == 0) { $expire_seconds = "800"; }
|
|
|
|
|
echo " <input class='formfld' type='text' name='expire_seconds' maxlength='255' value='$expire_seconds'>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-expire_seconds']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-register'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='register'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
2013-11-15 04:49:18 +01:00
|
|
|
if ($register == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($register == "false") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-register']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-retry_seconds'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='retry_seconds' maxlength='255' value='$retry_seconds'>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-retry_seconds']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
//--- begin: show_advanced -----------------------
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td style='padding: 0px;' colspan='2' class='' valign='top' align='left' nowrap>\n";
|
|
|
|
|
|
|
|
|
|
echo " <div id=\"show_advanced_box\">\n";
|
|
|
|
|
echo " <table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <td width=\"30%\" valign=\"top\" class=\"vncell\">".$text['button-advanced-show']."</td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <td width=\"70%\" class=\"vtable\">\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input type=\"button\" onClick=\"show_advanced_config()\" value=\"".$text['button-advanced']."\"></input></a>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " </div>\n";
|
|
|
|
|
|
|
|
|
|
echo " <div id=\"show_advanced\" style=\"display:none\">\n";
|
|
|
|
|
echo " <table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-distinct_to'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td width='70%' class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='distinct_to'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($distinct_to == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($distinct_to == "false") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-distinct_to']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-auth_username'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td width='70%' class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='auth_username' maxlength='255' value=\"$auth_username\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-auth_username']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-extension'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='extension' maxlength='255' value=\"$extension\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-extension']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-register_transport'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='register_transport'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($register_transport == "udp") {
|
|
|
|
|
echo " <option value='udp' selected='selected'>udp</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='udp'>udp</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($register_transport == "tcp") {
|
|
|
|
|
echo " <option value='tcp' selected='selected'>tcp</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='tcp'>tcp</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($register_transport == "tls") {
|
|
|
|
|
echo " <option value='tls' selected='selected'>tls</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='tls'>tls</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-register_transport']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-register_proxy'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='register_proxy' maxlength='255' value=\"$register_proxy\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-register_proxy']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-outbound_proxy'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='outbound_proxy' maxlength='255' value=\"$outbound_proxy\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-outbound_proxy']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-caller_id_in_from'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='caller_id_in_from'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($caller_id_in_from == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($caller_id_in_from == "false") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-caller_id_in_from']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-supress_cng'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='supress_cng'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($supress_cng == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($supress_cng == "false") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-supress_cng']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-sip_cid_type'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='sip_cid_type' maxlength='255' value=\"$sip_cid_type\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-sip_cid_type']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2013-09-24 19:26:48 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
|
|
|
|
echo " ".$text['label-codec_prefs'].":\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='codec_prefs' maxlength='255' value=\"$codec_prefs\">\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-codec_prefs']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-extension_in_contact'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='extension_in_contact'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($extension_in_contact == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($extension_in_contact == "false") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-extension_in_contact']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-ping'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='ping' maxlength='255' value=\"$ping\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-ping']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2013-09-24 19:26:48 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
2013-09-25 22:14:33 +02:00
|
|
|
echo " ".$text['label-channels'].":\n";
|
2013-09-24 19:26:48 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2013-09-25 22:14:33 +02:00
|
|
|
echo " <input class='formfld' type='text' name='channels' maxlength='255' value=\"$channels\">\n";
|
2013-09-24 19:26:48 +02:00
|
|
|
echo "<br />\n";
|
2013-09-25 22:14:33 +02:00
|
|
|
echo $text['description-channels']."\n";
|
2013-09-24 19:26:48 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " </div>";
|
|
|
|
|
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
//--- end: show_advanced -----------------------
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-context'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
if (strlen($context) == 0) { $context = "public"; }
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input class='formfld' type='text' name='context' maxlength='255' value=\"$context\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-context']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " ".$text['label-profile'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
if (strlen($profile) == 0) { $profile = "external"; }
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input class='formfld' type='text' name='profile' maxlength='255' value=\"$profile\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-profile']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-enabled'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <select class='formfld' name='enabled'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
if ($enabled == "true") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($enabled == "false") {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " </select>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-enabled']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-description'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input class='formfld' type='text' name='description' maxlength='255' value=\"$description\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<br />\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
echo $text['description-description']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2012-12-23 09:18:15 +01:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2' align='right'>\n";
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
echo " <input type='hidden' name='gateway_uuid' value='$gateway_uuid'>\n";
|
|
|
|
|
}
|
2012-12-23 09:18:15 +01:00
|
|
|
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</div>";
|
|
|
|
|
|
2012-12-23 09:18:15 +01:00
|
|
|
//include the footer
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2013-09-24 19:26:48 +02:00
|
|
|
?>
|