# HG changeset patch # User Wiktor Kwapisiewicz # Date 1587051293 -7200 # Node ID bbfcd786cc786c48621a4c584a8300fd6a1a9e7a # Parent f14c862598a95db2b322e5549d913748ba18d332 mod_turncredentials: Add 'transport' attribute XEP-0215 recommends using 'transport' attribute and since coturn can work in both TCP and UPD modes this patch adds one element for each combination of STUN/TURN and TCP/UDP. diff -r f14c862598a9 -r bbfcd786cc78 mod_turncredentials/mod_turncredentials.lua --- a/mod_turncredentials/mod_turncredentials.lua Wed Apr 15 21:19:45 2020 +0100 +++ b/mod_turncredentials/mod_turncredentials.lua Thu Apr 16 17:34:53 2020 +0200 @@ -44,8 +44,10 @@ local userpart = tostring(expires_at); local nonce = base64.encode(hmac_sha1(secret, tostring(userpart), false)); origin.send(st.reply(stanza):tag("services", {xmlns = "urn:xmpp:extdisco:2"}) - :tag("service", { type = "stun", host = host, port = ("%d"):format(port) }):up() - :tag("service", { type = "turn", host = host, port = ("%d"):format(port), username = userpart, password = nonce, expires = datetime(expires_at), restricted = "1" }):up() + :tag("service", { type = "stun", transport = "udp", host = host, port = ("%d"):format(port) }):up() + :tag("service", { type = "stun", transport = "tcp", host = host, port = ("%d"):format(port) }):up() + :tag("service", { type = "turn", transport = "udp", host = host, port = ("%d"):format(port), username = userpart, password = nonce, expires = datetime(expires_at), restricted = "1" }):up() + :tag("service", { type = "turn", transport = "tcp", host = host, port = ("%d"):format(port), username = userpart, password = nonce, expires = datetime(expires_at), restricted = "1" }):up() ); return true; end);