cuddly-cartoon-47334
03/26/2025, 11:40 PMtall-airline-16756
03/26/2025, 11:40 PMtall-airline-16756
03/26/2025, 11:40 PMlk cloud auth
.
1. Create a voice agent from the template:
◦ Run: lk app create --template voice-pipeline-agent-python
.
◦ When prompted, enter your OpenAI API Key and Deepgram API Key.
1. Navigate to your agent directory and install dependencies to start your agent:
◦ Use the command: cd <agent_dir>
.
Note: If you prefer not to use the CLI, you can manually clone the repositories and follow the setup instructions in each repository.
Sources: OpenAI Realtime API Quickstart | LiveKit Docs | AI Voice Assistant Quickstart | LiveKit Docscuddly-cartoon-47334
03/26/2025, 11:40 PMtall-airline-16756
03/26/2025, 11:40 PMsip.trunkPhoneNumber
attribute. This attribute contains the phone number associated with the SIP trunk:
• For inbound trunks, it represents the number dialed by an end user.
• For outbound trunks, it is the number a call originates from. Sources: SIP participant | LiveKit Docscuddly-cartoon-47334
03/26/2025, 11:41 PMtall-airline-16756
03/26/2025, 11:41 PMUSER_ID_STRING
in the SIP URI for LiveKit. It might be best to consult the LiveKit documentation or your implementation team for further clarification on this setup.cuddly-cartoon-47334
03/26/2025, 11:42 PMtall-airline-16756
03/26/2025, 11:42 PMentrypoint
function of a LiveKit agent, you can retrieve it from the job metadata. Here's an example:
async def entrypoint(ctx: JobContext):
# The phone number to dial is provided in the job metadata
phone_number = ctx.job.metadata
<http://logger.info|logger.info>(f"Dialing {phone_number} to room {ctx.room.name}")
The phone number is stored in ctx.job.metadata
and can be accessed directly within the entrypoint
function.
Sources: Making calls using SIP | LiveKit Docscuddly-cartoon-47334
03/26/2025, 11:43 PMtall-airline-16756
03/26/2025, 11:43 PMctx.job.metadata
contains the phone number to dial, but they do not specifically confirm whether it provides the TRUNK_NUMBER
. You may need to verify this in your implementation or consult your LiveKit configuration to confirm.cuddly-cartoon-47334
03/26/2025, 11:44 PMtall-airline-16756
03/26/2025, 11:44 PMlk app create --template voice-pipeline-agent-python
You can find more templates in the LiveKit examples repository.
2. Modify your agent code to identify SIP participants:
◦ Import the rtc
module in your agent.py
file.
◦ Update the entrypoint
function to handle SIP connections.
1. Create both inbound and outbound trunks in LiveKit to accept and make phone calls using your AI voice agent. Sources: Building an Automated IVR Menu Caller | LiveKit Docs | SIP participant | LiveKit Docs | Create and configure SIP trunk | LiveKit Docstall-airline-16756
03/26/2025, 11:49 PMtall-airline-16756
03/27/2025, 12:18 AMtall-airline-16756
03/27/2025, 12:18 AMcuddly-cartoon-47334
03/27/2025, 1:03 AMtall-airline-16756
03/27/2025, 1:03 AMsip:+[TRUNK_NUMBER]@[YOUR_PROJECT].sip.livekit.cloud
. You may need to consult the LiveKit documentation or your implementation team for guidance on setting up these rules.cuddly-cartoon-47334
03/27/2025, 2:10 AMtall-airline-16756
03/27/2025, 2:10 AMtall-airline-16756
03/27/2025, 2:25 AMcuddly-cartoon-47334
03/27/2025, 2:47 AM