To help you set up different agent classes for inbound and outbound SIP calls on your LiveKit server, here’s a simple step-by-step guide:
1.
Enable Explicit Agent Dispatch: Start by assigning unique agent names like "inbound-agent" and "outbound-agent." This way, calls will be directed to the right agent class without any confusion.
2.
Configure SIP Trunks: Next, set up separate inbound and outbound SIP trunks with your provider. You can use the LiveKit API to create these trunks smoothly.
3.
Create Dispatch Rules: Then, define dispatch rules so inbound calls reach the right agents. For outbound calls, you can dispatch agents programmatically when creating SIP participants or through room tokens.
4.
Run Separate Agent Workers: Finally, run separate processes for each agent class—for example, one for inbound agents and another for outbound agents—to keep things organized.
If you’d like, I’m here to help with detailed code examples or any part of this setup. Just let me know!
Sources:
Agents telephony integration | LiveKit Docs |
Agent dispatch | LiveKit Docs |
SIP overview | LiveKit Docs |
src/setup-livekit.ts |
README.md