mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Add a missing file sip_profile_copy.php to the dev branch.
This commit is contained in:
166
app/gateways/app_config.php
Normal file
166
app/gateways/app_config.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
//application details
|
||||
$apps[$x]['name'] = "Gateways";
|
||||
$apps[$x]['uuid'] = '297ab33e-2c2f-8196-552c-f3567d2caaf8';
|
||||
$apps[$x]['category'] = 'Switch';;
|
||||
$apps[$x]['subcategory'] = '';
|
||||
$apps[$x]['version'] = '';
|
||||
$apps[$x]['license'] = 'Mozilla Public License 1.1';
|
||||
$apps[$x]['url'] = 'http://www.fusionpbx.com';
|
||||
$apps[$x]['description']['en'] = 'Gateways provide access into other voice networks. These can be voice providers or other systems that require SIP registration.';
|
||||
|
||||
//menu details
|
||||
$apps[$x]['menu'][0]['title']['en'] = 'Gateways';
|
||||
$apps[$x]['menu'][0]['uuid'] = '237a512a-f8fe-1ce4-b5d7-e71c401d7159';
|
||||
$apps[$x]['menu'][0]['parent_uuid'] = 'bc96d773-ee57-0cdd-c3ac-2d91aba61b55';
|
||||
$apps[$x]['menu'][0]['category'] = 'internal';
|
||||
$apps[$x]['menu'][0]['path'] = '/app/gateways/v_gateways.php';
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = 'gateways_view';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][1]['name'] = 'gateways_add';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][2]['name'] = 'gateways_edit';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][3]['name'] = 'gateways_delete';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_gateways';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'gateway_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'gateway_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$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]['key']['type'] = 'primary';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$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]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'gateway';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'username';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'password';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'distinct_to';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'auth_username';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'realm';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'from_user';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'from_domain';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'proxy';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'register_proxy';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'outbound_proxy';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'expire_seconds';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'register';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'register_transport';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'retry_seconds';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'extension';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'ping';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'caller_id_in_from';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'supress_cng';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'sip_cid_type';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'extension_in_contact';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'context';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'enabled';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'description';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
||||
?>
|
||||
50
app/gateways/root.php
Normal file
50
app/gateways/root.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// make sure the PATH_SEPARATOR is defined
|
||||
if (!defined("PATH_SEPARATOR")) {
|
||||
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
|
||||
}
|
||||
|
||||
// make sure the document_root is set
|
||||
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
|
||||
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
|
||||
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
|
||||
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
|
||||
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
|
||||
|
||||
// if the project directory exists then add it to the include path otherwise add the document root to the include path
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
|
||||
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
|
||||
}
|
||||
else {
|
||||
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
|
||||
}
|
||||
|
||||
?>
|
||||
252
app/gateways/v_gateways.php
Normal file
252
app/gateways/v_gateways.php
Normal file
@@ -0,0 +1,252 @@
|
||||
<?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>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('gateways_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/paging.php";
|
||||
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//connect to event socket
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if ($fp) {
|
||||
if (strlen($_GET["a"]) > 0) {
|
||||
$profile = $_GET["profile"];
|
||||
if (strlen($profile) == 0) {
|
||||
$profile = 'external';
|
||||
}
|
||||
if ($_GET["a"] == "stop") {
|
||||
$gateway_name = $_GET["gateway"];
|
||||
if (count($_SESSION["domains"]) > 1) {
|
||||
$cmd = 'api sofia profile '.$profile.' killgw '.$_SESSION['domain_name'].'-'.$gateway_name;
|
||||
}
|
||||
else {
|
||||
$cmd = 'api sofia profile '.$profile.' killgw '.$gateway_name;
|
||||
}
|
||||
$response = trim(event_socket_request($fp, $cmd));
|
||||
$msg = '<strong>Stop Gateway:</strong><pre>'.$response.'</pre>';
|
||||
}
|
||||
if ($_GET["a"] == "start") {
|
||||
$gateway_name = $_GET["gateway"];
|
||||
$cmd = 'api sofia profile '.$profile.' rescan';
|
||||
$response = trim(event_socket_request($fp, $cmd));
|
||||
$msg = '<strong>Start Gateway:</strong><pre>'.$response.'</pre>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('switch_gateway_status')) {
|
||||
function switch_gateway_status($gateway_name, $result_type = 'xml') {
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if (count($_SESSION["domains"]) > 1) {
|
||||
$cmd = 'api sofia xmlstatus gateway '.$_SESSION['domain_name'].'-'.$gateway_name;
|
||||
}
|
||||
else {
|
||||
$cmd = 'api sofia xmlstatus gateway '.$gateway_name;
|
||||
}
|
||||
return trim(event_socket_request($fp, $cmd));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"center\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left'><span class=\"vexpl\"><span class=\"red\"><strong>Gateways\n";
|
||||
echo " </strong></span></span>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td align='right'>";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' colspan='2'>\n";
|
||||
echo " <span class=\"vexpl\">\n";
|
||||
echo " Gateways provide access into other voice networks. These can be voice providers or other systems that require SIP registration.\n";
|
||||
echo " </span>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>";
|
||||
|
||||
echo "<br />\n";
|
||||
echo "<br />\n";
|
||||
|
||||
$sql = "";
|
||||
$sql .= " select * from v_gateways ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$num_rows = count($result);
|
||||
unset ($prep_statement, $result, $sql);
|
||||
|
||||
$rows_per_page = 10;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
$sql = "";
|
||||
$sql .= " select * from v_gateways ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$sql .= " limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('gateway', 'Gateway', $order_by, $order);
|
||||
echo th_order_by('context', 'Context', $order_by, $order);
|
||||
if ($fp) {
|
||||
echo "<th>Status</th>\n";
|
||||
echo "<th>Action</th>\n";
|
||||
echo "<th>State</th>\n";
|
||||
}
|
||||
echo th_order_by('enabled', 'Enabled', $order_by, $order);
|
||||
echo th_order_by('description', 'Gateway Description', $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('gateways_add')) {
|
||||
echo " <a href='v_gateways_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if ($result_count == 0) {
|
||||
//no results
|
||||
}
|
||||
else { //received results
|
||||
foreach($result as $row) {
|
||||
echo "<tr >\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row["gateway"]."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row["context"]."</td>\n";
|
||||
|
||||
if ($fp) {
|
||||
if ($row["enabled"] == "true") {
|
||||
$response = switch_gateway_status($row["gateway"]);
|
||||
if ($response == "Invalid Gateway!") {
|
||||
//not running
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>Stopped</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='v_gateways.php?a=start&gateway=".$row["gateway"]."&profile=".$row["profile"]."' alt='start'>Start</a></td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'> </td>\n";
|
||||
}
|
||||
else {
|
||||
//running
|
||||
try {
|
||||
$xml = new SimpleXMLElement($response);
|
||||
$state = $xml->state;
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>Running</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='v_gateways.php?a=stop&gateway=".$row["gateway"]."&profile=".$row["profile"]."' alt='stop'>Stop</a></td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$state."</td>\n";
|
||||
}
|
||||
catch(Exception $e) {
|
||||
//echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'> </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'> </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'> </td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='align: center;'>".$row["enabled"]."</td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".$row["description"]."</td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('gateways_edit')) {
|
||||
echo " <a href='v_gateways_edit.php?id=".$row["gateway_uuid"]."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('gateways_delete')) {
|
||||
echo " <a href='v_gateways_delete.php?id=".$row["gateway_uuid"]."' onclick=\"return confirm('Do you really want to delete this?')\" alt='delete'>$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='8'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('gateways_add')) {
|
||||
echo " <a href='v_gateways_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='8' align='left'>\n";
|
||||
echo "<br />\n";
|
||||
if ($v_path_show) {
|
||||
echo $_SESSION['switch']['gateways']['dir']."/sip_profiles\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
161
app/gateways/v_gateways_copy.php
Normal file
161
app/gateways/v_gateways_copy.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?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>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
require_once "includes/paging.php";
|
||||
if (permission_exists('gateways_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//set the http get/post variable(s) to a php variable
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$gateway_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
|
||||
//get the data
|
||||
$sql = "";
|
||||
$sql .= "select * from v_gateways ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and gateway_uuid = '$gateway_uuid' ";
|
||||
$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"];
|
||||
$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"];
|
||||
$caller_id_in_from = $row["caller_id_in_from"];
|
||||
$supress_cng = $row["supress_cng"];
|
||||
$extension_in_contact = $row["extension_in_contact"];
|
||||
$effective_caller_id_name = $row["effective_caller_id_name"];
|
||||
$effective_caller_id_number = $row["effective_caller_id_number"];
|
||||
$outbound_caller_id_name = $row["outbound_caller_id_name"];
|
||||
$outbound_caller_id_number = $row["outbound_caller_id_number"];
|
||||
$context = $row["context"];
|
||||
$enabled = $row["enabled"];
|
||||
$description = 'copy: '.$row["description"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//copy the gateways
|
||||
$gateway_uuid = uuid();
|
||||
$sql = "insert into v_gateways ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "gateway_uuid, ";
|
||||
$sql .= "gateway, ";
|
||||
$sql .= "username, ";
|
||||
$sql .= "password, ";
|
||||
$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, ";
|
||||
$sql .= "caller_id_in_from, ";
|
||||
$sql .= "supress_cng, ";
|
||||
$sql .= "extension_in_contact, ";
|
||||
$sql .= "effective_caller_id_name, ";
|
||||
$sql .= "effective_caller_id_number, ";
|
||||
$sql .= "outbound_caller_id_name, ";
|
||||
$sql .= "outbound_caller_id_number, ";
|
||||
$sql .= "context, ";
|
||||
$sql .= "enabled, ";
|
||||
$sql .= "description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$gateway_uuid', ";
|
||||
$sql .= "'$gateway', ";
|
||||
$sql .= "'$username', ";
|
||||
$sql .= "'$password', ";
|
||||
$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', ";
|
||||
$sql .= "'$caller_id_in_from', ";
|
||||
$sql .= "'$supress_cng', ";
|
||||
$sql .= "'$extension_in_contact', ";
|
||||
$sql .= "'$effective_caller_id_name', ";
|
||||
$sql .= "'$effective_caller_id_number', ";
|
||||
$sql .= "'$outbound_caller_id_name', ";
|
||||
$sql .= "'$outbound_caller_id_number', ";
|
||||
$sql .= "'$context', ";
|
||||
$sql .= "'$enabled', ";
|
||||
$sql .= "'$description' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//synchronize the xml config
|
||||
save_gateway_xml();
|
||||
|
||||
//redirect the user
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_gateways.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Copy Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
?>
|
||||
122
app/gateways/v_gateways_delete.php
Normal file
122
app/gateways/v_gateways_delete.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?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>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('gateways_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (strlen($_GET["id"])>0) {
|
||||
//set the variable
|
||||
$id = $_GET["id"];
|
||||
|
||||
//get the gateway name
|
||||
$sql = "";
|
||||
$sql .= "select * from v_gateways ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and gateway_uuid = '$id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$gateway = $row["gateway"];
|
||||
$profile = $row["profile"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//delete the xml file
|
||||
if (count($_SESSION["domains"]) > 1) {
|
||||
$gateway_xml_file = $_SESSION['switch']['gateways']['dir']."/".$profile."/v_".$_SESSION['domain_name'].'-'.$gateway.".xml";
|
||||
}
|
||||
else {
|
||||
$gateway_xml_file = $_SESSION['switch']['gateways']['dir']."/".$profile."/v_".$gateway.".xml";
|
||||
}
|
||||
unlink($gateway_xml_file);
|
||||
|
||||
//create the event socket connection and stop the gateway
|
||||
if (!$fp) {
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
}
|
||||
if ($fp) {
|
||||
//send the api gateway stop command over event socket
|
||||
if (count($_SESSION["domains"]) > 1) {
|
||||
$tmp_cmd = 'api sofia profile '.$profile.' killgw '.$_SESSION['domain_name'].'-'.$gateway;
|
||||
}
|
||||
else {
|
||||
$tmp_cmd = 'api sofia profile '.$profile.' killgw '.$gateway;
|
||||
}
|
||||
$response = event_socket_request($fp, $tmp_cmd);
|
||||
unset($tmp_cmd);
|
||||
}
|
||||
|
||||
//delete gateway
|
||||
$sql = "delete from v_gateways ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and gateway_uuid = '$id' ";
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_gateway_xml();
|
||||
|
||||
//synchronize the xml config
|
||||
save_dialplan_xml();
|
||||
|
||||
//rescan the sip profile to look for new or stopped gateways
|
||||
//create the event socket connection and send a command
|
||||
if (!$fp) {
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
}
|
||||
if ($fp) {
|
||||
//send the api commandover event socket
|
||||
$tmp_cmd = 'api sofia profile '.$profile.' rescan';
|
||||
$response = event_socket_request($fp, $tmp_cmd);
|
||||
unset($tmp_cmd);
|
||||
//close the connection
|
||||
fclose($fp);
|
||||
}
|
||||
usleep(1000);
|
||||
|
||||
//clear the apply settings reminder
|
||||
$_SESSION["reload_xml"] = false;
|
||||
}
|
||||
|
||||
//redirect the users
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_gateways.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
?>
|
||||
797
app/gateways/v_gateways_edit.php
Normal file
797
app/gateways/v_gateways_edit.php
Normal file
@@ -0,0 +1,797 @@
|
||||
<?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>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('gateways_add') || permission_exists('gateways_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$gateway_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get the http values and set them as php variables
|
||||
if (count($_POST)>0) {
|
||||
//$domain_uuid = check_str($_POST["domain_uuid"]);
|
||||
$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"]);
|
||||
$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"]);
|
||||
$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
|
||||
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
|
||||
if (strlen($gateway) == 0) { $msg .= "Please provide: Gateway<br>\n"; }
|
||||
if ($register == "true") {
|
||||
if (strlen($username) == 0) { $msg .= "Please provide: Username<br>\n"; }
|
||||
if (strlen($password) == 0) { $msg .= "Please provide: Password<br>\n"; }
|
||||
}
|
||||
//if (strlen($distinct_to) == 0) { $msg .= "Please provide: Distinct To<br>\n"; }
|
||||
//if (strlen($auth_username) == 0) { $msg .= "Please provide: Auth username<br>\n"; }
|
||||
//if (strlen($realm) == 0) { $msg .= "Please provide: Realm<br>\n"; }
|
||||
//if (strlen($from_user) == 0) { $msg .= "Please provide: From user<br>\n"; }
|
||||
//if (strlen($from_domain) == 0) { $msg .= "Please provide: From domain<br>\n"; }
|
||||
//if (strlen($proxy) == 0) { $msg .= "Please provide: Proxy<br>\n"; }
|
||||
if (strlen($expire_seconds) == 0) { $msg .= "Please provide: Expire seconds<br>\n"; }
|
||||
if (strlen($register) == 0) { $msg .= "Please provide: Register<br>\n"; }
|
||||
//if (strlen($register_transport) == 0) { $msg .= "Please provide: Register transport<br>\n"; }
|
||||
if (strlen($retry_seconds) == 0) { $msg .= "Please provide: Retry seconds<br>\n"; }
|
||||
//if (strlen($extension) == 0) { $msg .= "Please provide: Extension<br>\n"; }
|
||||
//if (strlen($ping) == 0) { $msg .= "Please provide: Ping<br>\n"; }
|
||||
//if (strlen($caller_id_in_from) == 0) { $msg .= "Please provide: Caller ID in from<br>\n"; }
|
||||
//if (strlen($supress_cng) == 0) { $msg .= "Please provide: Supress CNG<br>\n"; }
|
||||
//if (strlen($sip_cid_type) == 0) { $msg .= "Please provide: SIP CID Type<br>\n"; }
|
||||
//if (strlen($extension_in_contact) == 0) { $msg .= "Please provide: Extension in Contact<br>\n"; }
|
||||
if (strlen($context) == 0) { $msg .= "Please provide: Context<br>\n"; }
|
||||
//if (strlen($profile) == 0) { $msg .= "Please provide: Profile<br>\n"; }
|
||||
if (strlen($enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
|
||||
//if (strlen($description) == 0) { $msg .= "Please provide: Gateway Description<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.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 "includes/footer.php";
|
||||
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") {
|
||||
if ($action == "add" && permission_exists('gateways_add')) {
|
||||
$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, ";
|
||||
$sql .= "caller_id_in_from, ";
|
||||
$sql .= "supress_cng, ";
|
||||
$sql .= "sip_cid_type, ";
|
||||
$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', ";
|
||||
$sql .= "'$caller_id_in_from', ";
|
||||
$sql .= "'$supress_cng', ";
|
||||
$sql .= "'$sip_cid_type', ";
|
||||
$sql .= "'$extension_in_contact', ";
|
||||
$sql .= "'$context', ";
|
||||
$sql .= "'$profile', ";
|
||||
$sql .= "'$enabled', ";
|
||||
$sql .= "'$description' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_gateway_xml();
|
||||
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update" && permission_exists('gateways_edit')) {
|
||||
$sql = "update v_gateways set ";
|
||||
//$sql .= "domain_uuid = '$domain_uuid', ";
|
||||
$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', ";
|
||||
$sql .= "caller_id_in_from = '$caller_id_in_from', ";
|
||||
$sql .= "supress_cng = '$supress_cng', ";
|
||||
$sql .= "sip_cid_type = '$sip_cid_type', ";
|
||||
$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);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_gateway_xml();
|
||||
|
||||
//synchronize the xml config
|
||||
save_dialplan_xml();
|
||||
|
||||
} //if ($action == "update")
|
||||
|
||||
//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)) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_gateways.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
if ($action == "add") {
|
||||
echo "Add Complete\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo "Edit Complete\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
}
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
||||
$gateway_uuid = $_GET["id"];
|
||||
$sql = "select * from v_gateways ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and gateway_uuid = '$gateway_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$domain_uuid = $row["domain_uuid"];
|
||||
$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"];
|
||||
$caller_id_in_from = $row["caller_id_in_from"];
|
||||
$supress_cng = $row["supress_cng"];
|
||||
$sip_cid_type = $row["sip_cid_type"];
|
||||
$extension_in_contact = $row["extension_in_contact"];
|
||||
$context = $row["context"];
|
||||
$profile = $row["profile"];
|
||||
$enabled = $row["enabled"];
|
||||
$description = $row["description"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//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";
|
||||
echo " <br>";
|
||||
|
||||
echo "<form method='post' name='ifrm' action=''>\n";
|
||||
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";
|
||||
echo " <strong>Gateway Edit</strong><br>\n";
|
||||
echo " </td>";
|
||||
echo " <td width='50%' align='right'>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='copy' onclick=\"if (confirm('Do you really want to copy this?')){window.location='v_gateways_copy.php?id=".$gateway_uuid."';}\" value='Copy'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_gateways.php'\" value='Back'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td align='left' colspan='2'>\n";
|
||||
echo " Defines a connections to a SIP Provider or another SIP server. <br />\n";
|
||||
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";
|
||||
echo " Gateway:\n";
|
||||
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";
|
||||
echo "Enter the gateway name here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Username:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='username' maxlength='255' value=\"$username\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the username here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Password:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='password' name='password' id='password' maxlength='50' onfocus=\"document.getElementById('show_password').innerHTML = 'Password: '+document.getElementById('password').value;\" value=\"$password\">\n";
|
||||
echo "<br />\n";
|
||||
echo "<span onclick=\"document.getElementById('show_password').innerHTML = ''\">Enter the password here. </span><span id='show_password'></span>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " From user:\n";
|
||||
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";
|
||||
echo "Enter the from-user here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " From domain:\n";
|
||||
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";
|
||||
echo "Enter the from-domain here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Proxy:\n";
|
||||
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";
|
||||
echo "Enter the domain or IP address of the proxy.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Realm:\n";
|
||||
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";
|
||||
echo "Enter the realm here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Expire seconds:\n";
|
||||
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";
|
||||
echo "Enter the expire-seconds here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Register:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='register'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($register == "true") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
}
|
||||
if ($register == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether to register. \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Retry seconds:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if (strlen($retry_seconds) == 0) { $retry_seconds = "60"; }
|
||||
echo " <input class='formfld' type='text' name='retry_seconds' maxlength='255' value='$retry_seconds'>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the retry-seconds here.\n";
|
||||
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";
|
||||
echo " <td width=\"30%\" valign=\"top\" class=\"vncell\">Show Advanced</td>\n";
|
||||
echo " <td width=\"70%\" class=\"vtable\">\n";
|
||||
echo " <input type=\"button\" onClick=\"show_advanced_config()\" value=\"Advanced\"></input></a>\n";
|
||||
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";
|
||||
echo " Distinct To:\n";
|
||||
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") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
}
|
||||
if ($distinct_to == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the distinct_to here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Auth username:\n";
|
||||
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";
|
||||
echo "Enter the auth-username here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Extension:\n";
|
||||
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";
|
||||
echo "Enter the extension here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Register transport:\n";
|
||||
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";
|
||||
echo "Choose whether to register-transport. \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Register Proxy:\n";
|
||||
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";
|
||||
echo "Enter the register proxy here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Outbound Proxy:\n";
|
||||
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";
|
||||
echo "Enter the outbound proxy here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Caller ID in from:\n";
|
||||
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") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
}
|
||||
if ($caller_id_in_from == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the caller-id-in-from.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Supress CNG:\n";
|
||||
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") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
}
|
||||
if ($supress_cng == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the supress-cng.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " SIP CID Type:\n";
|
||||
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";
|
||||
echo "Enter the sip_cid_type: none, pid, and rpid.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Extension in Contact:\n";
|
||||
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") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
}
|
||||
if ($extension_in_contact == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the extension_in_contact.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Ping:\n";
|
||||
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";
|
||||
echo "Enter the ping interval here in seconds.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " </table>\n";
|
||||
echo " </div>";
|
||||
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
//--- end: show_advanced -----------------------
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Context:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if (strlen($context) == 0) { $context = "public"; }
|
||||
echo " <input class='formfld' type='text' name='context' maxlength='255' value=\"$context\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the context here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Profile:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if (strlen($profile) == 0) { $profile = "external"; }
|
||||
echo " <input class='formfld' type='text' name='profile' maxlength='255' value=\"$profile\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the profile here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Enabled:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='enabled'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
}
|
||||
if ($enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Gateway Description:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='description' value='$description'>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the description of the gateway here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='gateway_uuid' value='$gateway_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
|
||||
//show footer
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
Reference in New Issue
Block a user