Call Report Stats
The Telnyx WebRTC JS SDK can automatically collect WebRTC statistics during and after calls. Use call reports to monitor quality, diagnose issues, and build real-time quality indicators.Enabling Call Reports
| Option | Type | Default | Description |
|---|---|---|---|
enableCallReports | boolean | true | Enable call report collection |
callReportInterval | number | 5000 | Interval in ms between periodic stats |
Real-Time Stats (telnyx.stats.frame)
Fires periodically during an active call (every callReportInterval ms):
StatsFrame Properties
| Property | Type | Description |
|---|---|---|
rtt | number | Round-trip time in milliseconds |
jitter | number | Jitter in milliseconds |
packetLoss | number | Packet loss percentage |
bytesSent | number | Total bytes sent |
bytesReceived | number | Total bytes received |
packetsSent | number | Total RTP packets sent |
packetsReceived | number | Total RTP packets received |
packetsLost | number | Total RTP packets lost |
audioLevel | number | Current audio level (0.0 - 1.0) |
timestamp | number | Unix timestamp of the measurement |
Quality Thresholds
| Metric | Good | Fair | Poor |
|---|---|---|---|
| RTT | < 150ms | 150-300ms | > 300ms |
| Jitter | < 20ms | 20-50ms | > 50ms |
| Packet Loss | < 1% | 1-3% | > 3% |
Building a quality indicator
Quality warning events
The SDK also emits structuredtelnyx.warning events when quality or connectivity thresholds are crossed. Use these warnings to drive user-facing indicators and collect diagnostics without parsing raw stats yourself:
LOW_LOCAL_AUDIO means RTP may still be flowing, but local microphone level is too low or silent. Ask the user to check microphone selection, mute state, and operating system input gain.
ICE_CANDIDATE_PAIR_CHANGED means the selected ICE path changed mid-call. The call may continue normally, but frequent changes are useful diagnostics for VPN changes, Wi-Fi handoffs, NAT rebinding, or relay fallback.
End-of-Call Report (telnyx.stats.report)
Fires when a call ends with a summary of the entire call:
Call Report Stats API
For SDK 2.25.20+, call reports are also available via HTTP API:API Response Structure
Key Fields for Diagnostics
| Field | Path | What It Tells You |
|---|---|---|
| DTLS state | ice_data.transport.dtls_state | "connected" = media encrypted , "connecting" = DTLS stuck |
| ICE state | ice_data.transport.ice_state | "connected" = ICE worked |
| SRTP cipher | ice_data.transport.srtp_cipher | Null = no encryption (DTLS failed) |
| Selected pair | ice_data.selected_pair | Which candidate pair is actually in use |
| Candidate types | ice_data.candidates[].type | host = direct, srflx = STUN, relay = TURN |
Diagnosing Issues from Call Reports
DTLS stuck (“connecting”)
All relay candidates
forceRelayCandidate: true.
No candidates at all
stun.telnyx.com and turn.telnyx.com. See Network Requirements.
See Also
- IClientOptions —
enableCallReports,callReportInterval - Best Practices — Quality monitoring guidance
- Network Requirements — ICE/STUN/TURN configuration
- Debug Data & Call Quality Analysis — Interpreting debug output