diff --git a/core/user_settings/user_dashboard.php b/core/user_settings/user_dashboard.php index 1ee1a402ea..0278c4b54e 100644 --- a/core/user_settings/user_dashboard.php +++ b/core/user_settings/user_dashboard.php @@ -1092,14 +1092,13 @@ //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; - $hud[$n]['html'] .= "\n"; - $hud[$n]['html'] .= "".$text['label-channels']."\n"; + $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; + $tr_link = "href='".PROJECT_PATH."/app/calls_active/calls_active.php'"; + $hud[$n]['html'] .= "\n"; + $hud[$n]['html'] .= "".$text['label-channels']."\n"; $hud[$n]['html'] .= "".$channels."\n"; $hud[$n]['html'] .= "\n"; $c = ($c) ? 0 : 1;