Skip to main content

Call Queues

Call queues, their agents, and per-call queue records.

CallQueue​

A call queue. Live state (waiting callers, agent states) is kept by the ACD worker in Redis, not in MySQL.

Table: call_queues
Model: App\Models\CallQueue
Tenant scoped: yes (OrganizationScope)
Traits: HasUnprovisionedState

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
namevarchar(255)No-Queue name
descriptionvarchar(255)YesnullDescription
strategyenumNoring_allHow agents are offered calls. Values: ring_all, round_robin, least_talk_time, fewest_calls (cast to CallQueueStrategy)
agent_ring_timeoutsmallint unsignedNo20Seconds an agent rings
max_wait_secondssmallint unsignedNo300Longest wait before the fallback (overflow)
wrap_up_secondssmallint unsignedNo15Agent wrap-up time after a call
announce_positionbooleanNofalseAnnounce the caller's position
announce_position_timeoutsmallint unsignedNo60Seconds between position announcements
announce_position_languagevarchar(20)YesnullLanguage of the announcements
immediate_connectbooleanNofalseWhen an agent becomes available, connect the first waiting caller at once instead of waiting for the next poll
conference_ring_allbooleanNofalseWith the ring_all strategy, offer the call to the agents as per-agent conference sessions. The create request defaults it to true for a ring_all queue (column default stays false); migration 2026_10_15_110000_enable_conference_ring_all_on_ring_all_queues switched it on for existing ring_all queues
moh_recording_idbigint unsignedYesnullMusic-on-hold recording. Foreign key to recordings, on delete set null
fallback_actionenumNohangupWhere the call goes when the queue gives up. Values: extension, ring_group, ivr_menu, ai_assistant, ai_load_balancer, hangup, unavailable, call_queue (cast to RingGroupFallbackAction)
fallback_extension_idbigint unsignedYesnullFallback extension. Foreign key to extensions, on delete set null
fallback_ring_group_idbigint unsignedYesnullFallback ring group. Foreign key to ring_groups, on delete set null
fallback_ivr_menu_idbigint unsignedYesnullFallback IVR menu. Foreign key to ivr_menus, on delete set null
fallback_ai_assistant_idbigint unsignedYesnullFallback AI assistant. Foreign key to ai_assistants, on delete set null
fallback_ai_load_balancer_idbigint unsignedYesnullFallback AI load balancer. Foreign key to ai_assistant_load_balancers, on delete set null
fallback_call_queue_idbigint unsignedYesnullFallback call queue (never the queue itself). Foreign key to call_queues, on delete set null
statusenumNoactiveActive or inactive. Values: active, inactive (cast to CallQueueStatus)
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • call_queues_fallback_ai_assistant_id_foreign: fallback_ai_assistant_id
  • call_queues_fallback_ai_load_balancer_id_foreign: fallback_ai_load_balancer_id
  • call_queues_fallback_call_queue_id_foreign: fallback_call_queue_id
  • call_queues_fallback_extension_id_foreign: fallback_extension_id
  • call_queues_fallback_ivr_menu_id_foreign: fallback_ivr_menu_id
  • call_queues_fallback_ring_group_id_foreign: fallback_ring_group_id
  • call_queues_moh_recording_id_foreign: moh_recording_id
  • cq_org_status_idx: organization_id, status

Relationships

$callQueue->organization() → Organization (organization_id) [BelongsTo]
$callQueue->agentRecords() → CallQueueAgent (call_queue_id) [HasMany]
$callQueue->agents() → User (pivot call_queue_agents) [BelongsToMany]
$callQueue->mohRecording() → Recording (moh_recording_id) [BelongsTo]
$callQueue->fallbackExtension() → Extension (fallback_extension_id) [BelongsTo]
$callQueue->fallbackRingGroup() → RingGroup (fallback_ring_group_id) [BelongsTo]
$callQueue->fallbackIvrMenu() → IvrMenu (fallback_ivr_menu_id) [BelongsTo]
$callQueue->fallbackAiAssistant() → AiAssistant (fallback_ai_assistant_id) [BelongsTo]
$callQueue->fallbackAiLoadBalancer() → AiAssistantLoadBalancer (fallback_ai_load_balancer_id) [BelongsTo]
$callQueue->fallbackCallQueue() → CallQueue (fallback_call_queue_id) [BelongsTo]

Scopes: forOrganization(), withStrategy(), withStatus(), active(), search(), unprovisioned()
Methods: isActive()

fallback_action is cast to RingGroupFallbackAction. With call_queue the target is fallback_call_queue_id; the API refuses the queue itself and any chain of call queue fallbacks that returns to the queue. unprovisioned() is true when fallback_action is unavailable.

CallQueueAgent​

Membership of a user (agent) in a queue.

Table: call_queue_agents
Model: App\Models\CallQueueAgent
Tenant scoped: yes (OrganizationScope)

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
call_queue_idbigint unsignedNo-Queue. Foreign key to call_queues, on delete cascade
user_idbigint unsignedNo-Agent. Foreign key to users, on delete cascade
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • call_queue_agents_call_queue_id_user_id_unique (unique): call_queue_id, user_id
  • call_queue_agents_organization_id_foreign: organization_id
  • call_queue_agents_user_id_foreign: user_id

Relationships

$callQueueAgent->organization() → Organization (organization_id) [BelongsTo]
$callQueueAgent->callQueue() → CallQueue (call_queue_id) [BelongsTo]
$callQueueAgent->user() → User (user_id) [BelongsTo]

QueueCall​

One call that entered a queue, kept for reports.

Table: queue_calls
Model: App\Models\QueueCall
Tenant scoped: yes (OrganizationScope)
Traits: PrunesByRetention

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
call_queue_idbigint unsignedNo-Queue. Foreign key to call_queues, on delete cascade
call_idvarchar(255)No-Cloudonix call ID
session_tokenvarchar(255)YesnullCloudonix session token
from_numbervarchar(255)YesnullCaller
to_numbervarchar(255)YesnullCalled number
entered_attimestampNo-When the call entered the queue
answered_attimestampYesnullWhen an agent answered
abandoned_attimestampYesnullWhen the caller hung up while waiting
ended_attimestampYesnullWhen the call ended
agent_user_idbigint unsignedYesnullAgent who answered. Foreign key to users, on delete set null
waiting_secondsint unsignedYesnullSeconds waited
handling_secondsint unsignedYesnullSeconds with the agent
dispositionenumYesnullOutcome; null while the call is in progress. Values: answered, abandoned, overflow (cast to QueueCallDisposition)
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • queue_calls_agent_user_id_foreign: agent_user_id
  • queue_calls_call_queue_id_call_id_unique (unique): call_queue_id, call_id
  • queue_calls_call_queue_id_entered_at_index: call_queue_id, entered_at
  • queue_calls_organization_id_entered_at_index: organization_id, entered_at

Relationships

$queueCall->organization() → Organization (organization_id) [BelongsTo]
$queueCall->callQueue() → CallQueue (call_queue_id) [BelongsTo]
$queueCall->agent() → User (agent_user_id) [BelongsTo]

Scopes: forOrganization(), pending()

pending() returns rows with no disposition. Rows whose created_at is older than RETENTION_QUEUE_CALLS_DAYS (default 183) are deleted daily by model:prune.