diff --git a/docs/capabilities.md b/docs/capabilities.md index b7a26f7fe16..e7cebf55a2b 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -159,3 +159,4 @@ ## 20.1 * `archived-conversations` (local) - Conversations can be marked as archived which will hide them from the conversation list by default * `config => call => start-without-media` (local) - Boolean, whether media should be disabled when starting or joining a conversation +* `config => call => max-duration` - Integer, maximum call duration in seconds. Please note that this should only be used with system cron and with a reasonable high value, due to the expended duration until the background job ran. diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 24fe017da7d..773e3c21d90 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -198,6 +198,7 @@ public function getCapabilities(): array { 'sip-dialout-enabled' => $this->talkConfig->isSIPDialOutEnabled(), 'can-enable-sip' => false, 'start-without-media' => $this->talkConfig->getCallsStartWithoutMedia($user?->getUID()), + 'max-duration' => $this->appConfig->getAppValueInt('max_call_duration'), ], 'chat' => [ 'max-length' => ChatManager::MAX_CHAT_LENGTH, diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 7f55a770b35..01f9c0e8d78 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -340,6 +340,7 @@ * sip-dialout-enabled: bool, * can-enable-sip: bool, * start-without-media: bool, + * max-duration: int, * }, * chat: array{ * max-length: int, diff --git a/openapi-administration.json b/openapi-administration.json index 47eae931040..fa4e80bed78 100644 --- a/openapi-administration.json +++ b/openapi-administration.json @@ -148,7 +148,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -190,6 +191,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi-backend-recording.json b/openapi-backend-recording.json index 513a2895d17..f6b1d452627 100644 --- a/openapi-backend-recording.json +++ b/openapi-backend-recording.json @@ -81,7 +81,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -123,6 +124,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi-backend-signaling.json b/openapi-backend-signaling.json index f76ee58b8b7..ad42624f290 100644 --- a/openapi-backend-signaling.json +++ b/openapi-backend-signaling.json @@ -81,7 +81,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -123,6 +124,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json index e4c3fcb37f0..80c9a4edf82 100644 --- a/openapi-backend-sipbridge.json +++ b/openapi-backend-sipbridge.json @@ -124,7 +124,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -166,6 +167,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi-bots.json b/openapi-bots.json index 1df3052fc8e..8f24560fe4b 100644 --- a/openapi-bots.json +++ b/openapi-bots.json @@ -81,7 +81,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -123,6 +124,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi-federation.json b/openapi-federation.json index 7ded17e6e2a..4e5813a5fbf 100644 --- a/openapi-federation.json +++ b/openapi-federation.json @@ -124,7 +124,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -166,6 +167,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi-full.json b/openapi-full.json index e01a2b76787..258b43457db 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -286,7 +286,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -328,6 +329,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/openapi.json b/openapi.json index 9408d9cdf55..5692d31d23e 100644 --- a/openapi.json +++ b/openapi.json @@ -227,7 +227,8 @@ "sip-enabled", "sip-dialout-enabled", "can-enable-sip", - "start-without-media" + "start-without-media", + "max-duration" ], "properties": { "enabled": { @@ -269,6 +270,10 @@ }, "start-without-media": { "type": "boolean" + }, + "max-duration": { + "type": "integer", + "format": "int64" } } }, diff --git a/src/__mocks__/capabilities.ts b/src/__mocks__/capabilities.ts index 4a57bd1482a..b94cc8fdead 100644 --- a/src/__mocks__/capabilities.ts +++ b/src/__mocks__/capabilities.ts @@ -113,6 +113,7 @@ export const mockedCapabilities: Capabilities = { 'sip-dialout-enabled': true, 'can-enable-sip': true, 'start-without-media': false, + 'max-duration': 0, }, chat: { 'max-length': 32000, diff --git a/src/types/openapi/openapi-administration.ts b/src/types/openapi/openapi-administration.ts index 54ae6d8303b..e960be1a078 100644 --- a/src/types/openapi/openapi-administration.ts +++ b/src/types/openapi/openapi-administration.ts @@ -229,6 +229,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi-backend-recording.ts b/src/types/openapi/openapi-backend-recording.ts index 517aa72e858..63f3a3b8602 100644 --- a/src/types/openapi/openapi-backend-recording.ts +++ b/src/types/openapi/openapi-backend-recording.ts @@ -63,6 +63,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi-backend-signaling.ts b/src/types/openapi/openapi-backend-signaling.ts index 81e1612060d..54bf7d5d98b 100644 --- a/src/types/openapi/openapi-backend-signaling.ts +++ b/src/types/openapi/openapi-backend-signaling.ts @@ -49,6 +49,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi-backend-sipbridge.ts b/src/types/openapi/openapi-backend-sipbridge.ts index 9a1e1c27d66..b195c2e9726 100644 --- a/src/types/openapi/openapi-backend-sipbridge.ts +++ b/src/types/openapi/openapi-backend-sipbridge.ts @@ -144,6 +144,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi-bots.ts b/src/types/openapi/openapi-bots.ts index a96b71c89ce..5e29b8e7795 100644 --- a/src/types/openapi/openapi-bots.ts +++ b/src/types/openapi/openapi-bots.ts @@ -67,6 +67,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi-federation.ts b/src/types/openapi/openapi-federation.ts index 2f466792e6f..b1a9507b482 100644 --- a/src/types/openapi/openapi-federation.ts +++ b/src/types/openapi/openapi-federation.ts @@ -175,6 +175,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index c0ec4e62e1a..e2b98fab483 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -1883,6 +1883,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 1f1669b1314..aa9867f63a6 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -1380,6 +1380,8 @@ export type components = { "sip-dialout-enabled": boolean; "can-enable-sip": boolean; "start-without-media": boolean; + /** Format: int64 */ + "max-duration": number; }; chat: { /** Format: int64 */ diff --git a/tests/php/CapabilitiesTest.php b/tests/php/CapabilitiesTest.php index 1feadcded6e..f18ab3d3c55 100644 --- a/tests/php/CapabilitiesTest.php +++ b/tests/php/CapabilitiesTest.php @@ -120,6 +120,7 @@ public function testGetCapabilitiesGuest(): void { 'sip-dialout-enabled' => false, 'can-enable-sip' => false, 'start-without-media' => false, + 'max-duration' => 0, 'predefined-backgrounds' => [ '1_office.jpg', '2_home.jpg', @@ -254,6 +255,7 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea 'sip-dialout-enabled' => false, 'can-enable-sip' => false, 'start-without-media' => false, + 'max-duration' => 0, 'predefined-backgrounds' => [ '1_office.jpg', '2_home.jpg',