Allow passing inline trunk for outbound calls. (#3987)

This commit is contained in:
Denys Smirnov
2025-10-07 17:30:14 +03:00
committed by GitHub
parent bf06596fcb
commit a87f6c4bc8
+5 -1
View File
@@ -625,11 +625,15 @@ func (s *SIPService) CreateSIPParticipantRequest(ctx context.Context, req *livek
log = log.WithValues("projectID", projectID) log = log.WithValues("projectID", projectID)
} }
trunk, err := s.store.LoadSIPOutboundTrunk(ctx, req.SipTrunkId) var trunk *livekit.SIPOutboundTrunkInfo
if req.SipTrunkId != "" {
var err error
trunk, err = s.store.LoadSIPOutboundTrunk(ctx, req.SipTrunkId)
if err != nil { if err != nil {
log.Errorw("cannot get trunk to update sip participant", err) log.Errorw("cannot get trunk to update sip participant", err)
return nil, err return nil, err
} }
}
return rpc.NewCreateSIPParticipantRequest(projectID, callID, host, wsUrl, token, req, trunk) return rpc.NewCreateSIPParticipantRequest(projectID, callID, host, wsUrl, token, req, trunk)
} }