Refactor transportclose 18

This commit is contained in:
Sergiu Toma 2022-08-12 14:56:20 +03:00
parent 7a564d4a61
commit 89ee1f301a

4
app.js
View File

@ -238,6 +238,7 @@ peers.on('connection', async socket => {
const createWebRtcTransportLayer = async (callId, callback) => { const createWebRtcTransportLayer = async (callId, callback) => {
try { try {
console.log('[createWebRtcTransportLayer] callId', callId);
// https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions // https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions
const webRtcTransport_options = { const webRtcTransport_options = {
listenIps: [ listenIps: [
@ -251,6 +252,8 @@ const createWebRtcTransportLayer = async (callId, callback) => {
preferUdp: true, preferUdp: true,
} }
console.log('webRtcTransport_options', webRtcTransport_options);
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport // https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport
let transport = await router[callId].createWebRtcTransport(webRtcTransport_options) let transport = await router[callId].createWebRtcTransport(webRtcTransport_options)
console.log(`callId: ${callId} | transport id: ${transport.id}`) console.log(`callId: ${callId} | transport id: ${transport.id}`)
@ -279,6 +282,7 @@ const createWebRtcTransportLayer = async (callId, callback) => {
return transport return transport
} catch (error) { } catch (error) {
console.log('[createWebRtcTransportLayer] ERROR', JSON.stringify(error));
callback({ callback({
params: { params: {
error: error error: error