changeset 3978:dd8ef22d4857

Merge
author Kim Alvefur <zash@zash.se>
date Sat, 18 Apr 2020 15:43:08 +0200
parents bbfcd786cc78 (diff) 3e4904cd7021 (current diff)
children 6bf362008052
files
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_turncredentials/mod_turncredentials.lua	Fri Apr 17 17:20:51 2020 +0200
+++ b/mod_turncredentials/mod_turncredentials.lua	Sat Apr 18 15:43:08 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);