Browse Source

fix(docs): Add capability configs for all the SIP states

Signed-off-by: Joas Schilling <coding@schilljs.com>
feat/10410/sip-dial-out
Joas Schilling 2 years ago
parent
commit
2b6cf6c476
No known key found for this signature in database GPG Key ID: 74434EFE0D2E2205
  1. 4
      docs/capabilities.md
  2. 7
      lib/Capabilities.php
  3. 14
      openapi.json
  4. 7
      tests/php/CapabilitiesTest.php

4
docs/capabilities.md

@ -132,5 +132,9 @@
* `session-state` - Sessions can mark themselves as inactive, so the participant receives notifications again
* `note-to-self` - Support for "Note-to-self" conversation exists
* `recording-consent` - Whether admins and moderators can require recording consent before joining a call
* `sip-support-dialout` - Whether admins can enable SIP dial-out
* `config => chat => has-translation-providers` - When true, translation tuples can be loaded from the [OCS Translation API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-translation-api.html#get-available-translation-options).
* `config => call => recording-consent` - Whether users need to consent into call recording before joining a call (see [constants list](constants.md#recording-consent-required))
* `config => call => sip-enabled` - Whether SIP is configured on the server allowing for SIP dial-in
* `config => call => sip-dialout-enabled` - Whether SIP dial-out is configured on the server, additionally requires `config => call => sip-enabled`
* `config => call => can-enable-sip` - Whether the current user is a member of the groups that are allowed to enable SIP dial-in on a conversation or use SIP dial-out

7
lib/Capabilities.php

@ -70,6 +70,9 @@ class Capabilities implements IPublicCapability {
* supported-reactions: string[],
* predefined-backgrounds: string[],
* can-upload-background: bool,
* sip-enabled: bool,
* sip-dialout-enabled: bool,
* can-enable-sip: bool,
* },
* chat: array{
* max-length: int,
@ -178,6 +181,8 @@ class Capabilities implements IPublicCapability {
'recording' => $this->talkConfig->isRecordingEnabled(),
'recording-consent' => $this->talkConfig->recordingConsentRequired(),
'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'],
'sip-enabled' => $this->talkConfig->isSIPConfigured(),
'sip-dialout-enabled' => $this->talkConfig->isSIPDialOutEnabled(),
],
'chat' => [
'max-length' => ChatManager::MAX_CHAT_LENGTH,
@ -261,8 +266,10 @@ class Capabilities implements IPublicCapability {
$quota = Util::computerFileSize($quota);
}
$capabilities['config']['call']['can-upload-background'] = $quota === 'none' || $quota > 0;
$capabilities['config']['call']['can-enable-sip'] = $this->talkConfig->canUserEnableSIP($user);
} else {
$capabilities['config']['call']['can-upload-background'] = false;
$capabilities['config']['call']['can-enable-sip'] = false;
}
return [

14
openapi.json

@ -655,7 +655,10 @@
"recording-consent",
"supported-reactions",
"predefined-backgrounds",
"can-upload-background"
"can-upload-background",
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip"
],
"properties": {
"enabled": {
@ -685,6 +688,15 @@
},
"can-upload-background": {
"type": "boolean"
},
"sip-enabled": {
"type": "boolean"
},
"sip-dialout-enabled": {
"type": "boolean"
},
"can-enable-sip": {
"type": "boolean"
}
}
},

7
tests/php/CapabilitiesTest.php

@ -143,6 +143,7 @@ class CapabilitiesTest extends TestCase {
'session-state',
'note-to-self',
'recording-consent',
'sip-support-dialout',
'message-expiration',
'reactions',
];
@ -194,6 +195,8 @@ class CapabilitiesTest extends TestCase {
'recording' => false,
'recording-consent' => 0,
'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'],
'sip-enabled' => false,
'sip-dialout-enabled' => false,
'predefined-backgrounds' => [
'1_office.jpg',
'2_home.jpg',
@ -205,6 +208,7 @@ class CapabilitiesTest extends TestCase {
'8_space_station.jpg',
],
'can-upload-background' => false,
'can-enable-sip' => false,
],
'chat' => [
'max-length' => 32000,
@ -319,6 +323,8 @@ class CapabilitiesTest extends TestCase {
'recording' => false,
'recording-consent' => 0,
'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'],
'sip-enabled' => false,
'sip-dialout-enabled' => false,
'predefined-backgrounds' => [
'1_office.jpg',
'2_home.jpg',
@ -330,6 +336,7 @@ class CapabilitiesTest extends TestCase {
'8_space_station.jpg',
],
'can-upload-background' => $canUpload,
'can-enable-sip' => false,
],
'chat' => [
'max-length' => 32000,

Loading…
Cancel
Save