mirror of
https://github.com/livekit/livekit.git
synced 2026-06-06 19:51:52 +00:00
handle AGENT_ERROR disconnect reason (#4339)
This commit is contained in:
@@ -23,7 +23,7 @@ require (
|
||||
github.com/jxskiss/base62 v1.1.0
|
||||
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731
|
||||
github.com/livekit/mediatransportutil v0.0.0-20260309115634-0e2e24b36ee8
|
||||
github.com/livekit/protocol v1.45.1-0.20260310090700-2249c636c0bf
|
||||
github.com/livekit/protocol v1.45.1-0.20260318014559-f734574de339
|
||||
github.com/livekit/psrpc v0.7.1
|
||||
github.com/mackerelio/go-osstat v0.2.6
|
||||
github.com/magefile/mage v1.15.0
|
||||
|
||||
@@ -177,8 +177,8 @@ github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 h1:9x+U2HGLrSw5AT
|
||||
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
|
||||
github.com/livekit/mediatransportutil v0.0.0-20260309115634-0e2e24b36ee8 h1:coWig9fKxdb/nwOaIoGUUAogso12GblAJh/9SA9hcxk=
|
||||
github.com/livekit/mediatransportutil v0.0.0-20260309115634-0e2e24b36ee8/go.mod h1:RCd46PT+6sEztld6XpkCrG1xskb0u3SqxIjy4G897Ss=
|
||||
github.com/livekit/protocol v1.45.1-0.20260310090700-2249c636c0bf h1:vpJlLm8GcZUVKzjzI9YoYbD1fRM4tuMN6S0NqN5a9t4=
|
||||
github.com/livekit/protocol v1.45.1-0.20260310090700-2249c636c0bf/go.mod h1:63AUi0vQak6Y6gPqSBHLc+ExYTUwEqF/m4b2IRW1iO0=
|
||||
github.com/livekit/protocol v1.45.1-0.20260318014559-f734574de339 h1:caapOI5QP2Desrw7K9MM12kKqEmD9ZuQ/toO/9QHDEc=
|
||||
github.com/livekit/protocol v1.45.1-0.20260318014559-f734574de339/go.mod h1:63AUi0vQak6Y6gPqSBHLc+ExYTUwEqF/m4b2IRW1iO0=
|
||||
github.com/livekit/psrpc v0.7.1 h1:ms37az0QTD3UXIWuUC5D/SkmKOlRMVRsI261eBWu/Vw=
|
||||
github.com/livekit/psrpc v0.7.1/go.mod h1:bZ4iHFQptTkbPnB0LasvRNu/OBYXEu1NA6O5BMFo9kk=
|
||||
github.com/mackerelio/go-osstat v0.2.6 h1:gs4U8BZeS1tjrL08tt5VUliVvSWP26Ai2Ob8Lr7f2i0=
|
||||
|
||||
@@ -94,6 +94,8 @@ func (s *signalhandler) HandleMessage(msg proto.Message) error {
|
||||
reason = types.ParticipantCloseReasonUserUnavailable
|
||||
case livekit.DisconnectReason_USER_REJECTED:
|
||||
reason = types.ParticipantCloseReasonUserRejected
|
||||
case livekit.DisconnectReason_AGENT_ERROR:
|
||||
reason = types.ParticipantCloseReasonAgentError
|
||||
}
|
||||
s.params.Logger.Debugw("client leaving room", "reason", reason)
|
||||
s.params.Participant.HandleLeaveRequest(reason)
|
||||
|
||||
@@ -117,6 +117,7 @@ const (
|
||||
ParticipantCloseReasonUserUnavailable
|
||||
ParticipantCloseReasonUserRejected
|
||||
ParticipantCloseReasonMoveFailed
|
||||
ParticipantCloseReasonAgentError
|
||||
)
|
||||
|
||||
func (p ParticipantCloseReason) String() string {
|
||||
@@ -177,6 +178,8 @@ func (p ParticipantCloseReason) String() string {
|
||||
return "USER_REJECTED"
|
||||
case ParticipantCloseReasonMoveFailed:
|
||||
return "MOVE_FAILED"
|
||||
case ParticipantCloseReasonAgentError:
|
||||
return "AGENT_ERROR"
|
||||
default:
|
||||
return fmt.Sprintf("%d", int(p))
|
||||
}
|
||||
@@ -214,6 +217,8 @@ func (p ParticipantCloseReason) ToDisconnectReason() livekit.DisconnectReason {
|
||||
return livekit.DisconnectReason_USER_UNAVAILABLE
|
||||
case ParticipantCloseReasonUserRejected:
|
||||
return livekit.DisconnectReason_USER_REJECTED
|
||||
case ParticipantCloseReasonAgentError:
|
||||
return livekit.DisconnectReason_AGENT_ERROR
|
||||
default:
|
||||
// the other types will map to unknown reason
|
||||
return livekit.DisconnectReason_UNKNOWN_REASON
|
||||
|
||||
Reference in New Issue
Block a user