TT#136550 CallForwarding - Add missing call forwarding types

- Add call forwarding type "Auto Attendant"
- Add call forwarding type "Office Hours Announcement"
- Add call forwarding type "Calling Card"
- Add call forwarding type "Call Through"
- Add call forwarding type "Local Subscriber"
- Add "gridView" to call forwarding menu

Change-Id: Ib64668e3caadfed2ec631d0242e0eef07aa7d819
mr10.1.1
Hans-Peter Herzog 4 years ago
parent d0a51c3ff9
commit 07a4dbd95f

@ -6,8 +6,24 @@
dense dense
@click.stop.prevent @click.stop.prevent
> >
<csc-popup-menu> <csc-popup-menu
:grid-view="gridView"
>
<slot /> <slot />
<template
v-slot:grid-column-1
>
<slot
name="grid-column-1"
/>
</template>
<template
v-slot:grid-column-2
>
<slot
name="grid-column-2"
/>
</template>
</csc-popup-menu> </csc-popup-menu>
</q-btn> </q-btn>
</template> </template>
@ -17,6 +33,12 @@ export default {
name: 'CscMoreMenu', name: 'CscMoreMenu',
components: { components: {
CscPopupMenu CscPopupMenu
},
props: {
gridView: {
type: Boolean,
default: false
}
} }
} }
</script> </script>

@ -3,16 +3,52 @@
@before-show="$store.commit('callForwarding/popupShow', null)" @before-show="$store.commit('callForwarding/popupShow', null)"
> >
<q-list <q-list
v-if="!gridView"
v-bind="$attrs" v-bind="$attrs"
v-on="$listeners" v-on="$listeners"
> >
<slot /> <slot />
</q-list> </q-list>
<div
v-else
class="row"
>
<div
class="col-xs-12 col-lg-6"
>
<q-list
v-bind="$attrs"
v-on="$listeners"
>
<slot
name="grid-column-1"
/>
</q-list>
</div>
<div
class="col-xs-12 col-lg-6"
>
<q-list
v-bind="$attrs"
v-on="$listeners"
>
<slot
name="grid-column-2"
/>
</q-list>
</div>
</div>
</q-popup-proxy> </q-popup-proxy>
</template> </template>
<script> <script>
export default { export default {
name: 'CscPopupMenu' name: 'CscPopupMenu',
props: {
gridView: {
type: Boolean,
default: false
}
}
} }
</script> </script>

@ -0,0 +1,69 @@
<template>
<span
:class="cssClasses"
>
<q-icon
:name="destinationIcon"
/>
{{ destinationLabel }}
<slot />
</span>
</template>
<script>
import destination from 'src/mixins/destination'
export default {
name: 'CscCfDestination',
mixins: [destination],
props: {
value: {
type: Object,
default: undefined
},
icon: {
type: String,
default: undefined
},
label: {
type: String,
default: undefined
},
clickable: {
type: Boolean,
default: false
}
},
computed: {
destinationIcon () {
if (this.icon) {
return this.icon
} else if (this.value?.destination) {
return this.destinationIconBySipUri(this.value.destination)
} else {
return ''
}
},
destinationLabel () {
if (this.label) {
return this.label
} else if (this.value?.destination) {
return this.destinationFormattedBySipUri(this.value.destination)
} else {
return ''
}
},
cssClasses () {
return [
'q-pl-xs',
'text-weight-bold',
'text-no-wrap',
...(this.clickable ? [
'cursor-pointer',
'text-primary'
] : [])
]
}
}
}
</script>

@ -0,0 +1,61 @@
<template>
<csc-cf-destination
:value="destination"
:label="announcement ? announcement.label : ''"
:clickable="true"
>
<q-popup-edit
v-model="announcement"
buttons
anchor="top left"
@before-show="$store.commit('callForwarding/popupShow', null)"
@save="$emit('input', announcement)"
>
<q-select
v-model="announcement"
map-options
:rules="[ checkAnnouncement ]"
:options="announcements"
:label="$t('Custom Announcements')"
:disable="$attrs.loading"
/>
</q-popup-edit>
</csc-cf-destination>
</template>
<script>
import CscCfDestination from 'components/call-forwarding/CscCfDestination'
import { showGlobalError } from 'src/helpers/ui'
export default {
name: 'CscCfDestinationCustomAnnouncement',
components: { CscCfDestination },
props: {
destination: {
type: Object,
default: undefined
},
announcements: {
type: Array,
default: undefined
}
},
data () {
return {
announcement: this.$attrs.value
}
},
watch: {
'$attrs.value' (value) {
this.announcement = value
}
},
methods: {
checkAnnouncement () {
const fieldFilled = this.announcement
if (!fieldFilled) {
showGlobalError(this.$t('Please select an option'))
}
return fieldFilled
}
}
}
</script>

