CDR Records

Get CDR Records for a Specific Time Period.

Get Information

URL:

https://cdr.teleapi.net/cdr/[start_date]/[end_date]?token=XXXXXXX

[start_date] would be month-day-year or 04-24-2017 [end_date] would be month-day-year or 04-26-2017

Full Sample URL:

https://cdr.teleapi.net/cdr/04-24-2017/04-26-2017?token=ABC-ABC-ABC

CURL

curl -v -X GET  "https://cdr.teleapi.net/cdr/04-24-2017/04-26-2017/?token=XXXX"

PHP + Curl

<?php
$start_date = "04-24-2017";
$end_date = "04-26-2017";

$baseurl = "https://cdr.teleapi.net/cdr/";
$baseurl .= $start_date."/".$end_date."/?token=XXXX";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);

$object = json_decode($retval);
print_r($object);

Responses from API

Successful Download

This is a sample of what to expect from the API. If you open this in a web browser, it will download a file for you.

date gmt,source,destination,callerid,hangup code,sip account,orig ip,duration,per minute,callcost,type
2017-04-22 03:02:30,5615551212,5614441313,15659993333 <5615551212>,NORMAL_CLEARING,callforward,na,66,0.008500,0.009400,term

Invalid Date Range

The code may return an empty set if the date range cannot get a result.

Failed to Download

{
   "status":"error",
   "error":"invalid date"
}

SQL Equivalents

date gmt: DATETIME
source: bigint(20)
destination: bigint(20)
hangup_code: varchar(100) ("NORMAL_CLEARING", "USER_BUSY", "ORIGINATOR_CANCEL", "NORMAL_CIRCUIT_CONGESTION", "NONE" or other errors)
sip_account: varchar(100)
orig_ip: varchar(30)
duration: int(12)
per_minute: decimal(14,6) or float()
callcost: decimal(14,6) or float()
type: varchar(50) ("term", "did", "intlterm", "faxoutbound", "exception")

results matching ""

    No results matching ""