Skip to content

Commit

Permalink
Implement Validate on TransferSIPParticipantRequest (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben authored Sep 24, 2024
1 parent ddac94c commit a963817
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-rats-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/protocol": patch
---

Implement Validate on TransferSIPParticipantRequest
14 changes: 14 additions & 0 deletions livekit/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,17 @@ func (p *CreateSIPParticipantRequest) Validate() error {
}
return nil
}

func (p *TransferSIPParticipantRequest) Validate() error {
if p.RoomName == "" {
return errors.New("missing room name")
}
if p.ParticipantIdentity == "" {
return errors.New("missing participant identity")
}
if p.TransferTo == "" {
return errors.New("missing transfer to")
}

return nil
}

0 comments on commit a963817

Please sign in to comment.