Skip to content

Commit

Permalink
Validate SipCallTo in CreateSIPParticipantRequest.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennwc committed Sep 25, 2024
1 parent a601adc commit b0064d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-guests-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"github.com/livekit/protocol": patch
---

Validate SipCallTo in CreateSIPParticipantRequest.
2 changes: 2 additions & 0 deletions livekit/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b0064d8

Please sign in to comment.