Compare commits

..

6 Commits

Author SHA1 Message Date
0c713ed286 Added logs 2022-09-29 18:26:59 +03:00
817781085f Added logs 2022-09-29 18:23:47 +03:00
a95c29659e Added logs 2022-09-29 18:07:32 +03:00
5d451d961f Added logs 2022-09-29 17:50:51 +03:00
1d47d02792 Added logs 2022-09-29 16:42:21 +03:00
8ac58f0d9d added log for dtls transport-connect 2022-09-29 14:24:44 +03:00

16
app.js
View File

@ -215,12 +215,14 @@ peers.on('connection', async socket => {
socket.on('transport-connect', async ({ dtlsParameters }) => {
try {
const callId = socketDetails[socket.id];
// 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}`);
}
});
@ -229,11 +231,9 @@ peers.on('connection', async socket => {
- For the router with the id callId, we make produce on producerTransport
- Create the handler on producer at the 'transportclose' event
*/
socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => {
socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => {
try {
const callId = socketDetails[socket.id];
if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters);
console.log('[transport-produce] | socket.id', socket.id, '| callId', callId);
videoCalls[callId].producer = await videoCalls[callId].producerTransport.produce({
kind,
@ -246,11 +246,6 @@ peers.on('connection', async socket => {
console.log('transport for this producer closed', callId)
closeCall(callId);
});
// Send back to the client the Producer's id
// callback({
// id: videoCalls[callId].producer.id
// });
} catch (error) {
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
}
@ -390,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 });