Skip to main content

SessionUpdate Model

The SessionUpdate model stores real-time session update events from Cloudonix for monitoring and debugging.

Table: session_updates
Model: App\Models\SessionUpdate

Database Schema

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
organization_idbigint unsignedNoTenant scope
session_idbigint unsignedNoCloudonix session ID
session_tokenstringYesToken for Cloudonix API disconnect
event_idstringNoIdempotency key
domain_idintNoCloudonix domain ID
domainstringNoDomain name
subscriber_idintNoSubscriber ID
outgoing_subscriber_idintYesOutgoing subscriber ID
caller_idstringNoCaller number
destinationstringNoCallee number
directionstringNoinbound / outbound
statusstringNoCurrent status
session_created_atdatetimeNoSession creation time
session_modified_atdatetimeNoLast modification time
call_start_timebigintYesStart timestamp (ms)
start_timedatetimeYesParsed start time
call_answer_timebigintYesAnswer timestamp (ms)
answer_timedatetimeYesParsed answer time
time_limitintYesCall time limit
vapp_serverstringYesVoice app server
actionstringNo
reasonstringNo
last_errorstringYes
call_idsJSONNoAssociated call IDs
profileJSONNoSession profile (QoS, AMD)
processed_atdatetimeNoWhen OPBX processed the event
created_atdatetimeNo
updated_atdatetimeNo

Relationships

$sessionUpdate->organization() → Organization

Scopes

SessionUpdate::forOrganization($orgId)
SessionUpdate::forSession($sessionId)
SessionUpdate::withStatus($status)
SessionUpdate::withDirection($direction)
SessionUpdate::search($term) // caller_id or destination

Usage Notes

  • The Live Calls module queries this table to display active sessions.
  • The profile field may contain AMD results written by the AMD worker.
  • Session updates are processed idempotently using event_id.