diff --git a/.changeset/wet-guests-eat.md b/.changeset/wet-guests-eat.md new file mode 100644 index 00000000..7f4bfa47 --- /dev/null +++ b/.changeset/wet-guests-eat.md @@ -0,0 +1,5 @@ +--- +"github.com/livekit/protocol": patch +--- + +Validate SipCallTo in CreateSIPParticipantRequest. diff --git a/livekit/sip.go b/livekit/sip.go index d7ce71c5..e91db6bb 100644 --- a/livekit/sip.go +++ b/livekit/sip.go @@ -182,6 +182,8 @@ func (p *CreateSIPParticipantRequest) Validate() error { } if p.SipCallTo == "" { return errors.New("missing sip callee number") + } else if strings.Contains(p.SipCallTo, "@") { + return errors.New("SipCallTo should be a phone number or SIP user, not a full SIP URI") } if p.RoomName == "" { return errors.New("missing room name")