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:
@@ -46,7 +46,8 @@ class Channel::Whatsapp < ApplicationRecord
|
|||||||
def voice_enabled?
|
def voice_enabled?
|
||||||
provider == 'whatsapp_cloud' &&
|
provider == 'whatsapp_cloud' &&
|
||||||
provider_config['source'] == 'embedded_signup' &&
|
provider_config['source'] == 'embedded_signup' &&
|
||||||
provider_config['calling_enabled'].present?
|
provider_config['calling_enabled'].present? &&
|
||||||
|
account.feature_enabled?('channel_voice')
|
||||||
end
|
end
|
||||||
|
|
||||||
def provider_service
|
def provider_service
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class Whatsapp::FacebookApiClient
|
|||||||
body: {
|
body: {
|
||||||
override_callback_uri: callback_url,
|
override_callback_uri: callback_url,
|
||||||
verify_token: verify_token,
|
verify_token: verify_token,
|
||||||
subscribed_fields: %w[messages smb_message_echoes]
|
subscribed_fields: %w[messages smb_message_echoes calls]
|
||||||
}.to_json
|
}.to_json
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user