Compare commits
9 Commits
LINXD-2197
...
dtls-test
Author | SHA1 | Date | |
---|---|---|---|
0c713ed286 | |||
817781085f | |||
a95c29659e | |||
5d451d961f | |||
1d47d02792 | |||
8ac58f0d9d | |||
fc42c79210 | |||
d81bc8582d | |||
de1458bbde |
15
app.js
15
app.js
@ -204,7 +204,7 @@ peers.on('connection', async socket => {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`ERROR | createWebRtcTransport | callId ${callId} | sender ${sender} | ${error.message}`);
|
||||
console.log(`ERROR | createWebRtcTransport | callId ${socketDetails[socket.id]} | sender ${sender} | ${error.message}`);
|
||||
}
|
||||
});
|
||||
|
||||
@ -215,10 +215,14 @@ peers.on('connection', async socket => {
|
||||
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
||||
try {
|
||||
const callId = socketDetails[socket.id];
|
||||
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`)
|
||||
// console.log('🔴 typeof dtlsParameters', typeof dtlsParameters);
|
||||
// console.log('🟢 dtlsParameters', JSON.parse(dtlsParameters));
|
||||
// console.log('🟡 dtlsParameters', dtlsParameters);
|
||||
if (typeof dtlsParameters === 'string') dtlsParameters = JSON.parse(dtlsParameters);
|
||||
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`);
|
||||
await videoCalls[callId].producerTransport.connect({ dtlsParameters });
|
||||
} catch (error) {
|
||||
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.stack}`);
|
||||
}
|
||||
});
|
||||
|
||||
@ -314,7 +318,7 @@ peers.on('connection', async socket => {
|
||||
console.log(`[canConsume] Can't consume | callId ${callId}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`ERROR | consume | callId ${callId} | ${error.message}`)
|
||||
console.log(`ERROR | consume | callId ${socketDetails[socket.id]} | ${error.message}`)
|
||||
callback({ params: { error } });
|
||||
}
|
||||
});
|
||||
@ -381,6 +385,7 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
||||
dtlsParameters: transport.dtlsParameters,
|
||||
};
|
||||
|
||||
console.log(`createWebRtcTransportLayer | params.dtlsParameters ${params.dtlsParameters}`);
|
||||
// Send back to the client the params
|
||||
callback({ params });
|
||||
|
||||
@ -388,7 +393,7 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
||||
return transport;
|
||||
|
||||
} catch (error) {
|
||||
console.log(`ERROR | createWebRtcTransportLayer | callId ${callId} | ${error.message}`);
|
||||
console.log(`ERROR | createWebRtcTransportLayer | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||
callback({ params: { error } });
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user