feat(voice): subscribe to calls webhook + gate WhatsApp calling on channel_voice flag

- Add 'calls' to the WhatsApp WABA override_callback subscribed_fields so a
  fresh embedded-signup connection (or a re-register) automatically receives
  call webhooks from Meta. Previously required a manual App Dashboard step.
- Gate Channel::Whatsapp#voice_enabled? on the account-level 'channel_voice'
  feature flag, matching the entitlement Twilio voice channel creation
  already requires. Cascades through the controller, webhook services, and
  inbox jbuilder voice_enabled serialization (FE button hides automatically).
This commit is contained in:
Tanmay Deep Sharma
2026-05-05 18:01:14 +07:00
parent cb420d83f6
commit 567631b866
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -46,7 +46,8 @@ class Channel::Whatsapp < ApplicationRecord
def voice_enabled?
provider == 'whatsapp_cloud' &&
provider_config['source'] == 'embedded_signup' &&
provider_config['calling_enabled'].present?
provider_config['calling_enabled'].present? &&
account.feature_enabled?('channel_voice')
end
def provider_service
+1 -1
View File
@@ -86,7 +86,7 @@ class Whatsapp::FacebookApiClient
body: {
override_callback_uri: callback_url,
verify_token: verify_token,
subscribed_fields: %w[messages smb_message_echoes]
subscribed_fields: %w[messages smb_message_echoes calls]
}.to_json
)