Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shiny-geckos-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"github.com/livekit/protocol": patch
---

Changing the wording on duplicate dispatch rule error message
12 changes: 10 additions & 2 deletions sip/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ func printID(s string) string {
return s
}

func printName(s string) string {
if s == "" {
return "<blank name>"
}
return s
}

// ValidateDispatchRules checks a set of dispatch rules for conflicts.
//
// Deprecated: use ValidateDispatchRulesIter
Expand Down Expand Up @@ -208,8 +215,9 @@ func (v *DispatchRuleValidator) Validate(r *livekit.SIPDispatchRuleInfo) error {
if v.opt.AllowConflicts {
continue
}
return twirp.NewErrorf(twirp.InvalidArgument, "Conflicting SIP Dispatch Rules: same Trunk+Number+PIN combination for for %q and %q",
printID(r.SipDispatchRuleId), printID(r2.SipDispatchRuleId))
return twirp.NewErrorf(twirp.InvalidArgument,
"Dispatch rule for the same trunk, number, and PIN combination already exists in dispatch rule %q %q",
printID(r2.SipDispatchRuleId), printName(r2.Name))
}
v.byRuleKey[key] = r
}
Expand Down
Loading