Call Data
Permissions
Requires System-Admin
or Billing Call-Summary
permissions. At this level of query (raw CDR data) it is not trivial to determine which rows belong to which company - That takes significant processing.
command 'read'
Path: /rest/call/read
All of the scope parameters are optional. The result set is always ordered by acctid
which is not necessarily date order, though it will be close to it.
The calldate
column is returned as a string, but can be translated to a real date simply by passing it to Javascript using new Date(string)
.
All of the fields under properties
are optional, and are filled when available.
{
	"type": "cdr",
	"scope": {
		minID: lowest acctid value to return,
		maxRows: max-rows-to-return (default 500),
		minDate: start-date-epoch-milliseconds,
		maxDate: end-date-epoch-milliseconds,
	}

}
Return value:
{
"result": "success",
"values": [
{
"acctid": sequence-number,
"calldate": "date as string with timezone",
"clid": "\"cidname\" <cidnum>",
"src": "caller-number",
"dst": "dest-number",
"dcontext": "dialplan-context",
"channel": "source-channel",
"dstchannel": "dest-channel",
"lastapp": "last-dialpaln-command",
"lastdata": "parameters-for-last-dialpaln-command",
"duration": seconds,
"billsec": billable-seconds,
"disposition": "FAILED|BUSY|ANSWERED|NOANSWER",
"amaflags": 2,
"accountcode": "company or >nnn",
"uniqueid": "semi-unique-call-id (epoch.integer)",
"properties" : {
"target": "target company",
"company": "calling company",
"src_ext": "source extension",
"dial_short": "Short dialled number",
"dial_full": "Full dialled number",
"trunk": "channel or trunk",
"bill_to": "bill-to",
"xfer": "Transferrer",
"is_ivr": "IVR (Boolean)",
"is_park": "Park record (Boolean)",
"is_pick": "Pickup record (Boolean)",
"is_auth": "Auth leg (Boolean)",
"auth": "Auth ID for external dialin",
"is_bounce": "Bounce back flag",
}
},
...
],
"numrows": number-of-rows
}
Example
{
"result": "success",
"minID": null,
"maxRows": 500,
"values": [
{
"calldate": "2016-03-22 10:52:41+00",
"clid": ""Bob's Desk" <01908276650>",
"src": "01908276650",
"dst": "441908276650",
"dcontext": "voip-external",
"channel": "IAX2/handbag-3265",
"dstchannel": "",
"lastapp": "ResetCDR",
"lastdata": "wv",
"duration": 45,
"billsec": 45,
"disposition": "ANSWERED",
"amaflags": 2,
"accountcode": "default",
"uniqueid": "1458643961.228",
"acctid": 44493,
"properties": {
"xfer": "",
"target": "default",
"company": "default",
"src_ext": "01908276654",
"dial_full": "227",
"dial_short": "227",
"bill_to": ""
}
}
],
"numRows": 1
}