Simple plug-and-play outbound calling using:
- LiveKit Cloud (Agent created via UI)
- Frejun Teler SIP Trunk
- Python script
Teler is a programmable voice API by FreJun. It handles carriers, phone numbers, and real-time audio streaming so you can connect AI models directly to phone calls. → frejun.ai
Before running:
- LiveKit Cloud project
- Agent created & deployed in LiveKit UI
- SIP outbound configured in LiveKit
- Frejun-teler SIP trunk created
- LiveKit API Key + Secret
- SIP trunk ID
you can setup your SIP trunk with Teler and Livekit by following the Guide.
git clone https://github.com/frejun-tech/teler-livekit-outbound.git
cd livekit-outboundpip install -r requirements.txtCreate a env file by copying the .env.example file to .env:
cp .env.example .envIt shoudl look like this :
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret
SIP_TRUNK_ID=your_sip_trunk_id
SIP_CALL_TO=your_number_with_country_code
ROOM_NAME=Teler-livekit-call-room
AGENT_NAME=your_agent_nameInside the .env file
make sure the details are correct, assign the SIP_CALL_TO with the number you want to call and then run the main file, either directly from the IDE or the terminal/cmd using :
Replace the number with the destination number in E.164 format.
python main.pyIf your LiveKit Agent shows Pending, first call may connect but agent may not respond or might take around 30 seconds.
Fix:
- Ensure agent is deployed
- Make one warm-up call
- Or redeploy agent from UI if stuck
If issue persists, verify:
- Agent is Active in LiveKit dashboard
- SIP trunk ID is correct
- Agent name matches deployed agent
Call connects but agent silent
- Agent in Pending state
- Agent not deployed
- Wrong Agent name
- Wrong SIP trunk ID
401 / 403 errors
- Invalid API key/secret
- SIP authentication mismatch