User Tools

Site Tools


api:mvno:account:cdr

API : MVNO CDR

Introduction

This request will return CDR data for the MVNO account.

This is a limited view into the CDR records. To access CDR data with all the details, you must access it via the CDR API.

Request

URL https://api.telecomx.dk/mvno/ACCOUNT_ID/cdr
Method GET
Access level VIEWER, MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN.
Param ACCOUNT_ID Id of the MVNO account (24 hex-char string).
Query fromDate [optional] Date to start from when returning CDR records. Date format: yyyy-mm-dd. Defaults to today.
toDate [optional] Last date to return CDR records for. Date format: yyyy-mm-dd.
limit [optional] Max number of CDR records to return, default 100 (0-1000).
offset [optional] Offset for paging, index of first CDR record to return, default 0 (0-1000000).
filter [optional] Search query that looks into A number, B number, users name, users extension.
direction [optional] Direction of the call, 'IN', 'OUT' or 'BOTH' (default).
format [optional] Format for output: json (default), csv or excel (max. 10000 rows).

Query example

https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr?fromDate=2014-07-23
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr?fromDate=2014-07-23&toDate=2014-07-31&limit=1000&offset=100&filter=12345678
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr?fromDate=2014-07-23&toDate=2014-07-31&limit=1000000&format=csv

Response

If format is CSV or Excel the response is a file for download. If format is JSON, the below applies.

JSON object
offset Number Index of the first CDR record returned.
limit Number Number of CDR records to return. Note that the actual number of CDR records returned may be lower.
total Number Number of CDR records that can be returned when offset and limit is not considered. This is to be used for paging through the data.
cdr Array Array of CDR records, see definition below.
CDR record object (JSON)
_id Id Unique id of the CDR record.
type String Type and direction of the call: MVNO_INBOUND, MVNO_OUTBOUND.
aNumber String The number presented by the caller, E.164 format. If the type is MVNO_INBOUND and the caller is using secret number then the number will be 'HIDDEN'.
aNumberSecret Boolean True of aNumber is secret and not to be presented.
bNumber String The number called, E.164 format. If the type is MVNO_OUTBOUND then the user must be RESELLER or ADMIN to see the full number, otherwise the last 2 digits is replaced with 'XX'.
diverter String If the call is a diverted call, this is the E.164 number of the one who diverted the call.
start Date Date and time the call started.
length Integer The length of the call in seconds.
terminationCause String The reason for the call to end:
HANGUP - call hang up
BUSY - callee is busy
NO_ANSWER - callee did not answer
BLACKLISTED - called number is blacklisted
BLOCKED - caller is not allowed to call the callee (highrate/international/all blocking)
ERROR - call failed
NOT_FOUND - callee does not exist
FRAUD - call terminated due to fraud
terminatedBy String Who terminated the call: A = caller, B = callee, S = system.
destination.country String The ISO3166-2 country code of the destination country.
destination.type String The type of destination 'fixed', 'mobile', 'special', 'dkspecial'.
destination.name String If the type is 'dkspecial', the call is towards a danish special number, 112, 114, 1813 etc., and this contains a precise description in danish of the destination (e.g. 1813 Akuttelefonen region hovedstaden).
userName String Name of the person making the call (if set by PBX).
userLocation String Location of the person making the call (if set by PBX).
userExtension String Local extension number of the person making the call (if set by PBX).
vatExemption Boolean True if no VAT is charged on the call.
roaming Boolean True if user was roaming while call was made.
roamingCountry String Name of country user was roaming in, if roaming
roamingRegion ObjectId ID of roaming region that was roamed in, if roaming.
callId String SIP Call-ID for the call (ADMIN only).
sbcServer String Session border controller that handled the call (ADMIN only).
minutesCost Number Cost of minutes.
minutesWholesale Number Reseller cost of minutes.
minutesPrice Number Customer minutes price.
connectionFeeCost Number Connection fee cost.
connectionFeeWholesale Number Reseller connection fee cost.
connectionFeePrice Number Customer connection fee price.
price Number Total price of call for customer.
voiceAccount Id Id of voice account call belongs to.
customer Id Id of customer call belongs to.

If a call originates from a PBX, then the PBX can add SIP headers to the outbound call to indicate the name of the caller, the location of the caller and the local extension number of the caller. These data will automatically be added to the CDR record if available.

Example

{
  offset: 0,
  limit: 100,
  total: 548,
  cdr:
  [
    {
      _id: '1234567890ABCDEF12345678',
      type: 'MVNO_OUTBOUND',
      aNumber: '+4581808888',
      bNumber: '+4570305050',
      diverter: null,
      start: '2014-07-23T12:34:56.123Z',
      length: 78,
      terminationCause: 'HANGUP',
      terminatedBy: 'B',
      destination: { country: 'DK', type: 'fixed' },
      roaming: false,
      roamingCountry: null,
      roamingRegion: null
    },
    ...
  ]
}

Errors

Error code Message Description
400 bad_request MVNO account id not found in request URI
404 sipAccount MVNO account not found
403 access_denied Insufficient access level
api/mvno/account/cdr.txt · Last modified: 2023/06/09 11:20 by Joakim Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki