You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mod_jitsi_session.lua 978B

123456789101112131415161718192021222324252627
  1. -- Jitsi session information
  2. -- Copyright (C) 2021-present 8x8, Inc.
  3. module:set_global();
  4. local formdecode = require "util.http".formdecode;
  5. -- Extract the following parameters from the URL and set them in the session:
  6. -- * previd: for session resumption
  7. function init_session(event)
  8. local session, request = event.session, event.request;
  9. local query = request.url.query;
  10. if query ~= nil then
  11. local params = formdecode(query);
  12. -- previd is used together with https://modules.prosody.im/mod_smacks.html
  13. -- the param is used to find resumed session and re-use anonymous(random) user id
  14. session.previd = query and params.previd or nil;
  15. -- The room name and optional prefix from the web query
  16. session.jitsi_web_query_room = params.room;
  17. session.jitsi_web_query_prefix = params.prefix or "";
  18. end
  19. end
  20. module:hook_global("bosh-session", init_session);
  21. module:hook_global("websocket-session", init_session);