github.com/livekit/protocol@v1.39.3/protobufs/rpc/sip.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 "google/protobuf/empty.proto"; 22 import "google/protobuf/duration.proto"; 23 import "options.proto"; 24 import "livekit_sip.proto"; 25 26 service SIPInternal { 27 rpc CreateSIPParticipant(InternalCreateSIPParticipantRequest) returns (InternalCreateSIPParticipantResponse) { 28 option (psrpc.options).affinity_func = true; 29 option (psrpc.options).topics = true; 30 }; 31 rpc TransferSIPParticipant(InternalTransferSIPParticipantRequest) returns (google.protobuf.Empty) { 32 option (psrpc.options) = { 33 topics: true 34 topic_params: { 35 names: ["sip_call_id"] 36 typed: false 37 } 38 }; 39 }; 40 } 41 42 message InternalCreateSIPParticipantRequest { 43 // Used in Cloud only 44 string project_id = 18; 45 46 string sip_call_id = 13; 47 string sip_trunk_id = 19; 48 // IP or hostname that SIP INVITE is sent too 49 string address = 2; 50 // Hostname for the 'From' SIP address in INVITE 51 string hostname = 20; 52 string destination_country = 30; 53 livekit.SIPTransport transport = 16; 54 55 // Number used to make the call 56 string number = 3; 57 58 // Number to call to 59 string call_to = 4; 60 61 string username = 5; 62 string password = 6; 63 64 string room_name = 7; 65 string participant_identity = 8; 66 string participant_name = 14; 67 string participant_metadata = 15; 68 map<string, string> participant_attributes = 17; 69 70 // optional token that should be used when creating LiveKit participant 71 string token = 9; 72 73 // optional websocket url that should be used when creating LiveKit participant 74 string ws_url = 10; 75 76 // Optionally send following DTMF digits (extension codes) when making a call. 77 // Character 'w' can be used to add a 0.5 sec delay. 78 string dtmf = 11; 79 80 // Optionally play dialtone in the room as an audible indicator for existing participants 81 bool play_dialtone = 12; 82 83 map<string, string> headers = 21; 84 map<string, string> headers_to_attributes = 22; 85 // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests. 86 // Keys are the names of attributes and values are the names of X-* headers they will be mapped to. 87 map<string, string> attributes_to_headers = 26; 88 // Map SIP headers from 200 OK to sip.h.* participant attributes automatically. 89 // 90 // When the names of required headers is known, using headers_to_attributes is strongly recommended. 91 // 92 // When mapping 200 OK headers to follow-up request headers with attributes_to_headers map, 93 // lowercase header names should be used, for example: sip.h.x-custom-header. 94 livekit.SIPHeaderOptions include_headers = 27; 95 96 repeated livekit.SIPFeature enabled_features = 25; 97 98 // Max time for the callee to answer the call. 99 google.protobuf.Duration ringing_timeout = 23; 100 // Max call duration. 101 google.protobuf.Duration max_call_duration = 24; 102 103 livekit.SIPMediaEncryption media_encryption = 28; 104 105 // Wait for the answer for the call before returning. 106 bool wait_until_answered = 29; 107 108 // NEXT ID: 31 109 } 110 111 message InternalCreateSIPParticipantResponse { 112 string participant_id = 1; 113 string participant_identity = 2; 114 string sip_call_id = 3; 115 } 116 117 message InternalTransferSIPParticipantRequest { 118 string sip_call_id = 1; 119 string transfer_to = 2; 120 121 // Optionally play dialtone to the SIP participant as an audible indicator of being transferred 122 bool play_dialtone = 3; 123 124 // Add the following headers to the REFER SIP request. 125 map<string, string> headers = 4; 126 127 // Max time for the transfer destination to answer the call. 128 google.protobuf.Duration ringing_timeout = 5; 129 } 130