feat(voice): add WhatsApp calling enable toggle to inbox configuration

This commit is contained in:
Tanmay Deep Sharma
2026-04-30 19:39:19 +07:00
parent c7b6a87e77
commit f3df486ce6
2 changed files with 39 additions and 0 deletions
@@ -800,6 +800,10 @@
"WHATSAPP_TEMPLATES_SYNC_SUBHEADER": "Manually sync message templates from WhatsApp to update your available templates.",
"WHATSAPP_TEMPLATES_SYNC_BUTTON": "Sync Templates",
"WHATSAPP_TEMPLATES_SYNC_SUCCESS": "Templates sync initiated successfully. It may take a couple of minutes to update.",
"WHATSAPP_CALLING_ENABLED": {
"LABEL": "Enable voice calling",
"DESCRIPTION": "Allow agents to start and receive WhatsApp voice calls on this inbox. Available only on embedded-signup WhatsApp Cloud channels with calling permission granted by Meta."
},
"UPDATE_PRE_CHAT_FORM_SETTINGS": "Update Pre Chat Form Settings"
},
"HELP_CENTER": {
@@ -44,6 +44,7 @@ export default {
allowedDomains: '',
isUpdatingAllowedDomains: false,
isSettingDefaults: false,
whatsAppCallingEnabled: false,
};
},
validations: {
@@ -71,6 +72,10 @@ export default {
if (!this.isSettingDefaults && this.isAWebWidgetInbox)
this.handleHmacFlag();
},
whatsAppCallingEnabled() {
if (!this.isSettingDefaults && this.isEmbeddedSignupWhatsApp)
this.updateWhatsAppCallingEnabled();
},
},
mounted() {
this.setDefaults();
@@ -83,6 +88,9 @@ export default {
this.inbox.selected_feature_flags || []
).includes('allow_mobile_webview');
this.allowedDomains = this.inbox.allowed_domains || '';
this.whatsAppCallingEnabled = Boolean(
this.inbox.provider_config?.calling_enabled
);
this.$nextTick(() => {
this.isSettingDefaults = false;
});
@@ -147,6 +155,24 @@ export default {
this.isUpdatingAllowedDomains = false;
}
},
async updateWhatsAppCallingEnabled() {
try {
const payload = {
id: this.inbox.id,
formData: false,
channel: {
provider_config: {
...this.inbox.provider_config,
calling_enabled: this.whatsAppCallingEnabled,
},
},
};
await this.$store.dispatch('inboxes/updateInbox', payload);
useAlert(this.$t('INBOX_MGMT.EDIT.API.SUCCESS_MESSAGE'));
} catch (error) {
useAlert(this.$t('INBOX_MGMT.EDIT.API.ERROR_MESSAGE'));
}
},
async updateWhatsAppInboxAPIKey() {
try {
const payload = {
@@ -374,6 +400,15 @@ export default {
</NextButton>
</div>
</SettingsFieldSection>
<SettingsToggleSection
v-model="whatsAppCallingEnabled"
:header="
$t('INBOX_MGMT.SETTINGS_POPUP.WHATSAPP_CALLING_ENABLED.LABEL')
"
:description="
$t('INBOX_MGMT.SETTINGS_POPUP.WHATSAPP_CALLING_ENABLED.DESCRIPTION')
"
/>
</template>
<!-- Manual Setup Section -->