diff --git a/plugin/Live/standAloneFiles/WebRTCServer/Logger.xml b/plugin/Live/standAloneFiles/WebRTCServer/Logger.xml new file mode 100644 index 000000000..1b7c8ea24 --- /dev/null +++ b/plugin/Live/standAloneFiles/WebRTCServer/Logger.xml @@ -0,0 +1,9 @@ + + + + + /var/log/ovenmediaengine + + + + \ No newline at end of file diff --git a/plugin/Live/standAloneFiles/WebRTCServer/server.php b/plugin/Live/standAloneFiles/WebRTCServer/server.php index a294a5f38..79c8c5d12 100644 --- a/plugin/Live/standAloneFiles/WebRTCServer/server.php +++ b/plugin/Live/standAloneFiles/WebRTCServer/server.php @@ -1,76 +1,82 @@ $value) { // copy all certificates into the folder if (!file_exists($value)) { echo ('WebRTCLiveCam server ERROR file does not exists ' . $value . PHP_EOL); } else { $command = "cp -Lr {$value} {$certificateFolderName}/{$key}.pem"; exec($command); } } $command = 'docker stop ' . $imageName . ' && docker rm ' . $imageName; exec($command); $path = '/var/lib/docker/volumes/ome-origin-conf/_data/'; make_path($path); $ServerXML = $path . 'Server.xml'; +$LoggerXML = $path . 'Logger.xml'; if (file_exists($ServerXML)) { $command = 'rm ' . $ServerXML; exec($command); } +if (!file_exists($LoggerXML)) { + $command = 'cp ' . dirname(__FILE__) . '/Server.xml ' . $LoggerXML; + exec($command); +} + $content = file_get_contents(dirname(__FILE__) . '/Server.xml'); $search = array('{ServerHost}', '{AccessToken}', '{OME_API_PORT}'); $replace = array($ServerHost, $AccessToken, $OME_API_PORT); file_put_contents($ServerXML, str_replace($search, $replace, $content)); $command = 'docker run -d ' . "-p {$OME_API_PORT}:{$OME_API_PORT} " //. "-p 41935:41935 " //. "-p 3333:3333 " . "-p {$OME_SOCKET_PORT}:{$OME_SOCKET_PORT} " . "-p {$OME_TCP_RELAY_ADDRESS}:{$OME_TCP_RELAY_ADDRESS} " . "-p {$OME_HLS_STREAM_PORT}:{$OME_HLS_STREAM_PORT} " //. "-p 20081:20081 " //Thumbnail . "-p {$OME_STREAM_PORT_TLS}:{$OME_STREAM_PORT_TLS} " //. "-p 9000:9000 " //. "-p 9999:9999/udp " //. "-p 4000-4005:4000-4005/udp " . "-p {$OME_ICE_CANDIDATES}:{$OME_ICE_CANDIDATES}/udp " . "--env OME_API_PORT={$OME_API_PORT} " . "--env OME_STREAM_PORT_TLS={$OME_STREAM_PORT_TLS} " . "--env OME_HLS_STREAM_PORT={$OME_HLS_STREAM_PORT} " . "--env OME_SOCKET_PORT={$OME_SOCKET_PORT} " . "--env OME_TCP_RELAY_ADDRESS='*:{$OME_TCP_RELAY_ADDRESS}' " . "--env OME_ICE_CANDIDATES='*:{$OME_ICE_CANDIDATES}/udp' " . '-v ome-origin-conf:/opt/ovenmediaengine/bin/origin_conf ' . '-v ome-edge-conf:/opt/ovenmediaengine/bin/edge_conf ' . '-v ' . $certificateFolderName . ':/cert ' //. '--name '.$imageName.' youphptube/ovenmediaengine:v1'; . '--name ' . $imageName . ' airensoft/ovenmediaengine:latest'; echo ('Execute WebRTCLiveCam server: ' . PHP_EOL . $command . PHP_EOL); exec($command);