github.com/livekit/protocol@v1.39.3/protobufs/rpc/io.proto (about) 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 15 syntax = "proto3"; 16 17 package rpc; 18 19 option go_package = "github.com/livekit/protocol/rpc"; 20 21 import "livekit_egress.proto"; 22 import "livekit_ingress.proto"; 23 import "livekit_sip.proto"; 24 import "livekit_room.proto"; 25 import "google/protobuf/empty.proto"; 26 import "google/protobuf/duration.proto"; 27 28 service IOInfo { 29 // egress 30 rpc CreateEgress(livekit.EgressInfo) returns (google.protobuf.Empty); 31 rpc UpdateEgress(livekit.EgressInfo) returns (google.protobuf.Empty); 32 rpc GetEgress(GetEgressRequest) returns (livekit.EgressInfo); 33 rpc ListEgress(livekit.ListEgressRequest) returns (livekit.ListEgressResponse); 34 rpc UpdateMetrics(UpdateMetricsRequest) returns (google.protobuf.Empty); 35 36 // ingress 37 rpc CreateIngress(livekit.IngressInfo) returns (google.protobuf.Empty); 38 rpc GetIngressInfo(GetIngressInfoRequest) returns (GetIngressInfoResponse); 39 rpc UpdateIngressState(UpdateIngressStateRequest) returns (google.protobuf.Empty); 40 41 // sip 42 rpc GetSIPTrunkAuthentication(GetSIPTrunkAuthenticationRequest) returns (GetSIPTrunkAuthenticationResponse); 43 rpc EvaluateSIPDispatchRules(EvaluateSIPDispatchRulesRequest) returns (EvaluateSIPDispatchRulesResponse); 44 rpc UpdateSIPCallState(UpdateSIPCallStateRequest) returns (google.protobuf.Empty); 45 } 46 47 message GetEgressRequest { 48 string egress_id = 1; 49 } 50 51 message UpdateMetricsRequest { 52 livekit.EgressInfo info = 1; 53 float avg_cpu_usage = 3; 54 float max_cpu_usage = 4; 55 } 56 57 // Query an ingress info from an ingress ID or stream key 58 message GetIngressInfoRequest { 59 string ingress_id = 1; 60 string stream_key = 2; 61 } 62 63 message GetIngressInfoResponse { 64 livekit.IngressInfo info = 1; 65 string token = 2; 66 string ws_url = 3; 67 map<string,string> logging_fields = 4; 68 } 69 70 // Request to store an update to the ingress state ingress -> service 71 message UpdateIngressStateRequest { 72 string ingress_id = 1; 73 livekit.IngressState state = 2; 74 } 75 76 message GetSIPTrunkAuthenticationRequest { 77 string sip_call_id = 6 [deprecated=true]; 78 79 // What Number is calling 80 string from = 2 [deprecated=true]; 81 // What Host is calling 82 string from_host = 7 [deprecated=true]; 83 84 // What Number was called 85 string to = 3 [deprecated=true]; 86 // What Host was called 87 string to_host = 5 [deprecated=true]; 88 89 // What is the IP address of the called number 90 string src_address = 4 [deprecated=true]; 91 92 SIPCall call = 8; 93 94 // NEXT ID: 9 95 } 96 97 message GetSIPTrunkAuthenticationResponse { 98 // Expected username and password 99 string username = 1; 100 string password = 2; 101 bool drop = 3; 102 // Trunk used to fulfill this request 103 string sip_trunk_id = 4; 104 // Used in Cloud only 105 string project_id = 5; 106 } 107 108 message EvaluateSIPDispatchRulesRequest { 109 string sip_call_id = 8 [deprecated=true]; 110 string sip_participant_id = 1 [deprecated=true]; 111 // Trunk from the auth response, if any 112 string sip_trunk_id = 10; 113 114 // What Number is calling 115 string calling_number = 2 [deprecated=true]; 116 117 // What Host is calling 118 string calling_host = 11 [deprecated=true]; 119 120 // What Number was called 121 string called_number = 3 [deprecated=true]; 122 123 // What is the IP address of the called number 124 string src_address = 4 [deprecated=true]; 125 126 // What pin has been entered if any 127 string pin = 5; 128 129 // Caller rejected pin prompt, only try public rooms 130 bool no_pin = 6; 131 132 // What Host was called 133 string called_host = 7 [deprecated=true]; 134 135 // Extra participant attributes added for this call. 136 // Usually include provider-specific metadata. 137 map<string, string> extra_attributes = 9; 138 139 SIPCall call = 12; 140 141 // NEXT ID: 13 142 } 143 144 message EvaluateSIPDispatchRulesResponse { 145 // non-empty string if SIPParticipant should be placed a room 146 string room_name = 1; 147 148 // What should be used for the LiveKit participant identity 149 string participant_identity = 2; 150 // What should be used for the LiveKit participant name 151 string participant_name = 7; 152 // What should be used for the LiveKit participant metadata 153 string participant_metadata = 8; 154 // What should be used for the LiveKit participant attributes 155 map<string, string> participant_attributes = 11; 156 157 bool request_pin = 3 [deprecated=true]; // see result 158 159 // optional token that should be used when creating LiveKit participant 160 string token = 4; 161 162 // optional websocket url that should be used when creating LiveKit participant 163 string ws_url = 5; 164 165 SIPDispatchResult result = 6; 166 167 // Trunk used to fulfill this request 168 string sip_trunk_id = 9; 169 // Dispatch Rule used to fulfill this request 170 string sip_dispatch_rule_id = 10; 171 172 // Used in Cloud only 173 string project_id = 12; 174 175 // Include these SIP X-* headers in 200 OK response to INVITE. 176 // These headers are included as-is and may help identify triggered LiveKit Dispatch Rule for the other SIP endpoint. 177 map<string, string> headers = 13; 178 // Map SIP X-* headers from INVITE to SIP participant attributes. 179 // Keys are the names of X-* headers and values are the names of attributes they will be mapped to. 180 map<string, string> headers_to_attributes = 14; 181 // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests. 182 // Keys are the names of attributes and values are the names of X-* headers they will be mapped to. 183 map<string, string> attributes_to_headers = 18; 184 // Map SIP headers from INVITE to sip.h.* participant attributes automatically. 185 // 186 // When the names of required headers is known, using headers_to_attributes is strongly recommended. 187 // 188 // When mapping INVITE headers to response headers with attributes_to_headers map, 189 // lowercase header names should be used, for example: sip.h.x-custom-header. 190 livekit.SIPHeaderOptions include_headers = 19; 191 192 repeated livekit.SIPFeature enabled_features = 15; 193 194 // Max time for the caller to wait for track subscription. 195 google.protobuf.Duration ringing_timeout = 16; 196 // Max call duration. 197 google.protobuf.Duration max_call_duration = 17; 198 199 // Room preset and config are used only to generate tokens 200 // once tokens are returned by this response consistently, it will no longer 201 // be needed 202 string room_preset = 20; 203 livekit.RoomConfiguration room_config = 21; 204 205 livekit.SIPMediaEncryption media_encryption = 22; 206 207 // NEXT ID: 23 208 } 209 210 message UpdateSIPCallStateRequest { 211 livekit.SIPCallInfo call_info = 1; 212 livekit.SIPTransferInfo transfer_info = 2; 213 214 // NEXT ID: 3 215 } 216 217 enum SIPDispatchResult { 218 LEGACY_ACCEPT_OR_PIN = 0; // check request_pin field 219 ACCEPT = 1; 220 REQUEST_PIN = 2; 221 REJECT = 3; 222 DROP = 4; 223 } 224 225 message SIPCall { 226 string lk_call_id = 1; 227 string source_ip = 2; // source ip (without port) 228 livekit.SIPUri address = 3; // address in the request line (INVITE) 229 livekit.SIPUri from = 4; // From header 230 livekit.SIPUri to = 5; // To header 231 repeated livekit.SIPUri via = 6; // Via headers 232 }