1. <http://1.lk|lk> 명령어 사용할때 SIP Inbound Trunk &am...
# ask-ai
c
1. lk 명령어 사용할때 SIP Inbound Trunk & dispatch 설정 가이드. 2. SIP Inbound Trunk & dispatch 잘 못 설정 되면 flood 될 수 있나?
t
Thanks for reaching out, Luka(오정묵). I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's walk through how to set up your SIP Inbound Trunk and Dispatch in LiveKit together: 1. First, you'll want to set up a SIP Inbound Trunk to authenticate incoming calls and limit traffic to certain numbers or IPs. You can do this easily using the LiveKit Server SDK or CLI. 2. Next, create a Dispatch Rule to route calls to LiveKit rooms. You have the flexibility to route all calls to one specific room or create individual rooms for each call—whichever fits your needs best. It's important to be careful with configurations. For example, leaving the
allowed_addresses
field empty or skipping authentication can leave your SIP endpoint open to unrestricted access. This might cause flooding issues if many connections come in at once without proper controls. To help keep things secure and running smoothly, consider these steps: • Limit the
allowed_addresses
to specific IP ranges provided by your SIP provider. • Turn on username/password authentication for your trunk. • Set up secure dispatch rules, like requiring PIN codes for room access. • Keep an eye on your SIP trunk usage and logs to catch any unusual activity early. If you'd like, I’m here to guide you through these configurations in more detail or help with any specific questions you have. Just let me know! Sources: README.md | src/setup-livekit.ts | SIP inbound trunk | LiveKit Docs | packages/sip--um-actually/src/setup-livekit.ts | lib/livekit/sip_service_client.rb
c
1. EvaluateSIPDispatchRules에서 DROP 판정이 날 때 구체적인 조건(특히 트렁크·디스패치 룰 우선순위와 와일드카드 처리 방식). 2. 동일 DID를 가진 여러 트렁크가 존재할 때의 충돌 처리와 권장 구성. 3. Direct 룰과 Individual 룰을 혼용할 때 room_prefix vs room_name 사용 가이드. 4. RTP 미디어까지 연결되지 않았을 때 추가 로그를 얻는 방법 또는 recommend tracing (예: lk sip call list 유무).
t
Thank you for reaching out! Here are the answers to your queries, and I hope they help clarify things for you: 1. Conditions for DROP in EvaluateSIPDispatchRules: DROP happens when there’s no valid SIP dispatch rule matching the incoming call. This might be because no trunk matches the call, there isn’t a wildcard dispatch rule, or the PIN/number constraints aren’t met. Dispatch rules are checked based on priority, where lower values mean higher priority. Wildcard rules (with empty
TrunkIds
) serve as a fallback when no specific trunk fits. 2. Handling conflicts with multiple trunks sharing the same DID: By default, LiveKit doesn’t allow conflicting trunks and will reject such configurations. But if you want to allow conflicts, you can enable the
WithAllowTrunkConflicts
option, which picks the first matching trunk instead of throwing an error. Still, it’s best to keep trunk uniqueness to avoid any confusion. 3. Guidelines for mixing Direct and Individual dispatch rules: For Direct rules, use
room_name
to route calls to a specific room. For Individual rules, use
room_prefix
to create unique rooms per call. It’s important to avoid overlapping
inbound_numbers
between these rule types to prevent conflicts. Remember, Direct rules take priority over Individual rules if their conditions overlap. 4. Tracing RTP media connection issues: To troubleshoot RTP media issues, use SIP-specific logs, track calls using call IDs, and check RTP stats like packet loss and jitter. The CLI offers commands such as
lk sip trunk list
for managing SIP resources. Although there isn’t a direct
lk sip call list
command, you can monitor active calls by searching logs with call IDs and reviewing analytics logs. Please feel free to reach out if you’d like me to walk you through any part of this or if you have more questions. I’m here to help! Sources: pkg/service/ioservice_sip.go | protobufs/livekit_sip.proto | SIP dispatch rule | LiveKit Docs | SIP trunk setup | LiveKit Docs | Inbound calls with Twilio Voice | LiveKit Docs
c
1. 새 Trunk/Dispatch가 적용됐는지 EvaluateSIPDispatchRules 호출 로그에서 확인하는 방법 2. 실서버에서 Dispatch rule priority를 어떻게 설정·확인할 수 있는지(특정 룰을 가장 먼저 매칭시키고 싶을 때)
t
Thank you for reaching out! Here are the answers to your queries to help you along: 1. Verifying if a new Trunk/Dispatch Rule is applied: You can use the
EvaluateSIPDispatchRules
API to simulate an incoming call. Then, simply check the logs for entries like
SIP trunk matched
or `SIP dispatch rule matched`—this will confirm which trunk and rule were applied. The logs provide helpful details such as
toUser
,
fromUser
,
src
,
sipTrunk
, and
sipRule
for thorough tracing. If no rule matches, you’ll see a
DROP
result, along with explanations in the logs. This way, you can be confident about what’s happening behind the scenes. 2. Setting and verifying Dispatch Rule priority: Dispatch Rule priority is set automatically, taking into account the rule type, PIN protection, and how specific the inbound numbers are. Rules with lower priority values get matched first. For instance, Direct rules that have PINs and specific numbers are given the highest priority. To make sure a particular rule is matched first, you can configure it with a PIN and define
InboundNumbers
. Feel free to use the API or dashboard to inspect your rules and test them with simulated calls to see if everything behaves as expected. If you have any questions or need a hand with these configurations or testing steps, please don’t hesitate to ask. I’m here to help! Sources: pkg/service/ioservice_sip.go | protobufs/livekit_sip.proto | SIP dispatch rule | LiveKit Docs | test/lktest-sip-outbound/README.md | Creating SIP Inbound Trunks and Dispatch Rules with Python SDK