Skip to content

Look Up Calls in CDR

CDR (Call Detail Records) is the searchable log of every call the PBX has handled — inbound, outbound, internal, queue, conferences. Use it to investigate "did the call come in?", "how long did it last?", "who hung up?", etc.

Before You Start

  • You know roughly when the call happened (date range tightens search).
  • You know one identifier: the caller's number, the destination, the extension involved, or a uniqueid from the live channel log.

Steps

  1. Go to Reports → CDR Reports.
  2. Use the search filters at the top of the page:
    • Date Range — pick start/end. Tighter range = faster query.
    • Source Number — caller ID number (regex supported with ^ and $ anchors).
    • Destination — extension or number called.
    • Caller ID Name — caller name string.
    • Account Code — present for PIN-protected calls (PIN value lands here).
    • DispositionANSWERED, NO ANSWER, BUSY, FAILED.
  3. Click Search.
  4. Results table shows: time, source, destination, src channel, dst channel, duration, billsec (talk time after answer), disposition, accountcode, uniqueid.
  5. Click a row to see full call details and (if recorded) play the recording.

Useful Filters

  • Find all calls from a specific number: Source Number = ^12075551234$ (anchored). Or with carrier-prepended digits, 12075551234.
  • All calls to a queue: Destination = the queue number.
  • All abandoned queue calls: Destination = queue number, Disposition = NO ANSWER.
  • Calls longer than 10 minutes: sort by duration column descending.

Inspect Live Calls vs CDR

CDR records the completed call. For in-progress calls, use:

asterisk -rx "core show channels"
asterisk -rx "core show channels concise"  # machine-parseable

For low-level event sequencing (which dialplan apps fired, in what order):

asterisk -rx "cli on; core set verbose 5"   # raise verbosity
tail -f /var/log/asterisk/full

Direct DB Query

CDR is in MySQL — useful for ad-hoc analysis or scripts:

mysql -u root cdr -e "
  SELECT calldate,src,dst,duration,billsec,disposition
  FROM cdr
  WHERE calldate > NOW() - INTERVAL 1 HOUR
  ORDER BY calldate DESC LIMIT 50"

Common Issues

  • Call I expect to see is missing. CDR only records calls that fully entered the dialplan. Calls rejected at the trunk (before authentication) or blocked by firewall don't show. Check /var/log/asterisk/full for the missed call.
  • Duration looks long but billsec is short. Duration includes ring time; billsec only counts answered talk time. Outbound that rang for 20s and connected for 5s shows duration=25, billsec=5.
  • Same call appears multiple times. Ring groups produce a row per leg. Queues produce per-attempt rows. Look at dstchannel to differentiate. See CDR interpretation memory note (ring groups produce multi-row calls).
  • Search slow with no date range. CDR can be millions of rows. Always add a date filter.