Voice & Video Calls
Chatto supports real-time voice calls inside rooms using LiveKit, an open-source WebRTC media server. When enabled, any room member can start or join a voice call directly from the room header.
How It Works
Section titled “How It Works”LiveKit runs as a separate service alongside Chatto. Chatto handles authentication and signaling, while LiveKit handles the actual audio transport:
- A user clicks the phone icon in a room header to join a call.
- Chatto verifies the user’s room membership and generates a short-lived LiveKit JWT token.
- The user’s browser connects directly to the LiveKit server using the token.
- Other room members see a real-time notification that someone joined a call.
Calls are implicit — there’s no “start call” action. The first person to join creates the call; when the last person leaves, it ends.
Requirements
Section titled “Requirements”- A running LiveKit server (self-hosted or cloud)
- An API key and secret configured on both the LiveKit server and Chatto
-
Install and run LiveKit
For local development, the quickest option is the LiveKit CLI:
Terminal window # macOSbrew install livekit# Then run in dev modelivekit-server --devThis starts LiveKit on
ws://localhost:7880with a default API key ofdevkeyand secret ofsecret.For production, see the LiveKit self-hosting guide.
-
Configure Chatto
Add a
[livekit]section to yourchatto.toml:[livekit]enabled = trueurl = 'ws://localhost:7880'api_key = 'devkey'api_secret = 'secret'[livekit]enabled = trueurl = 'wss://livekit.example.com'api_key = 'your-api-key'api_secret = 'your-api-secret'# webhook_url = 'https://chatto.example.com/webhooks/livekit' # defaults to {webserver.url}/webhooks/livekitOr use environment variables:
Terminal window CHATTO_LIVEKIT_ENABLED=trueCHATTO_LIVEKIT_URL=wss://livekit.example.comCHATTO_LIVEKIT_API_KEY=your-api-keyCHATTO_LIVEKIT_API_SECRET=your-api-secret# CHATTO_LIVEKIT_WEBHOOK_URL=https://chatto.example.com/webhooks/livekit # defaults to {webserver.url}/webhooks/livekit -
Configure LiveKit webhooks
LiveKit must send webhook events to Chatto so it can track who’s in a call. Add the webhook URL to your LiveKit server config (
livekit.yaml):webhook:urls:- https://chatto.example.com/webhooks/livekitapi_key: your-api-keyFor local development with
livekit-server --dev, the--devflag disables webhooks. You can use Chatto’s test webhook endpoints for development testing instead. -
Restart Chatto
Voice calls will be available immediately. A phone icon appears in every room header when LiveKit is configured.
Production Considerations
Section titled “Production Considerations”- Network: Users connect directly to the LiveKit server from their browsers. Make sure your LiveKit instance is reachable from the public internet (or your private network, for internal deployments).
- TURN/STUN: LiveKit includes a built-in TURN server for NAT traversal. For restrictive networks, you may need to configure it to listen on port 443.
- Scaling: A single LiveKit server handles hundreds of concurrent audio-only participants. For larger deployments, LiveKit supports multi-node clustering with Redis.
- API Secret: Keep your API secret confidential. It’s used to sign JWT tokens and should never be exposed to clients.
Features
Section titled “Features”- Mute/unmute — Toggle your microphone during a call
- Audio device selection — Switch between microphones without leaving the call
- Active call indicators — Rooms with active calls show a phone icon in the room list
- Audio level visualization — Participant avatars pulse with accent-colored rings based on speaking volume
- Real-time join/leave notifications — Room members see when others join or leave a call
Disabling Voice Calls
Section titled “Disabling Voice Calls”To disable voice calls, either remove the [livekit] section from chatto.toml or set:
[livekit]enabled = falseWhen disabled, the phone icon is hidden and all voice call API endpoints return null.