Rename the EventSocket class.
This commit is contained in:
@@ -111,7 +111,7 @@ if (!$included) {
|
|||||||
$fax_cover_font = $_SESSION['fax']['cover_font']['text'];
|
$fax_cover_font = $_SESSION['fax']['cover_font']['text'];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
require_once "resources/classes/EventSocket.php";
|
require_once "resources/classes/event_socket.php";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!function_exists('correct_path')) {
|
if(!function_exists('correct_path')) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
require_once "root.php";
|
require_once "root.php";
|
||||||
require_once "resources/classes/EventSocket.php";
|
require_once "resources/classes/event_socket.php";
|
||||||
|
|
||||||
//define the install class
|
//define the install class
|
||||||
class detect_switch {
|
class detect_switch {
|
||||||
@@ -144,7 +144,7 @@ require_once "resources/classes/EventSocket.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function connect_event_socket(){
|
protected function connect_event_socket(){
|
||||||
$esl = new EventSocket;
|
$esl = new event_socket;
|
||||||
if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
|
if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
|
||||||
$this->event_socket = $esl->reset_fp();
|
$this->event_socket = $esl->reset_fp();
|
||||||
return true;
|
return true;
|
||||||
@@ -153,7 +153,7 @@ require_once "resources/classes/EventSocket.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function event_socket_request($cmd) {
|
protected function event_socket_request($cmd) {
|
||||||
$esl = new EventSocket($this->event_socket);
|
$esl = new event_socket($this->event_socket);
|
||||||
$result = $esl->request($cmd);
|
$result = $esl->request($cmd);
|
||||||
$esl->reset_fp();
|
$esl->reset_fp();
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function restart_switch() {
|
protected function restart_switch() {
|
||||||
$esl = new EventSocket;
|
$esl = new event_socket;
|
||||||
if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
|
if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
|
||||||
throw new Exception("Failed to connect to switch");
|
throw new Exception("Failed to connect to switch");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,13 +37,12 @@ class Buffer {
|
|||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//$b = new Buffer;
|
//$b = new Buffer;
|
||||||
//$b->append("hello\nworld\n");
|
//$b->append("hello\nworld\n");
|
||||||
//print($b->read_line());
|
//print($b->read_line());
|
||||||
//print($b->read_line());
|
//print($b->read_line());
|
||||||
|
|
||||||
class EventSocket {
|
class event_socket {
|
||||||
private $buffer;
|
private $buffer;
|
||||||
private $fp;
|
private $fp;
|
||||||
|
|
||||||
@@ -173,7 +172,7 @@ class EventSocket {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
function event_socket_create($host, $port, $password) {
|
function event_socket_create($host, $port, $password) {
|
||||||
$esl = new EventSocket;
|
$esl = new event_socket;
|
||||||
if ($esl->connect($host, $port, $password)) {
|
if ($esl->connect($host, $port, $password)) {
|
||||||
return $esl->reset_fp();
|
return $esl->reset_fp();
|
||||||
}
|
}
|
||||||
@@ -181,14 +180,14 @@ function event_socket_create($host, $port, $password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function event_socket_request($fp, $cmd) {
|
function event_socket_request($fp, $cmd) {
|
||||||
$esl = new EventSocket($fp);
|
$esl = new event_socket($fp);
|
||||||
$result = $esl->request($cmd);
|
$result = $esl->request($cmd);
|
||||||
$esl->reset_fp();
|
$esl->reset_fp();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $esl = new EventSocket;
|
// $esl = new event_socket;
|
||||||
// $esl->connect('127.0.0.1', 8021, 'ClueCon');
|
// $esl->connect('127.0.0.1', 8021, 'ClueCon');
|
||||||
// print($esl->request('api sofia status'));
|
// print($esl->request('api sofia status'));
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function load_extensions() {
|
|||||||
load_extensions();
|
load_extensions();
|
||||||
|
|
||||||
function event_socket_create($host, $port, $password) {
|
function event_socket_create($host, $port, $password) {
|
||||||
$esl = new EventSocket;
|
$esl = new event_socket;
|
||||||
if ($esl->connect($host, $port, $password)) {
|
if ($esl->connect($host, $port, $password)) {
|
||||||
return $esl->reset_fp();
|
return $esl->reset_fp();
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ function event_socket_create($host, $port, $password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function event_socket_request($fp, $cmd) {
|
function event_socket_request($fp, $cmd) {
|
||||||
$esl = new EventSocket($fp);
|
$esl = new event_socket($fp);
|
||||||
$result = $esl->request($cmd);
|
$result = $esl->request($cmd);
|
||||||
$esl->reset_fp();
|
$esl->reset_fp();
|
||||||
return $result;
|
return $result;
|
||||||
@@ -142,7 +142,7 @@ function event_socket_request_cmd($cmd) {
|
|||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
$esl = new EventSocket;
|
$esl = new event_socket;
|
||||||
if (!$esl->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
|
if (!$esl->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ if(!function_exists('fax_split_dtmf')) {
|
|||||||
//includes
|
//includes
|
||||||
if (!defined('STDIN')) { include "root.php"; }
|
if (!defined('STDIN')) { include "root.php"; }
|
||||||
require_once "resources/require.php";
|
require_once "resources/require.php";
|
||||||
include "resources/classes/EventSocket.php";
|
include "resources/classes/event_socket.php";
|
||||||
include "resources/phpmailer/class.phpmailer.php";
|
include "resources/phpmailer/class.phpmailer.php";
|
||||||
include "resources/phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded
|
include "resources/phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user