Reliable voice interactions need a transport recovery design that does not confuse a successful signaling exchange with actual restored media. The following original test protocol separates those concerns and defines measurable, privacy-aware evidence.

What an ICE restart actually repairs

A real-time AI voice call can appear connected while neither person hears the other. A network handover, vanished relay path or incompatible candidate pair may require ICE renegotiation. MDN’s WebRTC documentation explains that restartIce requests new candidates and arranges an ICE restart on the next offer, while the application must still exchange descriptions through its signaling channel. The method cannot repair microphone permission, an expired application token or a crashed inference server. Treat it as a narrowly defined transport recovery tool rather than a universal retry button. Engineers should record the connection state before acting, along with the timestamps of the last transmitted and received audio packets. A connection-state transition and the media-plane symptom should be logged separately.

Design an observable recovery state machine

Define connected, degraded, restarting, verifying and failed. Enter degraded after sustained missing incoming audio or an ICE state transition indicating trouble. Enter restarting only after the signaling channel is available and a new negotiation can be delivered. Enter verifying when candidates are accepted and require sustained media receipt before restoring the active label. This protects users from a misleading green status when negotiation succeeds but the microphone track is muted. Give each recovery attempt a generation number and reject late candidates belonging to a previous negotiation. The client should maintain an explicit maximum retry count and show a manual reconnection option after exhaustion, rather than spinning through repeated offers without informing the caller.

Test simultaneous negotiation collisions

After an access-point failure, both peers may call restartIce and attempt to create a new offer. This is a negotiation collision, often called glare. MDN’s perfect-negotiation pattern describes how roles and rollback can manage competing offers. Establish a polite and an impolite peer role for collision handling, but do not confuse those protocol roles with social or account privileges. Queue candidates until the matching remote description exists. Keep a correlation identifier for each offer and acknowledgement so late events can be classified. If signaling becomes unavailable, do not accumulate an unbounded backlog of offers. On reconnect, reconcile the current generation first, then resume media. These tests matter especially when mobile operating systems suspend browser execution.

A reproducible Wi-Fi-to-cellular experiment

Run at least ten handovers on each of two representative operating-system and browser combinations. Begin a stable audio session on Wi-Fi, disable Wi-Fi while mobile data remains available, and measure the interval from the last valid audio packet to the first sustained restored packet. Repeat with a weak access point, a temporarily unreachable TURN server and a device that enters the background. Store p50, p95, reconnect failure rate and time spent in each recovery state. A five-second p95 goal could be an initial design threshold, but it is not an industry benchmark or an assurance about every network. Publish the exact tested connectivity conditions so teams do not extrapolate a laboratory pass to remote rural networks.

Distinguish an audio route failure from ICE failure

A person can disconnect Bluetooth earbuds, revoke microphone authorization or mute a local track without losing network transport. Track.readyState, enabled and muted provide signals about audio capture state, while system output routing needs separate diagnosis. An AI voice call should not trigger ICE restarts whenever the person presses a mute control. Conversely, an established ICE state should not prevent the application from recognizing that no usable input device remains. Build failure labels that distinguish microphone permission, device output, transport, inference service and remote-party availability. Present a suitable next action for each one. A user with working inbound audio but missing outbound audio should be offered a microphone repair path, not told that the entire call is offline.

Protect user state and metered sessions

Recovery should not submit the last spoken utterance twice or charge for two conversation turns after a duplicate connection attempt. Use a session identifier and a monotonic turn identifier to reconcile repeated requests. Persist only the conversational information permitted by the user’s memory and retention settings. If audio cannot recover, offer text or a deliberate end-call action rather than forcing a user to remain attached to a silent avatar. A session may be technically open while delivering no meaningful media, so billing and activity status should use a well-defined media or interaction signal. Log a reason when a degraded session ends and allow support staff to see a minimal, privacy-aware incident record without storing raw voice by default.

Define release gates and post-launch evidence

A candidate build should pass the handover matrix, an offer-collision scenario, permission withdrawal, repeated reconnect and a user-initiated cancellation. Check that an explicit leave action terminates media and any associated charges. Publish a dashboard of p95 repair time, unsuccessful attempts, false-active statuses, text-fallback choices and device-specific regressions. Correlate these with deployments and network conditions, not with the emotional content of conversations. The W3C WebRTC Recommendation dated 13 March 2025 describes the real-time browser API surface, while the product team owns the usability contract around it. Robust recovery is demonstrated by a repeatable failure test and a truthful interface, not by merely finding a call that eventually reconnected.

Sources