Hi
I’m trying to deploy openvidu 2.25 in a local network by means of the docker. I know this is not recommended for production, but for now I’m just trying to make it work.
I just need some cameras to send a stream to OpenVidu and the latter to make it available to clients.
Back-end side I’m using Postman to send requests to OpenVidu server. I can successfully create a session, an IPCAM connection and a WEBRTC connection, and have the token returned back.
Client side (client is running on the pc where also back-end server and open-vidu server run) for now I just use an hard-coded token to connect. Client side I’ve used the code from github hello world example, I’ve just modified the javascript in order to have it directly perform the connection, since it already has the token.
My javascript is therefore the following:
function joinSession() {
var mySessionId = document.getElementById("sessionId").value;
OV = new OpenVidu();
session = OV.initSession();
session.on("streamCreated", function (event) {
session.subscribe(event.stream, "subscriber");
});
let token = "ws://localhost:4443?sessionId=CUSTOM_SESSION_ID&token=tok_RAkTTRY0bm78AoVq";
session.connect(token)
.then(() => {
document.getElementById("session-header").innerText = mySessionId;
document.getElementById("join").style.display = "none";
document.getElementById("session").style.display = "block";
})
.catch(error => {
console.log("There was an error connecting to the session:", error.code, error.message);
});
}
Now, when I launch the client and I click JOIN, some connection step are executed but then I’ve a timeout on streamPlaying:
StreamManager of Stream [...] (Subscriber) did not trigger "streamPlaying" event in 4000 ms.
I’ll post what I think is the relevant part of the console log:
OpenVidu initialized OpenViduLogger.ts:246:43
openvidu-browser version: 2.25.0 OpenViduLogger.ts:246:43
STUN/TURN server IP: turn:localhost:3478 OpenViduLogger.ts:225:42
TURN credentials [1675175946:Deuq9NRw:FsFCRd8uBVk8E+LUCDwXXZWzKtk=] OpenViduLogger.ts:225:42
openvidu-server version: 2.25.0 OpenViduLogger.ts:246:43
'Connection' created (local) OpenViduLogger.ts:246:43
Remote 'Connection' with 'connectionId' [ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp] is now configured for receiving Streams with options:
Object { id: "str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp", createdAt: 1675088217690, connection: {…}, hasAudio: true, hasVideo: true, audioActive: true, videoActive: true, typeOfVideo: "IPCAM", frameRate: undefined, videoDimensions: undefined, … }
OpenViduLogger.ts:246:43
'Connection' created (remote) with 'connectionId' [ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp] OpenViduLogger.ts:246:43
Subscribing to ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp OpenViduLogger.ts:246:43
'Subscriber' (str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp) successfully subscribed OpenViduLogger.ts:246:43
Subscribed correctly to ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp OpenViduLogger.ts:246:43
IceConnectionState of RTCPeerConnection ccbd5f5b-a230-4661-83f7-93188365626b (str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp) change to "checking" OpenViduLogger.ts:225:42
StreamManager of Stream str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp (Subscriber) did not trigger "streamPlaying" event in 4000 ms OpenViduLogger.ts:257:39
WebRTC: ICE failed, add a STUN server and see about:webrtc for more details
IceConnectionState of RTCPeerConnection ccbd5f5b-a230-4661-83f7-93188365626b (str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp) to "failed" OpenViduLogger.ts:267:40
[ICE_CONNECTION_FAILED] Handling ICE_CONNECTION_FAILED event. Reconnecting stream str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp (Subscriber) OpenViduLogger.ts:225:42
[ICE_CONNECTION_FAILED] Reconnecting stream str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp (Subscriber) after event ICE_CONNECTION_FAILED OpenViduLogger.ts:225:42
[ICE_CONNECTION_FAILED] Trying to reconnect stream str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp (Subscriber) and the websocket is opened OpenViduLogger.ts:225:42
Inbound RTCPeerConnection with id [ccbd5f5b-a230-4661-83f7-93188365626b] from 'Stream' with id [str_IPC_RPzs_ipc_IPCAM_rtsp_DVGC_192_168_0_250_axismedia_media_amp] is now closed
Do you have any advice?
I’ve checked a couple of similar topics and they mentioned ICE/TURN server not being allowed through firewall. I’ve just temporarily deactivated firewall on my PC, but I still have the problem. Furthermore, since I need the program to run in local network only, I could just use a local ICE/TURN server, if that’s the problem. I don’t know how to do it, however.
Thanks,
Alessandro.