Page MenuHomePhabricator

sip_settings.phtml
No OneTemporary

sip_settings.phtml

<?php
/**
* Copyright (c) 2022 AG Projects
* https://ag-projects.com
*
* This page provides functions for management of
* SIP account settings on a remote NGNPro server
*
*/
Header('Content-Type: text/html; charset=utf-8');
require '/etc/cdrtool/global.inc';
require '/etc/cdrtool/ngnpro_engines.inc';
require 'sip_settings.php';
if ($_REQUEST['action'] == 'get_location') {
$location = get_location($_SERVER['REMOTE_ADDR']);
print $location;
exit;
}
if (strlen($_REQUEST['reseller'] || strlen($_REQUEST['customer']))) {
page_open(
array(
"sess" => "CDRTool_Session",
"auth" => "CDRTool_Auth",
"perm" => "CDRTool_Perm"
)
);
$account = $_REQUEST['account'];
$reseller = $_REQUEST['reseller'];
$customer = $_REQUEST['customer'];
$sip_engine = $_REQUEST['sip_engine'];
if ($reseller && !$customer) {
$customer = $reseller;
} else if ($customer && !$reseller) {
$reseller = $customer;
}
$perm->check("provisioning");
global $CDRTool;
if ($CDRTool['impersonate']) {
if (preg_match("/^([1-9][0-9]*)\.([1-9][0-9]*)$/", $CDRTool['impersonate'], $m)) {
$_customer = $m[1];
$_reseller = $m[2];
if ($_customer == $_reseller) {
$login_type = 'reseller';
} else {
$login_type = 'customer';
}
$login_credentials=array(
'customer' => $_customer,
'reseller' => $_reseller,
'login_type' => $login_type
);
} else if ($CDRTool['impersonate'] == '0' || $CDRTool['impersonate'] = '0.0') {
$login_credentials = array(
'customer' => $customer,
'reseller' => $reseller,
'login_type' => 'admin'
);
} else {
page_close();
printf("Error: Invalid impersonate value %s", $CDRTool['impersonate']);
exit;
}
} else {
page_close();
printf("Error: Missing impersonate setting");
exit;
}
} else {
page_open(
array(
"sess" => "SIP_Subscriber_Session",
"auth" => "SIP_Subscriber_Auth"
)
);
$account = $SIP['account'];
$reseller = $SIP['reseller'];
$customer = $SIP['customer'];
$sip_engine = $SIP['engine'];
$login_type = "subscriber";
$login_credentials=array(
'login_type' => $login_type,
'customer' => $customer,
'reseller' => $reseller,
'sip_engine' => $sip_engine
);
}
$_class = 'SipSettings';
$_reseller_class = $_class.$reseller;
if (class_exists($_reseller_class)) {
$SipSettings_class = $_reseller_class;
} else {
$SipSettings_class = $_class;
}
if ($resellerFilters[$login_credentials['reseller']]['sip_engine']) {
$login_credentials['sip_engine'] = $resellerFilters[$login_credentials['reseller']]['sip_engine'];
} else if ($_REQUEST['sip_engine']) {
$login_credentials['sip_engine'] = $_REQUEST['sip_engine'];
} else if ($resellerFilters['default']['sip_engine']) {
$login_credentials['sip_engine'] = $resellerFilters['default']['sip_engine'];
}
renderUI($SipSettings_class, $account, $login_credentials, $soapEngines);
page_close();
?>

File Metadata

Mime Type
text/x-php
Expires
Sat, Feb 1, 5:40 AM (22 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3488666
Default Alt Text
sip_settings.phtml (3 KB)

Event Timeline