added correct bits detection

This commit is contained in:
Matthew Vale 2015-12-30 16:54:36 +00:00
parent 73b5c22b65
commit a12e3f12b0
1 changed files with 2 additions and 1 deletions

View File

@ -122,10 +122,11 @@ require_once "resources/classes/EventSocket.php";
throw new Exception('Failed to use event socket'); throw new Exception('Failed to use event socket');
} }
$FS_Version = $this->event_socket_request('api version'); $FS_Version = $this->event_socket_request('api version');
preg_match("/FreeSWITCH Version (\d+\.\d+\.\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches); preg_match("/FreeSWITCH Version (\d+)\.(\d+)\.(\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
$this->_major = $matches[1]; $this->_major = $matches[1];
$this->_minor = $matches[2]; $this->_minor = $matches[2];
$this->_build = $matches[3]; $this->_build = $matches[3];
$this->_bits = $matches[4];
$FS_Vars = $this->event_socket_request('api global_getvar'); $FS_Vars = $this->event_socket_request('api global_getvar');
foreach (explode("\n",$FS_Vars) as $FS_Var){ foreach (explode("\n",$FS_Vars) as $FS_Var){
preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches); preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);