CDR Streaming interface

DIDWW Streaming API enables the streaming of CDRs to customers API. It’s a subscription-based mechanism that will deliver the CDRs using HTTP POST method within 3 seconds after call completion.

Configuration and usage

CDR Streaming is currently beta and it can enabled only by customers request to DIDWW technical support team at support@didww.com

Request format

CDRs are serialized to JSON format. Request can contain multiple CDRs (multiple JSON objects) separated by n(LF) - also known as JSONEachRow format. Request Payload encoded as gzip so customer API should support gzip.

HTTP request headers example:

POST /cdr HTTP/1.1
Host: 192.0.2.5
User-Agent: CDR-streamer
Accept: */*
Content-Type: text/plain
Content-Encoding: gzip
Content-Length: 2358
Expect: 100-continue

HTTP request payload example:

{"sub_customer_tf_connection_fee":0,"trm_initial_interval":null,"sub_customer_trm_duration":null,"metered_channels_duration":null,"sub_customer_trm_next_interval":null,"metered_channels_amount_no_vat":null,"local_tag":"10-04336EB9-5DBAF4AA000E6DDB-6A41F700","metered_channels_next_interval":null,"sub_customer_trm_rate":0,"disconnect_initiator":1,"legb_disconnect_reason":"","metered_channels_connection_fee":null,"duration":0,"is_last_cdr":true,"sub_customer_tf_duration":null,"customer_vat":0,"tf_connection_fee":0,"metered_channels_rate":null,"sub_customer_trm_connection_fee":0,"success":false,"dst_number":"97239723915909200","trm_duration":null,"tf_duration":null,"time_connect":null,"time_start":"2019-10-31 14:50:18.930234","sub_customer_trm_amount":null,"term_call_id":"","src_name":"","did_number":"972397239159092","early_media_present":false,"tf_initial_interval":null,"metered_channels_amount":null,"time_end":"2019-10-31 14:50:18.946403","trm_rate":0,"sub_customer_tf_next_interval":null,"trm_amount":null,"internal_disconnect_code":480,"trm_amount_no_vat":null,"sub_customer_tf_initial_interval":null,"trunk_destination":"iax:324@34234234","tf_rate":0,"out_pop_id":1,"sub_customer_tf_rate":0,"sub_customer_tf_amount":null,"sub_customer_trm_initial_interval":null,"tf_amount":null,"legb_disconnect_code":0,"routing_attempt":1,"is_redirected":false,"tf_next_interval":null,"metered_channels_initial_interval":null,"transport_protocol_id":null,"tf_amount_no_vat":null,"trm_next_interval":null,"trm_connection_fee":0,"src_number":"","user_agent":null,"internal_disconnect_reason":"DID number overloaded"}
{"sub_customer_tf_connection_fee":0,"trm_initial_interval":null,"sub_customer_trm_duration":null,"metered_channels_duration":null,"sub_customer_trm_next_interval":null,"metered_channels_amount_no_vat":null,"local_tag":"10-6C9724C3-5DBAF487000C0583-6A520700","metered_channels_next_interval":null,"sub_customer_trm_rate":0,"disconnect_initiator":3,"legb_disconnect_reason":"Bye","metered_channels_connection_fee":null,"duration":35,"is_last_cdr":true,"sub_customer_tf_duration":null,"customer_vat":0,"tf_connection_fee":0,"metered_channels_rate":null,"sub_customer_trm_connection_fee":0,"success":true,"dst_number":"972397239159092","trm_duration":null,"tf_duration":null,"time_connect":"2019-10-31 14:49:43.796925","time_start":"2019-10-31 14:49:43.775349","sub_customer_trm_amount":null,"term_call_id":"10-10-7ED7C3EC-5DBAF487000C1C19-8FCFC700","src_name":"4","did_number":"972397239159092","early_media_present":false,"tf_initial_interval":null,"metered_channels_amount":null,"time_end":"2019-10-31 14:50:18.85648","trm_rate":0,"sub_customer_tf_next_interval":null,"trm_amount":null,"internal_disconnect_code":200,"trm_amount_no_vat":null,"sub_customer_tf_initial_interval":null,"trunk_destination":"sip:972397239159092@didww.com","tf_rate":0,"out_pop_id":1,"sub_customer_tf_rate":0,"sub_customer_tf_amount":null,"sub_customer_trm_initial_interval":null,"tf_amount":null,"legb_disconnect_code":200,"routing_attempt":2,"is_redirected":false,"tf_next_interval":null,"metered_channels_initial_interval":null,"transport_protocol_id":1,"tf_amount_no_vat":null,"trm_next_interval":null,"trm_connection_fee":0,"src_number":"4","user_agent":"Asterisk PBX 11.13.1~dfsg-2+deb8u5","internal_disconnect_reason":"Bye"}

CDR attributes for DID service

time_start
Type: Timestamp
Description: Start time when the initial INVITE is received
time_connect
Type: Timestamp
Description: Time after the successful handshake (200OK SIP)
time_end
Type: Timestamp
Description: Time when the call was disconnected
duration
Type: Integer
Description: Call duration in seconds. For non-connected calls duration is 0
disconnect_initiator
Type: Integer
Description: Indicates which part initiated disconnection. Possible values:
  • 0 Routing engine
  • 1 SBC
  • 2 Disconnect was initiated by called destination network
  • 3 Disconnect was initiated by call originator
internal_disconnect_code
Type: Integer
Description: DIDWW internal disconnect code
however internal_disconnect_reason
Type: String
Description: DIDWW internal disconnect reason
legb_disconnect_code
Type: Integer
Description: SIP response code received from the destination network
legb_disconnect_reason
Type: String
Description: SIP disconnect reason received from the destination network
routing_attempt
Type: Integer
Description: Routing attempts to reach the destination network
is_last_cdr
Type: Boolean
Description: Indicates the last attempt to reach the destination network in the event of fail-over
success
Type: Boolean
Description: Indicates that the call was successful
term_call_id
Type: String
Description: SIP Call-ID of call leg between DIDWW and customer equipment
local_tag
Type: String
Description: Internal identifier of the call record
did_number
Type: String
Description: DID number in full format
src_name
Type: String
Description: Incoming caller name
src_number
Type: String
Description: Incoming Caller-ID
dst_number
Type: String
Description: Called destination number
trunk_destination
Type: String
Description: Call destination in URI format
customer_vat
Type: Numeric
Description: Charged VAT amount for the call
tf_rate
Type: Numeric
Description: Customer Toll-Free rate
tf_connection_fee
Type: Numeric
Description: Customer Toll-Free connection fee
tf_initial_interval
Type: Integer
Description: Initial billing interval for Toll-Free service
tf_next_interval
Type: Integer
Description: Next billing interval for Toll-Free service
tf_duration
Type: Integer
Description: Call duration rounded to configured billing interval for Toll-Free service
tf_amount
Type: Numeric
Description: Customer Toll-Free accumulated amount
tf_amount_no_vat
Type: Numeric
Description: Customer Toll-Free accumulated amount without VAT
trm_rate
Type: Numeric
Description: Customer termination rate. Applies when PSTN forwarding is used
trm_connection_fee
Type: Numeric
Description: Customer termination connection fee. Applies when PSTN forwarding is used
trm_initial_interval
Type: Integer
Description: Initial billing interval length in seconds for PSTN forwarding
trm_next_interval
Type: Integer
Description: Next billing interval length seconds for PSTN forwarding
trm_duration
Type: Integer
Description: Call duration rounded to configured billing interval for PSTN forwarding
trm_amount
Type: Numeric
Description: Customer PSTN termination accumulated amount
trm_amount_no_vat
Type: Numeric
Description: Customer PSTN termination accumulated amount without VAT
metered_channels_rate
Type: Numeric
Description: Metered capacity rate
metered_channels_connection_fee
Type: Numeric
Description: Metered capacity connection fee
metered_channels_initial_interval
Type: Integer
Description: Metered capacity initial billing interval in seconds
metered_channels_next_interval
Type: Integer
Description: Metered capacity next billing interval length
metered_channels_duration
Type: Integer
Description: Metered capacity charged duration
metered_channels_amount
Type: Numeric
Description: Customer metered capacity accumulated amount
metered_channels_amount_no_vat
Type: Numeric
Description: Customer metered capacity accumulated amount excluding VAT
sub_customer_tf_rate
Type: Numeric
Description: Sub customer rate for Toll-Free service
sub_customer_tf_connection_fee
Type: Numeric
Description: Sub customer connection fee for Toll-Free service
sub_customer_tf_initial_interval
Type: Integer
Description: Initial billing interval length in seconds for Toll-Free service
sub_customer_tf_next_interval
Type: Integer
Description: Next billing interval length in seconds for Toll-Free service
sub_customer_tf_duration
Type: Integer
Description: Sub customer call duration for Toll-Free service according to billing interval lengths
sub_customer_tf_amount
Type: Numeric
Description: Sub customer amount for Toll-Free service
sub_customer_trm_rate
Type: Numeric
Description: Sub customer rate for PSTN forwarding service
sub_customer_trm_connection_fee
Type: Numeric
Description: Sub customer connection fee for PSTN forwarding service
sub_customer_trm_initial_interval
Type: Integer
Description: Initial billing interval for PSTN forwarding service
sub_customer_trm_next_interval
Type: Integer
Description: Next billing interval for PSTN forwarding service
sub_customer_trm_duration
Type: Integer
Description: Sub customer call duration for PSTN forwarding service according with billing interval lengths
sub_customer_trm_amount
Type: Numeric
Description: Sub customer amount for PSTN forwarding service
out_pop_id
Type: Integer
Description: POP for the call leg from DIDWW to customer. Possible values:
  • 1 USA New-York
  • 2 DE Frankfurt
  • 4 USA Los-Angeles
  • 5 USA Miami
  • 6 Singapore
transport_protocol_id
Type: Integer
Description: Transport protocol used between DIDWW and the customer gateway: Possible values:
  • 1 UDP
  • 2 TCP
user_agent
Type: String
Description: User-Agent and Server header values from the customer gateway
is_redirected
Type: Boolean
Description: Used to indicate if call was redirected by 3xx SIP response. Possible values:
  • True
  • False
early_media_present
Type: Boolean
Description: Indicates if early media stream is present in the destination gateway. Possible values:
  • True
  • False

Batching

CDRs are delivered in batches, HTTP POST request can contain multiple CDRs. Maximum batch size is 1000. Destination API should be able to process multiple CDRs in same request.

Error handling

If the destination API responds with 2xx HTTP code, streaming interface will consider all CDRs sent in that request as processed and they will be automatically deleted from the queue. In case of HTTP error (non 2xx response or timeout), CDRs will be stored in the queue and will re-attempt to deliver them after 3 seconds.

Warning

Queue length is limited to 10000 records per customer, long customers API downtime or increased delay to process the requests can cause data loss. Therefore, CDR Streaming mechanism can not be used as the only way to receive CDRs. See the API documentation for other CDR fetching mechanisms.

IP addresses

Currently requests are being sent from IPv4 address 46.19.210.148 and IPv6 address 2a01:ad00:2:3::134