Skip to content

Call Detail Records (CDR)

Query CDRs with multiple filters and download recordings via signed URLs.

GET /api/pbx/cdr — List

Query parameters

FieldTypeRequiredDescriptionValid values
fromdateoptionalStart date (YYYY-MM-DD)If omitted → now() - 30 days
todateoptionalEnd date (YYYY-MM-DD)Must be ≥ from. If omitted → now()
directionstringoptionalCall directioninbound, outbound, internal, local
extensionstringoptionalFilter by extension (matches extension_number or agent_extension)3-20 chars
phonestringoptionalFilter by phone number (matches caller_number or destination_number)max 50 chars
pageintegeroptionalPage number≥ 1
per_pageintegeroptionalRecords per page1-200 (default 50)

Time-window limit

The from..to window is capped at 30 days (configurable per account through per-customer configuration limits). Exceeding returns HTTP 422.

Response body fields (each item in data[])

FieldTypeDescriptionValid values
uuidstringCall UUID (Zorio PBX call_uuid)36-char UUID
directionstringCall directioninbound / outbound / internal / local
source_typestringCall sourceinbound / outbound_manual / outbound_telesales / outbound_callback / outbound_webphone / internal
caller_numberstringOriginating number (caller ID)
destination_numberstringDestination number
extension_numberstring|nullAssociated extension (caller or destination)
agent_extensionstring|nullAgent extension that answered (for queue/IVR calls)
start_timedatetimeWhen the call startedISO 8601
answer_timedatetime|nullWhen the call was answeredISO 8601 (null if never answered)
end_timedatetimeWhen the call endedISO 8601
durationintegerTotal duration (seconds)≥ 0
billsecintegerBillable time (after pickup, seconds)≥ 0
queue_namestring|nullQueue name (if the call went through a queue)
queue_wait_timeinteger|nullTime waited in queue (seconds)
trunk_namestring|nullOutbound trunk name (for outbound calls)
transfer_countintegerNumber of transfers≥ 0
resultstringCall outcomeanswered / busy / no_answer / failed / cancelled / rejected / voicemail
hangup_causestringHangup code from Zorio PBXe.g. NORMAL_CLEARING, NO_ANSWER, USER_BUSY, CALL_REJECTED, ...
sip_response_codestring|nullFinal SIP response code (for outbound)e.g. 200, 486, 487
recording_availableboolWhether a recording existstrue / false
created_atdatetimeCDR row creation timestamp

Response Body (JSON) — 200

json
{
  "current_page": 1,
  "data": [
    {
      "uuid": "65569ce0-0183-4f61-a3b2-0e433cfa4031",
      "direction": "outbound",
      "source_type": "outbound_telesales",
      "caller_number": "0900000021",
      "destination_number": "0987654321",
      "extension_number": "0900000021",
      "agent_extension": null,
      "start_time": "2026-06-27T08:15:42+00:00",
      "answer_time": "2026-06-27T08:15:42+00:00",
      "end_time": "2026-06-27T08:15:56+00:00",
      "duration": 14,
      "billsec": 14,
      "queue_name": null,
      "queue_wait_time": null,
      "trunk_name": null,
      "transfer_count": 0,
      "result": "answered",
      "hangup_cause": "NORMAL_CLEARING",
      "sip_response_code": null,
      "recording_available": true,
      "created_at": "2026-06-27 08:15:56"
    }
  ],
  "last_page": 5,
  "per_page": 20,
  "total": 87
}

GET /api/pbx/cdr/{uuid} — Detail + signed recording URL

Path parameter

uuid (string, Zorio PBX call_uuid).

Response = the 22 fields from the list + a recording object (if a recording exists).

recording object fields

FieldTypeDescription
durationintegerRecording length (seconds)
file_sizeintegerFile size (bytes)
recorded_atdatetimeWhen recording started (ISO 8601)
urlstringHMAC-signed URL to download the .wav — valid only within expires_in_seconds
expires_in_secondsintegerURL TTL (default 1800 = 30 minutes)

Response Body (JSON) — 200

json
{
  "data": {
    "uuid": "65569ce0-...",
    "direction": "outbound",
    "recording_available": true,
    "recording": {
      "duration": 14,
      "file_size": 56265,
      "recorded_at": "2026-06-27T08:15:57+00:00",
      "url": "https://app.zorio.vn/api/public/recordings/401/audio?expires=1782706011&signature=de93e86...",
      "expires_in_seconds": 1800
    }
  }
}

GET /api/pbx/cdr/{uuid}/recording — 302 redirect to signed URL

Path parameter

uuid (CDR Unique-ID).

Response

HTTP 302 with header Location: <signed URL>. The client follows the redirect to download the .wav file. Signed URL TTL: 30 minutes (HMAC SHA256).

Cấp phép theo điều khoản sử dụng của Zorio.