--- a/mod_turncredentials/mod_turncredentials.lua Tue Apr 09 18:05:28 2019 +0200
+++ b/mod_turncredentials/mod_turncredentials.lua Tue Apr 09 23:23:30 2019 +0200
@@ -26,8 +26,8 @@
local userpart = tostring(now);
local nonce = base64.encode(hmac_sha1(secret, tostring(userpart), false));
origin.send(st.reply(stanza):tag("services", {xmlns = "urn:xmpp:extdisco:1"})
- :tag("service", { type = "stun", host = host, port = port }):up()
- :tag("service", { type = "turn", host = host, port = port, username = userpart, password = nonce, ttl = ttl}):up()
+ :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, ttl = ("%d"):format(ttl) }):up()
);
return true;
end);