CDR Data Export is an API scripting feature that enables you to extract CDR (Call Detail Record) data generated by your Mitel MiCloud phone system. This scripting feature enhances your ability to obtain and use CDR data for all users on your account. Currently, the Account Portal provides a Usage Log report that provides CDR data for all users. However, the Usage Log report requires manual effort to export CDR data.
NOTES:
- Call activity is not tracked and call detail records are not recorded for users who have the Call History Privacy feature enabled. For more information about this feature, see Configuring Call History Privacy.
- CDR data is not tracked for programming profiles; this includes Global Numbers that are DNIS mapped to users or other call flow components.
When using CDR Data Export, an HTTP request (customized URL) retrieves an export of CDR data directly from the Mitel CDR database. The HTTP request is scripted with specific parameters to extract CDR data to a standard .csv file. The CDR Data Export API can be used by a client-side application to automate the extraction of CDR data on a one-time or recurring basis.
Requirements
- Recent version of Firefox, Chrome, or Safari browser
- An Authorized Contact role in the MiCloud phone system
- Valid log in credentials for the Account Portal: username (business email address) and user password
- Permission to use CDR Data Export; contact Mitel Support for this permission
Limitations
The following limitations are associated with the CDR Data Export API:
- The maximum number of API requests per day is 24 (data is normally updated approximately every one to three hours).
- The time interval (range of dates) limit for exporting CDR data is 1 week (7 days); exporting data for a wider range of dates (longer time interval) is not supported.
- CDR data older than 13 months is not accessible using the CDR Data Export API. Data older than 13 months are archived; to obtain data older than 13 months, a formal request must be made by submitting a Support Case.
- All CDR data older than 7 years is deleted from Mitel's archives.
NOTE: CDR data does not change after it is written to the Mitel CDR database. For this reason, there is no benefit to downloading the same data more than once. Multiple exports of the same data may cause you to exceed the maximum number of requests.
Generating a CDR Data Report
You can use a web browser or a client-side application to submit a CDR Data Export request URL. This section describes how to format the URL.
NOTE: CDR data for the prior day is available daily by 12PM EST.
- Use the following as the base URL:
https://portal.mitelcloud.com/DataExport/CDRData? (for US and Canada accounts)
https://portal.mitelcloud.eu/DataExport/CDRData? (for UK accounts)
- Follow the base URL with the required and any desired optional parameters.
See Parameters for a CDR Data Export Request for information about the required and optional parameters.
- Separate each parameter from the next parameter with & (ampersand) as shown.
https://portal.mitelcloud.com/DataExport/CDRData?startDate=2015-02-01&endDate=2015-02-15
For additional examples, see Example CDR Data Export Requests.
- If submitting the URL through a web browser, enter your Account Portal credentials when prompted.
For more information, see the Authentication Options.
- Save a local copy of the CDR Data Export (.csv) file.
Authentication Options
Authentication is performed by transmitting the userid= and pass= parameters in the initial HTTP request headers via HTTP GET.
- If a web browser is used to extract a report, the Account Portal prompts for a username and password after the HTTP request is received.
- If the request is made via programming, the GET headers must include the username and password with the original request. See Example Wget Code for more information.
Parameters for a CDR Data Export Request
Two parameters are required when submitting a CDR Data Export request. Some additional, optional, parameters are also available.
Required Parameters
The following table lists the two parameters that are required when submitting a CDR Data Export request.
Parameter Syntax
|
Description
|
startDate=
|
The start date for the CDR report.
The format is YYYY-MM-DD
|
endDate=
|
The end date for the CDR report.
The format is YYYY-MM-DD
|
NOTE: The maximum date range supported for CDR export is 1 week (7 days). Exporting data for a longer time interval is not supported and may result in a "timing-out" of resources.
Optional Parameters
The following table lists the optional parameters that can be included when submitting a CDR Data Export request.
Parameter Syntax
|
Description
|
lastId=
|
Designed specifically for customers who submit multiple requests per day and who want to avoid receiving a subset of the same (overlapping) data in multiple output files.
To find the ID value to use, sort the most recent CDR export file on the ID column. Use the highest ID value as the lastID parameter when submitting the next CDR Data Export request. This results in a CDR export file containing only CDRs with an ID higher than the value used for the lastId parameter, preventing duplicate (overlapping) information in the CDR export files.
NOTE: Use of the lastId parameter is limited to requesting CDR data for the current and previous date. When a value is supplied for the lastId parameter, the CDR Data Export process ignores the values entered for the required startDate and endDate parameters.
|
subscribers=
|
Used to extract CDR data for specified phone numbers only. Any 10-digit phone number that belongs to your MiCloud Connect account can be specified. Multiple numbers can be specified using a comma-separated list.
The format is 9871234567; do not include spaces or special characters.
NOTE: If no value is specified for this parameter, the CDR export file contains CDR data for all phone numbers on the account.
|
connected=
|
Used to restrict exported CDR data so that only live calls or non-live calls are included in the export file.
The parameter must be one of the following:
- yes - to export CDR data for live calls only
- no - to export CDR data for non-live calls only
- all - to export CDR data for all calls
NOTE: If no value is specified for this parameter, the CDR export file contains CDR data for live calls only.
|
accountId=
|
Used to obtain CDR data for an account other than the account to which the authenticating user belongs. This requires proper permissions set on the server-side.
NOTE: If no value is specified for this parameter, the CDR export file contains CDR data for the account of the authenticating user.
|
direction=
|
Used to restrict exported CDR data so that only calls of a certain direction are included in the export file.
The parameter must be one of the following:
- inbound - to export CDR data for inbound calls only
- outbound - to export CDR data for outbound calls only
- forward - to export CDR data for forwarded calls only
NOTE: If no value is specified for this parameter, the CDR export file contains CDR data for all calls.
|
Viewing the CDR Data Export File
The following table describes the data provided in the CDR Data Export (.csv) file.
NOTE: When viewing the data in this file, if any column displays the data as a formula, for example, "#NAME?" instead of the actual data value, see Converting Formulas to Viewable Data in CSV Files for helpful instructions.
Field
|
Description
|
Location
|
Customer account location.
|
Date
|
Date when the call was initiated (in mm/dd/yyyy format).
|
Time
|
The time when the call was initiated (in hh:mm:ss 24-hour format).
|
TN Originating
|
Telephone number of the profile placing the call (in 1NPANXXxxxx format).
|
Direction
|
Indicates the direction of the call.
- INBOUND - indicates that the subscriber received the call
- OUTBOUND - indicates that the subscriber initiated the call
- INTERNAL - indicates that the call was between two users within the same MiCloud phone system
- FORWARD - indicates that the call was transferred
|
Originating City
|
City where the call was initiated. For US and Canadian locations, the name of the city is listed in the upper-case text. For other international locations, the country is the abbreviation listed. For toll-free calls, this field is left blank.
|
Originating State
|
State where the call was initiated. For US and Canadian locations, the two-letter abbreviation for the state or province is listed. For other international locations, the country is listed. For toll-free calls, this field is left blank.
|
TN Dialed
|
The phone number dialed to place the call.
|
Destination City
|
City where the call was received. For US and Canadian locations, the name of the city is listed in the upper-case text. For other international locations, the country is listed. For toll-free calls, this field is left blank.
|
Destination State
|
State where the call was received. For US and Canadian locations, the two-letter abbreviation for the state or province is listed. For other international locations, the country abbreviation is listed. For toll-free calls, this field is left blank.
|
Internal
|
Indicates whether the call was internal (between two users on the same MiCloud phone system) or external.
- Yes - indicates an internal call
- No - indicates an external call
|
Call Type
|
Indicates the type of call.
- DOMESTIC
- INTERNATIONAL
- TOLLFREE
|
Duration Minutes
|
Length of the call in minutes (rounded to two decimal places).
|
Charge
|
The cost associated with the call. Charges are normally only incurred for calls that are not included with the associated phone profile type, such as international calls and 900 numbers. Additionally, an account may have some non-billable profile numbers that can incur usage fees. For more information, see MiCloud Usage and Overage Charges, Rates, and Fees.
|
Account Code
|
Account code associated with the call (if applicable). For more information about account codes, see Managing Account Codes.
|
Answered By Target
|
Indicates whether or not the call was initially answered by the dialed phone number.
- Yes - indicates the call was initially answered by the dialed (target) phone number, even if the call was subsequently forwarded to another phone number.
- No - indicates the call was initially answered by a phone number other than the dialed (target) phone number.
The phone number that initially answered the call is normally associated with an Auto Attendant, Hunt Group, Shared Line Appearance, or other system components.
|
Id
|
A unique integer value that is incremented as new rows of CDR data is added to the CDR database for a specific customer account. This Id value is for setting the lastId parameter when submitting a CDR Data Export request. See the Optional Parameters for more information.
|
Example CDR Data Export Requests
This section contains example CDR Data Export request URLs and Wget code.
Example URLs
The following is an example of a URL with only the two required parameters:
https://portal.mitelcloud.com/DataExport/CDRData?startDate=2015-02-01&endDate=2015-02-15
The following is an example of a URL with the two required parameters and the optional lastId parameter:
https://portal.mitelcloud.com/DataExport/CDRData?startDate=2015-06-20&endDate=2015-06-21&lastId=12345678910
Example Wget Code
The following is an example of Wget code used to submit a URL with required and optional parameters:
$ wget --user=user@shoretel.com --password=pass "https://portal.mitelcloud.com/DataExport/CDRData?startDate=2015-02-01&endDate=2015-02-15&direction=inbound&connected=true&subscribers=6464425780,6464421610"
The Wget code above results in the following response:
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to portal.mitelcloud.com ... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1389 (1.4K) [text/csv]
Saving to: `CDRData@startDate=2014-02-01&endDate=2014-02-15&direction=inbound&connected=true&subscribers=6464425780,6464421610'
100%[====================================================================================================================>] 1,389 --.-K/s in 0s
2015-04-01 12:10:25 (11.6 MB/s) - `CDRData@startDate=2014-02-01&endDate=2014-02-05&direction=inbound&connected=true&subscribers=6464425780,6464421610' saved [1389/1389]