Skip to content

Commit 9706047

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

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
@@ -480,6 +480,7 @@ def _join_sfu(self, ice_servers=None, force=False):
480480
response = requests.get(
481481
sfu_server_url + "/v1/channel",
482482
headers={"Authorization": "jwt " + json_web_token},
483+
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
483484
timeout=3,
484485
)
485486
response.raise_for_status()
@@ -502,9 +503,11 @@ def _get_rtc_server_info(self, rtc_session, ice_servers=None, key=None):
502503
return None
503504
if not key:
504505
key = self.env["ir.config_parameter"].sudo().get_str("mail.sfu_local_key")
506+
is_partner = bool(rtc_session.partner_id)
505507
claims = {
506508
"session_id": rtc_session.id,
507509
"ice_servers": ice_servers,
510+
"permissions": {"recording": is_partner, "transcription": is_partner}
508511
}
509512
json_web_token = jwt.sign(claims, key=key, ttl=60 * 60 * 8, algorithm=jwt.Algorithm.HS256) # 8 hours
510513
return {"url": sfu_server_url, "channelUUID": sfu_channel_uuid, "jsonWebToken": json_web_token}

0 commit comments

Comments
 (0)