diff --git a/src/api/pbx-groups.js b/src/api/pbx-groups.js
index 6a26b4a4..4fea7eb6 100644
--- a/src/api/pbx-groups.js
+++ b/src/api/pbx-groups.js
@@ -10,7 +10,9 @@ import {
setPbxHuntPolicy,
setPbxHuntTimeout, setSubscriberNumbers,
setPbxHuntCancelMode,
- generateGeneralPassword
+ generateGeneralPassword,
+ setPreferenceAnnouncementCallSetup,
+ setPreferenceAnnouncementCfu
} from './subscriber'
import {
getAllSoundSets,
@@ -20,6 +22,7 @@ import {
PBX_CONFIG_ORDER_DIRECTION,
setSubscriberSoundSet
} from './pbx-config'
+
import {
assignNumbers,
getNumbers
@@ -306,6 +309,22 @@ export function setGroupSoundSet (options) {
})
}
+/**
+ * @param groupId
+ * @param announcementCfu
+ */
+export function setGroupAnnouncementCfu (groupId, announcementCfu) {
+ return setPreferenceAnnouncementCfu(groupId, announcementCfu)
+}
+
+/**
+ * @param groupId
+ * @param announcementCallSetup
+ */
+export function setGroupAnnouncementCallSetup (groupId, announcementCallSetup) {
+ return setPreferenceAnnouncementCallSetup(groupId, announcementCallSetup)
+}
+
// This mirrors the logic we use in ngcp-admin to handle the pbx groups creation
// If you change the logic below make sure you make the same changes in ngcp-admin too
function createUsername (name) {
diff --git a/src/pages/CscPagePbxGroupDetails.vue b/src/pages/CscPagePbxGroupDetails.vue
index 63a67b9f..1be4329c 100644
--- a/src/pages/CscPagePbxGroupDetails.vue
+++ b/src/pages/CscPagePbxGroupDetails.vue
@@ -237,6 +237,28 @@
@click="jumpToCallQueueInternal"
/>
+
+
+
+
{
+ const groupPreferences = state.preferenceMapById[id]
+ return groupPreferences && groupPreferences.play_announce_before_cf ? state.preferenceMapById[id].play_announce_before_cf : false
+ }
+ },
+ getAnnouncementCallSetup (state) {
+ return (id) => {
+ const groupPreferences = state.preferenceMapById[id]
+ return groupPreferences && groupPreferences.play_announce_before_call_setup ? state.preferenceMapById[id].play_announce_before_call_setup : false
+ }
}
},
mutations: {
@@ -434,6 +448,30 @@ export default {
}).catch((err) => {
context.commit('groupUpdateFailed', err.message)
})
+ },
+ async setAnnouncementCfu (context, options) {
+ context.commit('groupUpdateRequesting', {
+ groupId: options.groupId,
+ groupField: options.message || i18n.global.t('the playback announcement as early media before Call Forward Unconditional or Unavailable')
+ })
+ try {
+ const result = await setGroupAnnouncementCfu(options.groupId, options.announcementCfu)
+ context.commit('groupUpdateSucceeded', result)
+ } catch (err) {
+ context.commit('groupUpdateFailed', err.message)
+ }
+ },
+ async setAnnouncementCallSetup (context, options) {
+ context.commit('groupUpdateRequesting', {
+ groupId: options.groupId,
+ groupField: options.message || i18n.global.t('the playback announcement as early media before send the call to callee')
+ })
+ try {
+ const result = await setGroupAnnouncementCallSetup(options.groupId, options.announcementCallSetup)
+ context.commit('groupUpdateSucceeded', result)
+ } catch (err) {
+ context.commit('groupUpdateFailed', err.message)
+ }
}
}
}