Send POST /api/v1/voice/calls/{id}/control while a call is in progress. The worker running the call picks the command up within about 2 seconds; the API answers 202. If the worker running the call cannot be reached, the API answers 503 (code call_unreachable) and the command is not carried out.
type | What happens |
|---|---|
say | The agent says text after its current sentence, or at once with "interrupt": true |
note | The agent is told text (not spoken) and takes it into account from its next reply; the transcript notes it |
end | The agent says text if given, then hangs up; a phone call without text is hung up at once |
The call's ended_reason is then api_ended. The call page on the dashboard has the same controls.
POST /api/v1/voice/calls/{id}/listen (optionally { "channels": 2 }) returns a listen_url you can open within two minutes. It is a WebSocket: first a JSON message {"type":"start","sampleRate":8000,"channels":1,"encoding":"pcm_s16le"}, then binary frames of 16-bit little-endian PCM with what the caller hears (both voices mixed; with channels: 2, the caller on the left and the agent on the right). It closes when the call ends. The audio comes straight from the worker running the call, not through EvaSay's control plane; the Listen button on the dashboard's call page uses the same address.