Merge branch 'master' of https://github.com/fusionpbx/fusionpbx
This commit is contained in:
commit
7d92c4e4a4
|
|
@ -0,0 +1,4 @@
|
||||||
|
resources/config.php
|
||||||
|
secure/mailto.bat
|
||||||
|
secure/*.db
|
||||||
|
secure/*.sqlite
|
||||||
|
|
@ -183,6 +183,11 @@ else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reduce too long app data
|
||||||
|
if(strlen($application_data) > 512) {
|
||||||
|
$application_data = substr($application_data, 0, 512) . ' <b>...</b>';
|
||||||
|
}
|
||||||
|
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."'>".$sip_profile." </td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."'>".$sip_profile." </td>\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."'>".$created." </td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."'>".$created." </td>\n";
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,8 @@ else {
|
||||||
}
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
require_once "app_languages.php";
|
$language = new text;
|
||||||
foreach($text as $key => $value) {
|
$text = $language->get();
|
||||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
|
||||||
}
|
|
||||||
|
|
||||||
//get variables used to control the order
|
//get variables used to control the order
|
||||||
$order_by = check_str($_GET["order_by"]);
|
$order_by = check_str($_GET["order_by"]);
|
||||||
|
|
|
||||||
|
|
@ -173,8 +173,8 @@ foreach ($activity as $extension => $ext) {
|
||||||
$call_number = $ext['dest'];
|
$call_number = $ext['dest'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$call_name = $activity[(int) $ext['dest']]['effective_caller_id_name'];
|
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
|
||||||
$call_number = format_phone((int) $ext['dest']);
|
$call_number = format_phone($ext['dest']);
|
||||||
}
|
}
|
||||||
$dir_icon = 'outbound';
|
$dir_icon = 'outbound';
|
||||||
}
|
}
|
||||||
|
|
@ -182,13 +182,13 @@ foreach ($activity as $extension => $ext) {
|
||||||
if ($ext['callstate'] == 'ACTIVE') {
|
if ($ext['callstate'] == 'ACTIVE') {
|
||||||
$ext_state = 'active';
|
$ext_state = 'active';
|
||||||
if ($ext['direction'] == 'inbound') {
|
if ($ext['direction'] == 'inbound') {
|
||||||
$call_name = $activity[(int) $ext['dest']]['effective_caller_id_name'];
|
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
|
||||||
$call_number = format_phone((int) $ext['dest']);
|
$call_number = format_phone($ext['dest']);
|
||||||
$dir_icon = 'outbound';
|
$dir_icon = 'outbound';
|
||||||
}
|
}
|
||||||
else if ($ext['direction'] == 'outbound') {
|
else if ($ext['direction'] == 'outbound') {
|
||||||
$call_name = $activity[(int) $ext['cid_num']]['effective_caller_id_name'];
|
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
|
||||||
$call_number = format_phone((int) $ext['cid_num']);
|
$call_number = format_phone($ext['cid_num']);
|
||||||
$dir_icon = 'inbound';
|
$dir_icon = 'inbound';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -201,8 +201,8 @@ foreach ($activity as $extension => $ext) {
|
||||||
$ext_state = 'active';
|
$ext_state = 'active';
|
||||||
}
|
}
|
||||||
$dir_icon = 'inbound';
|
$dir_icon = 'inbound';
|
||||||
$call_name = $activity[(int) $ext['cid_num']]['effective_caller_id_name'];
|
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
|
||||||
$call_number = format_phone((int) $ext['cid_num']);
|
$call_number = format_phone($ext['cid_num']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unset($ext_state, $dir_icon, $call_name, $call_number);
|
unset($ext_state, $dir_icon, $call_name, $call_number);
|
||||||
|
|
|
||||||
|
|
@ -33,17 +33,23 @@ class cache {
|
||||||
* @var string $value string to be cached
|
* @var string $value string to be cached
|
||||||
*/
|
*/
|
||||||
public function set($key, $value) {
|
public function set($key, $value) {
|
||||||
|
// connect to event socket
|
||||||
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
|
if ($fp === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//send a custom event
|
//send a custom event
|
||||||
|
|
||||||
//run the memcache
|
//run the memcache
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$command = "memcache set ".$key." ".$value;
|
||||||
if ($fp) {
|
$result = event_socket_request($fp, 'api '.$command);
|
||||||
$command = "memcache set ".$key." ".$value;
|
|
||||||
return event_socket_request($fp, 'api '.$command);
|
//close event socket
|
||||||
}
|
fclose($fp);
|
||||||
else {
|
|
||||||
return false;
|
// return result
|
||||||
}
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -51,17 +57,23 @@ class cache {
|
||||||
* @var string $key cache id
|
* @var string $key cache id
|
||||||
*/
|
*/
|
||||||
public function get($key) {
|
public function get($key) {
|
||||||
|
// connect to event socket
|
||||||
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
|
if ($fp === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//send a custom event
|
//send a custom event
|
||||||
|
|
||||||
//run the memcache
|
//run the memcache
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$command = "memcache get ".$key;
|
||||||
if ($fp) {
|
$result = event_socket_request($fp, 'api '.$command);
|
||||||
$command = "memcache get ".$key;
|
|
||||||
return event_socket_request($fp, 'api '.$command);
|
//close event socket
|
||||||
}
|
fclose($fp);
|
||||||
else {
|
|
||||||
return false;
|
// return result
|
||||||
}
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -69,52 +81,58 @@ class cache {
|
||||||
* @var string $key cache id
|
* @var string $key cache id
|
||||||
*/
|
*/
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
//send a custom event
|
// connect to event socket
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
if ($fp) {
|
if ($fp === false) {
|
||||||
$event = "sendevent CUSTOM\n";
|
|
||||||
$event .= "Event-Name: MEMCACHE\n";
|
|
||||||
$event .= "Event-Subclass: delete\n";
|
|
||||||
$event .= "API-Command: memcache\n";
|
|
||||||
$event .= "API-Command-Argument: delete ".$key."\n";
|
|
||||||
echo event_socket_request($fp, $event);
|
|
||||||
}
|
|
||||||
|
|
||||||
//run the memcache
|
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
|
||||||
if ($fp) {
|
|
||||||
$command = "memcache delete ".$key;
|
|
||||||
return event_socket_request($fp, 'api '.$command);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//send a custom event
|
||||||
|
$event = "sendevent CUSTOM\n";
|
||||||
|
$event .= "Event-Name: MEMCACHE\n";
|
||||||
|
$event .= "Event-Subclass: delete\n";
|
||||||
|
$event .= "API-Command: memcache\n";
|
||||||
|
$event .= "API-Command-Argument: delete ".$key."\n";
|
||||||
|
event_socket_request($fp, $event);
|
||||||
|
|
||||||
|
//run the memcache
|
||||||
|
$command = "memcache delete ".$key;
|
||||||
|
$result = event_socket_request($fp, 'api '.$command);
|
||||||
|
|
||||||
|
//close event socket
|
||||||
|
fclose($fp);
|
||||||
|
|
||||||
|
// return result
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the entire cache
|
* Delete the entire cache
|
||||||
*/
|
*/
|
||||||
public function flush() {
|
public function flush() {
|
||||||
//send a custom event
|
// connect to event socket
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
if ($fp) {
|
if ($fp === false) {
|
||||||
$event = "sendevent CUSTOM\n";
|
|
||||||
$event .= "Event-Name: MEMCACHE\n";
|
|
||||||
$event .= "Event-Subclass: flush\n";
|
|
||||||
$event .= "API-Command: memcache\n";
|
|
||||||
$event .= "API-Command-Argument: flush\n";
|
|
||||||
echo event_socket_request($fp, $event);
|
|
||||||
}
|
|
||||||
|
|
||||||
//run the memcache
|
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
|
||||||
if ($fp) {
|
|
||||||
$command = "memcache flush";
|
|
||||||
return event_socket_request($fp, 'api '.$command);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//send a custom event
|
||||||
|
$event = "sendevent CUSTOM\n";
|
||||||
|
$event .= "Event-Name: MEMCACHE\n";
|
||||||
|
$event .= "Event-Subclass: flush\n";
|
||||||
|
$event .= "API-Command: memcache\n";
|
||||||
|
$event .= "API-Command-Argument: flush\n";
|
||||||
|
event_socket_request($fp, $event);
|
||||||
|
|
||||||
|
//run the memcache
|
||||||
|
$command = "memcache flush";
|
||||||
|
$result = event_socket_request($fp, 'api '.$command);
|
||||||
|
|
||||||
|
//close event socket
|
||||||
|
fclose($fp);
|
||||||
|
|
||||||
|
// return result
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue