06 Line
Browser SDK

Errors

PhoneError and its codes.

Every rejected promise and every error event carries a PhoneError:

class PhoneError extends Error {
  code: string;        // match on this
  requestId?: string;  // give it to support
  param?: string;      // offending field, for API errors
}

code is one of the API error codes, or one of these, specific to the browser:

CodeCauseWhat to do
microphone_deniedThe user or the browser refused microphone accessExplain how to allow it in the browser settings
microphone_not_foundNo microphone, or the chosen one was unplugged (mid-call too: then sent as an error event and the call is muted)Ask the user to plug one in or pick another
audio_unavailableThe page cannot run Web Audio (old browser, insecure origin)Serve the page over HTTPS, update the browser
user_gesture_requiredcall() or answer() ran outside a user actionCall them from a click handler
not_supportedAn output was set in a browser that cannot choose the speaker (Safari)Hide the speaker picker when phone.canChooseOutput is false
ephemeral_key_failedgetEphemeralKey threw or did not return the JSON of POST /v1/ephemeral-keysCheck your server route
connection_lostThe WebRTC session could not be restored for 2 minutes (network down, UDP and TURN blocked)Show it, offer to retry with phone.connect()