I’m connecting LiveKit Telephony with livekit-agen...
# ask-ai
b
I’m connecting LiveKit Telephony with livekit-agents. Other than setting up a dispatch rule, is there anything else I need to do?
t
Thanks for reaching out, 최윤지. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're right to ask — a dispatch rule is necessary but not sufficient. To fully connect LiveKit Telephony with livekit-agents, do the following in addition to creating the dispatch rule: • Set up a SIP trunk (inbound and/or outbound) with your SIP provider if you’re not using LiveKit Phone Numbers. • If using LiveKit Phone Numbers, purchase and assign a number to your dispatch rule (only inbound calls supported). • Configure agents for explicit dispatch by setting
agent_name
in the agent’s
@rtc_session
decorator so agents only join when explicitly dispatched. • Ensure the access token used by your orchestration service includes the
SIPCall
grant so the agent can make/receive SIP calls. • Implement SIP handling in your agent code: ◦ Use
session.generate_reply()
to answer incoming calls. ◦ Add any DTMF, voicemail, transfer, or other call logic you need. ◦ For outbound calls after dispatch, use
ctx.api.sip.create_sip_participant()
. • (Optional) Configure
room_config.egress
in the dispatch rule to record or perform AutoEgress for calls if you need recordings. • Test the full flow by starting the agent, placing an inbound call (or initiating outbound), and verifying the agent joins and handles the call as expected. Would you like steps for configuring a SIP trunk with a specific provider, or an example agent snippet for answering calls? Sources: SIP overview | LiveKit docs | SIP trunk setup | LiveKit docs | LiveKit Phone Numbers | LiveKit docs | Agents telephony integration | LiveKit Docs | Agent dispatch | LiveKit docs
t
t
좋습니다 — 해당 Twilio 트렁크 설정 가이드를 따라 하시면 SIP 트렁크 구성(인바운드/아웃바운드) 관련 단계는 해결됩니다. 다음으로 도와드릴 수 있는 항목을 선택해 주세요: • Twilio 가이드 따라 하다가 막힌 부분(어떤 단계에서, 어떤 에러/증상인지 알려주세요) 해결 도움 • livekit-agents 쪽에서 추가로 해야 하는 설정(예:
agent_name
명시적 디스패치,
SIPCall
권한 토큰 설정,
session.generate_reply()
사용 예제) 예시 코드 제공 • 디스패치 규칙에
room_config.egress
추가해서 녹음/AutoEgress 설정 방법 안내 • 전체 흐름 테스트 체크리스트 제공 어떤 걸 도와드릴까요?