LiveKit (outbound)
The LiveKit recipe is structurally different from the other recipes. Rather than using Teler’s media-streaming WebSocket bridge, it uses Teler’s SIP Trunk to dial outbound calls into LiveKit rooms where your LiveKit agent is already running.
Reference repo
Section titled “Reference repo” Python teler-livekit-outbound
A Node version is not currently available.
Prerequisites
Section titled “Prerequisites”- A LiveKit Cloud project
- A LiveKit agent created and deployed in the LiveKit dashboard (status: Active)
- LiveKit’s outbound SIP feature configured
- A Teler SIP trunk created (see Configure a SIP Trunk)
- The Teler SIP trunk ID
Configuration
Section titled “Configuration”| Variable | Required | Description |
|---|---|---|
LIVEKIT_URL | yes | Your LiveKit Cloud URL, e.g. wss://your-project.livekit.cloud |
LIVEKIT_API_KEY | yes | LiveKit API key |
LIVEKIT_API_SECRET | yes | LiveKit API secret |
SIP_TRUNK_ID | yes | The Teler SIP trunk ID configured in LiveKit |
SIP_CALL_TO | yes | The destination phone number in E.164 format |
ROOM_NAME | yes | LiveKit room name to dial the call into |
AGENT_NAME | yes | Name of the deployed LiveKit agent. Must match the deployed name exactly. |
How it works
Section titled “How it works”The script issues a LiveKit SIP outbound dial. LiveKit places the call via your configured Teler SIP trunk, then connects the audio to the named room where your LiveKit agent is running.
git clone https://github.com/frejun-tech/teler-livekit-outboundcd teler-livekit-outboundcp .env.example .env# fill all the LIVEKIT_*, SIP_*, ROOM_NAME, AGENT_NAME values# follow repo README for run instructionsCritical: cold-start gotcha
Section titled “Critical: cold-start gotcha”If your LiveKit agent shows Pending in the dashboard rather than Active, the first call may connect at the SIP layer but the agent will not respond, sometimes for ~30 seconds while it spins up.
Mitigations:
- Verify the agent is Active in the LiveKit dashboard before testing.
- Run a warm-up call (or a synthetic ping into the room) before customer-facing traffic.
- For production, deploy with autoscaling minimums above zero.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Fix |
|---|---|---|
| First call rings but agent silent | Agent in Pending state | Wait for Active; warm up before live traffic |
| SIP call fails to dial | Wrong SIP_TRUNK_ID | Verify the trunk ID in LiveKit’s SIP config |
| Agent never joins the room | AGENT_NAME mismatch | Must match the deployed agent name exactly |
| Outbound number rejected | E.164 format error | Use full international format, e.g. +91XXXXXXXXXX |
Next steps
Section titled “Next steps” SIP Trunking Configure your Teler SIP trunk before connecting LiveKit.
Configure a SIP Trunk Step-by-step trunk setup.
Other recipes WebSocket-based bridges for OpenAI, ElevenLabs, Gemini, and more.