Skip to main content

CallNotificationsSettings Model

The CallNotificationsSettings model stores per-organization webhook notification configuration for call events.

Table: call_notifications_settings
Model: App\Models\CallNotificationsSettings

Database Schema​

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Unique: one row per organization. Foreign key to organizations, ON DELETE CASCADE
webhook_urlvarchar(2048)No-Target URL
auth_methodenumNononenone, bearer_token, basic_auth. The column enum still lists hmac_sha256 (not accepted by the API); the DB default is none and migration 2026_10_14_100000 converted old hmac_sha256 rows to none
auth_secrettextYesnullBearer token or basic-auth password. encrypted cast, hidden from serialization
auth_usernamevarchar(255)YesnullFor basic auth
retry_attemptstinyint unsignedNo3Max retries (API: 1-10)
retry_backoff_secondssmallint unsignedNo60Base backoff (API: 10-3600)
request_timeout_secondssmallint unsignedNo30HTTP timeout (API: 5-120)
enabled_eventsjsonNoall eight events (model default)Subset of new, ringing, connected, answered, busy, cancel, failed, congestion. The column has no database default; the model's $attributes sets all eight
rate_limit_per_minutesmallint unsignedNo500Redis-based rate limit (API: 100-5000)
is_activebooleanNotrueMaster switch
created_attimestampYesnull
updated_attimestampYesnull

Relationships​

$settings->organization() → Organization

Scopes​

CallNotificationsSettings::forOrganization($orgId)
CallNotificationsSettings::active()

Methods​

$settings->isEventEnabled(string $event): bool
$settings->isConfigured(): bool
$settings->getAuthHeaders(array $payload): array

isConfigured() is true when webhook_url is set and is_active is true. getAuthHeaders() returns Authorization: Bearer <auth_secret> for bearer_token, Authorization: Basic base64(auth_username:auth_secret) for basic_auth, and no header for none.

Usage Notes​

  • Webhook URLs are validated by the ValidWebhookUrl rule (SSRF protection) before storage.
  • The model is scoped by OrganizationScope; webhook handlers use OrganizationScope::bypass() to read it.
  • Authentication secrets are encrypted at rest.