Skip to main content

Extensions, Phone Numbers and Conference Rooms

Core routing destinations.

Extension​

A PBX extension. User extensions are SIP subscribers on Cloudonix; the other types are virtual destinations.

Table: extensions
Model: App\Models\Extension
Tenant scoped: yes (OrganizationScope)

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
user_idbigint unsignedYesnullUser the extension belongs to. Foreign key to users, on delete set null
extension_numbervarchar(5)No-Extension number (up to 5 digits)
passwordvarchar(32)YesnullSIP password
cloudonix_subscriber_idvarchar(50)YesnullCloudonix subscriber ID
cloudonix_uuidvarchar(100)YesnullCloudonix subscriber UUID (matched against call_detail_records.subscriber)
cloudonix_syncedbooleanNofalseWhether the subscriber is synced to Cloudonix
typeenumNouserExtension type. virtual exists in the column but not in ExtensionType. Values: user, virtual, conference, ring_group, ivr, ai_assistant, custom_logic, forward, queue, ai_load_balancer (cast to ExtensionType)
statusenumNoactiveActive or inactive. Values: active, inactive (cast to UserStatus)
voicemail_enabledbooleanNofalseVoicemail on
configurationjsonYesnullType-specific settings, for example forward_to, ring_group_id, ivr_id, conference_room_id, call_queue_id, ai_assistant_id, ai_load_balancer_id, container_application_name, container_block_name, sip_uri
service_urlvarchar(255)YesnullService URL for AI assistant extensions (preferred over the legacy configuration)
service_tokenvarchar(255)YesnullService token
service_paramsjsonYesnullService parameters
ai_assistant_idbigint unsignedYesnullAI assistant. Foreign key to ai_assistants, on delete set null
default_caller_id_did_idbigint unsignedYesnullDefault outbound Caller ID. Foreign key to did_numbers, on delete set null
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • ext_org_extnum_status_idx: organization_id, extension_number, status
  • extensions_ai_assistant_id_index: ai_assistant_id
  • extensions_cloudonix_subscriber_id_index: cloudonix_subscriber_id
  • extensions_default_caller_id_did_id_foreign: default_caller_id_did_id
  • extensions_organization_id_extension_number_unique (unique): organization_id, extension_number
  • extensions_organization_id_status_index: organization_id, status
  • extensions_organization_id_type_index: organization_id, type
  • extensions_user_id_index: user_id
  • idx_org_ext_number: organization_id, extension_number

Casts: configuration (array), service_params (array)
Hidden from serialization: password

Relationships

$extension->organization() → Organization (organization_id) [BelongsTo]
$extension->user() → User (user_id) [BelongsTo]
$extension->aiAssistant() → AiAssistant (ai_assistant_id) [BelongsTo]
$extension->aiLoadBalancer() → AiAssistantLoadBalancer (configuration->ai_load_balancer_id) [BelongsTo]
$extension->defaultCallerId() → DidNumber (default_caller_id_did_id) [BelongsTo]

Scopes: forOrganization(), withType(), withStatus(), forUser(), search(), active(), unassigned()
Methods: isActive(), isInactive(), belongsToUser(), getFormattedNumberAttribute(), getSipUri(), hasSipUri(), getSipPassword(), regeneratePassword(), generateSecurePassword()

aiLoadBalancer() uses the JSON path configuration->ai_load_balancer_id.

DidNumber​

A phone number (DID) and how inbound calls to it are routed.

Table: did_numbers
Model: App\Models\DidNumber
Tenant scoped: yes (OrganizationScope)
Traits: HasUnprovisionedState

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
phone_numbervarchar(20)No-Number in E.164
friendly_namevarchar(255)YesnullDisplay name
routing_typeenumNoextensionWhere inbound calls go. Values: extension, ring_group, business_hours, conference_room, ai_assistant, ai_load_balancer, ivr_menu, call_queue, unavailable
routing_configjsonYesnullTarget of the route: extension_id, ring_group_id, business_hours_schedule_id, conference_room_id, ai_assistant_id, ai_load_balancer_id, ivr_menu_id or call_queue_id, depending on routing_type
statusenumNoactiveActive or inactive. Values: active, inactive
cloudonix_configjsonYesnullCloudonix-side settings of the number
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • did_numbers_organization_id_status_index: organization_id, status
  • did_numbers_phone_number_index: phone_number
  • did_numbers_phone_number_unique (unique): phone_number
  • idx_did_org_phone_status: organization_id, phone_number, status

Casts: routing_config (array), cloudonix_config (array)

Relationships

$didNumber->organization() → Organization (organization_id) [BelongsTo]

Scopes: forOrganization(), unprovisioned()
Methods: isActive(), getTargetId(), getTargetExtensionId(), getTargetRingGroupId(), getTargetCallQueueId(), getTargetBusinessHoursId(), getTargetConferenceRoomId(), getTargetAiAssistantId(), getTargetIvrMenuId(), getTargetAiLoadBalancerId(), getExtensionAttribute(), getRingGroupAttribute(), getCallQueueAttribute(), getBusinessHoursScheduleAttribute(), getConferenceRoomAttribute(), getAiAssistantAttribute(), getIvrMenuAttribute(), getAiLoadBalancerAttribute(), setExtension(), setRingGroup(), setBusinessHoursSchedule(), setConferenceRoom(), setAiAssistant(), setIvrMenu(), setAiLoadBalancer()

unprovisioned() and is_unprovisioned are true when routing_type is unavailable. The getTarget*Id() methods read the matching key from routing_config, the extension, ring_group, call_queue, ... accessors load the target, and the set*() methods write routing_type and routing_config together.

ConferenceRoom​

A conference room.

Table: conference_rooms
Model: App\Models\ConferenceRoom
Tenant scoped: yes (OrganizationScope)

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
namevarchar(255)No-Room name
descriptiontextYesnullDescription
max_participantsintNo25Participant limit
statusvarchar(255)NoactiveActive or inactive (cast to UserStatus) (cast to UserStatus)
pinvarchar(20)YesnullParticipant PIN
pin_requiredbooleanNofalseRequire the PIN
host_pinvarchar(20)YesnullHost PIN
recording_enabledbooleanNofalseRecord the conference
recording_auto_startbooleanNofalseStart recording automatically
recording_webhook_urlvarchar(255)YesnullWebhook for recording events
wait_for_hostbooleanNofalseHold participants until the host joins
mute_on_entrybooleanNofalseMute participants when they join
announce_join_leavebooleanNofalseAnnounce joins and leaves
music_on_holdbooleanNofalsePlay music while waiting
talk_detection_enabledbooleanNofalseSend talk-detection events
talk_detection_webhook_urlvarchar(255)YesnullWebhook for talk-detection events
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • conference_rooms_organization_id_name_index: organization_id, name
  • conference_rooms_organization_id_status_index: organization_id, status

Relationships

$conferenceRoom->organization() → Organization (organization_id) [BelongsTo]

Scopes: forOrganization(), active(), inactive(), withStatus(), search()
Methods: isActive()

status is a plain varchar column (default active) cast to UserStatus.