From d48503bdcf5fb3e3dd0b5f30b05fa68dc994f28f Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Fri, 22 Aug 2025 13:38:23 +0200 Subject: [PATCH] feat(voice): Improved voice call creation flow [EE] (#12268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR improves the voice call creation flow by simplifying configuration and automating setup with Twilio APIs. references: #11602 , #11481 ## Key changes - Removed the requirement for twiml_app_sid – provisioning is now automated through APIs. - Auto-configured webhook URLs for: - Voice number callbacks - Status callbacks - twiML callbacks - Disabled business hours, help center, and related options until voice inbox is fully supported. - Added a configuration tab in the voice inbox to display the required Twilio URLs (to make verification easier in Twilio console). ## Test Cases - Provisioning - Create a new voice inbox → verify that Twilio app provisioning happens automatically. - Verify twiML callback - Webhook configuration - Check that both voice number callback and status callback URLs are auto-populated in Twilio. - Disabled features - Confirm that business hours and help center options are hidden/disabled for voice inbox. - Configuration tab - Open the voice inbox configuration tab → verify that the displayed Twilio URLs match what’s set in Twilio. --- .../dashboard/i18n/locale/en/inboxMgmt.json | 11 ++- .../dashboard/settings/inbox/Settings.vue | 25 +++-- .../settings/inbox/channels/Voice.vue | 17 ---- .../inbox/settingsPage/ConfigurationPage.vue | 19 ++++ app/javascript/shared/mixins/inboxMixin.js | 6 +- app/views/api/v1/models/_inbox.json.jbuilder | 6 ++ enterprise/app/models/channel/voice.rb | 40 +++++++- .../twilio/voice_webhook_setup_service.rb | 99 +++++++++++++++++++ .../v1/accounts/inboxes_controller_spec.rb | 6 +- spec/enterprise/models/channel/voice_spec.rb | 21 +++- .../voice_webhook_setup_service_spec.rb | 88 +++++++++++++++++ spec/factories/channel/channel_voice.rb | 3 +- 12 files changed, 302 insertions(+), 39 deletions(-) create mode 100644 enterprise/app/services/twilio/voice_webhook_setup_service.rb create mode 100644 spec/enterprise/services/twilio/voice_webhook_setup_service_spec.rb diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index 4006212a3..6f44ec046 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -330,13 +330,14 @@ "LABEL": "API Key Secret", "PLACEHOLDER": "Enter your Twilio API Key Secret", "REQUIRED": "API Key Secret is required" - }, - "TWIML_APP_SID": { - "LABEL": "TwiML App SID", - "PLACEHOLDER": "Enter your Twilio TwiML App SID (starts with AP)", - "REQUIRED": "TwiML App SID is required" } }, + "CONFIGURATION": { + "TWILIO_VOICE_URL_TITLE": "Twilio Voice URL", + "TWILIO_VOICE_URL_SUBTITLE": "Configure this URL as the Voice URL on your Twilio phone number and TwiML App.", + "TWILIO_STATUS_URL_TITLE": "Twilio Status Callback URL", + "TWILIO_STATUS_URL_SUBTITLE": "Configure this URL as the Status Callback URL on your Twilio phone number." + }, "SUBMIT_BUTTON": "Create Voice Channel", "API": { "ERROR_MESSAGE": "We were not able to create the voice channel" diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue index 1db35af03..609fd3fd4 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue @@ -116,16 +116,22 @@ export default { key: 'collaborators', name: this.$t('INBOX_MGMT.TABS.COLLABORATORS'), }, - { - key: 'businesshours', - name: this.$t('INBOX_MGMT.TABS.BUSINESS_HOURS'), - }, - { - key: 'csat', - name: this.$t('INBOX_MGMT.TABS.CSAT'), - }, ]; + if (!this.isAVoiceChannel) { + visibleToAllChannelTabs = [ + ...visibleToAllChannelTabs, + { + key: 'businesshours', + name: this.$t('INBOX_MGMT.TABS.BUSINESS_HOURS'), + }, + { + key: 'csat', + name: this.$t('INBOX_MGMT.TABS.CSAT'), + }, + ]; + } + if (this.isAWebWidgetInbox) { visibleToAllChannelTabs = [ ...visibleToAllChannelTabs, @@ -144,6 +150,7 @@ export default { this.isATwilioChannel || this.isALineChannel || this.isAPIInbox || + this.isAVoiceChannel || (this.isAnEmailChannel && !this.inbox.provider) || this.shouldShowWhatsAppConfiguration || this.isAWebWidgetInbox @@ -676,7 +683,7 @@ export default { }}