@volter/twin-livekit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +106 -0
  3. package/dist/src/cli.d.ts +2 -0
  4. package/dist/src/cli.js +23 -0
  5. package/dist/src/egress-service-cli.d.ts +2 -0
  6. package/dist/src/egress-service-cli.js +101 -0
  7. package/dist/src/index.d.ts +14 -0
  8. package/dist/src/index.js +53 -0
  9. package/dist/src/livekit-budget.d.ts +57 -0
  10. package/dist/src/livekit-budget.js +131 -0
  11. package/dist/src/livekit-capabilities.d.ts +3 -0
  12. package/dist/src/livekit-capabilities.js +728 -0
  13. package/dist/src/livekit-conformance.d.ts +8 -0
  14. package/dist/src/livekit-conformance.js +13 -0
  15. package/dist/src/livekit-connector.d.ts +130 -0
  16. package/dist/src/livekit-connector.js +382 -0
  17. package/dist/src/livekit-data.d.ts +86 -0
  18. package/dist/src/livekit-data.js +246 -0
  19. package/dist/src/livekit-perform-harness.d.ts +5 -0
  20. package/dist/src/livekit-perform-harness.js +17 -0
  21. package/dist/src/livekit-server.d.ts +23 -0
  22. package/dist/src/livekit-server.js +45 -0
  23. package/dist/src/livekit-service-cli.d.ts +2 -0
  24. package/dist/src/livekit-service-cli.js +88 -0
  25. package/dist/src/livekit-token.d.ts +68 -0
  26. package/dist/src/livekit-token.js +76 -0
  27. package/dist/src/livekit-twin.d.ts +4 -0
  28. package/dist/src/livekit-twin.js +1161 -0
  29. package/dist/src/livekit-types.d.ts +203 -0
  30. package/dist/src/livekit-types.js +1 -0
  31. package/dist/src/livekit-webhook.d.ts +26 -0
  32. package/dist/src/livekit-webhook.js +79 -0
  33. package/dist/src/redis-service-cli.d.ts +2 -0
  34. package/dist/src/redis-service-cli.js +35 -0
  35. package/dist/test-fixtures/livekit-openapi-operations.SOURCE.md +88 -0
  36. package/dist/test-fixtures/livekit-openapi-operations.json +442 -0
  37. package/dist/test-fixtures/protobufs/cloud_replay.proto +82 -0
  38. package/dist/test-fixtures/protobufs/livekit_agent.proto +185 -0
  39. package/dist/test-fixtures/protobufs/livekit_agent_dispatch.proto +103 -0
  40. package/dist/test-fixtures/protobufs/livekit_agent_simulation.proto +422 -0
  41. package/dist/test-fixtures/protobufs/livekit_agent_worker.proto +29 -0
  42. package/dist/test-fixtures/protobufs/livekit_agentdb.proto +226 -0
  43. package/dist/test-fixtures/protobufs/livekit_analytics.proto +312 -0
  44. package/dist/test-fixtures/protobufs/livekit_cloud_agent.proto +376 -0
  45. package/dist/test-fixtures/protobufs/livekit_connector.proto +41 -0
  46. package/dist/test-fixtures/protobufs/livekit_connector_twilio.proto +65 -0
  47. package/dist/test-fixtures/protobufs/livekit_connector_whatsapp.proto +171 -0
  48. package/dist/test-fixtures/protobufs/livekit_egress.proto +641 -0
  49. package/dist/test-fixtures/protobufs/livekit_ingress.proto +222 -0
  50. package/dist/test-fixtures/protobufs/livekit_internal.proto +228 -0
  51. package/dist/test-fixtures/protobufs/livekit_metrics.proto +103 -0
  52. package/dist/test-fixtures/protobufs/livekit_models.proto +992 -0
  53. package/dist/test-fixtures/protobufs/livekit_phone_number.proto +151 -0
  54. package/dist/test-fixtures/protobufs/livekit_room.proto +312 -0
  55. package/dist/test-fixtures/protobufs/livekit_rtc.proto +673 -0
  56. package/dist/test-fixtures/protobufs/livekit_sip.proto +1000 -0
  57. package/dist/test-fixtures/protobufs/livekit_token_source.proto +49 -0
  58. package/dist/test-fixtures/protobufs/livekit_webhook.proto +62 -0
  59. package/package.json +58 -0
  60. package/src/cli.ts +22 -0
  61. package/src/egress-service-cli.ts +111 -0
  62. package/src/index.ts +103 -0
  63. package/src/livekit-budget.ts +158 -0
  64. package/src/livekit-capabilities.ts +789 -0
  65. package/src/livekit-conformance.ts +15 -0
  66. package/src/livekit-connector.ts +406 -0
  67. package/src/livekit-data.ts +278 -0
  68. package/src/livekit-perform-harness.ts +17 -0
  69. package/src/livekit-server.ts +67 -0
  70. package/src/livekit-service-cli.ts +93 -0
  71. package/src/livekit-token.ts +133 -0
  72. package/src/livekit-twin.ts +1162 -0
  73. package/src/livekit-types.ts +211 -0
  74. package/src/livekit-webhook.ts +91 -0
  75. package/src/redis-service-cli.ts +39 -0
  76. package/test-fixtures/livekit-openapi-operations.SOURCE.md +88 -0
  77. package/test-fixtures/livekit-openapi-operations.json +442 -0
  78. package/test-fixtures/protobufs/cloud_replay.proto +82 -0
  79. package/test-fixtures/protobufs/livekit_agent.proto +185 -0
  80. package/test-fixtures/protobufs/livekit_agent_dispatch.proto +103 -0
  81. package/test-fixtures/protobufs/livekit_agent_simulation.proto +422 -0
  82. package/test-fixtures/protobufs/livekit_agent_worker.proto +29 -0
  83. package/test-fixtures/protobufs/livekit_agentdb.proto +226 -0
  84. package/test-fixtures/protobufs/livekit_analytics.proto +312 -0
  85. package/test-fixtures/protobufs/livekit_cloud_agent.proto +376 -0
  86. package/test-fixtures/protobufs/livekit_connector.proto +41 -0
  87. package/test-fixtures/protobufs/livekit_connector_twilio.proto +65 -0
  88. package/test-fixtures/protobufs/livekit_connector_whatsapp.proto +171 -0
  89. package/test-fixtures/protobufs/livekit_egress.proto +641 -0
  90. package/test-fixtures/protobufs/livekit_ingress.proto +222 -0
  91. package/test-fixtures/protobufs/livekit_internal.proto +228 -0
  92. package/test-fixtures/protobufs/livekit_metrics.proto +103 -0
  93. package/test-fixtures/protobufs/livekit_models.proto +992 -0
  94. package/test-fixtures/protobufs/livekit_phone_number.proto +151 -0
  95. package/test-fixtures/protobufs/livekit_room.proto +312 -0
  96. package/test-fixtures/protobufs/livekit_rtc.proto +673 -0
  97. package/test-fixtures/protobufs/livekit_sip.proto +1000 -0
  98. package/test-fixtures/protobufs/livekit_token_source.proto +49 -0
  99. package/test-fixtures/protobufs/livekit_webhook.proto +62 -0
