summaryrefslogtreecommitdiffstats
path: root/recording
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2023-02-21 02:13:25 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2023-02-22 13:09:26 +0100
commiteca3161d246eac7e874a17ee3b747bb0129bee7b (patch)
treea3dd7785af66b729aa909f0c1930301dc22c396d /recording
parent808c9f0e36fadf4af0a6c8d0fc943361a7b421bf (diff)
Add failed status to recordings
Although recordings should not fail in some cases they could (for example, if the configuration is wrong, the disk is full...). A new recording status, "failed", has been added to notify that situation to the Nextcloud server from the recording server. Typically call participants will not be able to do anything about the failure, so the clients can just show a notification to the moderators and hint about asking the system administrators. In any case, even if the recording status is "failed" further recordings can be started, which will behave as if the recording was started from the "none" status. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'recording')
-rw-r--r--recording/src/nextcloud/talk/recording/BackendNotifier.py17
-rw-r--r--recording/src/nextcloud/talk/recording/Service.py5
2 files changed, 22 insertions, 0 deletions
diff --git a/recording/src/nextcloud/talk/recording/BackendNotifier.py b/recording/src/nextcloud/talk/recording/BackendNotifier.py
index 43b5485de..a8b6d6a34 100644
--- a/recording/src/nextcloud/talk/recording/BackendNotifier.py
+++ b/recording/src/nextcloud/talk/recording/BackendNotifier.py
@@ -154,6 +154,23 @@ def stopped(backend, token, actorType, actorId):
backendRequest(backend, data)
+def failed(backend, token):
+ """
+ Notifies the backend that the recording failed.
+
+ :param backend: the backend of the conversation.
+ :param token: the token of the conversation.
+ """
+
+ data = {
+ 'type': 'failed',
+ 'failed': {
+ 'token': token,
+ },
+ }
+
+ backendRequest(backend, data)
+
def uploadRecording(backend, token, fileName, owner):
"""
Upload the recording specified by fileName.
diff --git a/recording/src/nextcloud/talk/recording/Service.py b/recording/src/nextcloud/talk/recording/Service.py
index 12dbb5b7c..706afb682 100644
--- a/recording/src/nextcloud/talk/recording/Service.py
+++ b/recording/src/nextcloud/talk/recording/Service.py
@@ -250,6 +250,11 @@ class Service:
except Exception as exception:
self._stopHelpers()
+ try:
+ BackendNotifier.failed(self.backend, self.token)
+ except:
+ pass
+
raise
def stop(self, actorType, actorId):