Update protocol. Support SIP transports. (#2724)

This commit is contained in:
Denys Smirnov
2024-05-23 20:31:01 +03:00
committed by GitHub
parent 96cb829b84
commit a444f2477c
3 changed files with 4 additions and 19 deletions
+1 -16
View File
@@ -198,28 +198,13 @@ func (s *SIPService) CreateSIPParticipantWithToken(ctx context.Context, req *liv
log := logger.GetLogger()
log = log.WithValues("call-id", callID, "roomName", req.RoomName, "sip-trunk", req.SipTrunkId, "to-user", req.SipCallTo)
ireq := &rpc.InternalCreateSIPParticipantRequest{
SipCallId: callID,
CallTo: req.SipCallTo,
RoomName: req.RoomName,
ParticipantIdentity: req.ParticipantIdentity,
ParticipantName: req.ParticipantName,
ParticipantMetadata: req.ParticipantMetadata,
Dtmf: req.Dtmf,
PlayRingtone: req.PlayRingtone,
WsUrl: wsUrl,
Token: token,
}
trunk, err := s.store.LoadSIPTrunk(ctx, req.SipTrunkId)
if err != nil {
log.Errorw("cannot get trunk to update sip participant", err)
return nil, err
}
log = log.WithValues("from-user", trunk.OutboundNumber, "to-host", trunk.OutboundAddress)
ireq.Address = trunk.OutboundAddress
ireq.Number = trunk.OutboundNumber
ireq.Username = trunk.OutboundUsername
ireq.Password = trunk.OutboundPassword
ireq := rpc.NewCreateSIPParticipantRequest(callID, wsUrl, token, req, trunk)
// CreateSIPParticipant will wait for LiveKit Participant to be created and that can take some time.
// Thus, we must set a higher deadline for it, if it's not set already.