mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
SIP Status: Database class integration.
This commit is contained in:
@@ -102,11 +102,11 @@ if ($_GET['a'] == "download") {
|
|||||||
|
|
||||||
//get the gateways
|
//get the gateways
|
||||||
$sql = "select g.domain_uuid, g.gateway, g.gateway_uuid, d.domain_name ";
|
$sql = "select g.domain_uuid, g.gateway, g.gateway_uuid, d.domain_name ";
|
||||||
$sql .= "from v_gateways as g left outer join v_domains as d on d.domain_uuid = g.domain_uuid";
|
$sql .= "from v_gateways as g left ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$sql .= "outer join v_domains as d on d.domain_uuid = g.domain_uuid";
|
||||||
$prep_statement->execute();
|
$database = new database;
|
||||||
$gateways = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$gateways = $database->select($sql, null, 'all');
|
||||||
unset ($prep_statement, $sql);
|
unset($sql);
|
||||||
|
|
||||||
if ($fp) {
|
if ($fp) {
|
||||||
$hostname = trim(event_socket_request($fp, 'api switchname'));
|
$hostname = trim(event_socket_request($fp, 'api switchname'));
|
||||||
@@ -116,15 +116,15 @@ if ($_GET['a'] == "download") {
|
|||||||
$sql = "select sip_profile_name from v_sip_profiles ";
|
$sql = "select sip_profile_name from v_sip_profiles ";
|
||||||
$sql .= "where sip_profile_enabled = 'true' ";
|
$sql .= "where sip_profile_enabled = 'true' ";
|
||||||
if ($hostname) {
|
if ($hostname) {
|
||||||
$sql .= "and (sip_profile_hostname = '" . check_str($hostname) . "' ";
|
$sql .= "and (sip_profile_hostname = :sip_profile_hostname ";
|
||||||
$sql .= "or sip_profile_hostname = '' ";
|
$sql .= "or sip_profile_hostname = '' ";
|
||||||
$sql .= "or sip_profile_hostname is null ) ";
|
$sql .= "or sip_profile_hostname is null) ";
|
||||||
|
$parameters['sip_profile_hostname'] = $hostname;
|
||||||
}
|
}
|
||||||
$sql .= "order by sip_profile_name asc ";
|
$sql .= "order by sip_profile_name asc ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$database = new database;
|
||||||
$prep_statement->execute();
|
$sip_profiles = $database->select($sql, (is_array($parameters) && @sizeof($parameters) != 0 ? $parameters : null), 'all');
|
||||||
$sip_profiles = $prep_statement->fetchAll();
|
unset($sql, $parameters);
|
||||||
unset ($prep_statement, $sql);
|
|
||||||
|
|
||||||
//sofia status
|
//sofia status
|
||||||
if ($fp && permission_exists('system_status_sofia_status')) {
|
if ($fp && permission_exists('system_status_sofia_status')) {
|
||||||
@@ -199,9 +199,10 @@ if ($_GET['a'] == "download") {
|
|||||||
if ($_SESSION["domain_name"] == $gateway_domain_name) {
|
if ($_SESSION["domain_name"] == $gateway_domain_name) {
|
||||||
echo "<a href='".PROJECT_PATH."/app/gateways/gateway_edit.php?id=".strtolower(escape($row->name))."'>".escape($gateway_name)."@".escape($gateway_domain_name)."</a>";
|
echo "<a href='".PROJECT_PATH."/app/gateways/gateway_edit.php?id=".strtolower(escape($row->name))."'>".escape($gateway_name)."@".escape($gateway_domain_name)."</a>";
|
||||||
}
|
}
|
||||||
elseif ($gateway_domain_name == '') {
|
else if ($gateway_domain_name == '') {
|
||||||
echo $gateway_name ? $gateway_name : $row->name;
|
echo $gateway_name ? $gateway_name : $row->name;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo $gateway_name."@".$gateway_domain_name;
|
echo $gateway_name."@".$gateway_domain_name;
|
||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
@@ -343,4 +344,4 @@ if ($_GET['a'] == "download") {
|
|||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user