From 5bf9338afa1b5c089fea25342f376e11a807e052 Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Sat, 31 Aug 2024 19:43:11 +0300 Subject: [PATCH] Support new Callee dispatch type for SIP. (#401) --- cmd/lk/sip.go | 11 +++++++++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cmd/lk/sip.go b/cmd/lk/sip.go index 53b82e83..8e361331 100644 --- a/cmd/lk/sip.go +++ b/cmd/lk/sip.go @@ -396,9 +396,16 @@ func listSipDispatchRule(ctx context.Context, cmd *cli.Command) error { pin = r.DispatchRuleDirect.Pin typ = "Direct" case *livekit.SIPDispatchRule_DispatchRuleIndividual: - room = r.DispatchRuleIndividual.RoomPrefix + "*" + room = r.DispatchRuleIndividual.RoomPrefix + "__" pin = r.DispatchRuleIndividual.Pin - typ = "Individual" + typ = "Individual (Caller)" + case *livekit.SIPDispatchRule_DispatchRuleCallee: + room = r.DispatchRuleCallee.RoomPrefix + "" + if r.DispatchRuleCallee.Randomize { + room += "_" + } + pin = r.DispatchRuleCallee.Pin + typ = "Callee" } trunks := strings.Join(item.TrunkIds, ",") if trunks == "" { diff --git a/go.mod b/go.mod index 978354bc..36c55189 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/go-logr/logr v1.4.2 github.com/go-task/task/v3 v3.38.0 github.com/joho/godotenv v1.5.1 - github.com/livekit/protocol v1.19.4-0.20240808180722-581b59b65309 + github.com/livekit/protocol v1.20.2-0.20240831163355-2454665245fd github.com/livekit/server-sdk-go/v2 v2.2.1 github.com/pion/rtcp v1.2.14 github.com/pion/rtp v1.8.9 diff --git a/go.sum b/go.sum index 56cfbbf7..7351114a 100644 --- a/go.sum +++ b/go.sum @@ -130,8 +130,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ= github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598 h1:yLlkHk2feSLHstD9n4VKg7YEBR4rLODTI4WE8gNBEnQ= github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE= -github.com/livekit/protocol v1.19.4-0.20240808180722-581b59b65309 h1:iGGiQkgRkDND59LZDPDNsRNBEWF/rpLfaH6BGy4KqWI= -github.com/livekit/protocol v1.19.4-0.20240808180722-581b59b65309/go.mod h1:oU5XbEaQlywdgXcSQDzrI5CPnwuGn/HuRXuQaDxVryQ= +github.com/livekit/protocol v1.20.2-0.20240831163355-2454665245fd h1:NeZFjd/4Zb/xxwDdHBbue18wj3+eunBu+BYB3KOKR34= +github.com/livekit/protocol v1.20.2-0.20240831163355-2454665245fd/go.mod h1:AFuwk3+uIWFeO5ohKjx5w606Djl940+wktaZ441VoCI= github.com/livekit/psrpc v0.5.3-0.20240616012458-ac39c8549a0a h1:EQAHmcYEGlc6V517cQ3Iy0+jHgP6+tM/B4l2vGuLpQo= github.com/livekit/psrpc v0.5.3-0.20240616012458-ac39c8549a0a/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.2.1 h1:MK6H52X/k5FA3d613qAawAVvWPwyzxS5CLpxfKd/pD4=