It looks like conversations.im does not give a fuck to _turn SRV records.

Time to dive into this piece of #xmpp shit.

@artway what is it that you want to achieve with a _turn SRV record?

Conversations (both server and client) use XEP-0215 to resolve host, port and credentials for TURN.

@larma well, I don't exactly know what yet, but I need it to happen in a more controllable way. This far it wants UDP 3478 regardless of SRV. I don't even see DNS requests.

@artway XEP-0215 supports announcing any port of choice. If you run an XMPP Server you can configure what it should announce as a TURN server, including port numbers.

I'm not involved with Conversations myself (neither Client nor Server), but I'm involved with standardization both at XSF and IETF, hence I was wondering if there's something missing on the standardization side that XEP-0215 doesn't provide.

@larma I skimmed through XEP-0215 and I guess conversations.im relies on the discovery response from the server. But I have no idea how to configure prosody to return the proper configuration of coturn to the client. I need to dig in sources of both for the exact answer. Not today.

Anyway I wonder what _turn SRV records are exactly for in case of XMPP/jingle. XEP-0166 has no mentions and I feel like am reading SEO hallucinations on the Internet.

@artway @larma prosody even has docs for coturn specifically, no need to read the source code: https://prosody.im/doc/coturn
Using Prosody with coturn – Prosody IM

Guide to setting up Prosody with coturn for TURN and STUN support via XEP-0215

@j_r @larma unfortunately #prosody docs is a brilliant example how not to write docs.

grep -r 3478 /usr/lib/prosody

/usr/lib/prosody/modules/mod_turn_external.lua
/usr/lib/prosody/util/prosodyctl/check.lua

I open the first one and guess what I see?

turn_external_user
turn_external_port
turn_external_ttl
turn_external_tcp
turn_external_tls_port

Voila

I'll give it a try.

@artway @j_r

Prosody does have documentation for the supported options of mod_turn_external: https://prosody.im/doc/modules/mod_turn_external

You can easily find it using the searchbar at the top right of the prosody documentation website: https://prosody.im/search?q=turn

That way you also find the general documentation page for usage of TURN in Prosody, including how to properly check the configuration: https://prosody.im/doc/turn

Prosody docs are open source. I bet they would be very happy to see your ideas for improvements.

mod_turn_external – Prosody IM

@larma @j_r yep, my bad, overlooked this.

Actually this one was more helpful: https://prosody.im/doc/modules/mod_external_services

Initially I added

turn_external_tcp = true
turn_external_tls_port = 5349

and clients started falling back to TCP if I block UDP port. But they still did not want to use TLS.

When I added this snippet

external_services = {
{
type = "turns",
transport = "tcp",
host = "my.example.com",
port = 5349,
secret = "mysecret"
}
}

mod_external_services – Prosody IM

XEP-0215: External Service Discovery

@larma @j_r
it started to work. I checked by blocking both UDP and TCP ports 3478

But I was curious why. Unfortunately I had no idea (and still don't have) what tools they use to send raw messages and watch responses, I desperately tried to find any and ended up with slixmpp. It has a lot of XEP plugins except 0215, LOL. So I added the following snippet between get_roster and send_message in this example https://slixmpp.readthedocs.io/en/latest/getting_started/sendlogout.html:

Sign in, Send a Message, and Disconnect - slixmpp

@larma @j_r

class ExtDisco(ElementBase):
name = "services"
namespace = "urn:xmpp:extdisco:2"

iq = self.make_iq_get(ifrom=self.jid, ito=self.server)
iq.set_payload(ExtDisco())
await iq.send()

and found that #prosody sends service items for turns without username and password attributes. After a closer look at mod_turn_external.lua it became obvious why.

username = type == "turn" and user or nil;
secret = type == "turn" and secret or nil;
ttl = type == "turn" and ttl or nil;

@larma @j_r this should be

username = (type == "turn" or type == "turns") and user or nil;
secret = (type == "turn" or type == "turns") and secret or nil;
ttl = (type == "turn" or type == "turns") and ttl or nil;

Not sure my change is an idiomatic Lua code, I'm new to it as well as to #xmpp

@larma @j_r Okay, my server is now working on my terms. But the complexity of all this XMPP stuff is overwhelming and probably worth a serious scientific research on design decisions.

> I bet they would be very happy to see your ideas for improvements.

No, I'm afraid they'll die from my feedback so let they be. Finally, I'm happy so why bother them.

And, #conversations_im has nothing to do with all this, so -1 curse.