Change the switch class to freeswitch.

This commit is contained in:
markjcrane
2016-04-02 19:37:37 -06:00
parent 637a3fadb5
commit b5fbf389dd
3 changed files with 11 additions and 13 deletions

View File

@@ -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'])) {

View File

@@ -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;
}

View File

@@ -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);