@@ -272,7 +272,7 @@ func GetPinAndRoom(info *livekit.SIPDispatchRuleInfo) (room, pin string, err err
272272 // TODO: Could probably add methods on SIPDispatchRuleInfo struct instead.
273273 switch rule := info .GetRule ().GetRule ().(type ) {
274274 default :
275- return "" , "" , fmt .Errorf ("Unsupported SIP Dispatch Rule: %T" , rule )
275+ return "" , "" , fmt .Errorf ("Unsupported SIP Dispatch Rule: %T" , rule ) //nolint:staticcheck // part of public API
276276 case * livekit.SIPDispatchRule_DispatchRuleDirect :
277277 pin = rule .DispatchRuleDirect .GetPin ()
278278 room = rule .DispatchRuleDirect .GetRoomName ()
@@ -874,7 +874,7 @@ func EvaluateDispatchRule(projectID string, trunk *livekit.SIPInboundTrunkInfo,
874874 // This should never happen in practice, because matchSIPDispatchRule should remove rules with the wrong pin.
875875 return nil , twirp .NewError (twirp .PermissionDenied , "Incorrect PIN for SIP room" )
876876 }
877- } else {
877+ } else { //nolint:staticcheck // empty branch provides context for comment
878878 // Pin was sent, but room doesn't require one. Assume user accidentally pressed phone button.
879879 }
880880 switch rule := rule .GetRule ().GetRule ().(type ) {
@@ -898,19 +898,19 @@ func EvaluateDispatchRule(projectID string, trunk *livekit.SIPInboundTrunkInfo,
898898 room += "_" + guid .New ("" )
899899 }
900900 }
901- attrs [livekit .AttrSIPDispatchRuleID ] = rule .SipDispatchRuleId
901+ attrs [livekit .AttrSIPDispatchRuleID ] = rule .GetSipDispatchRuleId ()
902902 resp := & rpc.EvaluateSIPDispatchRulesResponse {
903903 ProjectId : projectID ,
904904 SipTrunkId : trunkID ,
905- SipDispatchRuleId : rule .SipDispatchRuleId ,
905+ SipDispatchRuleId : rule .GetSipDispatchRuleId () ,
906906 Result : rpc .SIPDispatchResult_ACCEPT ,
907907 RoomName : room ,
908908 ParticipantIdentity : fromID ,
909909 ParticipantName : fromName ,
910- ParticipantMetadata : rule .Metadata ,
910+ ParticipantMetadata : rule .GetMetadata () ,
911911 ParticipantAttributes : attrs ,
912- RoomPreset : rule .RoomPreset ,
913- RoomConfig : rule .RoomConfig ,
912+ RoomPreset : rule .GetRoomPreset () ,
913+ RoomConfig : rule .GetRoomConfig () ,
914914 MediaEncryption : enc ,
915915 }
916916 krispEnabled := false
0 commit comments