updated switch version detection

will now work with both git and packaged version numbers
added bits to detect_switch
This commit is contained in:
Matthew Vale
2015-12-10 10:51:38 +00:00
parent 3df36af619
commit cb440de264
2 changed files with 5 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ $document['title'] = $text['title-sys-status'];
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_version = event_socket_request($fp, 'api version');
preg_match("/FreeSWITCH Version (\d+\.\d+\.\d+(?:\.\d+)?).*\(\s*(\d+\w+)\s*\)/", $switch_version, $matches);
preg_match("/FreeSWITCH Version (\d+\.\d+\.\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $switch_version, $matches);
$switch_version = $matches[1];
$switch_bits = $matches[2];
echo "<tr>\n";