@ -0,0 +1,52 @@
<template>
<csc-cf-destination
:value="destination"
:label="destination.simple_destination === ' ' ? $t('Number') : destination.simple_destination"
:clickable="true"
>
<q-popup-edit
v-model="number"
buttons
@before-show="$store.commit('callForwarding/popupShow', null)"
@save="$emit('input', $event)"
>
<csc-input
v-model="number"
dense
>
<template
v-slot:prepend
>
<q-icon
name="phone_forwarded"
/>
</template>
</csc-input>
</q-popup-edit>
</csc-cf-destination>
</template>
<script>
import CscCfDestination from 'components/call-forwarding/CscCfDestination'
import CscInput from 'components/form/CscInput'
export default {
name: 'CscCfDestinationNumber',
components: { CscInput, CscCfDestination },
props: {
destination: {
type: Object,
default: undefined
}
},
data () {
return {
number: this.$attrs.value
}
},
watch: {
'$attrs.value' (value) {
this.number = value
}
}
}
</script>

@ -92,118 +92,29 @@
</span> </span>
{{ $t('forwarded to') }} {{ $t('forwarded to') }}
</template> </template>
<span <csc-cf-destination-custom-announcement
v-if="destination.destination.endsWith('voicebox.local')" v-if="isDestinationTypeCustomAnnouncement(destination.destination) && destination.announcement_id"
class="q-pl-xs text-weight-bold" v-model="announcement"
style="white-space: nowrap" :destination="destination"
> :announcements="announcements"
<q-icon @input="updateAnnouncementEvent({
name="voicemail" destinationIndex: destinationIndex,
/> destinationSetId: destinationSet.id
{{ $t('Voicebox') }} })"
</span> />
<span <csc-cf-destination-number
v-else-if="destination.destination.endsWith('fax2mail.local')" v-else-if="isDestinationTypeNumber(destination.destination)"
class="q-pl-xs text-weight-bold" v-model="changedDestination"
style="white-space: nowrap" :destination="destination"
> @input="updateDestinationEvent({
<q-icon destinationIndex: destinationIndex,
name="email" destinationSetId: destinationSet.id
/> })"
{{ $t('Fax2Mail') }} />
</span> <csc-cf-destination
<span
v-else-if="destination.destination.endsWith('managersecretary.local')"
class="q-pl-xs text-weight-bold"
style="white-space: nowrap"
>
<q-icon
name="phone_forwarded"
/>
{{ $t('ManagerSecretary') }}
</span>
<span
v-else-if="destination.destination.endsWith('conference.local')"
class="q-pl-xs text-weight-bold"
style="white-space: nowrap"
>
<q-icon
name="groups"
/>
{{ $t('Conference') }}
</span>
<span
v-else-if="destination.announcement_id"
class="q-pl-xs text-primary text-weight-bold cursor-pointer"
style="white-space: nowrap"
>
<q-icon
name="music_note"
/>
{{ announcement ? announcement.label : '' }}
<q-popup-edit
v-model="announcement"
buttons
anchor="top left"
@before-show="$store.commit('callForwarding/popupShow', null)"
@save="updateAnnouncementEvent({
destinationIndex: destinationIndex,
destinationSetId: destinationSet.id
})"
>
<q-select
v-model="announcement"
emit-value
map-options
:rules="[ checkAnnouncement ]"
:options="announcements"
:label="$t('Custom Announcements')"
:disable="loading"
/>
</q-popup-edit>
</span>
<span
v-else-if="destination.destination.endsWith('app.local')"
class="q-pl-xs text-weight-bold"
style="white-space: nowrap"
>
<q-icon
name="app"
/>
{{ $t('Application') }}
</span>
<span
v-else v-else
class="q-pl-xs text-primary text-weight-bold cursor-pointer" :value="destination"
style="white-space: nowrap" />
>
<q-icon
name="phone_forwarded"
/>
{{ destination.simple_destination }}
<q-popup-edit
v-model="changedDestination"
buttons
@before-show="$store.commit('callForwarding/popupShow', null)"
@save="updateDestinationEvent({
destinationIndex: destinationIndex,
destinationSetId: destinationSet.id
})"
>
<csc-input
v-model="changedDestination"
dense
>
<template
v-slot:prepend
>
<q-icon
name="phone_forwarded"
/>
</template>
</csc-input>
</q-popup-edit>
</span>
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
<q-item-section <q-item-section
@ -241,9 +152,14 @@ import CscSpinner from 'components/CscSpinner'
import { import {
showGlobalError showGlobalError
} from 'src/helpers/ui' } from 'src/helpers/ui'
import destination from 'src/mixins/destination'
import CscCfDestination from 'components/call-forwarding/CscCfDestination'
import CscCfDestinationCustomAnnouncement from 'components/call-forwarding/CscCfDestinationCustomAnnouncement'
import CscCfDestinationNumber from 'components/call-forwarding/CscCfDestinationNumber'
export default { export default {
name: 'CscCfGroupItem', name: 'CscCfGroupItem',
components: { CscSpinner, CscInput, CscPopupMenuItemDelete, CscMoreMenu }, components: { CscCfDestinationNumber, CscCfDestinationCustomAnnouncement, CscCfDestination, CscSpinner, CscInput, CscPopupMenuItemDelete, CscMoreMenu },
mixins: [destination],
props: { props: {
mapping: { mapping: {
type: Object, type: Object,
@ -366,7 +282,7 @@ export default {
async updateAnnouncementEvent (payload) { async updateAnnouncementEvent (payload) {
this.$wait.start(this.waitIdentifier) this.$wait.start(this.waitIdentifier)
try { try {
await this.updateAnnouncement({ ...payload, announcementId: this.announcement }) await this.updateAnnouncement({ ...payload, announcementId: this.announcement.value })
this.setAnnouncement() this.setAnnouncement()
} catch (err) { } catch (err) {
showGlobalError(err.message) showGlobalError(err.message)

@ -184,80 +184,137 @@
<q-item-section <q-item-section
side side
> >
<csc-more-menu> <csc-more-menu
<csc-popup-menu-item :grid-view="true"
v-if="mapping.type === 'cfu' && hasSubscriberProfileAttribute('cft')" >
icon="ring_volume" <template
:label="$t('Ring primary number')" v-slot:grid-column-1
@click="ringPrimaryNumberEvent" >
/> <csc-popup-menu-item
<csc-popup-menu-item v-if="mapping.type === 'cfu' && hasSubscriberProfileAttribute('cft')"
v-if="mapping.type === 'cft'" icon="ring_volume"
icon="phone_disabled" :label="$t('Ring primary number')"
:label="$t('Do not ring primary number')" @click="ringPrimaryNumberEvent"
@click="doNotRingPrimaryNumberEvent" />
/> <csc-popup-menu-item
<csc-popup-menu-item v-if="mapping.type === 'cft'"
icon="phone_forwarded" icon="phone_disabled"
:label="$t('Forward to Number')" :label="$t('Do not ring primary number')"
:disable="hasTermination" @click="doNotRingPrimaryNumberEvent"
@click="addDestinationEvent({ />
destinationSetId: destinationSet.id <csc-popup-menu-item
})" :icon="destinationIconByType('Number')"
/> :label="$t('Forward to Number')"
<csc-popup-menu-item :disable="hasTermination"
icon="voicemail" @click="addDestinationEvent({
:label="$t('Forward to Voicebox')" destinationSetId: destinationSet.id
:disable="hasTermination" })"
@click="addDestinationEvent({ />
destination: 'voicebox', <csc-popup-menu-item
destinationSetId: destinationSet.id :icon="destinationIconByType('VoiceBox')"
})" :label="$t('Forward to Voicebox')"
/> :disable="hasTermination"
<csc-popup-menu-item @click="addDestinationEvent({
icon="email" destination: 'voicebox',
:label="$t('Forward to Fax2Mail')" destinationSetId: destinationSet.id
:disable="hasTermination" })"
@click="addDestinationEvent({ />
destination: 'fax2mail', <csc-popup-menu-item
destinationSetId: destinationSet.id :icon="destinationIconByType('Conference')"
})" :label="$t('Forward to Conference')"
/> :disable="hasTermination"
<csc-popup-menu-item @click="addDestinationEvent({
icon="phone_forwarded" destination: 'conference',
:label="$t('Forward to ManagerSecretary')" destinationSetId: destinationSet.id
:disable="hasTermination" })"
@click="addDestinationEvent({ />
destination: 'managersecretary', <csc-popup-menu-item
destinationSetId: destinationSet.id :icon="destinationIconByType('Fax2Mail')"
})" :label="$t('Forward to Fax2Mail')"
/> :disable="hasTermination"
<csc-popup-menu-item @click="addDestinationEvent({
icon="groups" destination: 'fax2mail',
:label="$t('Forward to Conference')" destinationSetId: destinationSet.id
:disable="hasTermination" })"
@click="addDestinationEvent({ />
destination: 'conference', <csc-popup-menu-item
destinationSetId: destinationSet.id :icon="destinationIconByType('ManagerSecretary')"
})" :label="$t('Forward to Manager Secretary')"
/> :disable="hasTermination"
<csc-popup-menu-item @click="addDestinationEvent({
icon="music_note" destination: 'managersecretary',
:label="$t('Custom Announcement')" destinationSetId: destinationSet.id
:disable="hasTermination" })"
@click="addDestinationEvent({ />
destination: 'customhours', <csc-popup-menu-item
destinationSetId: destinationSet.id :icon="destinationIconByType('CustomAnnouncement')"
})" :label="$t('Forward to Custom Announcement')"
/> :disable="hasTermination"
<csc-popup-menu-item @click="addDestinationEvent({
:icon="(mapping.enabled)?'toggle_on':'toggle_off'" destination: 'customhours',
:label="(mapping.enabled)?$t('Disable'):$t('Enable')" destinationSetId: destinationSet.id
@click="toggleMappingEvent(mapping)" })"
/> />
<csc-popup-menu-item-delete </template>
@click="deleteMappingEvent(mapping)" <template
/> v-slot:grid-column-2
>
<csc-popup-menu-item
v-if="isPbxAttendant"
:icon="destinationIconByType('AutoAttendant')"
:label="$t('Forward to Auto Attendant')"
:disable="hasTermination"
@click="addDestinationEvent({
destination: 'autoattendant',
destinationSetId: destinationSet.id
})"
/>
<csc-popup-menu-item
v-if="isPbxAttendant"
:icon="destinationIconByType('OfficeHoursAnnouncement')"
:label="$t('Forward to Office Hours Announcement')"
:disable="hasTermination"
@click="addDestinationEvent({
destination: 'officehours',
destinationSetId: destinationSet.id
})"
/>
<csc-popup-menu-item
:icon="destinationIconByType('CallingCard')"
:label="$t('Forward to Calling Card')"
:disable="hasTermination"
@click="addDestinationEvent({
destination: 'callingcard',
destinationSetId: destinationSet.id
})"
/>
<csc-popup-menu-item
:icon="destinationIconByType('CallThrough')"
:label="$t('Forward to Call Through')"
:disable="hasTermination"
@click="addDestinationEvent({
destination: 'callthrough',
destinationSetId: destinationSet.id
})"
/>
<csc-popup-menu-item
:icon="destinationIconByType('LocalSubscriber')"
:label="$t('Forward to Local Subscriber')"
:disable="hasTermination"
@click="addDestinationEvent({
destination: 'localuser',
destinationSetId: destinationSet.id
})"
/>
<csc-popup-menu-item
:icon="(mapping.enabled)?'toggle_on':'toggle_off'"
:label="(mapping.enabled)?$t('Disable'):$t('Enable')"
@click="toggleMappingEvent(mapping)"
/>
<csc-popup-menu-item-delete
@click="deleteMappingEvent(mapping)"
/>
</template>
</csc-more-menu> </csc-more-menu>
</q-item-section> </q-item-section>
</q-item> </q-item>
@ -278,6 +335,7 @@ import CscCfConditionPopupCallNotFrom from 'components/call-forwarding/CscCfCond
import CscCfConditionPopupDateRange from 'components/call-forwarding/CscCfConditionPopupDateRange' import CscCfConditionPopupDateRange from 'components/call-forwarding/CscCfConditionPopupDateRange'
import CscCfConditionPopupWeekdays from 'components/call-forwarding/CscCfConditionPopupWeekdays' import CscCfConditionPopupWeekdays from 'components/call-forwarding/CscCfConditionPopupWeekdays'
import CscCfConditionPopupOfficeHours from 'components/call-forwarding/CscCfConditionPopupOfficeHours' import CscCfConditionPopupOfficeHours from 'components/call-forwarding/CscCfConditionPopupOfficeHours'
import destination from 'src/mixins/destination'
export default { export default {
name: 'CscCfGroupTitle', name: 'CscCfGroupTitle',
components: { components: {
@ -292,6 +350,7 @@ export default {
CscPopupMenuItemDelete, CscPopupMenuItemDelete,
CscMoreMenu CscMoreMenu
}, },
mixins: [destination],
props: { props: {
mapping: { mapping: {
type: Object, type: Object,
@ -316,7 +375,8 @@ export default {
}, },
computed: { computed: {
...mapGetters('user', [ ...mapGetters('user', [
'hasSubscriberProfileAttribute' 'hasSubscriberProfileAttribute',
'isPbxAttendant'
]), ]),
clickableClasses () { clickableClasses () {
return ['cursor-pointer', 'text-weight-bold', 'text-primary'] return ['cursor-pointer', 'text-weight-bold', 'text-primary']

@ -45,6 +45,7 @@
"Apps": "Apps", "Apps": "Apps",
"Assigned slot {slot}": "Assigned slot {slot}", "Assigned slot {slot}": "Assigned slot {slot}",
"Attach voicemail to email notification": "Attach voicemail to email notification", "Attach voicemail to email notification": "Attach voicemail to email notification",
"Auto Attendant": "Auto Attendant",
"Auto-attendant": "Auto-attendant", "Auto-attendant": "Auto-attendant",
"Block Incoming": "Block Incoming", "Block Incoming": "Block Incoming",
"Block Incoming/Outgoing": "Block Incoming/Outgoing", "Block Incoming/Outgoing": "Block Incoming/Outgoing",
@ -60,6 +61,7 @@
"Call Queue": "Call Queue", "Call Queue": "Call Queue",
"Call Queues": "Call Queues", "Call Queues": "Call Queues",
"Call Settings": "Call Settings", "Call Settings": "Call Settings",
"Call Through": "Call Through",
"Call back": "Call back", "Call back": "Call back",
"Call ended": "Call ended", "Call ended": "Call ended",
"Call forwarded": "Call forwarded", "Call forwarded": "Call forwarded",
@ -68,6 +70,7 @@
"Callee": "Callee", "Callee": "Callee",
"Caller": "Caller", "Caller": "Caller",
"Calling": "Calling", "Calling": "Calling",
"Calling Card": "Calling Card",
"Calling {number}...": "Calling {number}...", "Calling {number}...": "Calling {number}...",
"Calls": "Calls", "Calls": "Calls",
"Calls, Faxes, VoiceMails": "Calls, Faxes, VoiceMails", "Calls, Faxes, VoiceMails": "Calls, Faxes, VoiceMails",
@ -167,10 +170,17 @@
"Fine": "Fine", "Fine": "Fine",
"Forgot password?": "Forgot password?", "Forgot password?": "Forgot password?",
"Format": "Format", "Format": "Format",
"Forward to Auto Attendant": "Forward to Auto Attendant",
"Forward to Call Through": "Forward to Call Through",
"Forward to Calling Card": "Forward to Calling Card",
"Forward to Conference": "Forward to Conference", "Forward to Conference": "Forward to Conference",
"Forward to Custom Announcement": "Forward to Custom Announcement",
"Forward to Fax2Mail": "Forward to Fax2Mail", "Forward to Fax2Mail": "Forward to Fax2Mail",
"Forward to Local Subscriber": "Forward to Local Subscriber",
"Forward to Manager Secretary": "Forward to Manager Secretary",
"Forward to ManagerSecretary": "Forward to ManagerSecretary", "Forward to ManagerSecretary": "Forward to ManagerSecretary",
"Forward to Number": "Forward to Number", "Forward to Number": "Forward to Number",
"Forward to Office Hours Announcement": "Forward to Office Hours Announcement",
"Forward to Voicebox": "Forward to Voicebox", "Forward to Voicebox": "Forward to Voicebox",
"Forwarded to": "Forwarded to", "Forwarded to": "Forwarded to",
"Forwarding": "Forwarding", "Forwarding": "Forwarding",
@ -218,6 +228,7 @@
"Leave conference": "Leave conference", "Leave conference": "Leave conference",
"Leave current conference now!": "Leave current conference now!", "Leave current conference now!": "Leave current conference now!",
"List of registered devices for the subscriber": "List of registered devices for the subscriber", "List of registered devices for the subscriber": "List of registered devices for the subscriber",
"Local Subscriber": "Local Subscriber",
"Login": "Login", "Login": "Login",
"Logout": "Logout", "Logout": "Logout",
"Loop": "Loop", "Loop": "Loop",
@ -275,6 +286,7 @@
"Number list": "Number list", "Number list": "Number list",
"Number list name": "Number list name", "Number list name": "Number list name",
"Numbers": "Numbers", "Numbers": "Numbers",
"Office Hours Announcement": "Office Hours Announcement",
"On weekdays": "On weekdays", "On weekdays": "On weekdays",
"Only incoming calls from listed numbers are allowed": "Only incoming calls from listed numbers are allowed", "Only incoming calls from listed numbers are allowed": "Only incoming calls from listed numbers are allowed",
"Only once": "Only once", "Only once": "Only once",

@ -0,0 +1,160 @@
import sipUriParse from 'src/sip-uri-parse'
import _ from 'lodash'
const DestinationType = {
VoiceBox: 'VoiceBox',
Conference: 'Conference',
Fax2Mail: 'Fax2Mail',
CallingCard: 'CallingCard',
CallThrough: 'CallThrough',
AutoAttendant: 'AutoAttendant',
OfficeHoursAnnouncement: 'OfficeHoursAnnouncement',
CustomAnnouncement: 'CustomAnnouncement',
LocalSubscriber: 'LocalSubscriber',
ManagerSecretary: 'ManagerSecretary',
Application: 'Application',
Number: 'Number'
}
function parseSipUri (sipUri) {
const parsedUri = sipUriParse(sipUri)
const host = parsedUri.host
const username = parsedUri.username
let destinationType
if (host.endsWith('voicebox.local')) {
destinationType = DestinationType.VoiceBox
} else if (host.endsWith('conference.local')) {
destinationType = DestinationType.Conference
} else if (host.endsWith('fax2mail.local')) {
destinationType = DestinationType.Fax2Mail
} else if (username === 'callingcard' && host.endsWith('app.local')) {
destinationType = DestinationType.CallingCard
} else if (username === 'callthrough' && host.endsWith('app.local')) {
destinationType = DestinationType.CallThrough
} else if (username === 'auto-attendant' && host.endsWith('app.local')) {
destinationType = DestinationType.AutoAttendant
} else if (username === 'office-hours' && host.endsWith('app.local')) {
destinationType = DestinationType.OfficeHoursAnnouncement
} else if (username === 'custom-hours' && host.endsWith('app.local')) {
destinationType = DestinationType.CustomAnnouncement
} else if (username === 'localuser' && host.endsWith('local')) {
destinationType = DestinationType.LocalSubscriber
} else if (host.endsWith('managersecretary.local')) {
destinationType = DestinationType.ManagerSecretary
} else if (host.endsWith('app.local')) {
destinationType = DestinationType.Application
} else {
destinationType = DestinationType.Number
}
return {
destinationType,
parsedUri
}
}
export default {
methods: {
isDestinationType (sipUri, destinationType) {
const parsedSipUri = parseSipUri(sipUri)
return parsedSipUri.destinationType === destinationType
},
isDestinationTypeVoiceBox (sipUri) {
return this.isDestinationType(sipUri, DestinationType.VoiceBox)
},
isDestinationTypeConference (sipUri) {
return this.isDestinationType(sipUri, DestinationType.Conference)
},
isDestinationTypeFax2Mail (sipUri) {
return this.isDestinationType(sipUri, DestinationType.Fax2Mail)
},
isDestinationTypeCallingCard (sipUri) {
return this.isDestinationType(sipUri, DestinationType.CallingCard)
},
isDestinationTypeCallThrough (sipUri) {
return this.isDestinationType(sipUri, DestinationType.CallThrough)
},
isDestinationTypeAutoAttendant (sipUri) {
return this.isDestinationType(sipUri, DestinationType.AutoAttendant)
},
isDestinationTypeOfficeHoursAnnouncement (sipUri) {
return this.isDestinationType(sipUri, DestinationType.OfficeHoursAnnouncement)
},
isDestinationTypeCustomAnnouncement (sipUri) {
return this.isDestinationType(sipUri, DestinationType.CustomAnnouncement)
},
isDestinationTypeLocalSubscriber (sipUri) {
return this.isDestinationType(sipUri, DestinationType.LocalSubscriber)
},
isDestinationTypeManagerSecretary (sipUri) {
return this.isDestinationType(sipUri, DestinationType.ManagerSecretary)
},
isDestinationTypeApplication (sipUri) {
return this.isDestinationType(sipUri, DestinationType.Application)
},
isDestinationTypeNumber (sipUri) {
return this.isDestinationType(sipUri, DestinationType.Number)
},
destinationIconBySipUri (sipUri) {
const parsedSipUri = parseSipUri(sipUri)
return this.destinationIconByType(parsedSipUri.destinationType)
},
destinationIconByType (destinationType) {
switch (destinationType) {
case DestinationType.VoiceBox:
return 'voicemail'
case DestinationType.Conference:
return 'groups'
case DestinationType.Fax2Mail:
return 'email'
case DestinationType.CallingCard:
return 'credit_card'
case DestinationType.CallThrough:
return 'double_arrow'
case DestinationType.AutoAttendant:
return 'dialpad'
case DestinationType.OfficeHoursAnnouncement:
return 'schedule'
case DestinationType.CustomAnnouncement:
return 'music_note'
case DestinationType.LocalSubscriber:
return 'person_pin'
case DestinationType.ManagerSecretary:
return 'support_agent'
case DestinationType.Application:
return 'apps'
case DestinationType.Number:
return 'phone_forwarded'
}
},
destinationFormattedBySipUri (sipUri) {
const parsedSipUri = parseSipUri(sipUri)
switch (parsedSipUri.destinationType) {
case DestinationType.VoiceBox:
return this.$t('Voicebox')
case DestinationType.Conference:
return this.$t('Conference')
case DestinationType.Fax2Mail:
return this.$t('Fax2Mail')
case DestinationType.CallingCard:
return this.$t('Calling Card')
case DestinationType.CallThrough:
return this.$t('Call Through')
case DestinationType.AutoAttendant:
return this.$t('Auto Attendant')
case DestinationType.OfficeHoursAnnouncement:
return this.$t('Office Hours Announcement')
case DestinationType.CustomAnnouncement:
return this.$t('Custom Announcement')
case DestinationType.LocalSubscriber:
return this.$t('Local Subscriber')
case DestinationType.ManagerSecretary:
return this.$t('Manager Secretary')
case DestinationType.Application:
return _.words(parsedSipUri.parsedUri.username).map(word => _.upperFirst(word)).join(' ')
default:
case DestinationType.Number:
return parsedSipUri.parsedUri.username
}
}
}
}

@ -33,7 +33,7 @@ const DEFAULT_CUSTOM_ANNOUNCEMENT_ID = 255 // TODO get from endpoint
function createDefaultDestination (destination) { function createDefaultDestination (destination) {
const payload = { const payload = {
destination: destination || 'Number', destination: destination || ' ',
priority: DEFAULT_PRIORITY, priority: DEFAULT_PRIORITY,
timeout: DEFAULT_RING_TIMEOUT timeout: DEFAULT_RING_TIMEOUT
} }

@ -189,6 +189,18 @@ export default {
}, },
isOldCSCProxyingAllowed (state, getters) { isOldCSCProxyingAllowed (state, getters) {
return getters.isAdmin && state.platformInfo?.csc_v2_mode === 'mixed' && !!getters.getCustomerId return getters.isAdmin && state.platformInfo?.csc_v2_mode === 'mixed' && !!getters.getCustomerId
},
isPbxPilot (state) {
return !!state.subscriber?.is_pbx_pilot
},
isPbxGroup (state) {
return !!state.subscriber?.is_pbx_group
},
isPbxSeat (state, getters) {
return !getters.isPbxPilot && !getters.isPbxGroup && !!state.subscriber?.pbx_extension
},
isPbxAttendant (state, getters) {
return getters.isPbxPilot || getters.isPbxGroup || getters.isPbxSeat
} }
}, },
mutations: { mutations: {

Loading…
Cancel
Save