Allow passing inline trunk for outbound calls. (#3987)
This commit is contained in:
+8
-4
@@ -625,10 +625,14 @@ 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 err != nil {
|
if req.SipTrunkId != "" {
|
||||||
log.Errorw("cannot get trunk to update sip participant", err)
|
var err error
|
||||||
return nil, err
|
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)
|
return rpc.NewCreateSIPParticipantRequest(projectID, callID, host, wsUrl, token, req, trunk)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user