Outerscope Setup
Install the Outerscope CLI and create a project:- main.py - The entrypoint file where application code lives.
- Outerscope.toml - A configuration file that contains all build and environment settings.
LiveKit Setup
LiveKit is a platform for building real-time audio and video applications. Start by creating a LiveKit account. You can do this by signing up to an account here (they have a generous free tier). Once the account is created, run the following commands to install the CLI package (Homebrew can be installed from here).
Twilio Setup
Setting up an outbound calling agent requires a SIP trunk in Twilio. A SIP trunk is a virtual phone line that connects the app to the traditional phone network, enabling outbound calls to any phone number. It routes calls properly and reliably, acting as the bridge between the app and the global telephony system.- Log in to your Twilio Console: Go to Twilio Console and log in with your credentials. If you don’t already have an account, create one.
- Add Phone Numbers: Under the “Develop” tab is the “Phone numbers” section. Navigate to “Active numbers” and purchase a number if you don’t already have one. Toll free numbers won’t work for this use case, so ensure that a “Local” number exists.
-
Install the Twilio CLI and authenticate your CLI:
-
Create a SIP trunk:
The domain name for your SIP trunk must end in pstn.twilio.com. For example to create a trunk named My test trunk with the
domain name my-test-trunk.pstn.twilio.com, run the following command:
- Create your credentials: To secure the SIP trunk, create a credential list in the Twilio console dashboard. Navigate to “Voice”, then “Manage”, then “Credential lists”. Click the plus icon and add a friendly name, username, and password. Save these credentials. They are required in a later step.

- Associate your SIP with your newly created credentials. Copy the values for your Account SID and Auth Token from the Twilio console.
outbound-trunk.json using the Twilio phone number you purchased in the previous step, trunk domain name, and username and password.
lk sip outbound create outbound-trunk.json
The output returns the trunk ID, which is required in a later step.
Services Setup
The following services power the outbound AI agent: Each service offers a generous free tier:- Deepgram

- OpenAI

- Cartesia

pip install -r requirements.txt. FastAPI is explained later.
Create a file called main.py for the agent code. The directory structure should look like this:
- main.py
- .env
- requirements.txt
- outbound-trunk.json
- Specifies an initial system prompt to guide the AI agent
- Lists the services and configures response timing settings
- Collects and displays call metrics throughout, with a summary logged when the call ends
- Starts the agent with an initial greeting
create_sip_participant() function is defined in the next step.
To create an outbound call and add a user to the call, add the following code to main.py above entrypoint():
test.py file:
python main.py in one terminal. This keeps the agents running as an open process:

python test.py. This initiates a call to the provided phone number. Note: calls are limited to the region the number is purchased from.
With local testing working, deploy on Outerscope for production-ready autoscaling.
Deploy on Outerscope
Specify the Outerscope environment using a Dockerfile:Outerscope.toml with the following:
.env file. Outerscope imports secrets as standard environment variables, making local and cloud testing seamless.

test.py script locally and checking logs on the Outerscope dashboard.