WayloAIWaylo Docs
Web SDK

Show call status

What state.stage means and what to show.

wayloVoice.on('state', state => {
  statusText.textContent = STATUS[state.stage]; // your words for each stage, see below
});

state.stage folds connection and agent into the one value a status line needs. The SDK shows no text; your page picks the words.

{agent} is the agent's name, or "the agent".

stageStatus text
idlenothing, or your Talk button
connectingCalling {agent}…
joining{agent} is joining…
preparing{agent} is getting ready… (the agent is ready but hasn't spoken yet)
speaking{agent} is speaking
listeningGo ahead, I'm listening
thinkingThinking…
reconnectingReconnecting…
endedCall ended, or the failure in end

Next to it, while network is poor or lost: "Your connection is weak, you may hear gaps".

The state snapshot

FieldValues
stageidle, connecting, joining, preparing, speaking, listening, thinking, reconnecting, ended
connectionidle, connecting, connected, reconnecting, disconnected
agentnone, joining, listening, thinking, speaking
microphoneoff, on, muted
networkgood, poor, lost; good outside a call
playbackstopped, playing, blocked
volumelast setVolume() value, default 1
sessionIdthe Waylo session id, once known
microphoneDeviceId, speakerDeviceIdthe chosen device, or the one in use once the call has it; unset or 'default' means the system default
timingshow long each step of the call took, from start() on (Measure start-up time)
endset once when the call is over: { status: 'completed', reason? } or { status: 'failed', reason?, error }

network is how well this browser's connection to the call is doing. When it's poor or lost, show a non-blocking banner; the call goes on, and connection says if it's reconnecting.

  • network follows LiveKit's quality score once a dip lasts 2 s. It also turns poor after 3 s with no data arriving, after 2 s with the browser's network path down, or while connection is reconnecting, until data flows again for 1 s.
  • connection turns reconnecting at once when the browser goes offline, after 8 s with no data, or within 2 s of LiveKit starting to reconnect. It turns back once LiveKit reconnects or data flows again, after at least 1 s.
  • After 45 s of reconnecting, the call ends with CONNECTION_LOST.

How a call ends

end.reason is one of caller_hangup, caller_inactive, caller_goodbye, caller_not_joined, agent_end, busy, no_answer, rejected, cancelled, provider_error, provider_key_failed, worker_error, max_duration, timeout.

end is what this browser saw. A failed call also has end.error, a WayloVoiceError.

On this page