mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Change the switch class to freeswitch.
This commit is contained in:
@@ -28,9 +28,9 @@
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//add missing switch directories in default settings
|
||||
$switch = new switch;
|
||||
$switch->settings();
|
||||
unset($switch);
|
||||
$obj = new freeswitch;
|
||||
$obj->settings();
|
||||
unset($obj);
|
||||
|
||||
//use the module class to get the list of modules from the db and add any missing modules
|
||||
if (isset($_SESSION['switch']['mod']['dir'])) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Buffer {
|
||||
class buffer {
|
||||
private $content;
|
||||
private $eol;
|
||||
|
||||
@@ -37,7 +37,7 @@ class Buffer {
|
||||
return $tmp;
|
||||
}
|
||||
}
|
||||
//$b = new Buffer;
|
||||
//$b = new buffer;
|
||||
//$b->append("hello\nworld\n");
|
||||
//print($b->read_line());
|
||||
//print($b->read_line());
|
||||
@@ -47,7 +47,7 @@ class event_socket {
|
||||
private $fp;
|
||||
|
||||
public function __construct($fp = false) {
|
||||
$this->buffer = new Buffer;
|
||||
$this->buffer = new buffer;
|
||||
$this->fp = $fp;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* switch class provides access methods related to FreeSWITCH
|
||||
* freeswitch class provides access methods related to FreeSWITCH
|
||||
*
|
||||
* @method settings will add missing switch directories to default settings
|
||||
*/
|
||||
class switch {
|
||||
class freeswitch {
|
||||
|
||||
public $event_socket_ip_address;
|
||||
public $event_socket_port;
|
||||
@@ -45,13 +45,11 @@ class switch {
|
||||
}
|
||||
|
||||
//connect to event socket
|
||||
$fp = event_socket_create($this->event_socket_ip_address, $this->event_socket_port, $this->event_socket_password);
|
||||
if ($fp === false) {
|
||||
return false;
|
||||
}
|
||||
$esl = new event_socket;
|
||||
$esl->connect($this->event_socket_ip_address, $this->event_socket_port, $this->event_socket_password);
|
||||
|
||||
//run the api command
|
||||
$result = event_socket_request($fp, 'api global_getvar');
|
||||
$result = $esl->request('api global_getvar');
|
||||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
Reference in New Issue
Block a user