Outbound Calls via SIP

Learn how to make outgoing phone calls with your LiveKit agent.

This guide explains how to set up outbound calls via SIP using your LiveKit agent. By integrating SIP trunking with your LiveKit Agent, you can initiate calls to phone numbers and interact with users over the phone. This setup is useful for:

  • Call center callbacks: Automatically return calls to customers.
  • Product check-ins: Follow up on purchased items.
  • Sales calls: Reach out to potential customers.
  • Appointment reminders: Notify clients of upcoming appointments.
  • Surveys: Collect feedback through automated calls.

Prerequisites

Steps:

1. Set Up Your SIP Trunk

Follow the SIP Quickstart guide to configure your SIP trunk and phone number. This will allow your LiveKit server to initiate outbound calls to phone numbers via SIP.

Ensure you complete the following in the SIP Quickstart:

2. Set Up Your Agent

Once you've finished the SIP quickstart guide, set up your agent using one of the Agent Quickstart guides. This creates the agent that interacts with the people you are calling.

You'll need to choose one of the following agent types:

In most cases, we recommend using the Speech-to-Speech MultimodalAgent for its simplicity, low latency, and natural conversation flow.

Follow the steps in the Agent Quickstart to create and start your agent.

3. Make Outbound Call

Now that your SIP trunk and agent are set up, you can initiate outbound calls from any backend server. This includes the process where you're running the Agent itself.

First, create a JSON file with your participant details. For example:

{
"sip_trunk_id": "<your-trunk-id>",
"sip_call_to": "<phone-number-to-dial>",
"room_name": "my-sip-room",
"participant_identity": "sip-test",
"participant_name": "Test Call"
}

Then, create the SIP participant using the LiveKit CLI:

lk sip participant create sipParticipant.json

4. Test your outbound agent

Test the outbound calling setup by initiating a call to your own phone number:

  1. Initiate the Call: Use your LiveKit CLI, Python, or Node application code to start the call.
  2. Answer the Call: When your phone rings, answer it to join the LiveKit room.
  3. Interact with the Agent: Have a conversation with your agent over the phone.