diff --git a/src/streaming/Auth/StreamAuth.php b/src/streaming/Auth/StreamAuth.php index b3104192..2ad0f382 100644 --- a/src/streaming/Auth/StreamAuth.php +++ b/src/streaming/Auth/StreamAuth.php @@ -11,7 +11,8 @@ */ class StreamAuth { - public static function checkAccess($rServers, $rSettings, $rUserInfo, $rUserIP, $rCountryCode, $rUserISP = '') { + public static function checkAccess($rUserInfo, $rUserIP, $rCountryCode, $rUserISP = '') { + global $rServers; $rAvailableServers = array(); foreach ($rServers as $rServerID => $rServerInfo) { if ($rServerInfo['server_online'] && $rServerInfo['server_type'] == 0) { @@ -88,15 +89,13 @@ class StreamAuth { public static function validateConnections($rUserInfo, $rIsHMAC = false, $rIdentifier = '', $rIP = null, $rUserAgent = null) { if ($rUserInfo['max_connections'] != 0) { - global $rSettings, $rServers; - $redis = RedisManager::instance(); if (!$rIsHMAC) { if (!empty($rUserInfo['pair_id'])) { - ConnectionLimiter::closeConnections($redis, $rSettings, $rServers, $rUserInfo['pair_id'], $rUserInfo['max_connections'], null, '', $rIP, $rUserAgent); + ConnectionLimiter::closeConnections($rUserInfo['pair_id'], $rUserInfo['max_connections'], null, '', $rIP, $rUserAgent); } - ConnectionLimiter::closeConnections($redis, $rSettings, $rServers, $rUserInfo['id'], $rUserInfo['max_connections'], null, '', $rIP, $rUserAgent); + ConnectionLimiter::closeConnections($rUserInfo['id'], $rUserInfo['max_connections'], null, '', $rIP, $rUserAgent); } else { - ConnectionLimiter::closeConnections($redis, $rSettings, $rServers, null, $rUserInfo['max_connections'], $rIsHMAC, $rIdentifier, $rIP, $rUserAgent); + ConnectionLimiter::closeConnections(null, $rUserInfo['max_connections'], $rIsHMAC, $rIdentifier, $rIP, $rUserAgent); } } } diff --git a/src/streaming/Balancer/ProxySelector.php b/src/streaming/Balancer/ProxySelector.php index 676911be..4d9844cd 100644 --- a/src/streaming/Balancer/ProxySelector.php +++ b/src/streaming/Balancer/ProxySelector.php @@ -11,7 +11,8 @@ */ class ProxySelector { - public static function availableProxy($rServers, $rProxies, $rCountryCode, $rUserISP = '', $rSettings = null) { + public static function availableProxy($rProxies, $rCountryCode, $rUserISP = '') { + global $rServers; if (empty($rProxies)) { return null; } diff --git a/src/streaming/Delivery/OffAirHandler.php b/src/streaming/Delivery/OffAirHandler.php index d97bdc3d..5c655199 100644 --- a/src/streaming/Delivery/OffAirHandler.php +++ b/src/streaming/Delivery/OffAirHandler.php @@ -11,7 +11,8 @@ */ class OffAirHandler { - public static function getOffAirVideo($rSettings, $rPathKey) { + public static function getOffAirVideo($rPathKey) { + global $rSettings; if (!(isset($rSettings[$rPathKey]) && 0 < strlen($rSettings[$rPathKey]))) { switch ($rPathKey) { case 'connected_video_path': @@ -45,8 +46,9 @@ class OffAirHandler { } } - public static function showVideoServer($rSettings, $rServers, $rShowOptionKey, $rVideoPathKey, $rExtension, $rUserInfo, $rIP, $rCountryCode, $rISP, $rServerID = null, $rProxyID = null) { - $rVideoPath = self::getOffAirVideo($rSettings, $rVideoPathKey); + public static function showVideoServer($rShowOptionKey, $rVideoPathKey, $rExtension, $rUserInfo, $rIP, $rCountryCode, $rISP, $rServerID = null, $rProxyID = null) { + global $rSettings, $rServers; + $rVideoPath = self::getOffAirVideo($rVideoPathKey); if (!(!$rUserInfo['is_restreamer'] && $rSettings[$rShowOptionKey] && 0 < strlen($rVideoPath))) { switch ($rShowOptionKey) { case 'show_expired_video': @@ -64,7 +66,7 @@ class OffAirHandler { } } if (!$rServerID) { - $rServerID = StreamAuth::checkAccess($rServers, $rSettings, $rUserInfo, $rIP, $rCountryCode, $rISP); + $rServerID = StreamAuth::checkAccess($rUserInfo, $rIP, $rCountryCode, $rISP); } if (!$rServerID) { $rServerID = SERVER_ID; @@ -72,7 +74,7 @@ class OffAirHandler { $rOriginatorID = null; if ($rServers[$rServerID]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy'])) { $rProxies = ConnectionTracker::getProxies($rServerID); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); if (!$rProxyID) { generate404(); } diff --git a/src/streaming/Protection/ConnectionLimiter.php b/src/streaming/Protection/ConnectionLimiter.php index a3bfd9c3..56f23268 100644 --- a/src/streaming/Protection/ConnectionLimiter.php +++ b/src/streaming/Protection/ConnectionLimiter.php @@ -13,16 +13,12 @@ class ConnectionLimiter { public static function writeOfflineActivity($rServerID, $rProxyID, $rUserID, $rStreamID, $rStart, $rUserAgent, $rIP, $rExtension, $rGeoIP, $rISP, $rExternalDevice = '', $rDivergence = 0, $rIsHMAC = null, $rIdentifier = '') { global $rSettings; - if ($rSettings['save_closed_connection'] != 0) { - if ($rServerID && $rUserID && $rStreamID) { - $rActivityInfo = array('user_id' => intval($rUserID), 'stream_id' => intval($rStreamID), 'server_id' => intval($rServerID), 'proxy_id' => intval($rProxyID), 'date_start' => intval($rStart), 'user_agent' => $rUserAgent, 'user_ip' => htmlentities($rIP), 'date_end' => time(), 'container' => $rExtension, 'geoip_country_code' => $rGeoIP, 'isp' => $rISP, 'external_device' => htmlentities($rExternalDevice), 'divergence' => intval($rDivergence), 'hmac_id' => $rIsHMAC, 'hmac_identifier' => $rIdentifier); - file_put_contents(LOGS_TMP_PATH . 'activity', base64_encode(json_encode($rActivityInfo)) . "\n", FILE_APPEND | LOCK_EX); - } - } + ConnectionTracker::writeOfflineActivity($rSettings, intval($rServerID), intval($rProxyID ?? 0), intval($rUserID), intval($rStreamID), intval($rStart), strval($rUserAgent), strval($rIP), strval($rExtension), strval($rGeoIP), strval($rISP), $rExternalDevice, intval($rDivergence), $rIsHMAC, $rIdentifier); } - public static function closeConnections($redis, $rSettings, $rServers, $rUserID, $rMaxConnections, $rIsHMAC = null, $rIdentifier = '', $rIP = null, $rUserAgent = null) { - global $db; + public static function closeConnections($rUserID, $rMaxConnections, $rIsHMAC = null, $rIdentifier = '', $rIP = null, $rUserAgent = null) { + global $rSettings, $rServers, $db; + $redis = RedisManager::instance(); if ($rSettings['redis_handler']) { $rConnections = array(); $rKeys = ConnectionTracker::getLineConnections($rUserID, true, true); @@ -73,7 +69,7 @@ class ConnectionLimiter { if ($rKilled != $rToKill) { if ($rConnections[$i]['pid'] != getmypid()) { if ($rConnections[$i]['user_ip'] == $rIP && $rConnections[$i]['user_agent'] == $rUserAgent && $rKillOwnIP == 2 || $rConnections[$i]['user_ip'] == $rIP && $rKillOwnIP == 1 || $rKillOwnIP == 0) { - if (self::closeConnection($redis, $rSettings, $rServers, $rConnections[$i])) { + if (self::closeConnection($rConnections[$i])) { $rKilled++; if ($rConnections[$i]['container'] != 'hls') { if ($rSettings['redis_handler']) { @@ -136,8 +132,9 @@ class ConnectionLimiter { return $rKilled; } - public static function closeConnection($redis, $rSettings, $rServers, $rActivityInfo) { - global $db; + public static function closeConnection($rActivityInfo) { + global $rSettings, $rServers, $db; + $redis = RedisManager::instance(); if (empty($rActivityInfo)) { return false; } diff --git a/src/www/stream/auth.php b/src/www/stream/auth.php index 9508b65c..4b7c78e6 100644 --- a/src/www/stream/auth.php +++ b/src/www/stream/auth.php @@ -157,7 +157,7 @@ if ($rExtension) { } if (count($rAvailableServers) == 0) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_not_on_air_video', 'not_on_air_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], defined('SERVER_ID') ? SERVER_ID : 0); + OffAirHandler::showVideoServer('show_not_on_air_video', 'not_on_air_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], defined('SERVER_ID') ? SERVER_ID : 0); } } @@ -262,10 +262,10 @@ if ($rExtension) { DatabaseLogger::clientLog($rStreamID, $rUserInfo['id'], 'USER_EXPIRED', $rIP); if (in_array($rType, array('live', 'timeshift'))) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_expired_video', 'expired_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_expired_video', 'expired_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } else { if (in_array($rType, array('movie', 'series'))) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_expired_video', 'expired_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_expired_video', 'expired_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } else { generateError('EXPIRED'); } @@ -276,10 +276,10 @@ if ($rExtension) { DatabaseLogger::clientLog($rStreamID, $rUserInfo['id'], 'USER_BAN', $rIP); if (in_array($rType, array('live', 'timeshift'))) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_banned_video', 'banned_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_banned_video', 'banned_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } else { if (in_array($rType, array('movie', 'series'))) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_banned_video', 'banned_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_banned_video', 'banned_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } else { generateError('BANNED'); } @@ -290,10 +290,10 @@ if ($rExtension) { DatabaseLogger::clientLog($rStreamID, $rUserInfo['id'], 'USER_DISABLED', $rIP); if (in_array($rType, array('live', 'timeshift'))) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_banned_video', 'banned_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_banned_video', 'banned_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } else { if (in_array($rType, array('movie', 'series'))) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_banned_video', 'banned_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_banned_video', 'banned_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } else { generateError('DISABLED'); } @@ -409,7 +409,7 @@ if ($rExtension) { $db->query('UPDATE `lines` SET `last_expiration_video` = ? WHERE `id` = ?;', time(), $rUserInfo['id']); } - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_expiring_video', 'expiring_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_expiring_video', 'expiring_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } } } else { @@ -443,7 +443,7 @@ if ($rExtension) { if (($rServers[$rChannelInfo['redirect_id']]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy']))) { $rProxies = ConnectionTracker::getProxies($rChannelInfo['redirect_id']); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); if (!$rProxyID) { generateError('NO_SERVERS_AVAILABLE'); @@ -478,8 +478,7 @@ if ($rExtension) { if (($rServers[$rAdaptiveInfo['redirect_id']]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy']))) { $rProxies = ConnectionTracker::getProxies($rAdaptiveInfo['redirect_id']); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); - + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); if (!$rProxyID) { generateError('NO_SERVERS_AVAILABLE'); } @@ -516,7 +515,7 @@ if ($rExtension) { exit(); } - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_not_on_air_video', 'not_on_air_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], ($rChannelInfo['originator_id'] ?? $rChannelInfo['redirect_id']), (!empty($rChannelInfo['originator_id']) ? $rChannelInfo['redirect_id'] : null)); + OffAirHandler::showVideoServer('show_not_on_air_video', 'not_on_air_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], ($rChannelInfo['originator_id'] ?? $rChannelInfo['redirect_id']), (!empty($rChannelInfo['originator_id']) ? $rChannelInfo['redirect_id'] : null)); exit(); } else { @@ -562,7 +561,7 @@ if ($rExtension) { exit(); } } else { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_not_on_air_video', 'not_on_air_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_not_on_air_video', 'not_on_air_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); } break; @@ -574,7 +573,7 @@ if ($rExtension) { if ($rChannelInfo) { if (($rServers[$rChannelInfo['redirect_id']]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy']))) { $rProxies = ConnectionTracker::getProxies($rChannelInfo['redirect_id']); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); if (!$rProxyID) { generateError('NO_SERVERS_AVAILABLE'); @@ -613,7 +612,7 @@ if ($rExtension) { exit(); } - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_not_on_air_video', 'not_on_air_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_not_on_air_video', 'not_on_air_video_path', 'ts', $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); break; @@ -622,18 +621,14 @@ if ($rExtension) { $rRedirectID = StreamRedirector::redirectStream($rCached, $rSettings, $rServers, $rStreamID, $rExtension, $rUserInfo, $rCountryCode, $rUserInfo['con_isp_name'], 'archive'); if (!$rRedirectID) { - OffAirHandler::showVideoServer($rSettings, $rServers, 'show_not_on_air_video', 'not_on_air_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); + OffAirHandler::showVideoServer('show_not_on_air_video', 'not_on_air_video_path', $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo['con_isp_name'], SERVER_ID); break; } if (($rServers[$rChannelInfo['redirect_id']]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy']))) { $rProxies = ConnectionTracker::getProxies($rChannelInfo['redirect_id']); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); - - if (!$rProxyID) { - generateError('NO_SERVERS_AVAILABLE'); - } + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); $rOriginatorID = $rChannelInfo['redirect_id']; $rRedirectID = $rProxyID; @@ -708,7 +703,7 @@ if ($rExtension) { if (($rServers[$rStreamInfo['info']['vframes_server_id']]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy']))) { $rProxies = ConnectionTracker::getProxies($rStreamInfo['info']['vframes_server_id']); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); if (!$rProxyID) { generateError('THUMBNAILS_NOT_ENABLED'); @@ -730,7 +725,7 @@ if ($rExtension) { if ($rChannelInfo) { if (($rServers[$rChannelInfo['redirect_id']]['enable_proxy'] && (!$rUserInfo['is_restreamer'] || !$rSettings['restreamer_bypass_proxy']))) { $rProxies = ConnectionTracker::getProxies($rChannelInfo['redirect_id']); - $rProxyID = ProxySelector::availableProxy($rServers, array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name'], $rSettings); + $rProxyID = ProxySelector::availableProxy(array_keys($rProxies), $rCountryCode, $rUserInfo['con_isp_name']); if (!$rProxyID) { generateError('NO_SERVERS_AVAILABLE'); diff --git a/src/www/stream/live.php b/src/www/stream/live.php index 5822a77b..4958d283 100644 --- a/src/www/stream/live.php +++ b/src/www/stream/live.php @@ -115,7 +115,7 @@ if ($rChannelInfo) { if (!$rChannelInfo["monitor_pid"]) { // print('show_not_on_air_video_1'); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } for ($rRetries = 0; !AsyncFileOperations::awaitFileExists(STREAMS_PATH . intval($rStreamID) . "_.pid", 1, 10) && $rRetries < 300; $rRetries++) { @@ -125,7 +125,7 @@ if ($rChannelInfo) { if (!$rChannelInfo["pid"]) { // print('show_not_on_air_video_2'); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } } else { if (!empty($rChannelInfo["proxy"])) { @@ -140,13 +140,13 @@ if ($rChannelInfo) { if (!$rChannelInfo["monitor_pid"]) { // print('show_not_on_air_video_3'); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } $rChannelInfo["pid"] = $rChannelInfo["monitor_pid"]; } else { // print('show_not_on_air_video_4'); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } } } @@ -168,7 +168,7 @@ if ($rChannelInfo) { } else { // Verify stream is still running if (!(ProcessManager::isMonitorAlive($rChannelInfo["monitor_pid"], $rStreamID) && ProcessManager::isStreamAlive($rChannelInfo["pid"], $rStreamID))) { - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } } } @@ -219,7 +219,7 @@ if ($rChannelInfo) { if ($rAcceptIP && !$rIPMatch) { DatabaseLogger::clientLog($rStreamID, $rUserInfo["id"], "USER_ALREADY_CONNECTED", $rIP); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_connected_video", "connected_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_connected_video", "connected_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } } @@ -306,7 +306,7 @@ if ($rChannelInfo) { echo $rHLS; } else { // print('show_not_on_air_video_6'); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } exit(); @@ -638,5 +638,5 @@ if ($rChannelInfo) { } } else { // print('show_not_on_air_video_7'); - OffAirHandler::showVideoServer($rSettings, $rServers, "show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); + OffAirHandler::showVideoServer("show_not_on_air_video", "not_on_air_video_path", $rExtension, $rUserInfo, $rIP, $rCountryCode, $rUserInfo["con_isp_name"], $rServerID, $rProxyID); } diff --git a/src/www/stream/rtmp.php b/src/www/stream/rtmp.php index 45fe7e0d..41982518 100644 --- a/src/www/stream/rtmp.php +++ b/src/www/stream/rtmp.php @@ -252,7 +252,7 @@ if (!($_GET['addr'] == '127.0.0.1' && $_GET['call'] == 'publish')) { $rDeny = false; if ($rSettings['redis_handler']) { - ConnectionLimiter::closeConnection(RedisManager::instance(), $rSettings, $rServers, md5($rRequest['clientid'])); + ConnectionLimiter::closeConnection(md5($rRequest['clientid'])); } else { ConnectionLimiter::closeRTMP($rRequest['clientid']); }