Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix: Cleans some rayo headers.
damencho5ef3844e3ab5
diff --git a/resources/prosody-plugins/mod_filter_iq_rayo.lua b/resources/prosody-plugins/mod_filter_iq_rayo.luaindex b2d5afa1ea..e7c0984388 100644--- a/resources/prosody-plugins/mod_filter_iq_rayo.lua+++ b/resources/prosody-plugins/mod_filter_iq_rayo.lua@@ -65,6 +65,7 @@ load_config();local OUT_INITIATOR_USER_ATTR_NAME = "X-outbound-call-initiator-user";local OUT_INITIATOR_GROUP_ATTR_NAME = "X-outbound-call-initiator-group";local OUT_ROOM_NAME_ATTR_NAME = "JvbRoomName";+local OUT_ROOM_PASS_ATTR_NAME = 'JvbRoomPassword';local OUTGOING_CALLS_THROTTLE_INTERVAL = 60; -- if max_number_outgoing_calls is enabled it will be-- the max number of outgoing calls a user can try for a minute@@ -80,22 +81,20 @@ module:hook("pre-iq/full", function(event)local session = event.origin;local token = session.auth_token;- -- find header with attr name 'JvbRoomName' and extract its value+ -- find header with attr name 'JvbRoomName' or 'JvbRoomPassword' and extract the valueslocal roomName;+ local roomPassword;-- Remove any 'header' element if it already exists, so it cannot be spoofed by a clientdial:maptags(function(tag)- if tag.name == "header"- and (tag.attr.name == OUT_INITIATOR_USER_ATTR_NAME- or tag.attr.name == OUT_INITIATOR_GROUP_ATTR_NAME) then- return nil- elseif tag.name == "header" and tag.attr.name == OUT_ROOM_NAME_ATTR_NAME then- roomName = tag.attr.value;- -- we will remove it as we will add it later, modified- if is_visitor_prosody then- return nil;+ if tag.name == 'header' then+ if tag.attr.name == OUT_ROOM_NAME_ATTR_NAME then+ roomName = tag.attr.value;+ elseif tag.attr.name == OUT_ROOM_PASS_ATTR_NAME then+ roomPassword = tag.attr.value;end+ return nil;end- return tag+ return tag;end);local room_jid = jid.bare(stanza.attr.to);@@ -175,10 +174,20 @@ module:hook("pre-iq/full", function(event)-- we want to instruct jigasi to enter the main room, so send the correct main room jidif is_visitor_prosody then+ roomName = string.gsub(roomName, local_domain, main_domain);+ end+ dial:tag("header", {+ xmlns = "urn:xmpp:rayo:1",+ name = OUT_ROOM_NAME_ATTR_NAME,+ value = roomName+ });+ dial:up();+ if roomPassword thendial:tag("header", {xmlns = "urn:xmpp:rayo:1",- name = OUT_ROOM_NAME_ATTR_NAME,- value = string.gsub(roomName, local_domain, main_domain) });+ name = OUT_ROOM_PASS_ATTR_NAME,+ value = roomPassword+ });dial:up();endend