fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

David ZhaoAdding disconnect reason (#507)2ba0a2e

main
2.3 KiB73 linesraw
1// Copyright 2023 LiveKit, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package livekit.proto;
18option csharp_namespace = "LiveKit.Proto";
19
20import "handle.proto";
21
22message ParticipantInfo {
23  required string sid = 1;
24  required string name = 2;
25  required string identity = 3;
26  required string metadata = 4;
27  map<string, string> attributes = 5;
28  required ParticipantKind kind = 6;
29  required DisconnectReason disconnect_reason = 7;
30}
31
32message OwnedParticipant {
33  required FfiOwnedHandle handle = 1;
34  required ParticipantInfo info = 2;
35}
36
37enum ParticipantKind {
38  PARTICIPANT_KIND_STANDARD = 0;
39  PARTICIPANT_KIND_INGRESS = 1;
40  PARTICIPANT_KIND_EGRESS = 2;
41  PARTICIPANT_KIND_SIP = 3;
42  PARTICIPANT_KIND_AGENT = 4;
43}
44
45enum DisconnectReason {
46  UNKNOWN_REASON = 0;
47  // the client initiated the disconnect
48  CLIENT_INITIATED = 1;
49  // another participant with the same identity has joined the room
50  DUPLICATE_IDENTITY = 2;
51  // the server instance is shutting down
52  SERVER_SHUTDOWN = 3;
53  // RoomService.RemoveParticipant was called
54  PARTICIPANT_REMOVED = 4;
55  // RoomService.DeleteRoom was called
56  ROOM_DELETED = 5;
57  // the client is attempting to resume a session, but server is not aware of it
58  STATE_MISMATCH = 6;
59  // client was unable to connect fully
60  JOIN_FAILURE = 7;
61  // Cloud-only, the server requested Participant to migrate the connection elsewhere
62  MIGRATION = 8;
63  // the signal websocket was closed unexpectedly
64  SIGNAL_CLOSE = 9;
65  // the room was closed, due to all Standard and Ingress participants having left
66  ROOM_CLOSED = 10;
67  // SIP callee did not respond in time
68  USER_UNAVAILABLE = 11;
69  // SIP callee rejected the call (busy)
70  USER_REJECTED = 12;
71  // SIP protocol failure or unexpected response
72  SIP_TRUNK_FAILURE = 13;
73}