From a87f6c4bc86fe19f055287299867d5496ad55fb1 Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Tue, 7 Oct 2025 17:30:14 +0300 Subject: [PATCH] Allow passing inline trunk for outbound calls. (#3987) --- pkg/service/sip.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/service/sip.go b/pkg/service/sip.go index d78fc443f..0ce3c9c15 100644 --- a/pkg/service/sip.go +++ b/pkg/service/sip.go @@ -625,10 +625,14 @@ func (s *SIPService) CreateSIPParticipantRequest(ctx context.Context, req *livek log = log.WithValues("projectID", projectID) } - trunk, err := s.store.LoadSIPOutboundTrunk(ctx, req.SipTrunkId) - if err != nil { - log.Errorw("cannot get trunk to update sip participant", err) - return nil, err + var trunk *livekit.SIPOutboundTrunkInfo + if req.SipTrunkId != "" { + var err error + trunk, err = s.store.LoadSIPOutboundTrunk(ctx, req.SipTrunkId) + if err != nil { + log.Errorw("cannot get trunk to update sip participant", err) + return nil, err + } } return rpc.NewCreateSIPParticipantRequest(projectID, callID, host, wsUrl, token, req, trunk) }