Voice Sessions
A voice session represents a single call between a user and an agent. Sessions track the full lifecycle from connection to post-call analysis.Session Lifecycle
- CREATED: Session record created when a token is generated
- ACTIVE: User joins the LiveKit room and audio flows
- COMPLETED: Session ends normally, triggers call analysis
- FAILED: Session ends due to an error
Starting a Session
Browser (Preview/Test)
- User clicks “Preview” on an agent in the dashboard
- Frontend requests a LiveKit token from
/api/livekit/token - The token route creates the room, dispatches the agent, and creates a session record
- User connects via WebRTC and the agent joins
Phone (Inbound)
- Caller dials a Twilio number assigned to an agent
- Twilio routes the call through the SIP trunk to LiveKit
- LiveKit dispatch rule triggers the agent worker
- Agent fetches config from the backend and starts the pipeline
Phone (Outbound)
- User initiates a call from the dashboard via
POST /api/calls/outbound - Backend creates a LiveKit SIP participant for the phone number
- Agent joins the room and connects to the caller
Transcripts
Every message in the conversation is saved as a transcript entry with:- speaker:
USERorAGENT - content: The message text
- timestamp: When the message was spoken
POST /api/sessions/by-room/{room_name}/transcripts.
Post-Call Analysis
When a session ends, the backend triggers AI analysis using the full transcript. See Call Intelligence for details.Viewing Sessions
Navigate to Dashboard → Call Logs to browse all sessions. Click any session to see:- Session metadata (status, duration, start time)
- Full conversation transcript
- Call analysis (summary, sentiment, topics, action items)
- Cost breakdown by provider