@@ -0,0 +1,1000 @@
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 livekit;
18
+
19
+ import "google/protobuf/any.proto";
20
+ import "google/protobuf/duration.proto";
21
+ import "google/protobuf/timestamp.proto";
22
+ import "livekit_models.proto";
23
+ import "livekit_room.proto";
24
+ import "logger/options.proto";
25
+
26
+ option csharp_namespace = "LiveKit.Proto";
27
+ option go_package = "github.com/livekit/protocol/livekit";
28
+ option ruby_package = "LiveKit::Proto";
29
+
30
+ /*
31
+ LiveKit's SIP API is built with 3 high level primitives
32
+ - SIP Trunk
33
+ - SIP Dispatch Rule
34
+ - SIP Participant
35
+
36
+
37
+ The `SIP Trunk` is used to accept and make calls. A `SIP Trunk` is configured with
38
+ the IPs/Ports and Authentication details of your SIP Provider. When a call is accepted from
39
+ the `SIP Trunk` it is then handled by the `SIP Dispatch Rules`. When a `SIP Participant` is created
40
+ for a outbound call a `SIP Trunk` is chosen to make the call with.
41
+
42
+
43
+ The `SIP Dispatch Rule` is a list of rules that dictate how a incoming SIP call should be handled.
44
+ LiveKit currently supports 2 types, but may support more in the future.
45
+
46
+ - `Direct Dispatch` puts a caller into a existing room, possibly choosing between multiple rooms with a pin
47
+ - `Individual Dispatch` puts a caller into a new room created for the call
48
+
49
+
50
+ The `SIP Participant` represents an active SIP Session. These SIP Sessions are always associated with
51
+ a Participant on LiveKit side. Inbound calls create Participants directly (with a `SIP` kind), while outbound
52
+ calls must be initiated with `CreateSIPParticipant`.
53
+ */
54
+
55
+ service SIP {
56
+ // rpc CreateSIPTrunk(CreateSIPTrunkRequest) returns (SIPTrunkInfo) { option deprecated = true; }; DELETED
57
+
58
+ rpc ListSIPTrunk(ListSIPTrunkRequest) returns (ListSIPTrunkResponse) {
59
+ option deprecated = true;
60
+ }
61
+
62
+ rpc CreateSIPInboundTrunk(CreateSIPInboundTrunkRequest) returns (SIPInboundTrunkInfo);
63
+ rpc CreateSIPOutboundTrunk(CreateSIPOutboundTrunkRequest) returns (SIPOutboundTrunkInfo);
64
+ rpc UpdateSIPInboundTrunk(UpdateSIPInboundTrunkRequest) returns (SIPInboundTrunkInfo);
65
+ rpc UpdateSIPOutboundTrunk(UpdateSIPOutboundTrunkRequest) returns (SIPOutboundTrunkInfo);
66
+ rpc GetSIPInboundTrunk(GetSIPInboundTrunkRequest) returns (GetSIPInboundTrunkResponse);
67
+ rpc GetSIPOutboundTrunk(GetSIPOutboundTrunkRequest) returns (GetSIPOutboundTrunkResponse);
68
+ rpc ListSIPInboundTrunk(ListSIPInboundTrunkRequest) returns (ListSIPInboundTrunkResponse);
69
+ rpc ListSIPOutboundTrunk(ListSIPOutboundTrunkRequest) returns (ListSIPOutboundTrunkResponse);
70
+ rpc DeleteSIPTrunk(DeleteSIPTrunkRequest) returns (SIPTrunkInfo);
71
+
72
+ rpc CreateSIPDispatchRule(CreateSIPDispatchRuleRequest) returns (SIPDispatchRuleInfo);
73
+ rpc UpdateSIPDispatchRule(UpdateSIPDispatchRuleRequest) returns (SIPDispatchRuleInfo);
74
+ rpc ListSIPDispatchRule(ListSIPDispatchRuleRequest) returns (ListSIPDispatchRuleResponse);
75
+ rpc DeleteSIPDispatchRule(DeleteSIPDispatchRuleRequest) returns (SIPDispatchRuleInfo);
76
+
77
+ rpc CreateSIPParticipant(CreateSIPParticipantRequest) returns (SIPParticipantInfo);
78
+ rpc TransferSIPParticipant(TransferSIPParticipantRequest) returns (TransferSIPParticipantResponse);
79
+ }
80
+
81
+ enum SIPStatusCode {
82
+ SIP_STATUS_UNKNOWN = 0;
83
+
84
+ SIP_STATUS_TRYING = 100;
85
+ SIP_STATUS_RINGING = 180;
86
+ SIP_STATUS_CALL_IS_FORWARDED = 181;
87
+ SIP_STATUS_QUEUED = 182;
88
+ SIP_STATUS_SESSION_PROGRESS = 183;
89
+ SIP_STATUS_EARLY_DIALOG_TERMINATED = 199;
90
+
91
+ SIP_STATUS_OK = 200;
92
+ SIP_STATUS_ACCEPTED = 202;
93
+ SIP_STATUS_NO_NOTIFICATION = 204;
94
+
95
+ SIP_STATUS_MULTIPLE_CHOICES = 300;
96
+ SIP_STATUS_MOVED_PERMANENTLY = 301;
97
+ SIP_STATUS_MOVED_TEMPORARILY = 302;
98
+ SIP_STATUS_USE_PROXY = 305;
99
+ SIP_STATUS_ALTERNATIVE_SERVICE = 380;
100
+
101
+ SIP_STATUS_BAD_REQUEST = 400;
102
+ SIP_STATUS_UNAUTHORIZED = 401;
103
+ SIP_STATUS_PAYMENT_REQUIRED = 402;
104
+ SIP_STATUS_FORBIDDEN = 403;
105
+ SIP_STATUS_NOTFOUND = 404;
106
+ SIP_STATUS_METHOD_NOT_ALLOWED = 405;
107
+ SIP_STATUS_NOT_ACCEPTABLE = 406;
108
+ SIP_STATUS_PROXY_AUTH_REQUIRED = 407;
109
+ SIP_STATUS_REQUEST_TIMEOUT = 408;
110
+ SIP_STATUS_CONFLICT = 409;
111
+ SIP_STATUS_GONE = 410;
112
+ SIP_STATUS_LENGTH_REQUIRED = 411;
113
+ SIP_STATUS_CONDITIONAL_REQUEST_FAILED = 412;
114
+ SIP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413;
115
+ SIP_STATUS_REQUEST_URI_TOO_LONG = 414;
116
+ SIP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415;
117
+ SIP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
118
+ SIP_STATUS_UNKNOWN_RESOURCE_PRIORITY = 417;
119
+ SIP_STATUS_BAD_EXTENSION = 420;
120
+ SIP_STATUS_EXTENSION_REQUIRED = 421;
121
+ SIP_STATUS_SESSION_INTERVAL_TOO_SMALL = 422;
122
+ SIP_STATUS_INTERVAL_TOO_BRIEF = 423;
123
+ SIP_STATUS_BAD_LOCATION_INFORMATION = 424;
124
+ SIP_STATUS_BAD_ALERT_MESSAGE = 425;
125
+ SIP_STATUS_USE_IDENTITY_HEADER = 428;
126
+ SIP_STATUS_PROVIDE_REFERRER_IDENTITY = 429;
127
+ SIP_STATUS_FLOW_FAILED = 430;
128
+ SIP_STATUS_ANONYMITY_DISALLOWED = 433;
129
+ SIP_STATUS_BAD_IDENTITY_INFO = 436;
130
+ SIP_STATUS_UNSUPPORTED_CERTIFICATE = 437;
131
+ SIP_STATUS_INVALID_IDENTITY_HEADER = 438;
132
+ SIP_STATUS_FIRST_HOP_LACKS_OUTBOUND_SUPPORT = 439;
133
+ SIP_STATUS_MAX_BREADTH_EXCEEDED = 440;
134
+ SIP_STATUS_BAD_INFO_PACKAGE = 469;
135
+ SIP_STATUS_CONSENT_NEEDED = 470;
136
+ SIP_STATUS_TEMPORARILY_UNAVAILABLE = 480;
137
+ SIP_STATUS_CALL_TRANSACTION_DOES_NOT_EXISTS = 481;
138
+ SIP_STATUS_LOOP_DETECTED = 482;
139
+ SIP_STATUS_TOO_MANY_HOPS = 483;
140
+ SIP_STATUS_ADDRESS_INCOMPLETE = 484;
141
+ SIP_STATUS_AMBIGUOUS = 485;
142
+ SIP_STATUS_BUSY_HERE = 486;
143
+ SIP_STATUS_REQUEST_TERMINATED = 487;
144
+ SIP_STATUS_NOT_ACCEPTABLE_HERE = 488;
145
+ SIP_STATUS_BAD_EVENT = 489;
146
+ SIP_STATUS_REQUEST_PENDING = 491;
147
+ SIP_STATUS_UNDECIPHERABLE = 493;
148
+ SIP_STATUS_SECURITY_AGREEMENT_REQUIRED = 494;
149
+
150
+ SIP_STATUS_INTERNAL_SERVER_ERROR = 500;
151
+ SIP_STATUS_NOT_IMPLEMENTED = 501;
152
+ SIP_STATUS_BAD_GATEWAY = 502;
153
+ SIP_STATUS_SERVICE_UNAVAILABLE = 503;
154
+ SIP_STATUS_GATEWAY_TIMEOUT = 504;
155
+ SIP_STATUS_VERSION_NOT_SUPPORTED = 505;
156
+ SIP_STATUS_MESSAGE_TOO_LARGE = 513;
157
+
158
+ SIP_STATUS_GLOBAL_BUSY_EVERYWHERE = 600;
159
+ SIP_STATUS_GLOBAL_DECLINE = 603;
160
+ SIP_STATUS_GLOBAL_DOES_NOT_EXIST_ANYWHERE = 604;
161
+ SIP_STATUS_GLOBAL_NOT_ACCEPTABLE = 606;
162
+ SIP_STATUS_GLOBAL_UNWANTED = 607;
163
+ SIP_STATUS_GLOBAL_REJECTED = 608;
164
+ }
165
+
166
+ // SIPStatus is returned as an error detail in CreateSIPParticipant.
167
+ message SIPStatus {
168
+ SIPStatusCode code = 1;
169
+ string status = 2;
170
+ }
171
+
172
+ message CreateSIPTrunkRequest {
173
+ option deprecated = true;
174
+ // CIDR or IPs that traffic is accepted from
175
+ // An empty list means all inbound traffic is accepted.
176
+ repeated string inbound_addresses = 1;
177
+
178
+ // IP that SIP INVITE is sent too
179
+ string outbound_address = 2;
180
+
181
+ // Number used to make outbound calls
182
+ string outbound_number = 3;
183
+
184
+ repeated string inbound_numbers_regex = 4 [deprecated = true];
185
+
186
+ // Accepted `To` values. This Trunk will only accept a call made to
187
+ // these numbers. This allows you to have distinct Trunks for different phone
188
+ // numbers at the same provider.
189
+ repeated string inbound_numbers = 9;
190
+
191
+ // Username and password used to authenticate inbound and outbound SIP invites
192
+ // May be empty to have no Authentication
193
+ string inbound_username = 5 [(logger.sensitivity) = SENSITIVITY_PII];
194
+ string inbound_password = 6 [(logger.sensitivity) = SENSITIVITY_SECRET];
195
+ string outbound_username = 7 [(logger.sensitivity) = SENSITIVITY_PII];
196
+ string outbound_password = 8 [(logger.sensitivity) = SENSITIVITY_SECRET];
197
+
198
+ // Optional human-readable name for the Trunk.
199
+ string name = 10;
200
+ // Optional user-defined metadata for the Trunk.
201
+ string metadata = 11 [
202
+ (logger.sensitivity) = SENSITIVITY_PII,
203
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
204
+ ];
205
+ }
206
+
207
+ enum SIPTransport {
208
+ SIP_TRANSPORT_AUTO = 0;
209
+ SIP_TRANSPORT_UDP = 1;
210
+ SIP_TRANSPORT_TCP = 2;
211
+ SIP_TRANSPORT_TLS = 3;
212
+ }
213
+
214
+ enum SIPHeaderOptions {
215
+ SIP_NO_HEADERS = 0; // do not map any headers, except ones mapped explicitly
216
+ SIP_X_HEADERS = 1; // map all X-* headers to sip.h.x-* attributes
217
+ SIP_ALL_HEADERS = 2; // map all headers to sip.h.* attributes
218
+ }
219
+
220
+ enum SIPMediaEncryption {
221
+ SIP_MEDIA_ENCRYPT_DISABLE = 0; // do not enable encryption
222
+ SIP_MEDIA_ENCRYPT_ALLOW = 1; // use encryption if available
223
+ SIP_MEDIA_ENCRYPT_REQUIRE = 2; // require encryption
224
+ }
225
+
226
+ message SIPCodec {
227
+ string name = 1;
228
+ uint32 rate = 2;
229
+ }
230
+
231
+ message SIPMediaConfig {
232
+ // if set, ignore the default codecs and use the list below.
233
+ bool only_listed_codecs = 1;
234
+ // List of allowed codecs. If only_listed_codecs is not set, this list is added to default codecs.
235
+ repeated SIPCodec codecs = 2;
236
+ optional SIPMediaEncryption encryption = 3;
237
+ // Use specific media timeout. If zero or not specified, will use default timeout.
238
+ optional google.protobuf.Duration media_timeout = 4;
239
+ }
240
+
241
+ message ProviderInfo {
242
+ string id = 1;
243
+ string name = 2;
244
+ ProviderType type = 3;
245
+ bool prevent_transfer = 4;
246
+ }
247
+
248
+ enum ProviderType {
249
+ PROVIDER_TYPE_UNKNOWN = 0;
250
+ PROVIDER_TYPE_INTERNAL = 1; // Internally implemented
251
+ PROVIDER_TYPE_EXTERNAL = 2; // Vendor provided
252
+ }
253
+
254
+ message SIPTrunkInfo {
255
+ option deprecated = true;
256
+
257
+ enum TrunkKind {
258
+ TRUNK_LEGACY = 0;
259
+ TRUNK_INBOUND = 1;
260
+ TRUNK_OUTBOUND = 2;
261
+ }
262
+
263
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
264
+ TrunkKind kind = 14;
265
+
266
+ // CIDR or IPs that traffic is accepted from
267
+ // An empty list means all inbound traffic is accepted.
268
+ repeated string inbound_addresses = 2;
269
+
270
+ // IP that SIP INVITE is sent too
271
+ string outbound_address = 3;
272
+
273
+ // Number used to make outbound calls
274
+ string outbound_number = 4;
275
+
276
+ // Transport used for inbound and outbound calls.
277
+ SIPTransport transport = 13;
278
+
279
+ repeated string inbound_numbers_regex = 5 [deprecated = true];
280
+
281
+ // Accepted `To` values. This Trunk will only accept a call made to
282
+ // these numbers. This allows you to have distinct Trunks for different phone
283
+ // numbers at the same provider.
284
+ repeated string inbound_numbers = 10;
285
+
286
+ // Username and password used to authenticate inbound and outbound SIP invites
287
+ // May be empty to have no Authentication
288
+ string inbound_username = 6 [(logger.sensitivity) = SENSITIVITY_PII];
289
+ string inbound_password = 7 [(logger.sensitivity) = SENSITIVITY_SECRET];
290
+ string outbound_username = 8 [(logger.sensitivity) = SENSITIVITY_PII];
291
+ string outbound_password = 9 [(logger.sensitivity) = SENSITIVITY_SECRET];
292
+
293
+ // Human-readable name for the Trunk.
294
+ string name = 11;
295
+ // User-defined metadata for the Trunk.
296
+ string metadata = 12 [
297
+ (logger.sensitivity) = SENSITIVITY_PII,
298
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
299
+ ];
300
+
301
+ // NEXT ID: 15
302
+ }
303
+
304
+ message CreateSIPInboundTrunkRequest {
305
+ SIPInboundTrunkInfo trunk = 1; // Trunk ID is ignored
306
+ }
307
+
308
+ message UpdateSIPInboundTrunkRequest {
309
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
310
+ oneof action {
311
+ SIPInboundTrunkInfo replace = 2;
312
+ SIPInboundTrunkUpdate update = 3;
313
+ }
314
+ }
315
+
316
+ message SIPInboundTrunkInfo {
317
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
318
+
319
+ // Human-readable name for the Trunk.
320
+ string name = 2;
321
+ // User-defined metadata for the Trunk.
322
+ string metadata = 3 [
323
+ (logger.sensitivity) = SENSITIVITY_PII,
324
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
325
+ ];
326
+
327
+ // Numbers associated with LiveKit SIP. The Trunk will only accept calls made to these numbers.
328
+ // Creating multiple Trunks with different phone numbers allows having different rules for a single provider.
329
+ repeated string numbers = 4;
330
+
331
+ // CIDR or IPs that traffic is accepted from.
332
+ // An empty list means all inbound traffic is accepted.
333
+ repeated string allowed_addresses = 5;
334
+
335
+ // Numbers that are allowed to make calls to this Trunk.
336
+ // An empty list means calls from any phone number is accepted.
337
+ repeated string allowed_numbers = 6;
338
+
339
+ // Username and password used to authenticate inbound SIP invites.
340
+ // May be empty to have no authentication.
341
+ string auth_username = 7 [(logger.sensitivity) = SENSITIVITY_PII];
342
+ string auth_password = 8 [(logger.sensitivity) = SENSITIVITY_SECRET];
343
+ string auth_realm = 19;
344
+
345
+ // Include these SIP X-* headers in 200 OK responses.
346
+ map<string, string> headers = 9 [
347
+ (logger.sensitivity) = SENSITIVITY_PII,
348
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
349
+ ];
350
+ // Map SIP X-* headers from INVITE to SIP participant attributes.
351
+ map<string, string> headers_to_attributes = 10;
352
+ // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests.
353
+ // Keys are the names of attributes and values are the names of X-* headers they will be mapped to.
354
+ map<string, string> attributes_to_headers = 14;
355
+ // Map SIP headers from INVITE to sip.h.* participant attributes automatically.
356
+ //
357
+ // When the names of required headers is known, using headers_to_attributes is strongly recommended.
358
+ //
359
+ // When mapping INVITE headers to response headers with attributes_to_headers map,
360
+ // lowercase header names should be used, for example: sip.h.x-custom-header.
361
+ SIPHeaderOptions include_headers = 15;
362
+
363
+ // Max time for the caller to wait for track subscription.
364
+ google.protobuf.Duration ringing_timeout = 11;
365
+ // Max call duration.
366
+ google.protobuf.Duration max_call_duration = 12;
367
+
368
+ bool krisp_enabled = 13;
369
+ SIPMediaEncryption media_encryption = 16 [deprecated = true];
370
+ SIPMediaConfig media = 20;
371
+
372
+ google.protobuf.Timestamp created_at = 17;
373
+ google.protobuf.Timestamp updated_at = 18;
374
+
375
+ // NEXT ID: 21
376
+ }
377
+
378
+ message SIPInboundTrunkUpdate {
379
+ ListUpdate numbers = 1;
380
+ ListUpdate allowed_addresses = 2;
381
+ ListUpdate allowed_numbers = 3;
382
+ optional string auth_username = 4 [(logger.sensitivity) = SENSITIVITY_PII];
383
+ optional string auth_password = 5 [(logger.sensitivity) = SENSITIVITY_SECRET];
384
+ optional string auth_realm = 9;
385
+ optional string name = 6;
386
+ optional string metadata = 7 [
387
+ (logger.sensitivity) = SENSITIVITY_PII,
388
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
389
+ ];
390
+ optional SIPMediaEncryption media_encryption = 8 [deprecated = true];
391
+ SIPMediaConfig media = 10;
392
+
393
+ // NEXT ID: 11
394
+ }
395
+
396
+ message CreateSIPOutboundTrunkRequest {
397
+ SIPOutboundTrunkInfo trunk = 1; // Trunk ID is ignored
398
+ }
399
+
400
+ message UpdateSIPOutboundTrunkRequest {
401
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
402
+ oneof action {
403
+ SIPOutboundTrunkInfo replace = 2;
404
+ SIPOutboundTrunkUpdate update = 3;
405
+ }
406
+ }
407
+
408
+ message SIPOutboundTrunkInfo {
409
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
410
+
411
+ // Human-readable name for the Trunk.
412
+ string name = 2;
413
+ // User-defined metadata for the Trunk.
414
+ string metadata = 3 [
415
+ (logger.sensitivity) = SENSITIVITY_PII,
416
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
417
+ ];
418
+
419
+ // Hostname or IP that SIP INVITE is sent too.
420
+ // Note that this is not a SIP URI and should not contain the 'sip:' protocol prefix.
421
+ string address = 4;
422
+
423
+ // country where the call terminates as ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will be used by the livekit infrastructure to route calls.
424
+ string destination_country = 14;
425
+
426
+ // SIP Transport used for outbound call.
427
+ SIPTransport transport = 5;
428
+
429
+ // Numbers used to make the calls. Random one from this list will be selected.
430
+ repeated string numbers = 6;
431
+
432
+ // Username and password used to authenticate with SIP server.
433
+ // May be empty to have no authentication.
434
+ string auth_username = 7 [(logger.sensitivity) = SENSITIVITY_PII];
435
+ string auth_password = 8 [(logger.sensitivity) = SENSITIVITY_SECRET];
436
+
437
+ // Include these SIP X-* headers in INVITE request.
438
+ // These headers are sent as-is and may help identify this call as coming from LiveKit for the other SIP endpoint.
439
+ map<string, string> headers = 9 [
440
+ (logger.sensitivity) = SENSITIVITY_PII,
441
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
442
+ ];
443
+ // Map SIP X-* headers from 200 OK to SIP participant attributes.
444
+ // Keys are the names of X-* headers and values are the names of attributes they will be mapped to.
445
+ map<string, string> headers_to_attributes = 10;
446
+ // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests.
447
+ // Keys are the names of attributes and values are the names of X-* headers they will be mapped to.
448
+ map<string, string> attributes_to_headers = 11;
449
+ // Map SIP headers from 200 OK to sip.h.* participant attributes automatically.
450
+ //
451
+ // When the names of required headers is known, using headers_to_attributes is strongly recommended.
452
+ //
453
+ // When mapping 200 OK headers to follow-up request headers with attributes_to_headers map,
454
+ // lowercase header names should be used, for example: sip.h.x-custom-header.
455
+ SIPHeaderOptions include_headers = 12;
456
+
457
+ SIPMediaEncryption media_encryption = 13 [deprecated = true];
458
+ SIPMediaConfig media = 18;
459
+
460
+ // Optional custom hostname for the 'From' SIP header in outbound INVITEs.
461
+ // When set, outbound calls from this trunk will use this host instead of the default project SIP domain.
462
+ // Enables originating calls from custom domains.
463
+ string from_host = 15;
464
+
465
+ google.protobuf.Timestamp created_at = 16;
466
+ google.protobuf.Timestamp updated_at = 17;
467
+
468
+ // NEXT ID: 19
469
+ }
470
+
471
+ message SIPOutboundTrunkUpdate {
472
+ optional string address = 1;
473
+ optional SIPTransport transport = 2;
474
+ optional string destination_country = 9;
475
+ ListUpdate numbers = 3;
476
+ optional string auth_username = 4 [(logger.sensitivity) = SENSITIVITY_PII];
477
+ optional string auth_password = 5 [(logger.sensitivity) = SENSITIVITY_SECRET];
478
+ optional string name = 6;
479
+ optional string metadata = 7 [
480
+ (logger.sensitivity) = SENSITIVITY_PII,
481
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
482
+ ];
483
+ optional SIPMediaEncryption media_encryption = 8 [deprecated = true];
484
+ SIPMediaConfig media = 11;
485
+ optional string from_host = 10;
486
+
487
+ // NEXT ID: 12
488
+ }
489
+
490
+ message GetSIPInboundTrunkRequest {
491
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
492
+ }
493
+
494
+ message GetSIPInboundTrunkResponse {
495
+ SIPInboundTrunkInfo trunk = 1;
496
+ }
497
+
498
+ message GetSIPOutboundTrunkRequest {
499
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
500
+ }
501
+
502
+ message GetSIPOutboundTrunkResponse {
503
+ SIPOutboundTrunkInfo trunk = 1;
504
+ }
505
+
506
+ message ListSIPTrunkRequest {
507
+ option deprecated = true;
508
+ Pagination page = 1;
509
+ }
510
+
511
+ message ListSIPTrunkResponse {
512
+ option deprecated = true;
513
+ repeated SIPTrunkInfo items = 1;
514
+ }
515
+
516
+ // ListSIPInboundTrunkRequest lists inbound trunks for given filters. If no filters are set, all trunks are listed.
517
+ message ListSIPInboundTrunkRequest {
518
+ Pagination page = 3;
519
+ // Trunk IDs to list. If this option is set, the response will contains trunks in the same order.
520
+ // If any of the trunks is missing, a nil item in that position will be sent in the response.
521
+ repeated string trunk_ids = 1;
522
+ // Only list trunks that contain one of the numbers, including wildcard trunks.
523
+ repeated string numbers = 2;
524
+ }
525
+
526
+ message ListSIPInboundTrunkResponse {
527
+ repeated SIPInboundTrunkInfo items = 1;
528
+ }
529
+
530
+ // ListSIPOutboundTrunkRequest lists outbound trunks for given filters. If no filters are set, all trunks are listed.
531
+ message ListSIPOutboundTrunkRequest {
532
+ Pagination page = 3;
533
+ // Trunk IDs to list. If this option is set, the response will contains trunks in the same order.
534
+ // If any of the trunks is missing, a nil item in that position will be sent in the response.
535
+ repeated string trunk_ids = 1;
536
+ // Only list trunks that contain one of the numbers, including wildcard trunks.
537
+ repeated string numbers = 2;
538
+ }
539
+
540
+ message ListSIPOutboundTrunkResponse {
541
+ repeated SIPOutboundTrunkInfo items = 1;
542
+ }
543
+
544
+ message DeleteSIPTrunkRequest {
545
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
546
+ }
547
+
548
+ message SIPDispatchRuleDirect {
549
+ // What room should call be directed into
550
+ string room_name = 1;
551
+
552
+ // Optional pin required to enter room
553
+ string pin = 2;
554
+ }
555
+
556
+ message SIPDispatchRuleIndividual {
557
+ // Prefix used on new room name
558
+ string room_prefix = 1;
559
+
560
+ // Optional pin required to enter room
561
+ string pin = 2;
562
+
563
+ // Optionally append random suffix
564
+ bool no_randomness = 3;
565
+ }
566
+
567
+ message SIPDispatchRuleCallee {
568
+ // Prefix used on new room name
569
+ string room_prefix = 1;
570
+
571
+ // Optional pin required to enter room
572
+ string pin = 2;
573
+
574
+ // Optionally append random suffix
575
+ bool randomize = 3;
576
+ }
577
+
578
+ message SIPDispatchRule {
579
+ oneof rule {
580
+ // SIPDispatchRuleDirect is a `SIP Dispatch Rule` that puts a user directly into a room
581
+ // This places users into an existing room. Optionally you can require a pin before a user can
582
+ // enter the room
583
+ SIPDispatchRuleDirect dispatch_rule_direct = 1;
584
+
585
+ // SIPDispatchRuleIndividual is a `SIP Dispatch Rule` that creates a new room for each caller.
586
+ SIPDispatchRuleIndividual dispatch_rule_individual = 2;
587
+
588
+ // SIPDispatchRuleCallee is a `SIP Dispatch Rule` that creates a new room for each callee.
589
+ SIPDispatchRuleCallee dispatch_rule_callee = 3;
590
+ }
591
+ }
592
+
593
+ message CreateSIPDispatchRuleRequest {
594
+ SIPDispatchRuleInfo dispatch_rule = 10; // Rule ID is ignored
595
+
596
+ SIPDispatchRule rule = 1 [deprecated = true];
597
+
598
+ // What trunks are accepted for this dispatch rule
599
+ // If empty all trunks will match this dispatch rule
600
+ repeated string trunk_ids = 2 [deprecated = true];
601
+
602
+ // By default the From value (Phone number) is used for participant name/identity and added to attributes.
603
+ // If true, a random value for identity will be used and numbers will be omitted from attributes.
604
+ bool hide_phone_number = 3 [deprecated = true];
605
+
606
+ // Dispatch Rule will only accept a call made to these numbers (if set).
607
+ repeated string inbound_numbers = 6 [deprecated = true];
608
+
609
+ // Optional human-readable name for the Dispatch Rule.
610
+ string name = 4 [deprecated = true];
611
+ // User-defined metadata for the Dispatch Rule.
612
+ // Participants created by this rule will inherit this metadata.
613
+ string metadata = 5 [
614
+ deprecated = true,
615
+ (logger.sensitivity) = SENSITIVITY_PII,
616
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
617
+ ];
618
+ // User-defined attributes for the Dispatch Rule.
619
+ // Participants created by this rule will inherit these attributes.
620
+ map<string, string> attributes = 7 [
621
+ deprecated = true,
622
+ (logger.sensitivity) = SENSITIVITY_PII,
623
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
624
+ ];
625
+
626
+ // Cloud-only, config preset to use
627
+ string room_preset = 8 [deprecated = true];
628
+
629
+ // RoomConfiguration to use if the participant initiates the room
630
+ RoomConfiguration room_config = 9 [deprecated = true];
631
+
632
+ // NEXT ID: 11
633
+ }
634
+
635
+ message UpdateSIPDispatchRuleRequest {
636
+ string sip_dispatch_rule_id = 1 [(logger.name) = "sipDispatchRuleID"];
637
+ oneof action {
638
+ SIPDispatchRuleInfo replace = 2;
639
+ SIPDispatchRuleUpdate update = 3;
640
+ }
641
+ }
642
+
643
+ message SIPDispatchRuleInfo {
644
+ string sip_dispatch_rule_id = 1 [(logger.name) = "sipDispatchRuleID"];
645
+ SIPDispatchRule rule = 2;
646
+ repeated string trunk_ids = 3;
647
+ bool hide_phone_number = 4;
648
+ // Dispatch Rule will only accept a call made from these numbers (if set).
649
+ repeated string inbound_numbers = 7;
650
+
651
+ // Dispatch Rule will only accept a call made to these numbers (if set).
652
+ repeated string numbers = 13;
653
+
654
+ // Human-readable name for the Dispatch Rule.
655
+ string name = 5;
656
+ // User-defined metadata for the Dispatch Rule.
657
+ // Participants created by this rule will inherit this metadata.
658
+ string metadata = 6 [
659
+ (logger.sensitivity) = SENSITIVITY_PII,
660
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
661
+ ];
662
+ // User-defined attributes for the Dispatch Rule.
663
+ // Participants created by this rule will inherit these attributes.
664
+ map<string, string> attributes = 8 [
665
+ (logger.sensitivity) = SENSITIVITY_PII,
666
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
667
+ ];
668
+
669
+ // Cloud-only, config preset to use
670
+ string room_preset = 9;
671
+
672
+ // RoomConfiguration to use if the participant initiates the room
673
+ RoomConfiguration room_config = 10;
674
+
675
+ SIPMediaConfig media = 16;
676
+ bool krisp_enabled = 11;
677
+ SIPMediaEncryption media_encryption = 12 [deprecated = true];
678
+
679
+ google.protobuf.Timestamp created_at = 14;
680
+ google.protobuf.Timestamp updated_at = 15;
681
+
682
+ // NEXT ID: 17
683
+ }
684
+
685
+ message SIPDispatchRuleUpdate {
686
+ ListUpdate trunk_ids = 1;
687
+ SIPDispatchRule rule = 2;
688
+ optional string name = 3;
689
+ optional string metadata = 4 [
690
+ (logger.sensitivity) = SENSITIVITY_PII,
691
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
692
+ ];
693
+ map<string, string> attributes = 5 [
694
+ (logger.sensitivity) = SENSITIVITY_PII,
695
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
696
+ ];
697
+ optional SIPMediaEncryption media_encryption = 6 [deprecated = true];
698
+ SIPMediaConfig media = 7;
699
+ }
700
+
701
+ // ListSIPDispatchRuleRequest lists dispatch rules for given filters. If no filters are set, all rules are listed.
702
+ message ListSIPDispatchRuleRequest {
703
+ Pagination page = 3;
704
+ // Rule IDs to list. If this option is set, the response will contains rules in the same order.
705
+ // If any of the rules is missing, a nil item in that position will be sent in the response.
706
+ repeated string dispatch_rule_ids = 1;
707
+ // Only list rules that contain one of the Trunk IDs, including wildcard rules.
708
+ repeated string trunk_ids = 2;
709
+ }
710
+
711
+ message ListSIPDispatchRuleResponse {
712
+ repeated SIPDispatchRuleInfo items = 1;
713
+ }
714
+
715
+ message DeleteSIPDispatchRuleRequest {
716
+ string sip_dispatch_rule_id = 1 [(logger.name) = "sipDispatchRuleID"];
717
+ }
718
+
719
+ message SIPOutboundConfig {
720
+ // SIP server address
721
+ string hostname = 1;
722
+
723
+ // country where the call terminates as ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will be used by the livekit infrastructure to route calls.
724
+ string destination_country = 7;
725
+
726
+ // SIP Transport used for outbound call.
727
+ SIPTransport transport = 2;
728
+
729
+ // Username and password used to authenticate with SIP server.
730
+ // May be empty to have no authentication.
731
+ string auth_username = 3 [(logger.sensitivity) = SENSITIVITY_PII];
732
+ string auth_password = 4 [(logger.sensitivity) = SENSITIVITY_SECRET];
733
+
734
+ // Map SIP X-* headers from 200 OK to SIP participant attributes.
735
+ // Keys are the names of X-* headers and values are the names of attributes they will be mapped to.
736
+ map<string, string> headers_to_attributes = 5;
737
+ // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests.
738
+ // Keys are the names of attributes and values are the names of X-* headers they will be mapped to.
739
+ map<string, string> attributes_to_headers = 6;
740
+
741
+ // Optional custom hostname for the 'From' SIP header. When set, outbound calls use this host instead of the default project SIP domain.
742
+ string from_host = 8;
743
+
744
+ // NEXT ID: 9
745
+ }
746
+
747
+ // A SIP Participant is a singular SIP session connected to a LiveKit room via
748
+ // a SIP Trunk into a SIP DispatchRule
749
+ message CreateSIPParticipantRequest {
750
+ // What SIP Trunk should be used to dial the user
751
+ string sip_trunk_id = 1 [(logger.name) = "sipTrunkID"];
752
+ SIPOutboundConfig trunk = 20;
753
+
754
+ SIPRequestDest sip_request_uri = 24; // INVITE <uri>
755
+ // Currently not usable with CreateSIPParticipant: sip_call_to is required, and
756
+ // the two cannot be combined. Use to_user_override to change the To header user.
757
+ SIPNamedDest sip_to_header = 25; // To: "Name" <uri>
758
+ SIPNamedDest sip_from_header = 26; // From: "Name" <uri>
759
+
760
+ // What number should be dialed via SIP
761
+ string sip_call_to = 2;
762
+
763
+ // Replaces the user part of the To header, leaving its host, port and transport
764
+ // as they would otherwise be. The request URI is not affected, so the call is
765
+ // still placed to sip_call_to. Empty means no override.
766
+ //
767
+ // Use this when the callee expects a To header that differs from the number
768
+ // being dialed. Setting "To" in the headers map is not a valid alternative:
769
+ // it adds a second To header rather than replacing the existing one, which
770
+ // makes the INVITE malformed.
771
+ string to_user_override = 27;
772
+
773
+ // Optional SIP From number to use. If empty, trunk number is used.
774
+ string sip_number = 15;
775
+
776
+ // What LiveKit room should this participant be connected too
777
+ string room_name = 3;
778
+
779
+ // Optional identity of the participant in LiveKit room
780
+ string participant_identity = 4;
781
+
782
+ // Optional name of the participant in LiveKit room
783
+ string participant_name = 7 [
784
+ (logger.sensitivity) = SENSITIVITY_PII,
785
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
786
+ ];
787
+
788
+ // Optional user-defined metadata. Will be attached to a created Participant in the room.
789
+ string participant_metadata = 8 [
790
+ (logger.sensitivity) = SENSITIVITY_PII,
791
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
792
+ ];
793
+ // Optional user-defined attributes. Will be attached to a created Participant in the room.
794
+ map<string, string> participant_attributes = 9 [
795
+ (logger.sensitivity) = SENSITIVITY_PII,
796
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
797
+ ];
798
+
799
+ // Optionally send following DTMF digits (extension codes) when making a call.
800
+ // Character 'w' can be used to add a 0.5 sec delay.
801
+ string dtmf = 5;
802
+
803
+ // Optionally play dialtone in the room as an audible indicator for existing participants. The `play_ringtone` option is deprectated but has the same effect.
804
+ bool play_ringtone = 6 [deprecated = true];
805
+ bool play_dialtone = 13;
806
+
807
+ // By default the From value (Phone number) is used for participant name/identity (if not set) and added to attributes.
808
+ // If true, a random value for identity will be used and numbers will be omitted from attributes.
809
+ bool hide_phone_number = 10;
810
+
811
+ // These headers are sent as-is and may help identify this call as coming from LiveKit for the other SIP endpoint.
812
+ map<string, string> headers = 16 [
813
+ (logger.sensitivity) = SENSITIVITY_PII,
814
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
815
+ ];
816
+ // Map SIP headers from 200 OK to sip.h.* participant attributes automatically.
817
+ //
818
+ // When the names of required headers is known, using headers_to_attributes is strongly recommended.
819
+ //
820
+ // When mapping 200 OK headers to follow-up request headers with attributes_to_headers map,
821
+ // lowercase header names should be used, for example: sip.h.x-custom-header.
822
+ SIPHeaderOptions include_headers = 17;
823
+
824
+ // Max time for the callee to answer the call.
825
+ google.protobuf.Duration ringing_timeout = 11;
826
+ // Max call duration.
827
+ google.protobuf.Duration max_call_duration = 12;
828
+
829
+ // Enable voice isolation for the callee.
830
+ bool krisp_enabled = 14;
831
+
832
+ SIPMediaEncryption media_encryption = 18 [deprecated = true];
833
+ SIPMediaConfig media = 23;
834
+
835
+ // Wait for the answer for the call before returning.
836
+ bool wait_until_answered = 19;
837
+
838
+ // Optional display name for the 'From' SIP header.
839
+ //
840
+ // Cases:
841
+ // 1) Unspecified: Use legacy behavior - display name will be set to be the caller's number.
842
+ // 2) Empty string: Do not send a display name, which will result in a CNAM lookup downstream.
843
+ // 3) Non-empty: Use the specified value as the display name.
844
+ optional string display_name = 21 [
845
+ (logger.sensitivity) = SENSITIVITY_PII,
846
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
847
+ ];
848
+ optional Destination destination = 22;
849
+ // NEXT ID: 28
850
+ }
851
+
852
+ message SIPParticipantInfo {
853
+ string participant_id = 1 [(logger.name) = "participantID"];
854
+ string participant_identity = 2;
855
+ string room_name = 3;
856
+ string sip_call_id = 4 [(logger.name) = "sipCallID"];
857
+ }
858
+
859
+ message TransferSIPParticipantRequest {
860
+ string participant_identity = 1;
861
+ string room_name = 2;
862
+ string transfer_to = 3;
863
+
864
+ // Optionally play dialtone to the SIP participant as an audible indicator of being transferred
865
+ bool play_dialtone = 4;
866
+
867
+ // Add the following headers to the REFER SIP request.
868
+ map<string, string> headers = 5 [
869
+ (logger.sensitivity) = SENSITIVITY_PII,
870
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
871
+ ];
872
+
873
+ // Max time for the transfer destination to answer the call.
874
+ google.protobuf.Duration ringing_timeout = 6;
875
+ }
876
+
877
+ message TransferSIPParticipantResponse {
878
+ string transfer_id = 1 [(logger.name) = "transferID"];
879
+ SIPTransferStatus status = 2;
880
+ SIPTransferReason reason = 3;
881
+
882
+ // Set when the outcome was reported by a SIP response.
883
+ SIPStatus sip_status = 4;
884
+
885
+ // NEXT ID: 5
886
+ }
887
+
888
+ message SIPCallInfo {
889
+ string call_id = 1 [(logger.name) = "callID"];
890
+ string trunk_id = 2 [(logger.name) = "trunkID"];
891
+ string dispatch_rule_id = 16 [(logger.name) = "dispatchRuleID"];
892
+ string region = 17;
893
+ string room_name = 3;
894
+ string room_id = 4 [(logger.name) = "roomID"]; // ID of the current/previous room published to
895
+ string participant_identity = 5;
896
+ map<string, string> participant_attributes = 18 [
897
+ (logger.sensitivity) = SENSITIVITY_PII,
898
+ (logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
899
+ ];
900
+ SIPUri from_uri = 6;
901
+ SIPUri to_uri = 7;
902
+ int64 created_at = 9 [deprecated = true];
903
+ int64 started_at = 10 [deprecated = true];
904
+ int64 ended_at = 11 [deprecated = true];
905
+ repeated SIPFeature enabled_features = 14;
906
+ SIPCallDirection call_direction = 15;
907
+ SIPCallStatus call_status = 8;
908
+ int64 created_at_ns = 22;
909
+ int64 started_at_ns = 23;
910
+ int64 ended_at_ns = 24;
911
+ DisconnectReason disconnect_reason = 12;
912
+ string error = 13;
913
+ SIPStatus call_status_code = 19;
914
+ string audio_codec = 20;
915
+ string media_encryption = 21;
916
+ string pcap_file_link = 25;
917
+ repeated google.protobuf.Any call_context = 26;
918
+ ProviderInfo provider_info = 27;
919
+ string sip_call_id = 28 [(logger.name) = "sipCallID"];
920
+
921
+ // NEXT ID: 29
922
+ }
923
+
924
+ message SIPTransferInfo {
925
+ string transfer_id = 1 [(logger.name) = "transferID"];
926
+ string call_id = 2 [(logger.name) = "callID"];
927
+ string transfer_to = 3;
928
+ int64 transfer_initiated_at_ns = 4;
929
+ int64 transfer_completed_at_ns = 5;
930
+ SIPTransferStatus transfer_status = 6;
931
+ string error = 7;
932
+ SIPStatus transfer_status_code = 8;
933
+ SIPTransferReason reason = 9;
934
+
935
+ // NEXT ID: 10
936
+ }
937
+
938
+ message SIPUri {
939
+ string user = 1;
940
+ string host = 2;
941
+ string ip = 3;
942
+ uint32 port = 4;
943
+ SIPTransport transport = 5;
944
+ }
945
+
946
+ message SIPRequestDest {
947
+ oneof uri {
948
+ string raw = 1; // <sip:user@sip.example.com:5060;transport=tcp>
949
+ SIPUri values = 2;
950
+ }
951
+ }
952
+
953
+ message SIPNamedDest {
954
+ string display_name = 3;
955
+ oneof uri {
956
+ string raw = 1; // <sip:user@sip.example.com:5060;transport=tcp>
957
+ SIPUri values = 2;
958
+ }
959
+ }
960
+
961
+ enum SIPCallStatus {
962
+ SCS_CALL_INCOMING = 0; // Incoming call is being handled by the SIP service. The SIP participant hasn't joined a LiveKit room yet
963
+ SCS_PARTICIPANT_JOINED = 1; // SIP participant for outgoing call has been created. The SIP outgoing call is being established
964
+ SCS_ACTIVE = 2; // Call is ongoing. SIP participant is active in the LiveKit room
965
+ SCS_DISCONNECTED = 3; // Call has ended
966
+ SCS_ERROR = 4; // Call has ended or never succeeded because of an error
967
+ }
968
+
969
+ enum SIPTransferStatus {
970
+ STS_TRANSFER_ONGOING = 0;
971
+ STS_TRANSFER_FAILED = 1;
972
+ STS_TRANSFER_SUCCESSFUL = 2;
973
+ }
974
+
975
+ enum SIPTransferReason {
976
+ STR_UNSPECIFIED = 0; // No reason reported
977
+ STR_COMPLETED = 1; // The transferee answered and the transfer completed
978
+ STR_CALL_ENDED = 2; // The call ended before the transfer completed: remote BYE, room deleted or local hangup
979
+ STR_REJECTED = 3; // The transferee, or its provider, rejected the transfer
980
+ STR_RINGING_TIMEOUT = 4; // The transferee did not answer in time
981
+ STR_SUBSCRIPTION_TERMINATED = 5; // The provider stopped reporting the transfer status without a final response
982
+ STR_CANCELED = 6; // Canceled through the API
983
+ }
984
+
985
+ enum SIPFeature {
986
+ NONE = 0;
987
+ KRISP_ENABLED = 1;
988
+ }
989
+
990
+ enum SIPCallDirection {
991
+ SCD_UNKNOWN = 0;
992
+ SCD_INBOUND = 1;
993
+ SCD_OUTBOUND = 2;
994
+ }
995
+
996
+ message Destination {
997
+ string city = 1;
998
+ string country = 2;
999
+ string region = 3;
1000
+ }