normalise (states.py)

zvonok · voice

The canonical status vocabulary. call-api owns it; everything else is a dialect. The voice agent has its own words for how a call ended (`goal_achieved`, `no_audio`, `abandoned`, `callee_hangup`, `setup_failed`, …) and BRIEF §4 names a different set of terminal call states (`busy

"""The canonical status vocabulary. call-api owns it; everything else is a dialect.

The voice agent has its own words for how a call ended (`goal_achieved`,
`no_audio`, `abandoned`, `callee_hangup`, `setup_failed`, …) and BRIEF §4 names a
different set of terminal call states (`busy`, `no_answer`, `voicemail`, …).
Letting both float was flagged as a phase-2 trap (BRIEF §9, trap 3): a status
that means different things in two services eventually drives a wrong retry, and
a wrong retry redials a stranger. So the agent's vocabulary is treated as an
INPUT DIALECT and normalised here, once, on the way in.
"""

from __future__ import annotations

# Lifecycle (BRIEF §4).
CALL_STATES = (
    "queued", "provisioning", "dialing", "ringing", "in_progress",
    "ending", "post_processing", "completed

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key