@@ -19,7 +19,7 @@ require (
|
|||||||
github.com/jxskiss/base62 v1.1.0
|
github.com/jxskiss/base62 v1.1.0
|
||||||
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
|
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
|
||||||
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598
|
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598
|
||||||
github.com/livekit/protocol v1.26.1-0.20241022053724-1eb56d424343
|
github.com/livekit/protocol v1.27.1-0.20241022061022-caa595ed3292
|
||||||
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9
|
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9
|
||||||
github.com/mackerelio/go-osstat v0.2.5
|
github.com/mackerelio/go-osstat v0.2.5
|
||||||
github.com/magefile/mage v1.15.0
|
github.com/magefile/mage v1.15.0
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
|
|||||||
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
|
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
|
||||||
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598 h1:yLlkHk2feSLHstD9n4VKg7YEBR4rLODTI4WE8gNBEnQ=
|
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598 h1:yLlkHk2feSLHstD9n4VKg7YEBR4rLODTI4WE8gNBEnQ=
|
||||||
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE=
|
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE=
|
||||||
|
github.com/livekit/protocol v1.27.1-0.20241022061022-caa595ed3292 h1:wVzOLGSjJpCsdKHKKpPxYhXW/JL90l0XYFQbeINSdP4=
|
||||||
|
github.com/livekit/protocol v1.27.1-0.20241022061022-caa595ed3292/go.mod h1:nxRzmQBKSYK64gqr7ABWwt78hvrgiO2wYuCojRYb7Gs=
|
||||||
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDXQU42tnHl8eCX9G6PVUToBVuCUyOs=
|
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDXQU42tnHl8eCX9G6PVUToBVuCUyOs=
|
||||||
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
|
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
|
||||||
github.com/mackerelio/go-osstat v0.2.5 h1:+MqTbZUhoIt4m8qzkVoXUJg1EuifwlAJSk4Yl2GXh+o=
|
github.com/mackerelio/go-osstat v0.2.5 h1:+MqTbZUhoIt4m8qzkVoXUJg1EuifwlAJSk4Yl2GXh+o=
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/livekit/livekit-server/pkg/service"
|
"github.com/livekit/livekit-server/pkg/service"
|
||||||
"github.com/livekit/protocol/auth"
|
"github.com/livekit/protocol/auth"
|
||||||
"github.com/livekit/protocol/livekit"
|
"github.com/livekit/protocol/livekit"
|
||||||
"github.com/livekit/protocol/utils"
|
"github.com/livekit/protocol/utils/events"
|
||||||
"github.com/livekit/protocol/utils/guid"
|
"github.com/livekit/protocol/utils/guid"
|
||||||
"github.com/livekit/protocol/utils/must"
|
"github.com/livekit/protocol/utils/must"
|
||||||
"github.com/livekit/protocol/utils/options"
|
"github.com/livekit/protocol/utils/options"
|
||||||
@@ -111,11 +111,11 @@ func (h *TestServer) SimulateAgentWorker(opts ...SimulatedWorkerOption) *AgentWo
|
|||||||
jobs: map[string]*AgentJob{},
|
jobs: map[string]*AgentJob{},
|
||||||
SimulatedWorkerOptions: o,
|
SimulatedWorkerOptions: o,
|
||||||
|
|
||||||
RegisterWorkerResponses: utils.NewDefaultEventObserverList[*livekit.RegisterWorkerResponse](),
|
RegisterWorkerResponses: events.NewObserverList[*livekit.RegisterWorkerResponse](),
|
||||||
AvailabilityRequests: utils.NewDefaultEventObserverList[*livekit.AvailabilityRequest](),
|
AvailabilityRequests: events.NewObserverList[*livekit.AvailabilityRequest](),
|
||||||
JobAssignments: utils.NewDefaultEventObserverList[*livekit.JobAssignment](),
|
JobAssignments: events.NewObserverList[*livekit.JobAssignment](),
|
||||||
JobTerminations: utils.NewDefaultEventObserverList[*livekit.JobTermination](),
|
JobTerminations: events.NewObserverList[*livekit.JobTermination](),
|
||||||
WorkerPongs: utils.NewDefaultEventObserverList[*livekit.WorkerPong](),
|
WorkerPongs: events.NewObserverList[*livekit.WorkerPong](),
|
||||||
}
|
}
|
||||||
w.ctx, w.cancel = context.WithCancel(context.Background())
|
w.ctx, w.cancel = context.WithCancel(context.Background())
|
||||||
|
|
||||||
@@ -178,11 +178,11 @@ type AgentWorker struct {
|
|||||||
serverMessages deque.Deque[*livekit.ServerMessage]
|
serverMessages deque.Deque[*livekit.ServerMessage]
|
||||||
jobs map[string]*AgentJob
|
jobs map[string]*AgentJob
|
||||||
|
|
||||||
RegisterWorkerResponses *utils.EventObserverList[*livekit.RegisterWorkerResponse]
|
RegisterWorkerResponses *events.ObserverList[*livekit.RegisterWorkerResponse]
|
||||||
AvailabilityRequests *utils.EventObserverList[*livekit.AvailabilityRequest]
|
AvailabilityRequests *events.ObserverList[*livekit.AvailabilityRequest]
|
||||||
JobAssignments *utils.EventObserverList[*livekit.JobAssignment]
|
JobAssignments *events.ObserverList[*livekit.JobAssignment]
|
||||||
JobTerminations *utils.EventObserverList[*livekit.JobTermination]
|
JobTerminations *events.ObserverList[*livekit.JobTermination]
|
||||||
WorkerPongs *utils.EventObserverList[*livekit.WorkerPong]
|
WorkerPongs *events.ObserverList[*livekit.WorkerPong]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *AgentWorker) statusWorker() {
|
func (w *AgentWorker) statusWorker() {
|
||||||
|
|||||||
+6
-7
@@ -392,27 +392,26 @@ func (s *SIPService) CreateSIPParticipantRequest(ctx context.Context, req *livek
|
|||||||
return nil, ErrSIPNotConnected
|
return nil, ErrSIPNotConnected
|
||||||
}
|
}
|
||||||
callID := sip.NewCallID()
|
callID := sip.NewCallID()
|
||||||
log := logger.GetLogger()
|
log := logger.GetLogger().WithUnlikelyValues(
|
||||||
if projectID != "" {
|
|
||||||
log = log.WithValues("projectID", projectID)
|
|
||||||
}
|
|
||||||
unlikelyLogger := log.WithUnlikelyValues(
|
|
||||||
"callID", callID,
|
"callID", callID,
|
||||||
"room", req.RoomName,
|
"room", req.RoomName,
|
||||||
"sipTrunk", req.SipTrunkId,
|
"sipTrunk", req.SipTrunkId,
|
||||||
"toUser", req.SipCallTo,
|
"toUser", req.SipCallTo,
|
||||||
)
|
)
|
||||||
|
if projectID != "" {
|
||||||
|
log = log.WithValues("projectID", projectID)
|
||||||
|
}
|
||||||
|
|
||||||
trunk, err := s.store.LoadSIPOutboundTrunk(ctx, req.SipTrunkId)
|
trunk, err := s.store.LoadSIPOutboundTrunk(ctx, req.SipTrunkId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
unlikelyLogger.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)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SIPService) TransferSIPParticipant(ctx context.Context, req *livekit.TransferSIPParticipantRequest) (*emptypb.Empty, error) {
|
func (s *SIPService) TransferSIPParticipant(ctx context.Context, req *livekit.TransferSIPParticipantRequest) (*emptypb.Empty, error) {
|
||||||
log := logger.GetLogger().WithValues("room", req.RoomName, "participant", req.ParticipantIdentity)
|
log := logger.GetLogger().WithUnlikelyValues("room", req.RoomName, "participant", req.ParticipantIdentity)
|
||||||
ireq, err := s.transferSIPParticipantRequest(ctx, req)
|
ireq, err := s.transferSIPParticipantRequest(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorw("cannot create transfer sip participant request", err)
|
log.Errorw("cannot create transfer sip participant request", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user