diff --git a/app.js b/app.js index 189bbec..3253a26 100644 --- a/app.js +++ b/app.js @@ -158,9 +158,10 @@ peers.on('connection', async socket => { console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`) producer.on('transportclose', () => { - console.log('transport for this producer closed ') + console.log('transport for this producer closed', callId) // closeRoom(callId) producer.close() + router[callId].close() delete router[callId] }) @@ -197,7 +198,9 @@ peers.on('connection', async socket => { }) consumer.on('producerclose', () => { - console.log('producer of consumer closed') + console.log('producer of consumer closed', callId) + router[callId].close() + delete router[callId] }) // from the consumer extract the following params