diff --git a/objects/functionsExec.php b/objects/functionsExec.php index 6181ed78d65e..d498cf5d4b2c 100644 --- a/objects/functionsExec.php +++ b/objects/functionsExec.php @@ -331,12 +331,15 @@ function isPortOpenInternal($host, $port) { } function isPortOpenExternal($port) { + global $isPortOpenExternalResponse; $ports = array($port); //postVariables($url, $array, $httpcodeOnly = true, $timeout = 10) + $isPortOpenExternalResponse = new stdClass(); $response = postVariables('https://search.ypt.me/checkPorts.json.php', $ports, false, 4); if(!empty($response)){ $json = json_decode($response); if(!empty($json)){ + $isPortOpenExternalResponse = $json; $json->ports[0]->isOpen; } } diff --git a/plugin/WebRTC/WebRTC.php b/plugin/WebRTC/WebRTC.php index cf95a386af16..bad059d03dc7 100644 --- a/plugin/WebRTC/WebRTC.php +++ b/plugin/WebRTC/WebRTC.php @@ -103,13 +103,18 @@ static function getWebRTC2RTMPFile(){ return "{$global['systemRootPath']}plugin/WebRTC/WebRTC2RTMP"; } + static function getWebRTC2RTMPLogFile(){ + global $global; + return "{$global['systemRootPath']}videos/WebRTC2RTMP.log"; + } + static function startServer() { _error_log('Starting WebRTC Server'); global $global; $obj = AVideoPlugin::getDataObject('WebRTC'); $file = self::getWebRTC2RTMPFile(); - $log = "{$global['systemRootPath']}videos/WebRTC2RTMP.log"; + $log = self::getWebRTC2RTMPLogFile(); $command = "{$file} --port={$obj->port} > $log "; // Check if the file has executable permissions diff --git a/plugin/WebRTC/status.json.php b/plugin/WebRTC/status.json.php index 1510b218685b..6c7912bf05a1 100644 --- a/plugin/WebRTC/status.json.php +++ b/plugin/WebRTC/status.json.php @@ -15,6 +15,7 @@ $obj['is_executable'] = is_executable($file); $obj['portOpenInternally'] = isPortOpenInternal('localhost', $objP->port) ; $obj['portOpenExternally'] = isPortOpenExternal($objP->port); +$obj['portOpenExternallyResponse'] = $isPortOpenExternalResponse; $obj['file'] = $file; $obj['file_exists'] = file_exists($file); echo json_encode($obj);