MT#58744 Add some new subscriber's preferences in the 'pbx configuration > seats' page

Change-Id: I0650f7c56e94eee4031f9b83e80ff2d2a8a64f29
mr12.4
Hugo Zigha 1 year ago
parent 6b7d53ed5f
commit dac59416dc

@ -14,7 +14,13 @@ import {
setPreferenceMusicOnHold,
setPreferenceCli,
getPreferences,
setPbxSIPPassword
setPbxSIPPassword,
setPreferenceAnnouncementCfu,
setPreferenceAnnouncementCallSetup,
setPreferenceAnnouncementToCallee,
setPreferenceIgnoreCfWhenHunting,
setPreferenceCstaClient,
setPreferenceCstaController
} from './subscriber'
import _ from 'lodash'
import {
@ -325,6 +331,54 @@ export function setSeatCli (seatId, cli) {
})
}
/**
* @param seatId
* @param announcementCfu
*/
export function setSeatAnnouncementCfu (seatId, announcementCfu) {
return setPreferenceAnnouncementCfu(seatId, announcementCfu)
}
/**
* @param seatId
* @param announcementCallSetup
*/
export function setSeatAnnouncementCallSetup (seatId, announcementCallSetup) {
return setPreferenceAnnouncementCallSetup(seatId, announcementCallSetup)
}
/**
* @param seatId
* @param announcementToCallee
*/
export function setSeatAnnouncementToCallee (seatId, announcementToCallee) {
return setPreferenceAnnouncementToCallee(seatId, announcementToCallee)
}
/**
* @param seatId
* @param ignoreCfWhenHunting
*/
export function setSeatIgnoreCfWhenHunting (seatId, ignoreCfWhenHunting) {
return setPreferenceIgnoreCfWhenHunting(seatId, ignoreCfWhenHunting)
}
/**
* @param seatId
* @param cstaClient
*/
export function setSeatCstaClient (seatId, cstaClient) {
return setPreferenceCstaClient(seatId, cstaClient)
}
/**
* @param seatId
* @param cstaController
*/
export function setSeatCstaController (seatId, cstaController) {
return setPreferenceCstaController(seatId, cstaController)
}
/**
* @param options
* @param options.seatId

@ -417,6 +417,30 @@ export function setPreferenceMusicOnHold (id, value) {
return setPreference(id, 'music_on_hold', value)
}
export function setPreferenceAnnouncementCfu (id, value) {
return setPreference(id, 'play_announce_before_cf', value)
}
export function setPreferenceAnnouncementCallSetup (id, value) {
return setPreference(id, 'play_announce_before_call_setup', value)
}
export function setPreferenceAnnouncementToCallee (id, value) {
return setPreference(id, 'play_announce_to_callee', value)
}
export function setPreferenceIgnoreCfWhenHunting (id, value) {
return setPreference(id, 'ignore_cf_when_hunting', value)
}
export function setPreferenceCstaClient (id, value) {
return setPreference(id, 'csta_client', value)
}
export function setPreferenceCstaController (id, value) {
return setPreference(id, 'csta_controller', value)
}
export function setPreferenceCli (id, value) {
return setPreference(id, 'cli', value)
}

@ -40,11 +40,11 @@
<q-item
v-if="selectedTab === 'preferences'"
class="col col-xs-12 col-md-6"
class="row"
>
<q-list
v-if="changes"
class="col col-xs-12 col-md-6"
class="col-xs-12 col-md-6 q-mr-xl"
side
top
no-wrap
@ -268,13 +268,6 @@
/>
</template>
</q-select>
<q-toggle
v-model="changes.clirIntrapbx"
class="q-pa-sm"
:label="$t('Hide number within own PBX')"
:disable="isLoading"
@update:model-value="changeIntraPbx"
/>
<q-btn
v-if="hasCallQueue(seatSelected.id)"
icon="filter_none"
@ -284,6 +277,21 @@
:disable="isLoading"
@click="goToCallQueue"
/>
</q-list>
<q-list
v-if="changes"
class="column"
side
top
no-wrap
>
<q-toggle
v-model="changes.clirIntrapbx"
class="q-pa-sm"
:label="$t('Hide number within own PBX')"
:disable="isLoading"
@update:model-value="changeIntraPbx"
/>
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
@ -291,6 +299,48 @@
:disable="isLoading"
@update:model-value="changeMusicOnHold"
/>
<q-toggle
v-model="changes.announcementCfu"
class="q-pa-sm"
:label="$t('Play announcement before routing to CFU/CFNA')"
:disable="isLoading"
@update:model-value="changeAnnouncementCfu"
/>
<q-toggle
v-model="changes.announcementCallSetup"
class="q-pa-sm"
:label="$t('Play announcement before call setup')"
:disable="isLoading"
@update:model-value="changeAnnouncementCallSetup"
/>
<q-toggle
v-model="changes.announcementToCallee"
class="q-pa-sm"
:label="$t('Play announcement to callee after answer')"
:disable="isLoading"
@update:model-value="changeAnnouncementToCallee"
/>
<q-toggle
v-model="changes.ignoreCfWhenHunting"
class="q-pa-sm"
:label="$t('Ignore Members Call Forwards when Hunting')"
:disable="isLoading"
@update:model-value="changeIgnoreCfWhenHunting"
/>
<q-toggle
v-model="changes.cstaClient"
class="q-pa-sm"
:label="$t('CSTA Client')"
:disable="isLoading"
@update:model-value="changeCstaClient"
/>
<q-toggle
v-model="changes.cstaController"
class="q-pa-sm"
:label="$t('CSTA Controller')"
:disable="isLoading"
@update:model-value="changeCstaController"
/>
</q-list>
</q-item>
@ -392,7 +442,13 @@ export default {
'getCurrentCli',
'getIntraPbx',
'getSeatUpdateToastMessage',
'isSeatLoading'
'isSeatLoading',
'getAnnouncementCfu',
'getAnnouncementCallSetup',
'getAnnouncementToCallee',
'getIgnoreCfWhenHunting',
'getCstaClient',
'getCstaController'
]),
...mapGetters('pbx', [
'getExtensionHint',
@ -566,7 +622,13 @@ export default {
'loadPreferences',
'setCli',
'setNcosSet',
'NcosSet'
'NcosSet',
'setAnnouncementCfu',
'setAnnouncementCallSetup',
'setAnnouncementToCallee',
'setIgnoreCfWhenHunting',
'setCstaClient',
'setCstaController'
]),
...mapActions('user', [
'getNcosLevelsSubscriber',
@ -631,6 +693,12 @@ export default {
aliasNumbers: this.getAliasNumberIds(),
webPassword: this.seatSelected.webpassword,
clirIntrapbx: this.getIntraPbx(this.seatSelected.id),
announcementCfu: this.getAnnouncementCfu(this.seatSelected.id),
announcementCallSetup: this.getAnnouncementCallSetup(this.seatSelected.id),
announcementToCallee: this.getAnnouncementToCallee(this.seatSelected.id),
ignoreCfWhenHunting: this.getIgnoreCfWhenHunting(this.seatSelected.id),
cstaClient: this.getCstaClient(this.seatSelected.id),
cstaController: this.getCstaController(this.seatSelected.id),
musicOnHold: this.getMusicOnHold(this.seatSelected.id),
groups: this.getGroupIds(),
soundSet: this.getSoundSetId(),
@ -741,6 +809,42 @@ export default {
this.changes.musicOnHold = !this.changes.musicOnHold
}
},
changeAnnouncementCfu () {
this.setAnnouncementCfu({
seatId: this.seatSelected.id,
announcementCfu: this.changes.announcementCfu
})
},
changeAnnouncementCallSetup () {
this.setAnnouncementCallSetup({
seatId: this.seatSelected.id,
announcementCallSetup: this.changes.announcementCallSetup
})
},
changeAnnouncementToCallee () {
this.setAnnouncementToCallee({
seatId: this.seatSelected.id,
announcementToCallee: this.changes.announcementToCallee
})
},
changeIgnoreCfWhenHunting () {
this.setIgnoreCfWhenHunting({
seatId: this.seatSelected.id,
ignoreCfWhenHunting: this.changes.ignoreCfWhenHunting
})
},
changeCstaClient () {
this.setCstaClient({
seatId: this.seatSelected.id,
cstaClient: this.changes.cstaClient
})
},
changeCstaController () {
this.setCstaController({
seatId: this.seatSelected.id,
cstaController: this.changes.cstaController
})
},
goToCallQueue () {
this.jumpToCallQueue(this.seatSelected)
},

@ -27,7 +27,13 @@ import {
setNcosSet,
setNcosLevelSets,
NcosSet,
NcosSets
NcosSets,
setSeatAnnouncementCfu,
setSeatAnnouncementCallSetup,
setSeatAnnouncementToCallee,
setSeatIgnoreCfWhenHunting,
setSeatCstaClient,
setSeatCstaController
} from '../api/pbx-seats'
import { getSubscriberId } from 'src/auth'
export default {
@ -119,11 +125,47 @@ export default {
return seatPreferences && seatPreferences.clir_intrapbx ? state.preferenceMapById[id].clir_intrapbx : false
}
},
getAnnouncementCfu (state) {
return (id) => {
const seatPreferences = state.preferenceMapById[id]
return seatPreferences && seatPreferences.play_announce_before_cf ? state.preferenceMapById[id].play_announce_before_cf : false
}
},
getMusicOnHold (state) {
return (id) => {
return state?.preferenceMapById[id]?.music_on_hold || false
}
},
getAnnouncementCallSetup (state) {
return (id) => {
const seatPreferences = state.preferenceMapById[id]
return seatPreferences && seatPreferences.play_announce_before_call_setup ? state.preferenceMapById[id].play_announce_before_call_setup : false
}
},
getAnnouncementToCallee (state) {
return (id) => {
const seatPreferences = state.preferenceMapById[id]
return seatPreferences && seatPreferences.play_announce_to_callee ? state.preferenceMapById[id].play_announce_to_callee : false
}
},
getIgnoreCfWhenHunting (state) {
return (id) => {
const seatPreferences = state.preferenceMapById[id]
return seatPreferences && seatPreferences.ignore_cf_when_hunting ? state.preferenceMapById[id].ignore_cf_when_hunting : false
}
},
getCstaClient (state) {
return (id) => {
const seatPreferences = state.preferenceMapById[id]
return seatPreferences && seatPreferences.csta_client ? state.preferenceMapById[id].csta_client : false
}
},
getCstaController (state) {
return (id) => {
const seatPreferences = state.preferenceMapById[id]
return seatPreferences && seatPreferences.csta_controller ? state.preferenceMapById[id].csta_controller : false
}
},
getCurrentCli (state) {
return (id) => {
return state?.preferenceMapById[id]?.cli || false
@ -550,7 +592,78 @@ export default {
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
},
async setAnnouncementCfu (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.global.tc('the playback announcement as early media before Call Forward Unconditional or Unavailable')
})
try {
const result = await setSeatAnnouncementCfu(options.seatId, options.announcementCfu)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
},
async setAnnouncementCallSetup (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.global.tc('the playback announcement as early media before send the call to callee')
})
try {
const result = await setSeatAnnouncementCallSetup(options.seatId, options.announcementCallSetup)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
},
async setAnnouncementToCallee (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.global.tc('the playback announcement to callee after he answered the call')
})
try {
const result = await setSeatAnnouncementToCallee(options.seatId, options.announcementToCallee)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
},
async setIgnoreCfWhenHunting (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.global.tc('the behavior of the members call forwards from a Cloud PBX subscriber when it is called within a huntgroup')
})
try {
const result = await setSeatIgnoreCfWhenHunting(options.seatId, options.ignoreCfWhenHunting)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
},
async setCstaClient (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.global.tc('the right of this subscriber to be controlled by a CTI subscriber within the same customer using uaCSTA via SIP')
})
try {
const result = await setSeatCstaClient(options.seatId, options.cstaClient)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
},
async setCstaController (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.global.tc('the right this subscriber to initiate CTI sessions to other subscribers within the same customer using uaCSTA via SIP')
})
try {
const result = await setSeatCstaController(options.seatId, options.cstaController)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
}
}
}

Loading…
Cancel
Save