Prompt

How do I get call quality metrics for WebRTC sessions

Technology / API Platforms1 observationLast seen Nov 2, 2026

Latest observation

Nov 2, 2026OpenAI APIWeb search: off

To get call quality metrics for WebRTC sessions, you typically read them from the browser’s built-in WebRTC stats APIs and, if needed, supplement with your own signaling/app telemetry.

1) Use RTCPeerConnection.getStats()

This is the primary source of WebRTC quality metrics.

What you can measure

Common metrics include:

  • Packet loss: audio/video send and receive loss
  • Jitter: variation in packet arrival time
  • Round-trip time (RTT): network latency estimate
  • Bitrate / bytes sent/received
  • Frame rate / frame dimensions for video
  • Audio concealment / samples lost
  • NACK/PLI/FIR counts for video recovery behavior
  • Candidate pair info: current network path, local/remote IPs, transport type

Example

async function logWebRTCStats(pc) {
  const stats = await pc.getStats();

  stats.forEach(report => {
    if (report.type === 'inbound-rtp' && !report.isRemote) {
      console.log('Inbound', {
        kind: report.kind,
        packetsReceived: report.packetsReceived,
        packetsLost: report.packetsLost,
        jitter: report.jitter,
        bytesReceived: report.bytesReceived,
        framesDecoded: report.framesDecoded,
        frameWidth: report.frameWidth,
        frameHeight: report.frameHeight,
      });
    }

    if (report.type === 'outbound-rtp' && !report.isRemote) {
      console.log('Outbound', {
        kind: report.kind,
        packetsSent: report.packetsSent,
        bytesSent: report.bytesSent,
        framesEncoded: report.framesEncoded,
      });
    }

    if (report.type === 'candidate-pair' && report.state === 'succeeded' && report.selected) {
      console.log('Selected candidate pair', {
        currentRoundTripTime: report.currentRoundTripTime,
        availableOutgoingBitrate: report.availableOutgoingBitrate,
        availableIncomingBitrate: report.availableIncomingBitrate,
      });
    }
  });
}

Call it periodically:

setInterval(() => logWebRTCStats(pc), 5000);

2) Derive higher-level quality indicators

Raw stats are useful, but call quality is often expressed as derived metrics:

  • Packet loss %
    • lost / (received + lost) or use deltas over time
  • Jitter buffer delay
  • Effective bitrate
    • bytes delta over time × 8
  • Video quality
    • resolution, frames per second, freeze count
  • Audio quality
    • concealment, jitter, late packets

For better accuracy, compare delta values between samples rather than absolute totals.


3) Correlate with signaling and session data

To understand call issues, combine WebRTC stats with:

  • session start/end timestamps
  • ICE connection state changes
  • track mute/unmute events
  • selected codec
  • device/browser info
  • server-side SFU/MCU stats if you use one

Useful events:

pc.oniceconnectionstatechange = () => {
  console.log('ICE state:', pc.iceConnectionState);
};

pc.onconnectionstatechange = () => {
  console.log('PeerConnection state:', pc.connectionState);
};

4) If you use an SFU or media server

If your app uses Twilio, Daily, Agora, Janus, mediasoup, Jitsi, etc., you can often get:

  • server-side RTP stats
  • subscriber/publisher packet loss
  • relay bandwidth
  • per-participant quality
  • server relay latency

This is often easier for fleet-wide monitoring than client-only stats.


5) Convert stats into user-facing QoE metrics

Common quality KPIs:

  • MOS-like score or “good/fair/poor”
  • Call setup time
  • Audio/video freeze rate
  • One-way latency estimate
  • Join success rate
  • ICE failure rate

Example thresholds (rough, app-dependent):

  • RTT > 300 ms: poor
  • packet loss > 2–5%: noticeable issues
  • jitter > 30 ms: potential audio/video instability
  • video FPS < 15: degraded experience

6) Tools and libraries

You can use:

  • Native browser WebRTC stats API
  • WebRTC internals in Chrome: chrome://webrtc-internals
  • Analytics libraries/platforms:
    • callstats.io
    • Twilio Insights
    • Daily analytics
    • Agora analytics
    • your own telemetry pipeline

7) Best practice implementation approach

  1. Poll getStats() every 2–5 seconds.
  2. Store time-series data for each peer connection.
  3. Compute deltas for bytes/packets/frames.
  4. Capture ICE/connection state transitions.
  5. Send aggregated metrics to your backend.
  6. Alert on thresholds or sudden changes.

If you want, I can give you:

  1. a complete JavaScript WebRTC stats collector,
  2. metric formulas for packet loss/jitter/bitrate, or
  3. a React/Node example that sends call quality telemetry to your backend.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.