LINXD-2209: Correctly close the call

This commit is contained in:
Sergiu Toma 2022-09-15 09:57:57 +03:00
parent c059dd5afc
commit a51a757d17

4
app.js
View File

@ -118,14 +118,12 @@ peers.on('connection', async socket => {
}) })
socket.on('createRoom', async ({ callId }, callback) => { socket.on('createRoom', async ({ callId }, callback) => {
console.log('[createRoom] videoCalls', videoCalls); console.log(`[createRoom] socket.id ${socket.id} callId ${callId}`);
if (!videoCalls[callId]) { if (!videoCalls[callId]) {
console.log('create room');
console.log('[createRoom] callId', callId); console.log('[createRoom] callId', callId);
videoCalls[callId] = { router: await worker.createRouter({ mediaCodecs }) } videoCalls[callId] = { router: await worker.createRouter({ mediaCodecs }) }
console.log(`[createRoom] Router ID: ${videoCalls[callId].router.id}`) console.log(`[createRoom] Router ID: ${videoCalls[callId].router.id}`)
} }
console.log('room exists', videoCalls);
socketDetails[socket.id] = callId; socketDetails[socket.id] = callId;
getRtpCapabilities(callId, callback); getRtpCapabilities(callId, callback);
}) })