Skip to main content

Call Logs and Delivery Logs

Legacy call logs and webhook delivery logs.

CallLog​

Legacy per-call log. The call-initiated webhook dispatches ProcessInboundCallJob, which creates the row (firstOrCreate by call_id); the call-status and CDR webhooks update it if it exists. Call history in the UI comes from call detail records.

Table: call_logs
Model: App\Models\CallLog
Tenant scoped: yes (OrganizationScope)

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
call_idvarchar(255)No-Cloudonix call ID
directionenumNoinboundInbound or outbound. Values: inbound, outbound
from_numbervarchar(20)No-Caller
to_numbervarchar(20)No-Called number
did_idbigint unsignedYesnullNumber called. Foreign key to did_numbers, on delete set null
extension_idbigint unsignedYesnullExtension. Foreign key to extensions, on delete set null
ring_group_idbigint unsignedYesnullRing group. Foreign key to ring_groups, on delete set null
statusenumNoinitiatedCall state. Values: initiated, ringing, answered, completed, busy, no_answer, failed (cast to CallStatus)
initiated_attimestampYesnullStart
answered_attimestampYesnullAnswer
ended_attimestampYesnullEnd
durationintYesnullSeconds
recording_urlvarchar(255)YesnullRecording URL
cloudonix_cdrjsonYesnullCDR payload
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • call_logs_call_id_index: call_id
  • call_logs_call_id_unique (unique): call_id
  • call_logs_did_id_foreign: did_id
  • call_logs_extension_id_foreign: extension_id
  • call_logs_from_number_created_at_index: from_number, created_at
  • call_logs_organization_id_created_at_index: organization_id, created_at
  • call_logs_ring_group_id_foreign: ring_group_id
  • call_logs_status_index: status
  • call_logs_to_number_created_at_index: to_number, created_at

Casts: cloudonix_cdr (array)

Relationships

$callLog->organization() → Organization (organization_id) [BelongsTo]
$callLog->didNumber() → DidNumber (did_id) [BelongsTo]
$callLog->extension() → Extension (extension_id) [BelongsTo]
$callLog->ringGroup() → RingGroup (ring_group_id) [BelongsTo]

Methods: isActive(), isCompleted()

CallNotificationLog​

One delivery attempt of a call notification webhook.

Table: call_notification_logs
Model: App\Models\CallNotificationLog
Tenant scoped: yes (OrganizationScope)
Traits: PrunesByRetention

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
call_session_tokenvarchar(255)No-Cloudonix session token
event_idchar(36)No-Event UUID
event_typevarchar(50)No-Event (new, ringing, ...)
statusvarchar(50)No-Call status in the event
webhook_urlvarchar(2048)No-Destination URL
request_payloadjsonNo-JSON sent
request_headersjsonYesnullHeaders sent
request_bodytextYesnullBody sent
response_status_codesmallint unsignedYesnullHTTP status
response_bodytextYesnullResponse body
response_headersjsonYesnullResponse headers
response_time_msint unsignedYesnullResponse time
attempt_numbertinyint unsignedNo1Attempt number
is_successbooleanNofalse2xx response
error_messagetextYesnullError
created_attimestampNo-

Indexes

  • call_notification_logs_call_session_token_index: call_session_token
  • call_notification_logs_event_id_index: event_id
  • call_notification_logs_organization_id_created_at_index: organization_id, created_at

Casts: request_payload (array), request_headers (array), response_headers (array)

Relationships

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

Scopes: forOrganization(), forSession(), successful(), failed(), recent()
Methods: markAsSuccess(), markAsFailed()

Rows whose created_at is older than RETENTION_CALL_NOTIFICATION_LOGS_DAYS (default 90) are deleted daily by model:prune.