added log for dtls transport-connect
This commit is contained in:
parent
fc42c79210
commit
56835d6660
13
app.js
13
app.js
@ -215,7 +215,9 @@ peers.on('connection', async socket => {
|
|||||||
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
||||||
try {
|
try {
|
||||||
const callId = socketDetails[socket.id];
|
const callId = socketDetails[socket.id];
|
||||||
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`)
|
if (typeof dtlsParameters === 'string') dtlsParameters = JSON.parse(dtlsParameters);
|
||||||
|
|
||||||
|
console.log(`[transport-connect] socket.id ${socket.id} | callId ${callId}`);
|
||||||
await videoCalls[callId].producerTransport.connect({ dtlsParameters });
|
await videoCalls[callId].producerTransport.connect({ dtlsParameters });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
|
console.log(`ERROR | transport-connect | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||||
@ -227,9 +229,11 @@ peers.on('connection', async socket => {
|
|||||||
- For the router with the id callId, we make produce on producerTransport
|
- For the router with the id callId, we make produce on producerTransport
|
||||||
- Create the handler on producer at the 'transportclose' event
|
- Create the handler on producer at the 'transportclose' event
|
||||||
*/
|
*/
|
||||||
socket.on('transport-produce', async ({ kind, rtpParameters, appData }) => {
|
socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => {
|
||||||
try {
|
try {
|
||||||
const callId = socketDetails[socket.id];
|
const callId = socketDetails[socket.id];
|
||||||
|
if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters);
|
||||||
|
|
||||||
console.log('[transport-produce] | socket.id', socket.id, '| callId', callId);
|
console.log('[transport-produce] | socket.id', socket.id, '| callId', callId);
|
||||||
videoCalls[callId].producer = await videoCalls[callId].producerTransport.produce({
|
videoCalls[callId].producer = await videoCalls[callId].producerTransport.produce({
|
||||||
kind,
|
kind,
|
||||||
@ -242,6 +246,11 @@ peers.on('connection', async socket => {
|
|||||||
console.log('transport for this producer closed', callId)
|
console.log('transport for this producer closed', callId)
|
||||||
closeCall(callId);
|
closeCall(callId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Send back to the client the Producer's id
|
||||||
|
// callback({
|
||||||
|
// id: videoCalls[callId].producer.id
|
||||||
|
// });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
|
console.log(`ERROR | transport-produce | callId ${socketDetails[socket.id]} | ${error.message}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user