# Configure call events and CDR streaming

Use this workflow for any of the four Call Events API configurations. Each
configuration has its own endpoint settings and delivery switch.

## Before you begin

- Have the **Call Events API activated for your account**. Activation is
  available on request from [DIDWW Technical Support](mailto:support%40didww.com). Account access is separate from
saving
  an endpoint and turning on a delivery switch.
- Use an account that can manage **APIs > Call Events API**. If the
  section or its controls are unavailable, check access with your account
  administrator.
- Prepare an HTTP endpoint that accepts POST requests and the format of your
  chosen feed. If you enable compression, it must also decode gzip bodies.
- Check the [Configuration and delivery reference](configuration-and-delivery-reference.html) for network access, authentication,
  acknowledgement and CDR queue limits.
- Have a DID number or outbound trunk available for a controlled test, and
  access to your receiver's request logs.

## 1. Open the Call Events API settings

In the [DIDWW User Panel](https://my.didww.com/), go to **APIs > Call Events
API**, or open [Call Events API settings](https://my.didww.com/#/call_event_configs) directly.

[![Voice IN and Voice OUT cards for Call Events and CDR Streaming.](../_images/call_events_fig1.webp)](../_images/call_events_fig1.webp)


Call Events API settings in the User Panel.

## 2. Choose the configuration

| Direction and card | Receives | Payload reference |
| --- | --- | --- |
| **Voice IN → Call Events** | Progress notifications for calls to your DID numbers. | [Inbound call events](did-call-events.html) |
| **Voice OUT → Call Events** | Progress notifications for calls through your outbound trunks. | [Outbound call events](termination-call-events.html) |
| **Voice IN → CDR Streaming** | Completed inbound records and routing attempts. | [Inbound CDR streaming](did-cdr.html) |
| **Voice OUT → CDR Streaming** | Completed outbound call records. | [Outbound CDR streaming](termination-cdr.html) |

On the required card, click **Configure**, or **Edit Configuration** if settings
have already been saved. A configuration applies to that service and direction
on the account. It is not selected separately for each DID number.

## 3. Enter the endpoint settings

1. Set **Endpoint** to your receiving URL, for example
   `https://example.com/webhooks/didww`.
2. Select **Enable GZIP compression** only if the receiver accepts gzip-encoded
   request bodies.
3. If the endpoint requires HTTP Basic Authentication, enter its **Username**
   and **Password** in **Authentication**.
4. If the endpoint requires custom headers, use **Add Header** under **Headers**
   and enter each header name and value.

[![Endpoint, Enable GZIP compression, Authentication and Headers fields.](../_images/call_events_fig2.webp)](../_images/call_events_fig2.webp)


Configuration fields for a receiving endpoint.

## 4. Save the configuration

Click **Submit**. Confirm that the card shows the endpoint you entered.
**Cancel** closes the form without saving its changes.

Saving the endpoint does not by itself enable delivery. The card must also
have its delivery switch turned on.

## 5. Enable delivery

Turn on the switch on the selected card. Repeat the configuration and enabling
steps for every service and direction that your application needs.

For example, receiving inbound CDRs and outbound CDRs requires enabling both
**CDR Streaming** cards. Enabling either card does not enable **Call Events**.

## 6. Make and validate a test call

1. For **Voice IN**, call your DID number. For **Voice OUT**, place a call
   through the outbound trunk being tested.
2. Answer the call, allow a short conversation and hang up. For Call Events,
   check for start, connect and end notifications. For CDR Streaming, wait
   until the call has ended and check the completed record.
3. Confirm the request's content type and compression. Decode the body, then
   compare its `type`, identifiers and attributes with the applicable
   payload reference from step 2.
4. Compare the direction, numbers, times, trunk and outcome with **Logs &
   Analytics > Call Logs**. Use `time_connect` and duration to confirm that
   a connection was recorded.
5. Test an unanswered or rejected attempt as well. Expect no connect event.
   Check the end event or CDR for the unconnected outcome.

If the test transfers an inbound call through an outbound trunk, check each
enabled direction separately. Use the resulting records to identify the
outbound leg rather than assuming that a transfer is an inbound-only test.

After a temporary test, turn off any delivery switches that you do not want
to keep enabled. To edit, pause or remove settings later, see
[Manage a configuration](configuration-and-delivery-reference.html#call-events-manage-configuration).

## Troubleshoot delivery

No requests arrive

Confirm the correct account, direction and card. Verify that the endpoint is saved
and its switch is on. Check DNS, TLS, firewall access and receiver availability.

Authentication or access error

Check Basic Authentication credentials, custom header names and values, and any
receiver IP allowlist. Inspect the HTTP response in receiver logs.

The body is unreadable

Check `Content-Encoding` before parsing. Decompress gzip once, then parse the
appropriate body format.

JSON parsing fails for CDRs

A CDR batch is newline-delimited JSON, not a JSON array or one combined JSON
document. Parse each record.

No connect event arrives

Check whether the call was answered. An unconnected call has no connect event.
Inspect the end event or CDR and call logs.

Expected records are missing after an outage

Check receiver errors and CDR queue limits. Reconcile historical records with
call logs or exports. Do not assume every missed callback will be replayed.

For acknowledgement and retry behavior, see the
[Configuration and delivery reference](configuration-and-delivery-reference.html). For voice failures, use
[Inbound troubleshooting](../voice/inbound-trunks/troubleshooting.html) or
[Outbound analytics and troubleshooting](../voice/outbound-trunks/analytics-troubleshooting.html).
