Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ const (
RejectedByUser DisconnectionReason = "rejected by remote user"
Failed DisconnectionReason = "connection to room failed"
RoomClosed DisconnectionReason = "room closed"
RoomDeleted DisconnectionReason = "room deleted"
ParticipantRemoved DisconnectionReason = "removed by server"
DuplicateIdentity DisconnectionReason = "duplicate identity"
Migration DisconnectionReason = "migration"
ServerShutdown DisconnectionReason = "server shutdown"
OtherReason DisconnectionReason = "other reasons"
)

Expand All @@ -147,11 +150,21 @@ func GetDisconnectionReason(reason livekit.DisconnectReason) DisconnectionReason
r = RejectedByUser
case livekit.DisconnectReason_ROOM_CLOSED:
r = RoomClosed
case livekit.DisconnectReason_ROOM_DELETED:
r = RoomDeleted
case livekit.DisconnectReason_PARTICIPANT_REMOVED:
r = ParticipantRemoved
case livekit.DisconnectReason_DUPLICATE_IDENTITY:
r = DuplicateIdentity
case livekit.DisconnectReason_JOIN_FAILURE, livekit.DisconnectReason_SIGNAL_CLOSE, livekit.DisconnectReason_STATE_MISMATCH:
case livekit.DisconnectReason_MIGRATION:
r = Migration
case livekit.DisconnectReason_SERVER_SHUTDOWN:
r = ServerShutdown
case livekit.DisconnectReason_JOIN_FAILURE,
livekit.DisconnectReason_SIGNAL_CLOSE,
livekit.DisconnectReason_STATE_MISMATCH,
livekit.DisconnectReason_CONNECTION_TIMEOUT,
livekit.DisconnectReason_SIP_TRUNK_FAILURE:
r = Failed
}
return r
Expand Down
Loading