api:pbx:cdrhistory
Table of Contents
API : PBX : CDR History
Request
This request returns details about the path a call took through the PBX.
There are two ways to address a call. Prefer the callRef form: it is the only one that works
for a call leg created by a transfer, and it returns the whole call rather than one leg of it.
| URL | https://api.telecomx.dk/pbx/cdrhistory/ref/CALL-REF | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGE, OWNER if calls belongs to the customer RESELLER if customer belongs to the reseller or ADMIN. |
|
| Params | CALL-REF | callRef of the call, from the CDR record. URL-encode it - it contains a colon. |
Returns the history of every leg of the call merged into one timeline, ordered by date. The
remaining top-level fields are those of the call's first leg.
| URL | https://api.telecomx.dk/pbx/cdrhistory/CALL-ID | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGE, OWNER if calls belongs to the customer RESELLER if customer belongs to the reseller or ADMIN. |
|
| Params | CALL-ID | SIP Call-ID of the call. |
Returns the history of the single leg the call arrived on. Only calls that arrived over SIP have a
Call-ID; a leg the PBX created itself has none, so this form cannot address it. Use it for calls
handled before call grouping was introduced, which have no callRef.
Query examples
https://api.telecomx.dk/pbx/cdrhistory/ref/pbx12.telecomx.dk%3A1787811065.192529 https://api.telecomx.dk/pbx/cdrhistory/f378478ghuidhu3y8fghiufdgiueyufhguerguio
Response
| JSON object | ||
|---|---|---|
| _id | Id | Unique Id of the CDR History item. |
| callId | String | Call-ID from SIP. Empty on a leg the PBX created itself. |
| callRef | String | Grouping key shared by every leg of the same physical call - see CDR. Null on calls handled before call grouping was introduced. |
| logged | Date | Date and time when this record was logged. Also used for auto-expire. |
| pbx | String | Hostname of the PBX server that handled the call. |
| customer | Id | Id of customer the caller belongs to or callee called into. |
| history | Array | List of events during the call. |
| history.date | Date | When the event occurred. |
| history.action | String | Human readable description of what happened. |
| history.callerNumber | String | Callers number. |
| history.callerName | String | Callers name, if available. |
| history.callerExtension | Id | Id of callers extension, if call originated from a SIP or mobile phone. |
| history.calleeNumber | String | Callee's number. |
| history.calleeName | String | Callee's name, if available. |
| history.calleeExtension | Id | Id of callee's extension, if call terminated on a SIP or mobile phone. |
Example
{ _id: ObjectId('12345789012457890ABCD'), callId: 'f737tye73yt8hefv7ebvg@192.168.0.2', callRef: 'pbx1.telecomx.dk:4657574.341', logged: ISODate('2018-01-01T00:00:00.000Z'), pbx: 'pbx1.telecomx.dk', customer: ObjectId('12345678901234567890AAAA'), history: [ { date: ISODate('2018-01-01T00:00:00.000Z'), action: 'Call answered', callerNumber: '+4570305050', callerName: 'Telecom X', callerExtension: null, calleeNumber: '+4570305060', calleeName: 'Acme Soap and Shampoo', calleeExtension: ObjectId('1234567890123457890FEDE') }, { ... } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | callId | Call ID not found, or no Call-ID was given |
| 404 | callRef | Call not found, or no callRef was given |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/pbx/cdrhistory.txt · Last modified: by Per Møller