github.com/livekit/protocol@v1.16.1-0.20240517185851-47e4c6bba773/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 "google/protobuf/empty.proto";
    24  
    25  service IOInfo {
    26    // egress
    27    rpc CreateEgress(livekit.EgressInfo) returns (google.protobuf.Empty);
    28    rpc UpdateEgress(livekit.EgressInfo) returns (google.protobuf.Empty);
    29    rpc GetEgress(GetEgressRequest) returns (livekit.EgressInfo);
    30    rpc ListEgress(livekit.ListEgressRequest) returns (livekit.ListEgressResponse);
    31    rpc UpdateMetrics(UpdateMetricsRequest) returns (google.protobuf.Empty);
    32  
    33    // ingress
    34    rpc CreateIngress(livekit.IngressInfo) returns (google.protobuf.Empty);
    35    rpc GetIngressInfo(GetIngressInfoRequest) returns (GetIngressInfoResponse);
    36    rpc UpdateIngressState(UpdateIngressStateRequest) returns (google.protobuf.Empty);
    37  
    38    // sip
    39    rpc GetSIPTrunkAuthentication(GetSIPTrunkAuthenticationRequest) returns (GetSIPTrunkAuthenticationResponse);
    40    rpc EvaluateSIPDispatchRules(EvaluateSIPDispatchRulesRequest) returns (EvaluateSIPDispatchRulesResponse);
    41  }
    42  
    43  message GetEgressRequest {
    44    string egress_id = 1;
    45  }
    46  
    47  message UpdateMetricsRequest {
    48    livekit.EgressInfo info = 1;
    49    float avg_cpu_usage = 3;
    50    float max_cpu_usage = 4;
    51  }
    52  
    53  // Query an ingress info from an ingress ID or stream key
    54  message GetIngressInfoRequest {
    55    string ingress_id = 1;
    56    string stream_key = 2;
    57  }
    58  
    59  message GetIngressInfoResponse {
    60    livekit.IngressInfo info = 1;
    61    string token = 2;
    62    string ws_url = 3;
    63    map<string,string> logging_fields = 4;
    64  }
    65  
    66  // Request to store an update to the ingress state ingress -> service
    67  message UpdateIngressStateRequest {
    68    string ingress_id = 1;
    69    livekit.IngressState state = 2;
    70  }
    71  
    72  message GetSIPTrunkAuthenticationRequest {
    73    string sip_call_id = 6;
    74    // What Number is calling
    75    string from = 2;
    76  
    77    // What Number was called
    78    string to = 3;
    79  
    80    // What is the IP address of the called number
    81    string src_address = 4;
    82  
    83    // What Host was called
    84    string to_host = 5;
    85  
    86    // NEXT ID: 7
    87  }
    88  
    89  message GetSIPTrunkAuthenticationResponse {
    90    // Expected username and password
    91    string username = 1;
    92    string password = 2;
    93    bool   drop = 3;
    94    // Trunk used to fulfill this request
    95    string sip_trunk_id = 4;
    96  }
    97  
    98  message EvaluateSIPDispatchRulesRequest {
    99    string sip_call_id = 8;
   100    string sip_participant_id = 1 [deprecated=true];
   101  
   102    // What Number is calling
   103    string calling_number = 2;
   104  
   105    // What Number was called
   106    string called_number = 3;
   107  
   108    // What is the IP address of the called number
   109    string src_address = 4;
   110  
   111    // What pin has been entered if any
   112    string pin = 5;
   113  
   114    // Caller rejected pin prompt, only try public rooms
   115    bool no_pin = 6;
   116  
   117    // What Host was called
   118    string called_host = 7;
   119  
   120    // NEXT ID: 9
   121  }
   122  
   123  message EvaluateSIPDispatchRulesResponse {
   124    // non-empty string if SIPParticipant should be placed a room
   125    string room_name = 1;
   126  
   127    // What should be used for the LiveKit participant identity
   128    string participant_identity = 2;
   129    // What should be used for the LiveKit participant name
   130    string participant_name = 7;
   131    // What should be used for the LiveKit participant metadata
   132    string participant_metadata = 8;
   133  
   134    bool request_pin = 3 [deprecated=true]; // see result
   135  
   136    // optional token that should be used when creating LiveKit participant
   137    string token = 4;
   138  
   139    // optional websocket url that should be used when creating LiveKit participant
   140    string ws_url = 5;
   141  
   142    SIPDispatchResult result = 6;
   143  
   144    // Trunk used to fulfill this request
   145    string sip_trunk_id = 9;
   146    // Dispatch Rule used to fulfill this request
   147    string sip_dispatch_rule_id = 10;
   148    // NEXT ID: 11
   149  }
   150  
   151  enum SIPDispatchResult {
   152    LEGACY_ACCEPT_OR_PIN = 0; // check request_pin field
   153    ACCEPT = 1;
   154    REQUEST_PIN = 2;
   155    REJECT = 3;
   156    DROP = 4;
   157  }