CloudonixSettings Model
The CloudonixSettings model stores per-organization Cloudonix CPaaS credentials and voice application configuration.
Table: cloudonix_settings
Model: App\Models\CloudonixSettings
Database Schema
| Column | Type | Nullable | Description |
|---|---|---|---|
id | bigint unsigned | No | Primary key |
organization_id | bigint unsigned | No | One-to-one with organization (unique). Foreign key, ON DELETE CASCADE |
domain_uuid | char(36) | Yes | Cloudonix domain UUID (unique) |
domain_name | varchar(255) | Yes | Cloudonix domain name (unique) |
domain_api_key | text | Yes | Encrypted API key. Hidden from serialization |
domain_requests_api_key | text | Yes | Encrypted webhook auth key. Hidden from serialization |
webhook_base_url | varchar(255) | Yes | Organization's webhook base URL |
voice_application_id | bigint unsigned | Yes | Cloudonix voice app ID |
voice_application_uuid | varchar(255) | Yes | Cloudonix voice app UUID |
voice_application_name | varchar(255) | Yes | Cloudonix voice app name |
embed_allowed_domains | json | Yes | Sites allowed to embed the dialer |
no_answer_timeout | int | No | Default ring timeout, seconds. Default 60 |
call_recording_mode | enum | No | disabled, inbound, outbound, internal, inbound_outbound, all. Default disabled |
recording_format | enum | No | wav or mp3. Default mp3 |
cloudonix_package | varchar(255) | Yes | Unused; never written. The package tier is read live from Cloudonix and cached (cloudonix:package:{organization_id}, one hour) |
created_at | timestamp | Yes | |
updated_at | timestamp | Yes |
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()andgetVoiceRouteUrl()return{base}/api/webhooks/cloudonix/session-update,{base}/api/webhooks/cloudonix/cdrand{base}/api/voice/route. The base is the effective webhook base URL, orAPP_URLwhen that is empty.- The effective webhook base URL is
OPBX_APPLICATION_WEBHOOK_BASEURLwhen that environment variable is set (application-level override), otherwise the row'swebhook_base_url. isConfigured()is true whendomain_uuidanddomain_api_keyare set;hasWebhookAuth()whendomain_requests_api_keyis set.- Settings are updated through
SettingsController::updateCloudonixSettings, which also syncs the voice application to Cloudonix.