Fix. Display session count on User Dashboard.

Also it does not request information about all active calls which can be quite huge.
This commit is contained in:
Alexey Melnichuk 2016-04-12 16:18:19 +03:00
parent 8b0c01c772
commit 1405f252e5
1 changed files with 4 additions and 6 deletions

View File

@ -1092,12 +1092,10 @@
//channel count
if ($fp) {
$tmp = event_socket_request($fp, 'api show channels');
$tmp = explode("\n", $tmp);
$tmp = preg_replace('!\s+!', ' ', trim($tmp[3]));
$tmp = explode(' ', $tmp);
$tmp = $tmp[0];
$channels = (is_numeric($tmp)) ? $tmp : 0;
$tmp = event_socket_request($fp, 'api status');
$matches = Array();
preg_match("/(\d+)\s+session\(s\)\s+\-\speak/", $tmp, $matches);
$channels = $matches[1] ? $matches[1] : 0;
$hud[$n]['html'] .= "<tr class='tr_link_void'>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-channels']."</td>\n";
$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right;'>".$channels."</td>\n";