P2P not working on self hosted install

Greetings,

I just did a new self hosted install on WSL Ubuntu 20.04. The install is behind a Linksys router. I followed the guide for the install. The only things to note was I changed the ports in the nginx configuration from port 80 and 443, and I didn’t use let’s encrypt.

All media connections work with 2 or more people (yes I realize P2P is for < 3 participants) . However, for the connection type, it appears its always going through the JVB on port 10000. P2P always fails. I do not have that problem when starting meetings from https://meet.jit.si/ , when using the same two peer computers.

I started to try to study the console logs on the clients and noticed when I used https://meet.jit.si/ , the STUN servers listed are three Google addresses, whereas the default install for Jitsi Meet included a jitsi.net address. So I changed my config.js to use those three same Google Stun servers instead, but that didn’t change anything.

I noticed when using https://meet.jit.si, that modules/xmpp/JingleSessionPC.js] <w.sendIceCandidates> includes an entry with my public IP address properly included (which you would expect for it to work), whereas my self hosted application does not - I only see my LAN IP address. I assume this is why the P2P can’t be established.

Can anyone tell me why that might be?

Thanks,
Scott

Did you deploy a TURN server? That is needed in order for P2P to work always. Otherwise it may only work in certain network conditions due to NAT. If you used our Debian packages, there is a jitsi-meet-turnserver package (IIRC) which you can use.

Hi Saúl - I followed the quick start instructions and followed that page only: https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart

I’m just trying to get P2P to work. Is a Turn server really needed? Direct P2P in both directions where (Turn) isn’t used. It seems the jvb handles all my needs for participants > 2.

I tried to get coturn running following every piece of information I could find in the forums and doc. When I added the useStunTurn: true to my config.js, the main page was blank grey and failed to load any content.

It looks like my peers are trying to negotiate P2P mode based on the console log, but the candidates being generated for my install don’t match what I see when I visit meet.jit.si. Isn’t that a issue with Stun? Doesn’t it have to be talking to a stun server to be generating candidates? Why are there stun servers listed in the config.js, but when I look at chrome://webrtc-internals, the stun server is the one that seemingly comes from the prosody xmpp configuration anyway? Even when I don’t set useStunTurn?

Thank,
Scott

Since these forums have seemingly become the larger source of documentation for Jitsi Meet over the formal documentation itself, I am going to report my findings here and still follow with the question I asked above.

P2P mode can work without a Turn server. Once I put a valid stun server in /etc/prosody/conf.avail/MYHOST.cfg.lua , my clients were able to negotiate direct P2P connections.

I was asking above because that is pretty confusing considering the config.js file seems to document the place were you can enter the stun servers, but these don’t seem to be used in any manner. Even when useStunTurn wasn’t set. I didn’t have a valid turn or turns server in MYHOST.cfg.lua file and P2P worked fine when the networks allowed it. If it fails, it falls back to the jvb, which is fine for me.

-Scott

2 Likes

@Digital1955 I am finding myself in the same situation as you. Would you please share what exactly you added/updated in the /etc/prosody/conf.avail/MYHOST.cfg.lua config and whether or not you had to setup an STUN server and the details of that.

Thank you so much in advance!!!

I am far from an expert here, so I am sure you might get other opinions regarding what is most secure / correct.

turncredentials = {
{ type = “stun”, host = “stun.l.google.com”, port = “19302” },

This is a public Google Stun server that seems OK. It’s fine for my usage. So no I don’t run my own Stun server.

The success rate at getting a constant P2P connection is a mysterious thing. Its normally about 85% successful for me. I can always rejoin the session a few times and get it to use P2P. I’d be interested in knowing how many attempts the Jitsi Meet code makes at negotiating P2P. Seems to me like it’s just once because I can frequently rejoin and get P2P to work when it fails.

Make sure P2P works most of the time when you use the meet.jit.si servers. This is about all I can add.

-Scott

Thank you!

I fall in trouble with the following settings:

  1. useStunTurn: false (inside config.js)
  2. p2p: true (inside config.js)
  3. stunServers: [{ urls: ‘stun:<my_domain>:6349’, username: ‘12345’, credential: ‘12345’, password: ‘12345’ }] (inside config.js)
  4. stopped videobridge (I want to only test p2p calls)
  5. no TURN credential is configured in the XMPP server.

Coturn works well. I’ve tested here.
I disabled useStunTurn so that the client doesn’t try to fetch STUN server’s address and credential from the XMPP server and instead use hardcoded credentials in stunServers (Currently security is not a matter). I also stopped videobridge because it’s not needed for p2p calls. With the mentioned configuration, p2p calls don’t work. Although useStunTurn: false, the client still tries to fetch credentials from XMPP server. These are the logs in the client console:

Logger.js:154 2021-05-20T13:58:32.173Z [modules/xmpp/strophe.jingle.js] getting turn credentials failed <iq xmlns=​"jabber:​client" xml:lang=​"en" to=​"934fe90c-f943-49b7-ae31-a757c7571afceb66d13a-02ea-41f9-816a-f45cc5aa4795d2hik4lmrhgala24ogta4a7o@<my_domain>/​70672320695555156386178" from=​"<my_domain>" type=​"error" id=​"1c3a6891-b2e4-40cd-9bce-dfca749971ec:​sendIQ">​…​​
o @ Logger.js:154
(anonymous) @ strophe.jingle.js:390
(anonymous) @ strophe.umd.js:2716
run @ strophe.umd.js:1875
(anonymous) @ strophe.umd.js:3157
forEachChild @ strophe.umd.js:830
_dataRecv @ strophe.umd.js:3146
_onMessage @ strophe.umd.js:5836
Logger.js:154

When the second participant joins, it starts reconnecting. Can anyone help?
This is the log after second participant joins:

<ee._onConferenceFailed>: CONFERENCE FAILED: conference.videobridgeNotAvailable

Seems you should set useStunTurn: false to use stun servers listed in stunServers in config.js.
reference: Setting up TURN · Jitsi Meet Handbook

The reload is due to no bridge in the conference.

There are only two participants, Also P2P is enabled. Why Do I need to start JVB?

Because if P2P doesn’t succeed or you have more than 2 you need a JVB. The P2P case is just an optimization, for the general case you need the JVB.

1 Like