summaryrefslogtreecommitdiffstats
path: root/docs/recording.md
blob: 463e0f2c674962b1240d3ea03f3717a8b4948a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Call recording API

* API v1: Base endpoint `/ocs/v2.php/apps/spreed/api/v1`: since Nextcloud 26

## Start call recording

* Required capability: `recording-v1`
* Method: `POST`
* Endpoint: `/recording/{token}`
* Data:

| Field  | Type | Description                                                                                          |
| ------ | ---- | ---------------------------------------------------------------------------------------------------- |
| status | int  | Type of call recording (see [Constants - Call recording status](constants.md#call-recording-status)) |

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Message: `status`. When the status to start is invalid.
        + `400 Bad Request` Message: `config`. Need to enable the config `recording`.
        + `400 Bad Request` Message: `recording`. Already have a recording in progress.
        + `400 Bad Request` Message: `call`. Call is not activated.
        + `403 Forbidden` When the user is not a moderator/owner.
        + `412 Precondition Failed` When the lobby is active and the user is not a moderator.

## Stop call recording

* Required capability: `recording-v1`
* Method: `DELETE`
* Endpoint: `/recording/{token}`

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Message: `config`. Need to enable the config `recording`.
        + `400 Bad Request` Message: `recording`. Recording has already been stopped.
        + `400 Bad Request` Message: `call`. Call is not activated.
        + `403 Forbidden` When the user is not a moderator/owner.
        + `412 Precondition Failed` When the lobby is active and the user is not a moderator.

## Store call recording

* Required capability: `recording-v1`
* Method: `POST`
* Endpoint: `/recording/{token}/store`

* Header:

| field                     | type   | Description                                                                                                               |
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `TALK_SIPBRIDGE_RANDOM`   | string | Random string that need to be concatenated with room token to generate the checksum using the `sip_bridge_shared_secret`. |
| `TALK_SIPBRIDGE_CHECKSUM` | string | The checksum generated with `TALK_SIPBRIDGE_RANDOM`.                                                                      |

* Data:

| field   | type   | Description                                               |
| ------- | ------ | --------------------------------------------------------- |
| `file`  | string | File with the recording in a multipart/form-data request. |
| `owner` | string | The person that started the recording.                    |

* Response:
    - Status code:
        + `200 OK`
        + `400 Bad Request` Error: `invalid_file`: File in block list or invalid
        + `400 Bad Request` Error: `empty_file`: Invalid file extension
        + `400 Bad Request` Error: `file_mimetype`: Invalid mimetype
        + `400 Bad Request` Error: `file_name`. :nvalid file name
        + `400 Bad Request` Error: `file_extension`: Invalid file extension
        + `400 Bad Request` Error: `owner_participant`: Owner is not to be a participant of room
        + `400 Bad Request` Error: `owner_invalid`: Owner invalid
        + `400 Bad Request` Error: `owner_permission`: Owner have not permission to store record file
        + `401 Unauthorized` When the validation as SIP bridge failed
        + `404 Not Found` Room not found
        + `429 Too Many Request` Brute force protection