This agent was forked from a LiveKit example located here.
This agent will answer calls and give the caller the option to specify which department they want to speak with. The caller can select from the Billing Department, Customer Service Department or the Tech Support Department. The agent will transfer the call to that department using SIP REFER. This means that the call will be sent back to the carrier and the carrier will initiate a new call using a SIP URI that represents that department.
python3 -m venv ./.venv
source ./.venv/bin/activate
python3 -m pip install -r requirements.txt
Copy the sample file to .env.local and update the file with values needed to connect to LiveKit and OpenAI. The LiveKit values can be found in the LiveKit Portal and the OpenAI API Key can be found in the OpenAI Portal
cp env.local.example .env.local
vi .env.local
- Login into Twilio
- Setup an Elastic SIP Trunk
- Set the Origination SIP URI to the SIP URI in your LikeKit Portal
- Purchase and/or Assign a Phone Number to the trunk
- Place an inbound test call
- Install the LiveKit CLI
- Create/Obtain your LiveKit API Keys
- Configure Environment Variables
- Login to the CLI via OAUTH
- Add the Twilio Phone Number to inbound-trunk.json and create an inbound configuration
lk sip inbound create inbound-trunk.json
- Setup a Dispatch rule that will route the inbound call from Twilio to the Agent
lk dispatch create dispatch-rule.json