Mediasoup - Users Cannot Join Room (Media Blocked)

Hi everyone,

I’m using mediasoup in an Express project to build a video conferencing application.
Sometimes, I’m facing an issue where some users cannot join the room. The media connection is blocked, likely due to firewall restrictions.

I use my own signaling server with coturn running on it.

If I’ve understood correctly, in Mediasoup, the iceServers parameter is used when creating a client-side WebRTC transport. It is used to configure the STUN/TURN servers that help establish a connection between the client and the mediasoup server.
STUN/TURN helps clients to establish a connection despite NAT/Firewalls.

Do you have any ideas? Thanks !

First you create the server side WebRtcTransport for the client (sending or receiving transport). You signal it’s information (including transport.iceCandidates) to the client. And in the client you create the sending or receiving transport by passing that server side info plus TURN URLs and credentials (iceServers field), being TURN stuff something completely independent from mediasoup server side.

Thanks for your response! This is how I implemented it on the frontend:

const transportInfo = await this._protoo?.request('createWebRtcTransport', {
  forceTcp: this._forceTcp,
  producing: true,
  consuming: false,
  sctpCapabilities: this._useDataChannel
    ? this._mediasoupDevice.sctpCapabilities
    : undefined,
})

const { id, iceParameters, iceCandidates, dtlsParameters, sctpParameters } =
  transportInfo

this._sendTransport = this._mediasoupDevice.createSendTransport({
  id,
  iceParameters,
  iceCandidates,
  dtlsParameters,
  sctpParameters,
  iceServers: ICE_SERVERS,
  proprietaryConstraints: PC_PROPRIETARY_CONSTRAINTS,
})

I’m including iceServers: ICE_SERVERS when creating the send transport. Does this look correct, or is there something missing that could help with connectivity issues behind NAT/firewalls?

In theory it looks ok.

1 Like

Thanks, so the problem I’m having is with my turn/stun server configuration?

I cannot assume that