Skip to content

Commit 6ae1a04

Browse files
[IMP] discuss: wip recording
see: odoo/sfu#27 task-3725174
1 parent eaaf8d1 commit 6ae1a04

File tree

6 files changed

+7685
-5387
lines changed

6 files changed

+7685
-5387
lines changed

addons/mail/models/discuss/discuss_channel_member.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ def _join_sfu(self, ice_servers=None, force=False):
448448
response = requests.get(
449449
sfu_server_url + "/v1/channel",
450450
headers={"Authorization": "jwt " + json_web_token},
451+
params={"recordingAddress": "{root_url}/discuss/recording/{channel_id}/{token}"}, # TODO add a real destination or change the API, shoundnt be provided if no cloud storage
451452
timeout=3,
452453
)
453454
response.raise_for_status()
@@ -470,9 +471,11 @@ def _get_rtc_server_info(self, rtc_session, ice_servers=None, key=None):
470471
return None
471472
if not key:
472473
key = self.env["ir.config_parameter"].sudo().get_str("mail.sfu_local_key")
474+
is_partner = bool(rtc_session.partner_id)
473475
claims = {
474476
"session_id": rtc_session.id,
475477
"ice_servers": ice_servers,
478+
"permissions": {"recording": is_partner, "transcription": is_partner}
476479
}
477480
json_web_token = jwt.sign(claims, key=key, ttl=60 * 60 * 8, algorithm=jwt.Algorithm.HS256) # 8 hours
478481
return {"url": sfu_server_url, "channelUUID": sfu_channel_uuid, "jsonWebToken": json_web_token}

0 commit comments

Comments
 (0)