Call records (CDRs)¶
For enabled projects and billing accounts, call records are generated daily and are available over SFTP.
The following formats are available:
- Full format: each call leg is one row.
- Two-legged format: parent and child legs are merged into one row.
CDR specification¶
Enfonica call records are CSV files with the following specifications:
Property | Value |
---|---|
Header row | Yes |
Delimiter | Comma (, ) |
Line ending style | Windows (\r\n ) |
Text qualifier | Double quote (" ) |
Encoding | UTF-8 |
Conventions¶
The following conventions are used.
Property | Description |
---|---|
Date/time fields | Uses RFC 3339 format in UTC. For example: 2022-08-26T10:11:22.025Z |
Full format¶
The full format includes each call leg as one row. This format provides the most flexibility and is suitable for complex call scenarios with multiple branches.
Options¶
The following options can be configured.
Option | Description |
---|---|
Exclude SIP call legs | Whether to exclude SIP call legs. These calls typically represent the plumbing involved to establish a PSTN call, and include no billing information. |
Exclude unanswered calls | Whether to exclude unanswered call legs. If enabled, only answered and billed calls will be included. |
File structure¶
The following directory and file structure is used.
Property | Description |
---|---|
Directory | /call-records-full/ in SFTP. |
File name | YYYY-mm-dd.csv For example: 2022-08-25.csv for calls on August 25, 2022. |
Time range of included data¶
Calls are included in the CDR where the EndTime
of the calls falls within the date of the CDR file. While calls will generally be ordered by ProjectId
and StartTime
, you should not rely on ordering within the file.
Fields¶
The following fields are present in the CDR.
Field | Description |
---|---|
ID | The unique identifier of the call. This is a 30 character, alphanumeric string. For example: kd8sore0at5emifrkh04p4foulugj4 |
ProjectId | The ID of the project where the call was made. This is up to 30 characters and can include lowercase alphanumeric characters and dash (- ).For example: example-project |
StartTime | The date and time that the call started. |
RingTime | The date and time that the call started ringing. Only set for outgoing calls where a ringing signal was received. |
AnswerTime | The date and time that the call was answered. This is when billing begins for a call. |
EndTime | The date and time that the call ended. This can either be when an answered call hung up, or when an unsuccessful call attempt completed. |
Direction | The direction of the call. Possible values: INCOMING , OUTGOING . |
From | The originator of the call. For PSTN calls, this is the CLI (Caller ID) in +E164 format. For calls to a SIP domain, this is the URI in the From header, in the format sip:user-or-number@domain . For PSTN originated private calls, this field will be blank. |
To | The recipient of the call. For PSTN calls, this is the phone number in +E164 format. For calls to a SIP domain, this is the URI in the To header, in the format sip:user-or-number@domain . |
DurationSeconds | The duration (rounded up to the second) for which the call was answered. If the call was not answered, this field will be blank. |
State | The state of the call. Possible values:
|
SkuId | The ID of the SKU that was used to rate the call. A list of SKUs can be downloaded from the pricing page. For example: 461C-87AB-7608 |
Price | The price that was charged for the call as a decimal number. If the call was not billable, this field will be blank. For example: 0.0245 |
CurrencyCode | The currency code of the charge. If the call was not billable, this field will be blank. The currency of all charges under a project or billing account will be the same and cannot change. For example: AUD |
SipCallId | The value of the Call-ID header of the SIP call. Only set for SIP call legs.For example: 6d265936-aa3d-48b4-a8fa-d633df94dc8d |
OriginatingCallId | The ID of the parent call. The parent call is the call that initiated this call. For top-level calls, this field will be blank. For more information on the relationship between calls, see the Cloud Voice Overview. For example, if an incoming call was received on a toll-free number, it's OriginatingCallId will be blank. If that call was forwarded to a DID, then the value of OriginatingCallId of the call leg to the DID would match the ID of the toll-free call leg.For example: p9h76te0atldpofrkh04p4fomgis6 |
FromRegionCode | The alpha-2 region or country code representing the location of the caller. This is only set for incoming PSTN calls. If this information cannot be determined, this field will be blank. For example: AU |
FromAdministrativeArea | The administrative area (such as a state or territory) representing the location of the caller. This is only set for incoming PSTN calls. If this information cannot be determined, this field will be blank. For example: QLD |
FromLocality | The locality (such as a town or city) representing the location of the caller. This is only set for incoming PSTN calls. If this information cannot be determined, this field will be blank. For example: Redcliffe |
FromLongitude | The approximate longitude of the caller. This is only set for incoming PSTN calls and is the best approximation given the available information. If this cannot be determined, this field will be blank. For example: 152.992 |
FromLatitude | The approximate latitude of the caller. This is only set for incoming PSTN calls and is the best approximation given the available information. If this cannot be determined, this field will be blank. For example: -27.2583 |
Moli | The mobile location information (MoLI) code that was received. This is only set for incoming PSTN calls to Australian toll-free and shared-rate numbers where the call was originated by a mobile phone. Note that MoLI may not be provided for all mobile callers, particularly when the call was originated by IP telephony or as a result of call forwarding. For example: 56 |
Two-legged format¶
The two-legged format merges the parent and child legs into one row. This format is suitable for call scenarios without multiple branches. See Cloud Voice for more information about call legs.
Unsuitable for calls with multiple branches
This format is useful for calls consisting of one or two legs, such as simple IVR and call-forwarding scenarios. If there are multiple child legs, we will select the child leg: that is answered with the latest EndTime
; or with the latest EndTime
.
File structure¶
The following directory and file structure is used.
Property | Description |
---|---|
Directory | /call-records-two-legged/ in SFTP. |
File name | YYYY-mm-dd.csv For example: 2022-08-25.csv for calls on August 25, 2022. |
Time range of included data¶
Calls are included in the CDR where the EndTime
of the parent calls falls within the date of the CDR file. While records will generally be ordered by ProjectId
and EndTime
, you should not rely on the ordering of records within the file.
Fields¶
The following fields are present in the CDR.
Field | Description |
---|---|
ID | The unique identifier of the parent call. This is a 30 character, alphanumeric string. For example: kd8sore0at5emifrkh04p4foulugj4 |
ProjectId | The ID of the project where the call was made. This is up to 30 characters and can include lowercase alphanumeric characters and dash (- ).For example: example-project |
StartTime | The date and time that the parent call started. |
AnswerTime | The date and time that the parent call was answered. This is when billing begins for the parent call. |
EndTime | The date and time that the parent call ended. This can either be when an answered call hung up, or when an unsuccessful call attempt completed. |
Direction | The direction of the parent call. Possible values: INCOMING , OUTGOING . |
ParentFrom | The originator of the parent call. For PSTN calls, this is the CLI (Caller ID) in +E164 format. For calls to a SIP domain, this is the URI in the From header, in the format sip:user-or-number@domain . For PSTN originated private calls, this field will be blank.This is the A Party. |
ParentTo | The recipient of the parent call. For PSTN calls, this is the phone number in +E164 format. For calls to a SIP domain, this is the URI in the To header, in the format sip:user-or-number@domain .For virtual number scenarios, this is the dialed number. |
ChildFrom | The originator of the child call. |
ChildTo | The recipient of the child call. This is the B Party. |
DurationSeconds | The duration (rounded up to the second) for which the parent call was answered. If the call was not answered, this field will be blank. |
State | The state of the child call. If there is no child call, the state of the parent call. Possible values:
|
ParentSkuId | The ID of the SKU that was used to rate the parent call. A list of SKUs can be downloaded from the pricing page. For example: 461C-87AB-7608 |
ChildSkuId | The ID of the SKU that was used to rate the child call. For example: 7C93-EAC0-7D2F |
CompositeSku | The SKU representing both the parent and the child SKUs. See the below section for more details. For example: 461C-87AB-7608>7C93-EAC0-7D2F |
ParentPrice | The price that was charged for the parent call as a decimal number. If the call was not billable, this field will be blank. For example: 0.0245 |
ChildPrice | The price that was charged for the child call as a decimal number. If the call was not billable, this field will be blank. For example: 0.04 |
TotalPrice | The price that was charged for both legs of the call as a decimal number. If the call was not billable, this field will be blank. For example: 0.0645 |
CurrencyCode | The currency code of the charge. If the call was not billable, this field will be blank. The currency of all charges under a project or billing account will be the same and cannot change. For example: AUD |
SipCallId | The value of the Call-ID header of the SIP call. Only set if either the parent or child leg is a SIP call. If both legs are SIP calls, the parent leg will be used.For example: 6d265936-aa3d-48b4-a8fa-d633df94dc8d |
FromRegionCode | The alpha-2 region or country code representing the location of the caller. This is only set for incoming PSTN calls. If this information cannot be determined, this field will be blank. For example: AU |
FromAdministrativeArea | The administrative area (such as a state or territory) representing the location of the caller. This is only set for incoming PSTN calls. If this information cannot be determined, this field will be blank. For example: QLD |
FromLocality | The locality (such as a town or city) representing the location of the caller. This is only set for incoming PSTN calls. If this information cannot be determined, this field will be blank. For example: Redcliffe |
FromLongitude | The approximate longitude of the caller. This is only set for incoming PSTN calls and is the best approximation given the available information. If this cannot be determined, this field will be blank. For example: 152.992 |
FromLatitude | The approximate latitude of the caller. This is only set for incoming PSTN calls and is the best approximation given the available information. If this cannot be determined, this field will be blank. For example: -27.2583 |
Moli | The mobile location information (MoLI) code that was received. This is only set for incoming PSTN calls to Australian toll-free and shared-rate numbers where the call was originated by a mobile phone. Note that MoLI may not be provided for all mobile callers, particularly when the call was originated by IP telephony or as a result of call forwarding. For example: 56 |
Composite SKUs¶
Composite SKUs are special SKUs for representing both the parent and child legs of a call. A list of Enfonica's standard SKUs can be downloaded from the pricing page for reference.
Composite SKUs have the following format.
Scenario | Format |
---|---|
Both legs are billable | {ParentSkuId}>{ChildSkuId} |
Only the parent leg is billable | {ParentSkuId} |
Only the child leg is billable | {ChildSkuId} |
No legs are billable | (blank) |
Common composite SKUs are documented below.
Australian 13/1300¶
Composite SKU | Description |
---|---|
F30B-9D78-E85D>7C93-EAC0-7D2F |
13/1300 Mobile to Fixed |
F30B-9D78-E85D>461C-87AB-7608 |
13/1300 Mobile to Mobile |
F30B-9D78-E85D |
13/1300 Mobile (to IVR or SIP) |
8CAF-D7FB-D5FC>7C93-EAC0-7D2F |
13/1300 Fixed to Fixed |
8CAF-D7FB-D5FC>461C-87AB-7608 |
13/1300 Fixed to Mobile |
8CAF-D7FB-D5FC |
13/1300 Fixed (to IVR or SIP) |
8CAF-D7FB-D5FC>1CF9-6A54-3EC6 |
13/1300 International to Fixed |
8CAF-D7FB-D5FC>ED92-012C-DE9C |
13/1300 International to Mobile |
Australian 1800¶
Composite SKU | Description |
---|---|
2BFA-4872-063A>7C93-EAC0-7D2F |
1800 Mobile to Fixed |
2BFA-4872-063A>461C-87AB-7608 |
1800 Mobile to Mobile |
2BFA-4872-063A |
1800 Mobile (to IVR or SIP) |
F5D4-6609-D20F>7C93-EAC0-7D2F |
1800 Fixed to Fixed |
F5D4-6609-D20F>461C-87AB-7608 |
1800 Fixed to Mobile |
F5D4-6609-D20F |
1800 Fixed (to IVR or SIP) |
F5D4-6609-D20F>1CF9-6A54-3EC6 |
1800 International to Fixed |
F5D4-6609-D20F>ED92-012C-DE9C |
1800 International to Mobile |
Other Examples¶
Composite SKU | Description |
---|---|
F5D4-6609-D20F>68C7-8C74-26DE |
Australian 1800 Fixed to Japan (Tokyo) |
4931-B4A2-2C9F>461C-87AB-7608 |
New Zealand Local to Australia Mobile |
A4D4-5B86-5D71 |
Australian Mobile to SIP |
461C-87AB-7608 |
SIP to Australia Mobile |