Reservation System setup
Support for a reservation system over REST API
It is possible to connect to an external conference reservation system using a REST API. Before a new Jitsi Meet conference is created, the reservation system will be queried for room availability. The system is supposed to return a positive or negative response code, which also contains conference duration. Prosody will enforce conference duration and if the time limit is exceeded the conference will be terminated.
Enable reservation system
In order to enable the reservation system, the URL base for the REST API endpoint must be
configured. Under the main virtual host in prosody, enable module "reservations" and
add the config reservations_api_prefix
:
VirtualHost "jitmeet.example.com"
-- ....
modules_enabled = {
-- ....
"reservations";
}
reservations_api_prefix = "http://reservation.example.com"
The URL base is used to construct the request URL. Currently, only '/conference'
endpoint is supported, so all request will go to:
http://reservation.example.com/conference
Additional configuration options are available:
- "reservations_api_timeout" to change API call timeouts (defaults to 20 seconds)
- "reservations_api_headers" to specify custom HTTP headers included in all API calls e.g. to provide auth tokens.
- "reservations_api_retry_count" to specify the number of times API call failures are retried (defaults to 3)
- "reservations_api_retry_delay" seconds to wait between retries (defaults to 3s)
- "reservations_api_should_retry_for_code" as a function that takes an HTTP response code and returns true if the API call should be retried. By default, retries are done for 5XX responses. Timeouts are never retried, and HTTP call failures are always retried.
- "reservations_enable_max_occupants" to enable support for setting max occupants. If this is set to
true
, and if the API response payload includes a "max_occupants" value, then that value will be set as the max occupancy limit for that specific room.- "muc_max_occupants" module must also be enabled for this to work.
- "reservations_enable_lobby_support" to enable support for lobby. If this is set to
true
, and if the API response payload includes a "lobby" field set totrue
, then the lobby will be enabled for the room.- "muc_lobby_rooms" and "persistent_lobby" modules must also be enabled for this to work.
- "reservations_enable_password_support" to enable support for room password. If this is set to
true
, and if the API response payload includes a "password" value, then that value will be set as room password. Users will then be required to know that password to be able to join the room, or in the case where lobby is enabled, can use the password to bypass the lobby.
--- The following are all optional
reservations_api_headers = {
["Authorization"] = "Bearer TOKEN-237958623045";
}
reservations_api_timeout = 10 -- timeout if API does not respond within 10s
reservations_api_retry_count = 5 -- retry up to 5 times
reservations_api_retry_delay = 1 -- wait 1s between retries
reservations_api_should_retry_for_code = function (code)
return code >= 500 or code == 408
end
reservations_enable_max_occupants = true -- enable integration with muc_max_occupants
reservations_enable_lobby_support = true -- enable integration with muc_lobby_rooms
reservations_enable_password_support = true -- enable support for setting room passwords
Call flow
Notes
All API calls use the following datetime format:
yyyy-MM-dd'T'HH:mm:ss.SSSX
- more info can be found in
SimpleDateFormat
JavaDoc
Conference allocation
When the first user joins a MUC room (i.e. Jitsi Meet URL is opened), an HTTP POST
request is sent to '/conference'
endpoint with the following parameters
included:
name (string)
- short name of the conference room (not full MUC address). If tenant is used, the name will be[tenant]roomname
.start_time (string)
- conference start date and timemail_owner (string)
- if authentication system is enabled this field will contain user's identity. It that case it will not be possible to create a new conference room without authenticating.
The payload sent to the endpoint will be encoded as application/x-www-form-urlencoded
.
The reservation system is expected to respond with one of the following responses:
HTTP 200 or 201 Conference created successfully
In the HTTP response, a JSON object is expected. It should contain conference id
assigned by the system and duration
measured in seconds. Sample response body:
{
"id": 364758328,
"name": "conference1234",
"mail_owner": "user@server.com",
"start_time": "2048-04-20T17:55:12.000Z",
"duration": 900000
}
The object can optionally include a max_occupants
key with an integer value. When provided, and if
reservations_enable_max_occupants
is enabled, then the value will be passed to muc_mod_max_occupants to enforce
per-room occupancy limits.
HTTP 409 - Conference already exists
This is to recover from previous failures. If for some reason the conference was
restarted and the user tries to create the room again, this response informs Prosody
that the conference room already exists. It is expected to contain
conflict_id
in the JSON response body:
{
"conflict_id": 364758328
}
Prosody will use HTTP GET
to fetch information about the conflicting conference for the
given conflict_id
. More info about this request can be found in the "Reading conference info"
section.