Issues with 2 users joining room

Hello,

I have a random voice chat app where users can join, hit start call, and be matched with eachother for voice chat. I’m using NodeJS for server backend, and Digital Ocean Droplet to host it all. Janus is already configured and installed, etc. I’m utilizing the Audiobridge plugin. However, on my frontend console I see this:

Initializing library
janus.js:584 Library initialized: true
janus.js:604 Using WebSockets to contact Janus: wss://rizztalk.live/janus
janus.js:1034 Created session: 6713604597526425
client.js:79 Janus initialized successfully
client.js:13 Start call clicked
client.js:42 Incoming call from: IJX4E05bZwXGDSWaAAAR in room: 119765
janus.js:1332 Created handle: 2295828950316479
client.js:100 Joined room: undefined
janus.js:2082 Deprecated media object passed, use tracks instead. Automatically translated to: [{…}]
prepareWebrtc @ janus.js:2082
createOffer @ janus.js:1377
(anonymous) @ client.js:125
Promise.then
publishOwnFeed @ client.js:124
success @ client.js:101
(anonymous) @ janus.js:1580
handleEvent @ janus.js:760
message @ janus.js:1043Understand this warning
janus.js:1923 Creating PeerConnection
janus.js:1930 Preparing local SDP and gathering candidates (trickle=true)
janus.js:2197 Creating offer (iceDone=false)
janus.js:2215 Setting local description
client.js:132 Publishing own feed

So I believe a “room” is created, but the users aren’t being placed in the room , thus no audio is heard from either party. Microphone permissions work fine etc. Just trying to understand what I’m doing wrong here. Thanks in advance!

Btw, here’s a snippet of my server.js code:

async function createJanusSession() {
  try {
    const session = await janus.createSession();
    const plugin = await session.attachPlugin('janus.plugin.audiobridge');
    return { session, plugin };
  } catch (error) {
    console.error('Error creating Janus session:', error);
    throw error;
  }
}

async function createJanusRoom(plugin, roomId) {
    try {
      const response = await plugin.sendWithTransaction({
        body: { request: 'create', room: roomId, description: `Room ${roomId}`, secret: 'roomsecret' }
      });
      console.log('Room creation response:', response);
      return response;
    } catch (error) {
      console.error('Error creating Janus room:', error);
      throw error;
    }
  }

async function matchUsers(userId) {
  const partnerId = await redisClient.rPop('waitingUsers');
  
  if (partnerId) {
    // If a partner is found, initiate the call
    const roomId = Math.floor(Math.random() * 1000000);
    io.to(userId).emit('callInitiated', { partnerId, roomId });
    io.to(partnerId).emit('incomingCall', { callerId: userId, roomId });
    return true;
  } else {
    // If no partner is found, add the current user to the queue
    await redisClient.lPush('waitingUsers', userId);
    io.to(userId).emit('waitingForMatch');
    return false;
  }
}

Use the Admin API to figure out if PeerConnections aren’t being established for any reason: