Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Settings/Admin/AdminSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ protected function initSIPBridge(): void {
$this->initialState->provideInitialState('sip_bridge_dialin_info', $this->talkConfig->getDialInInfo());
$this->initialState->provideInitialState('sip_bridge_dialout', $this->talkConfig->isSIPDialOutEnabled());
$this->initialState->provideInitialState('sip_bridge_dialout_anonymous', $this->appConfig->getAppValueBool('sip_bridge_dialout_anonymous'));
$this->initialState->provideInitialState('sip_bridge_dialout_number', $this->serverConfig->getAppValue('spreed', 'sip_bridge_dialout_anonymous', ''));
$this->initialState->provideInitialState('sip_bridge_dialout_prefix', $this->serverConfig->getAppValue('spreed', 'sip_bridge_dialout_anonymous', '+'));
$this->initialState->provideInitialState('sip_bridge_dialout_number', $this->serverConfig->getAppValue('spreed', 'sip_bridge_dialout_number', ''));
$this->initialState->provideInitialState('sip_bridge_dialout_prefix', $this->serverConfig->getAppValue('spreed', 'sip_bridge_dialout_prefix', '+'));
}

protected function getGroupDetailsArray(array $gids, string $configKey): array {
Expand Down
66 changes: 66 additions & 0 deletions src/components/AdminSettings/SIPBridge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,49 @@
type="warning"
:text="t('spreed', 'Signaling server needs to be updated to supported SIP Dial-out feature.')" />

<template v-if="dialOutEnabled">
<NcCheckboxRadioSwitch
v-model="dialOutAnonymous"
type="switch"
:disabled="loading">
{{ t('spreed', 'Do not show SIP Dial-out caller number') }}
</NcCheckboxRadioSwitch>
<p class="settings-hint">
{{ t('spreed', 'Anonymous number should appear as "unknown" or "withheld number" to call recipient') }}
</p>
</template>

<template v-if="dialOutEnabled && !dialOutAnonymous">
<label for="sip-dialout-number" class="form__label additional-top-margin">
{{ t('spreed', 'Dial-out number') }}
</label>
<NcTextField
id="sip-dialout-number"
v-model="dialOutNumber"
class="form"
name="sip-dialout-number"
:disabled="loading"
placeholder="+49123456789"
label-outside />
<p class="settings-hint additional-top-margin">
{{ t('spreed', 'E164 formatted number used as a fallback caller number for outgoing calls') }}
</p>

<label for="sip-dialout-prefix" class="form__label additional-top-margin">
{{ t('spreed', 'Dial-out prefix') }}
</label>
<NcTextField
id="sip-dialout-prefix"
v-model="dialOutPrefix"
class="form"
name="sip-dialout-prefix"
:disabled="loading"
label-outside />
<p class="settings-hint additional-top-margin">
{{ t('spreed', 'Prefix to configured user number for outgoing calls (default is `+`)') }}
</p>
</template>

<NcSelect v-model="sipGroups"
input-id="sip-group-enabled"
:input-label="t('spreed', 'Restrict SIP configuration')"
Expand Down Expand Up @@ -91,6 +134,7 @@ import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
import NcPasswordField from '@nextcloud/vue/components/NcPasswordField'
import NcSelect from '@nextcloud/vue/components/NcSelect'
import NcTextArea from '@nextcloud/vue/components/NcTextArea'
import NcTextField from '@nextcloud/vue/components/NcTextField'
import { EventBus } from '../../services/EventBus.ts'
import { setSIPSettings } from '../../services/settingsService.ts'
import { getWelcomeMessage } from '../../services/signalingService.js'
Expand All @@ -104,6 +148,7 @@ export default {
NcNoteCard,
NcSelect,
NcTextArea,
NcTextField,
NcPasswordField,
},

Expand All @@ -123,6 +168,9 @@ export default {
dialInInfo: '',
sharedSecret: '',
dialOutEnabled: false,
dialOutAnonymous: false,
dialOutNumber: '',
dialOutPrefix: '',
currentSetup: {},
dialOutSupported: false,
debounceSearchGroup: () => {},
Expand All @@ -134,6 +182,9 @@ export default {
return this.currentSetup.sharedSecret !== this.sharedSecret
|| this.currentSetup.dialInInfo !== this.dialInInfo
|| this.currentSetup.dialOutEnabled !== this.dialOutEnabled
|| this.currentSetup.dialOutAnonymous !== this.dialOutAnonymous
|| this.currentSetup.dialOutNumber !== this.dialOutNumber
|| this.currentSetup.dialOutPrefix !== this.dialOutPrefix
|| this.currentSetup.sipGroups !== this.sipGroups.map((group) => group.id).join('_')
},
},
Expand All @@ -147,6 +198,9 @@ export default {
this.sipGroups = this.groups
this.dialInInfo = loadState('spreed', 'sip_bridge_dialin_info')
this.dialOutEnabled = loadState('spreed', 'sip_bridge_dialout')
this.dialOutAnonymous = loadState('spreed', 'sip_bridge_dialout_anonymous')
this.dialOutNumber = loadState('spreed', 'sip_bridge_dialout_number')
this.dialOutPrefix = loadState('spreed', 'sip_bridge_dialout_prefix')
this.sharedSecret = loadState('spreed', 'sip_bridge_shared_secret')
this.debounceSearchGroup('')
this.loading = false
Expand Down Expand Up @@ -183,6 +237,9 @@ export default {
sharedSecret: this.sharedSecret,
dialInInfo: this.dialInInfo,
dialOutEnabled: this.dialOutEnabled,
dialOutAnonymous: this.dialOutAnonymous,
dialOutNumber: this.dialOutNumber,
dialOutPrefix: this.dialOutPrefix,
sipGroups: this.sipGroups.map((group) => group.id).join('_'),
}
EventBus.emit('sip-settings-updated', this.currentSetup)
Expand All @@ -204,6 +261,15 @@ export default {
if (this.currentSetup.dialOutEnabled !== this.dialOutEnabled) {
await OCP.AppConfig.setValue('spreed', 'sip_dialout', this.dialOutEnabled ? 'yes' : 'no')
}
if (this.currentSetup.dialOutAnonymous !== this.dialOutAnonymous) {
await OCP.AppConfig.setValue('spreed', 'sip_bridge_dialout_anonymous', this.dialOutAnonymous)
}
if (this.currentSetup.dialOutNumber !== this.dialOutNumber) {
await OCP.AppConfig.setValue('spreed', 'sip_bridge_dialout_number', this.dialOutNumber)
}
if (this.currentSetup.dialOutPrefix !== this.dialOutPrefix) {
await OCP.AppConfig.setValue('spreed', 'sip_bridge_dialout_prefix', this.dialOutPrefix)
}

this.loading = false
this.saveCurrentSetup()
Expand Down
Loading