From 2a2b6db6216aafc71c8ca4d32fdd05b1ed6fb85f Mon Sep 17 00:00:00 2001 From: He Chen Date: Thu, 23 Apr 2026 22:17:32 -0700 Subject: [PATCH 1/3] TEL-543: same trunk can match duplicate normalized SIP numbers (#1514) --- sip/sip.go | 3 ++- sip/sip_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sip/sip.go b/sip/sip.go index 87f9cec79..69500c3bb 100644 --- a/sip/sip.go +++ b/sip/sip.go @@ -550,7 +550,8 @@ func MatchTrunkDetailed(it iters.Iter[*livekit.SIPInboundTrunkInfo], call *rpc.S result.MatchType = TrunkMatchSpecific return result, nil } - // Keep searching! We want to know if there are any conflicting Trunk definitions. + // A trunk matches at most once per call; remaining numbers on this trunk cannot change the decision. + break } else { opt.Filtered(tr, TrunkFilteredCalledNumberDisallowed) } diff --git a/sip/sip_test.go b/sip/sip_test.go index bed65407c..d4f3258dc 100644 --- a/sip/sip_test.go +++ b/sip/sip_test.go @@ -287,6 +287,32 @@ func TestSIPMatchTrunk(t *testing.T) { } } +// TestSIPMatchTrunkSameTrunkDuplicateNumberForms verifies that a trunk listing +// the same number in both +E.164 and bare forms is not treated as a conflict +// with itself. Regression test for "Multiple SIP Trunks matched" when a user +// configures both "+19793169351" and "19793169351" on one trunk. +func TestSIPMatchTrunkSameTrunkDuplicateNumberForms(t *testing.T) { + trunks := []*livekit.SIPInboundTrunkInfo{ + {SipTrunkId: "aaa", Numbers: []string{"+" + sipNumber2, sipNumber2}}, + } + for _, toNum := range []string{sipNumber2, "+" + sipNumber2} { + t.Run("to="+toNum, func(t *testing.T) { + call := &rpc.SIPCall{ + SipCallId: "test-call-id", + SourceIp: "1.1.1.1", + From: &livekit.SIPUri{User: sipNumber1, Host: "sip.example.com"}, + To: &livekit.SIPUri{User: toNum}, + } + call.Address = call.To + got, err := MatchTrunkIter(iters.Slice(trunks), call, WithTrunkConflict(func(t1, t2 *livekit.SIPInboundTrunkInfo, reason TrunkConflictReason) { + t.Fatalf("unexpected conflict: %v\n%v\nvs\n%v", reason, t1, t2) + })) + require.NoError(t, err) + require.Equal(t, trunks[0], got) + }) + } +} + func TestSIPValidateTrunks(t *testing.T) { for _, c := range trunkCases { c := c From 3be31d2d2a5c384c14ea5db22ee3916e3e74d005 Mon Sep 17 00:00:00 2001 From: Chenghao Mou Date: Fri, 24 Apr 2026 14:56:53 +0800 Subject: [PATCH 2/3] fix change set for eot changes (#1515) * fix changeset * Fix change set for EOT changes Correct the change set for end-of-transmission changes. --- .changeset/many-seas-fry.md | 2 +- .changeset/proud-bottles-shave.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/proud-bottles-shave.md diff --git a/.changeset/many-seas-fry.md b/.changeset/many-seas-fry.md index a31f49c77..3d892cb48 100644 --- a/.changeset/many-seas-fry.md +++ b/.changeset/many-seas-fry.md @@ -1,5 +1,5 @@ --- -"@fake-scope/fake-pkg": patch +"github.com/livekit/protocol": patch --- Add turn detection protobufs diff --git a/.changeset/proud-bottles-shave.md b/.changeset/proud-bottles-shave.md new file mode 100644 index 000000000..fee54290b --- /dev/null +++ b/.changeset/proud-bottles-shave.md @@ -0,0 +1,5 @@ +--- +"github.com/livekit/protocol": patch +--- + +fix change set for eot changes From a4ac2627b46a7d515005db589a4eda3100dc1b8a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:21:50 +0800 Subject: [PATCH 3/3] Version Packages (#1517) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/many-seas-fry.md | 5 ----- .changeset/proud-bottles-shave.md | 5 ----- CHANGELOG.md | 8 ++++++++ package.json | 2 +- packages/javascript/CHANGELOG.md | 2 ++ packages/javascript/package.json | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 .changeset/many-seas-fry.md delete mode 100644 .changeset/proud-bottles-shave.md diff --git a/.changeset/many-seas-fry.md b/.changeset/many-seas-fry.md deleted file mode 100644 index 3d892cb48..000000000 --- a/.changeset/many-seas-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"github.com/livekit/protocol": patch ---- - -Add turn detection protobufs diff --git a/.changeset/proud-bottles-shave.md b/.changeset/proud-bottles-shave.md deleted file mode 100644 index fee54290b..000000000 --- a/.changeset/proud-bottles-shave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"github.com/livekit/protocol": patch ---- - -fix change set for eot changes diff --git a/CHANGELOG.md b/CHANGELOG.md index 45fa17019..bf5cc0517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # github.com/livekit/protocol +## 1.45.6 + +### Patch Changes + +- Add turn detection protobufs - [#1485](https://github.com/livekit/protocol/pull/1485) ([@chenghao-mou](https://github.com/chenghao-mou)) + +- fix change set for eot changes - [#1515](https://github.com/livekit/protocol/pull/1515) ([@chenghao-mou](https://github.com/chenghao-mou)) + ## 1.45.5 ## 1.45.4 diff --git a/package.json b/package.json index 4abc5cf05..8c31dd670 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "github.com/livekit/protocol", "private": true, - "version": "1.45.5", + "version": "1.45.6", "scripts": { "changeset": "changeset", "ci:publish": "pnpm --filter @livekit/protocol run build && changeset publish" diff --git a/packages/javascript/CHANGELOG.md b/packages/javascript/CHANGELOG.md index a144cbe90..fa76e4611 100644 --- a/packages/javascript/CHANGELOG.md +++ b/packages/javascript/CHANGELOG.md @@ -1,5 +1,7 @@ # @livekit/protocol +## 1.45.6 + ## 1.45.5 ### Patch Changes diff --git a/packages/javascript/package.json b/packages/javascript/package.json index 447901b10..11f47cea0 100644 --- a/packages/javascript/package.json +++ b/packages/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@livekit/protocol", - "version": "1.45.5", + "version": "1.45.6", "description": "", "type": "module", "require": "dist/index.cjs",