Skip to main content

Recordings

Audio files.

Recording​

An audio file used for prompts and music on hold: an uploaded file in the recordings bucket, or a remote URL.

Table: recordings
Model: App\Models\Recording
Tenant scoped: yes (OrganizationScope)

ColumnTypeNullableDefaultDescription
idbigint unsignedNoautoPrimary key
organization_idbigint unsignedNo-Tenant. Foreign key to organizations, on delete cascade
namevarchar(255)No-Display name
typeenumNo-Uploaded file or remote URL. Values: upload, remote
file_pathvarchar(255)YesnullObject path of an uploaded file
remote_urlvarchar(255)YesnullURL of a remote file
original_filenamevarchar(255)YesnullUploaded file name
file_sizebigint unsignedYesnullBytes
mime_typevarchar(255)YesnullMIME type
duration_secondsintYesnullLength in seconds
statusenumNoactiveActive or inactive. Values: active, inactive
is_mohbooleanNofalseUsable as call-queue music on hold
created_bybigint unsignedYesnullUser who created it. Foreign key to users, on delete set null
updated_bybigint unsignedYesnullUser who last changed it. Foreign key to users, on delete set null
created_attimestampYesnull
updated_attimestampYesnull

Indexes

  • recordings_created_by_index: created_by
  • recordings_organization_id_status_index: organization_id, status
  • recordings_organization_id_type_index: organization_id, type
  • recordings_updated_by_foreign: updated_by

Relationships

$recording->organization() → Organization (organization_id) [BelongsTo]
$recording->creator() → User (created_by) [BelongsTo]
$recording->updater() → User (updated_by) [BelongsTo]

Methods: isActive(), isUploaded(), isRemote(), getPublicUrl(), getPlaybackUrl(), getDownloadUrl(), getFormattedFileSize(), getFormattedDuration()

getPlaybackUrl() and getDownloadUrl() return the remote URL for remote files and a tokenized URL (RecordingAccessService) for uploaded files. Call recordings are not rows in this table; they are referenced from call detail records.