VICIfast
Guides & tutorials

Exporting inbound-call logs with did_log_export

Pull a single day of inbound calls to a DID with the did_log_export API function — required fields, output format, permissions, and errors.

VICIfast Support
··2 min read
Exporting inbound-call logs with did_log_export

If you need a clean list of every inbound call that hit a given phone number on a given day, the Non-Agent API has a purpose-built function: did_log_export. It pulls one day of inbound calls to one DID (direct inward dialing) — a DID being the direct inward dial number your carrier points at your system — and returns them in a format you can drop straight into a spreadsheet.

The two required fields

  • phone_number — the DID you want logs for, 2 to 20 characters
  • date — the day of the calls, in YYYY-MM-DD format

That is the whole search. The export is scoped to one number and one day on purpose, which keeps it fast. To shape the output, two optional settings fields apply: stage sets the format (csv, tab, json, or the default pipe), and header=YES prepends a column header row (the default is no header).

The api user must have user_level 7 or higher with "view reports" enabled. If you have not set up a dedicated reporting login yet, walk through securing the API first so you are not exporting call data over an over-privileged account.

A real example call

Here is a request for all inbound calls to 3125551212 on one day. The source parameter is a short free-text label describing what kicked off the call — useful when you are scanning access logs later.

http://your-server/vicidial/non_agent_api.php?source=test&function=did_log_export&stage=pipe&user=6666&pass=1234&phone_number=3125551212&date=2010-12-03

A successful response does not print SUCCESS. It just prints one pipe-delimited line per inbound call:

did_number|call_date|caller_id_number|length_in_sec

3125551212|2010-12-03 12:00:01|7275551212|123

So you get the DID that was dialed, the timestamp, the caller's number, and the call length in seconds. That is enough to reconcile carrier billing or to spot a number that is getting hammered. How the DID routes a call once it lands — to an agent group, an IVR, or a voicemail — is set by the DID route config, but this export is about what arrived, not where it went.

How the export flows

sequenceDiagram
    participant R as Reporting client
    participant API as non_agent_api.php
    participant DB as Inbound call log
    R->>API: did_log_export + phone_number + date
    API->>API: check user_level >= 7
    API->>DB: select calls to DID for date
    DB-->>API: matching rows
    API-->>R: pipe stream (one line per call)

Errors and limits

A failed permission check returns ERROR: did_log_export USER DOES NOT HAVE PERMISSION TO GET DID INFO - 6666|0. A missing or malformed field returns ERROR: did_log_export INVALID SEARCH PARAMETERS, and a valid request with nothing to show returns ERROR: did_log_export NO RECORDS FOUND. There is a hard cap of 100,000 results, which is generous for a single DID over a single day — if you hit it, you are looking at a very busy number.

To pull calls placed across more than one number, or to mix inbound and outbound, reach for phone_number_log instead. And because this is a raw export, the same response-parsing habits apply as with every API (application programming interface) function: read the first token, and if it starts with ERROR, branch.

Every VICIfast box comes with the inbound stack and the Non-agent API ready to go, so you can script DID reconciliation from day one. Have a look at what each plan includes on the pricing page.

About VICIfast LLC

VICIfast LLC operates a managed VICIdial hosting + BYOI service for outbound and inbound call centers. We run the dialers, the carriers, the recordings pipeline, and the compliance plumbing so operators don’t have to.

Citing this article

VICIfast Engineering. “Exporting inbound-call logs with did_log_export”. VICIfast LLC, June 28, 2026. Retrieved from https://vicifast.com/blog/use-did-log-export-api

Have questions?

Related posts

You might be interested in

VICIfast newsletter

Liked this? Get the next one in your inbox.

We ship the kind of stuff you just read — concrete, numbers-first, no drip. One email when a new post goes live. Unsubscribe in one click.

Comments

Comments are reviewed before they appear. We never publish your email.

No comments yet — be the first.