Skip to main content

CloudonixSettings Model

The CloudonixSettings model stores per-organization Cloudonix CPaaS credentials and voice application configuration.

Table: cloudonix_settings
Model: App\Models\CloudonixSettings

Database Schema​

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
organization_idbigint unsignedNoOne-to-one with organization (unique). Foreign key, ON DELETE CASCADE
domain_uuidchar(36)YesCloudonix domain UUID (unique)
domain_namevarchar(255)YesCloudonix domain name (unique)
domain_api_keytextYesEncrypted API key. Hidden from serialization
domain_requests_api_keytextYesEncrypted webhook auth key. Hidden from serialization
webhook_base_urlvarchar(255)YesOrganization's webhook base URL
voice_application_idbigint unsignedYesCloudonix voice app ID
voice_application_uuidvarchar(255)YesCloudonix voice app UUID
voice_application_namevarchar(255)YesCloudonix voice app name
embed_allowed_domainsjsonYesSites allowed to embed the dialer
no_answer_timeoutintNoDefault ring timeout, seconds. Default 60
call_recording_modeenumNodisabled, inbound, outbound, internal, inbound_outbound, all. Default disabled
recording_formatenumNowav or mp3. Default mp3
cloudonix_packagevarchar(255)YesUnused; never written. The package tier is read live from Cloudonix and cached (cloudonix:package:{organization_id}, one hour)
created_attimestampYes
updated_attimestampYes

Relationships​

$settings->organization() → Organization

Methods​

CloudonixSettings::forDomain(string $column, string $value): ?self // column is domain_name or domain_uuid; bypasses OrganizationScope
CloudonixSettings::forOrganization(?int $organizationId): ?self // bypasses OrganizationScope
$settings->getCallbackUrl(): string
$settings->getCdrUrl(): string
$settings->getVoiceRouteUrl(): string
$settings->getMaskedDomainApiKey(): ?string
$settings->getMaskedDomainRequestsApiKey(): ?string
$settings->isConfigured(): bool
$settings->hasWebhookAuth(): bool
$settings->getEffectiveWebhookBaseUrlAttribute(): ?string
$settings->isWebhookUrlOverridden(): bool
$settings->getWebhookUrlDetails(): array

Usage Notes​

  • API keys are encrypted at rest using Laravel's encryption.
  • getCallbackUrl(), getCdrUrl() and getVoiceRouteUrl() return {base}/api/webhooks/cloudonix/session-update, {base}/api/webhooks/cloudonix/cdr and {base}/api/voice/route. The base is the effective webhook base URL, or APP_URL when that is empty.
  • The effective webhook base URL is OPBX_APPLICATION_WEBHOOK_BASEURL when that environment variable is set (application-level override), otherwise the row's webhook_base_url.
  • isConfigured() is true when domain_uuid and domain_api_key are set; hasWebhookAuth() when domain_requests_api_key is set.
  • Settings are updated through SettingsController::updateCloudonixSettings, which also syncs the voice application to Cloudonix.