From c8a12bf2541aa180f61aa7677d3884519a71cb76 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 12 Apr 2016 16:18:19 +0300 Subject: [PATCH 1/2] Fix. Display session count on User Dashboard. Also it does not request information about all active calls which can be quite huge. --- core/user_settings/user_dashboard.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/user_settings/user_dashboard.php b/core/user_settings/user_dashboard.php index 6b49af586c..1ce65b73eb 100644 --- a/core/user_settings/user_dashboard.php +++ b/core/user_settings/user_dashboard.php @@ -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'] .= "\n"; $hud[$n]['html'] .= "".$text['label-channels']."\n"; $hud[$n]['html'] .= "".$channels."\n"; From 5971e716c4db5b0dd9811683618ad3a9809f134e Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 12 Apr 2016 16:25:06 +0300 Subject: [PATCH 2/2] Add. Make `Channels` link that point to `Active calls` --- core/user_settings/user_dashboard.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/user_settings/user_dashboard.php b/core/user_settings/user_dashboard.php index 1ce65b73eb..27f3807b45 100644 --- a/core/user_settings/user_dashboard.php +++ b/core/user_settings/user_dashboard.php @@ -1096,8 +1096,9 @@ $matches = Array(); preg_match("/(\d+)\s+session\(s\)\s+\-\speak/", $tmp, $matches); $channels = $matches[1] ? $matches[1] : 0; - $hud[$n]['html'] .= "\n"; - $hud[$n]['html'] .= "".$text['label-channels']."\n"; + $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;