diff --git a/.changeset/good-parrots-peel.md b/.changeset/good-parrots-peel.md new file mode 100644 index 000000000..72906e058 --- /dev/null +++ b/.changeset/good-parrots-peel.md @@ -0,0 +1,6 @@ +--- +"@livekit/protocol": minor +"github.com/livekit/protocol": minor +--- + +Split SIP Trunk configuration to inbound and outbound parts. diff --git a/livekit/livekit_sip.pb.go b/livekit/livekit_sip.pb.go index 32d1e2f75..16dead2b9 100644 --- a/livekit/livekit_sip.pb.go +++ b/livekit/livekit_sip.pb.go @@ -86,6 +86,56 @@ func (SIPTransport) EnumDescriptor() ([]byte, []int) { return file_livekit_sip_proto_rawDescGZIP(), []int{0} } +type SIPTrunkInfo_TrunkKind int32 + +const ( + SIPTrunkInfo_TRUNK_LEGACY SIPTrunkInfo_TrunkKind = 0 + SIPTrunkInfo_TRUNK_INBOUND SIPTrunkInfo_TrunkKind = 1 + SIPTrunkInfo_TRUNK_OUTBOUND SIPTrunkInfo_TrunkKind = 2 +) + +// Enum value maps for SIPTrunkInfo_TrunkKind. +var ( + SIPTrunkInfo_TrunkKind_name = map[int32]string{ + 0: "TRUNK_LEGACY", + 1: "TRUNK_INBOUND", + 2: "TRUNK_OUTBOUND", + } + SIPTrunkInfo_TrunkKind_value = map[string]int32{ + "TRUNK_LEGACY": 0, + "TRUNK_INBOUND": 1, + "TRUNK_OUTBOUND": 2, + } +) + +func (x SIPTrunkInfo_TrunkKind) Enum() *SIPTrunkInfo_TrunkKind { + p := new(SIPTrunkInfo_TrunkKind) + *p = x + return p +} + +func (x SIPTrunkInfo_TrunkKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SIPTrunkInfo_TrunkKind) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_sip_proto_enumTypes[1].Descriptor() +} + +func (SIPTrunkInfo_TrunkKind) Type() protoreflect.EnumType { + return &file_livekit_sip_proto_enumTypes[1] +} + +func (x SIPTrunkInfo_TrunkKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SIPTrunkInfo_TrunkKind.Descriptor instead. +func (SIPTrunkInfo_TrunkKind) EnumDescriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{1, 0} +} + +// Deprecated: Marked as deprecated in livekit_sip.proto. type CreateSIPTrunkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -226,12 +276,14 @@ func (x *CreateSIPTrunkRequest) GetMetadata() string { return "" } +// Deprecated: Marked as deprecated in livekit_sip.proto. type SIPTrunkInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SipTrunkId string `protobuf:"bytes,1,opt,name=sip_trunk_id,json=sipTrunkId,proto3" json:"sip_trunk_id,omitempty"` + SipTrunkId string `protobuf:"bytes,1,opt,name=sip_trunk_id,json=sipTrunkId,proto3" json:"sip_trunk_id,omitempty"` + Kind SIPTrunkInfo_TrunkKind `protobuf:"varint,14,opt,name=kind,proto3,enum=livekit.SIPTrunkInfo_TrunkKind" json:"kind,omitempty"` // CIDR or IPs that traffic is accepted from // An empty list means all inbound traffic is accepted. InboundAddresses []string `protobuf:"bytes,2,rep,name=inbound_addresses,json=inboundAddresses,proto3" json:"inbound_addresses,omitempty"` @@ -298,6 +350,13 @@ func (x *SIPTrunkInfo) GetSipTrunkId() string { return "" } +func (x *SIPTrunkInfo) GetKind() SIPTrunkInfo_TrunkKind { + if x != nil { + return x.Kind + } + return SIPTrunkInfo_TRUNK_LEGACY +} + func (x *SIPTrunkInfo) GetInboundAddresses() []string { if x != nil { return x.InboundAddresses @@ -319,93 +378,583 @@ func (x *SIPTrunkInfo) GetOutboundNumber() string { return "" } -func (x *SIPTrunkInfo) GetTransport() SIPTransport { - if x != nil { - return x.Transport - } - return SIPTransport_SIP_TRANSPORT_AUTO +func (x *SIPTrunkInfo) GetTransport() SIPTransport { + if x != nil { + return x.Transport + } + return SIPTransport_SIP_TRANSPORT_AUTO +} + +// Deprecated: Marked as deprecated in livekit_sip.proto. +func (x *SIPTrunkInfo) GetInboundNumbersRegex() []string { + if x != nil { + return x.InboundNumbersRegex + } + return nil +} + +func (x *SIPTrunkInfo) GetInboundNumbers() []string { + if x != nil { + return x.InboundNumbers + } + return nil +} + +func (x *SIPTrunkInfo) GetInboundUsername() string { + if x != nil { + return x.InboundUsername + } + return "" +} + +func (x *SIPTrunkInfo) GetInboundPassword() string { + if x != nil { + return x.InboundPassword + } + return "" +} + +func (x *SIPTrunkInfo) GetOutboundUsername() string { + if x != nil { + return x.OutboundUsername + } + return "" +} + +func (x *SIPTrunkInfo) GetOutboundPassword() string { + if x != nil { + return x.OutboundPassword + } + return "" +} + +func (x *SIPTrunkInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SIPTrunkInfo) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +type CreateSIPInboundTrunkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Trunk *SIPInboundTrunkInfo `protobuf:"bytes,1,opt,name=trunk,proto3" json:"trunk,omitempty"` // Trunk ID is ignored +} + +func (x *CreateSIPInboundTrunkRequest) Reset() { + *x = CreateSIPInboundTrunkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateSIPInboundTrunkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSIPInboundTrunkRequest) ProtoMessage() {} + +func (x *CreateSIPInboundTrunkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSIPInboundTrunkRequest.ProtoReflect.Descriptor instead. +func (*CreateSIPInboundTrunkRequest) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateSIPInboundTrunkRequest) GetTrunk() *SIPInboundTrunkInfo { + if x != nil { + return x.Trunk + } + return nil +} + +type SIPInboundTrunkInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SipTrunkId string `protobuf:"bytes,1,opt,name=sip_trunk_id,json=sipTrunkId,proto3" json:"sip_trunk_id,omitempty"` + // Human-readable name for the Trunk. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // User-defined metadata for the Trunk. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Numbers associated with LiveKit SIP. The Trunk will only accept calls made to these numbers. + // Creating multiple Trunks with different phone numbers allows having different rules for a single provider. + Numbers []string `protobuf:"bytes,4,rep,name=numbers,proto3" json:"numbers,omitempty"` + // CIDR or IPs that traffic is accepted from. + // An empty list means all inbound traffic is accepted. + AllowedAddresses []string `protobuf:"bytes,5,rep,name=allowed_addresses,json=allowedAddresses,proto3" json:"allowed_addresses,omitempty"` + // Numbers that are allowed to make calls to this Trunk. + // An empty list means calls from any phone number is accepted. + AllowedNumbers []string `protobuf:"bytes,6,rep,name=allowed_numbers,json=allowedNumbers,proto3" json:"allowed_numbers,omitempty"` + // Username and password used to authenticate inbound SIP invites. + // May be empty to have no authentication. + AuthUsername string `protobuf:"bytes,7,opt,name=auth_username,json=authUsername,proto3" json:"auth_username,omitempty"` + AuthPassword string `protobuf:"bytes,8,opt,name=auth_password,json=authPassword,proto3" json:"auth_password,omitempty"` +} + +func (x *SIPInboundTrunkInfo) Reset() { + *x = SIPInboundTrunkInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SIPInboundTrunkInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SIPInboundTrunkInfo) ProtoMessage() {} + +func (x *SIPInboundTrunkInfo) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SIPInboundTrunkInfo.ProtoReflect.Descriptor instead. +func (*SIPInboundTrunkInfo) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{3} +} + +func (x *SIPInboundTrunkInfo) GetSipTrunkId() string { + if x != nil { + return x.SipTrunkId + } + return "" +} + +func (x *SIPInboundTrunkInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SIPInboundTrunkInfo) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +func (x *SIPInboundTrunkInfo) GetNumbers() []string { + if x != nil { + return x.Numbers + } + return nil +} + +func (x *SIPInboundTrunkInfo) GetAllowedAddresses() []string { + if x != nil { + return x.AllowedAddresses + } + return nil +} + +func (x *SIPInboundTrunkInfo) GetAllowedNumbers() []string { + if x != nil { + return x.AllowedNumbers + } + return nil +} + +func (x *SIPInboundTrunkInfo) GetAuthUsername() string { + if x != nil { + return x.AuthUsername + } + return "" +} + +func (x *SIPInboundTrunkInfo) GetAuthPassword() string { + if x != nil { + return x.AuthPassword + } + return "" +} + +type CreateSIPOutboundTrunkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Trunk *SIPOutboundTrunkInfo `protobuf:"bytes,1,opt,name=trunk,proto3" json:"trunk,omitempty"` // Trunk ID is ignored +} + +func (x *CreateSIPOutboundTrunkRequest) Reset() { + *x = CreateSIPOutboundTrunkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateSIPOutboundTrunkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSIPOutboundTrunkRequest) ProtoMessage() {} + +func (x *CreateSIPOutboundTrunkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSIPOutboundTrunkRequest.ProtoReflect.Descriptor instead. +func (*CreateSIPOutboundTrunkRequest) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateSIPOutboundTrunkRequest) GetTrunk() *SIPOutboundTrunkInfo { + if x != nil { + return x.Trunk + } + return nil +} + +type SIPOutboundTrunkInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SipTrunkId string `protobuf:"bytes,1,opt,name=sip_trunk_id,json=sipTrunkId,proto3" json:"sip_trunk_id,omitempty"` + // Human-readable name for the Trunk. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // User-defined metadata for the Trunk. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Hostname or IP that SIP INVITE is sent too. + // Note that this is not a SIP URI and should not contain the 'sip:' protocol prefix. + Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` + // SIP Transport used for outbound call. + Transport SIPTransport `protobuf:"varint,5,opt,name=transport,proto3,enum=livekit.SIPTransport" json:"transport,omitempty"` + // Numbers used to make the calls. Random one from this list will be selected. + Numbers []string `protobuf:"bytes,6,rep,name=numbers,proto3" json:"numbers,omitempty"` + // Username and password used to authenticate with SIP server. + // May be empty to have no authentication. + AuthUsername string `protobuf:"bytes,7,opt,name=auth_username,json=authUsername,proto3" json:"auth_username,omitempty"` + AuthPassword string `protobuf:"bytes,8,opt,name=auth_password,json=authPassword,proto3" json:"auth_password,omitempty"` +} + +func (x *SIPOutboundTrunkInfo) Reset() { + *x = SIPOutboundTrunkInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SIPOutboundTrunkInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SIPOutboundTrunkInfo) ProtoMessage() {} + +func (x *SIPOutboundTrunkInfo) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SIPOutboundTrunkInfo.ProtoReflect.Descriptor instead. +func (*SIPOutboundTrunkInfo) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{5} +} + +func (x *SIPOutboundTrunkInfo) GetSipTrunkId() string { + if x != nil { + return x.SipTrunkId + } + return "" +} + +func (x *SIPOutboundTrunkInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SIPOutboundTrunkInfo) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +func (x *SIPOutboundTrunkInfo) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *SIPOutboundTrunkInfo) GetTransport() SIPTransport { + if x != nil { + return x.Transport + } + return SIPTransport_SIP_TRANSPORT_AUTO +} + +func (x *SIPOutboundTrunkInfo) GetNumbers() []string { + if x != nil { + return x.Numbers + } + return nil +} + +func (x *SIPOutboundTrunkInfo) GetAuthUsername() string { + if x != nil { + return x.AuthUsername + } + return "" +} + +func (x *SIPOutboundTrunkInfo) GetAuthPassword() string { + if x != nil { + return x.AuthPassword + } + return "" +} + +// Deprecated: Marked as deprecated in livekit_sip.proto. +type ListSIPTrunkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListSIPTrunkRequest) Reset() { + *x = ListSIPTrunkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSIPTrunkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSIPTrunkRequest) ProtoMessage() {} + +func (x *ListSIPTrunkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSIPTrunkRequest.ProtoReflect.Descriptor instead. +func (*ListSIPTrunkRequest) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{6} +} + +// Deprecated: Marked as deprecated in livekit_sip.proto. +type ListSIPTrunkResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*SIPTrunkInfo `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ListSIPTrunkResponse) Reset() { + *x = ListSIPTrunkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSIPTrunkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSIPTrunkResponse) ProtoMessage() {} + +func (x *ListSIPTrunkResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSIPTrunkResponse.ProtoReflect.Descriptor instead. +func (*ListSIPTrunkResponse) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{7} +} + +func (x *ListSIPTrunkResponse) GetItems() []*SIPTrunkInfo { + if x != nil { + return x.Items + } + return nil +} + +type ListSIPInboundTrunkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListSIPInboundTrunkRequest) Reset() { + *x = ListSIPInboundTrunkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSIPInboundTrunkRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -// Deprecated: Marked as deprecated in livekit_sip.proto. -func (x *SIPTrunkInfo) GetInboundNumbersRegex() []string { - if x != nil { - return x.InboundNumbersRegex +func (*ListSIPInboundTrunkRequest) ProtoMessage() {} + +func (x *ListSIPInboundTrunkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *SIPTrunkInfo) GetInboundNumbers() []string { - if x != nil { - return x.InboundNumbers - } - return nil +// Deprecated: Use ListSIPInboundTrunkRequest.ProtoReflect.Descriptor instead. +func (*ListSIPInboundTrunkRequest) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{8} } -func (x *SIPTrunkInfo) GetInboundUsername() string { - if x != nil { - return x.InboundUsername - } - return "" +type ListSIPInboundTrunkResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*SIPInboundTrunkInfo `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` } -func (x *SIPTrunkInfo) GetInboundPassword() string { - if x != nil { - return x.InboundPassword +func (x *ListSIPInboundTrunkResponse) Reset() { + *x = ListSIPInboundTrunkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_livekit_sip_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (x *SIPTrunkInfo) GetOutboundUsername() string { - if x != nil { - return x.OutboundUsername - } - return "" +func (x *ListSIPInboundTrunkResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *SIPTrunkInfo) GetOutboundPassword() string { - if x != nil { - return x.OutboundPassword +func (*ListSIPInboundTrunkResponse) ProtoMessage() {} + +func (x *ListSIPInboundTrunkResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *SIPTrunkInfo) GetName() string { - if x != nil { - return x.Name - } - return "" +// Deprecated: Use ListSIPInboundTrunkResponse.ProtoReflect.Descriptor instead. +func (*ListSIPInboundTrunkResponse) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{9} } -func (x *SIPTrunkInfo) GetMetadata() string { +func (x *ListSIPInboundTrunkResponse) GetItems() []*SIPInboundTrunkInfo { if x != nil { - return x.Metadata + return x.Items } - return "" + return nil } -type ListSIPTrunkRequest struct { +type ListSIPOutboundTrunkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *ListSIPTrunkRequest) Reset() { - *x = ListSIPTrunkRequest{} +func (x *ListSIPOutboundTrunkRequest) Reset() { + *x = ListSIPOutboundTrunkRequest{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[2] + mi := &file_livekit_sip_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListSIPTrunkRequest) String() string { +func (x *ListSIPOutboundTrunkRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListSIPTrunkRequest) ProtoMessage() {} +func (*ListSIPOutboundTrunkRequest) ProtoMessage() {} -func (x *ListSIPTrunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[2] +func (x *ListSIPOutboundTrunkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -416,36 +965,36 @@ func (x *ListSIPTrunkRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListSIPTrunkRequest.ProtoReflect.Descriptor instead. -func (*ListSIPTrunkRequest) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{2} +// Deprecated: Use ListSIPOutboundTrunkRequest.ProtoReflect.Descriptor instead. +func (*ListSIPOutboundTrunkRequest) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{10} } -type ListSIPTrunkResponse struct { +type ListSIPOutboundTrunkResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Items []*SIPTrunkInfo `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Items []*SIPOutboundTrunkInfo `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` } -func (x *ListSIPTrunkResponse) Reset() { - *x = ListSIPTrunkResponse{} +func (x *ListSIPOutboundTrunkResponse) Reset() { + *x = ListSIPOutboundTrunkResponse{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[3] + mi := &file_livekit_sip_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListSIPTrunkResponse) String() string { +func (x *ListSIPOutboundTrunkResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListSIPTrunkResponse) ProtoMessage() {} +func (*ListSIPOutboundTrunkResponse) ProtoMessage() {} -func (x *ListSIPTrunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[3] +func (x *ListSIPOutboundTrunkResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_sip_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -456,12 +1005,12 @@ func (x *ListSIPTrunkResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListSIPTrunkResponse.ProtoReflect.Descriptor instead. -func (*ListSIPTrunkResponse) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{3} +// Deprecated: Use ListSIPOutboundTrunkResponse.ProtoReflect.Descriptor instead. +func (*ListSIPOutboundTrunkResponse) Descriptor() ([]byte, []int) { + return file_livekit_sip_proto_rawDescGZIP(), []int{11} } -func (x *ListSIPTrunkResponse) GetItems() []*SIPTrunkInfo { +func (x *ListSIPOutboundTrunkResponse) GetItems() []*SIPOutboundTrunkInfo { if x != nil { return x.Items } @@ -479,7 +1028,7 @@ type DeleteSIPTrunkRequest struct { func (x *DeleteSIPTrunkRequest) Reset() { *x = DeleteSIPTrunkRequest{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[4] + mi := &file_livekit_sip_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -492,7 +1041,7 @@ func (x *DeleteSIPTrunkRequest) String() string { func (*DeleteSIPTrunkRequest) ProtoMessage() {} func (x *DeleteSIPTrunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[4] + mi := &file_livekit_sip_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -505,7 +1054,7 @@ func (x *DeleteSIPTrunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteSIPTrunkRequest.ProtoReflect.Descriptor instead. func (*DeleteSIPTrunkRequest) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{4} + return file_livekit_sip_proto_rawDescGZIP(), []int{12} } func (x *DeleteSIPTrunkRequest) GetSipTrunkId() string { @@ -529,7 +1078,7 @@ type SIPDispatchRuleDirect struct { func (x *SIPDispatchRuleDirect) Reset() { *x = SIPDispatchRuleDirect{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[5] + mi := &file_livekit_sip_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -542,7 +1091,7 @@ func (x *SIPDispatchRuleDirect) String() string { func (*SIPDispatchRuleDirect) ProtoMessage() {} func (x *SIPDispatchRuleDirect) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[5] + mi := &file_livekit_sip_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -555,7 +1104,7 @@ func (x *SIPDispatchRuleDirect) ProtoReflect() protoreflect.Message { // Deprecated: Use SIPDispatchRuleDirect.ProtoReflect.Descriptor instead. func (*SIPDispatchRuleDirect) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{5} + return file_livekit_sip_proto_rawDescGZIP(), []int{13} } func (x *SIPDispatchRuleDirect) GetRoomName() string { @@ -586,7 +1135,7 @@ type SIPDispatchRuleIndividual struct { func (x *SIPDispatchRuleIndividual) Reset() { *x = SIPDispatchRuleIndividual{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[6] + mi := &file_livekit_sip_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -599,7 +1148,7 @@ func (x *SIPDispatchRuleIndividual) String() string { func (*SIPDispatchRuleIndividual) ProtoMessage() {} func (x *SIPDispatchRuleIndividual) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[6] + mi := &file_livekit_sip_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -612,7 +1161,7 @@ func (x *SIPDispatchRuleIndividual) ProtoReflect() protoreflect.Message { // Deprecated: Use SIPDispatchRuleIndividual.ProtoReflect.Descriptor instead. func (*SIPDispatchRuleIndividual) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{6} + return file_livekit_sip_proto_rawDescGZIP(), []int{14} } func (x *SIPDispatchRuleIndividual) GetRoomPrefix() string { @@ -644,7 +1193,7 @@ type SIPDispatchRule struct { func (x *SIPDispatchRule) Reset() { *x = SIPDispatchRule{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[7] + mi := &file_livekit_sip_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -657,7 +1206,7 @@ func (x *SIPDispatchRule) String() string { func (*SIPDispatchRule) ProtoMessage() {} func (x *SIPDispatchRule) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[7] + mi := &file_livekit_sip_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -670,7 +1219,7 @@ func (x *SIPDispatchRule) ProtoReflect() protoreflect.Message { // Deprecated: Use SIPDispatchRule.ProtoReflect.Descriptor instead. func (*SIPDispatchRule) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{7} + return file_livekit_sip_proto_rawDescGZIP(), []int{15} } func (m *SIPDispatchRule) GetRule() isSIPDispatchRule_Rule { @@ -737,7 +1286,7 @@ type CreateSIPDispatchRuleRequest struct { func (x *CreateSIPDispatchRuleRequest) Reset() { *x = CreateSIPDispatchRuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[8] + mi := &file_livekit_sip_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -750,7 +1299,7 @@ func (x *CreateSIPDispatchRuleRequest) String() string { func (*CreateSIPDispatchRuleRequest) ProtoMessage() {} func (x *CreateSIPDispatchRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[8] + mi := &file_livekit_sip_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -763,7 +1312,7 @@ func (x *CreateSIPDispatchRuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateSIPDispatchRuleRequest.ProtoReflect.Descriptor instead. func (*CreateSIPDispatchRuleRequest) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{8} + return file_livekit_sip_proto_rawDescGZIP(), []int{16} } func (x *CreateSIPDispatchRuleRequest) GetRule() *SIPDispatchRule { @@ -829,7 +1378,7 @@ type SIPDispatchRuleInfo struct { func (x *SIPDispatchRuleInfo) Reset() { *x = SIPDispatchRuleInfo{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[9] + mi := &file_livekit_sip_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -842,7 +1391,7 @@ func (x *SIPDispatchRuleInfo) String() string { func (*SIPDispatchRuleInfo) ProtoMessage() {} func (x *SIPDispatchRuleInfo) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[9] + mi := &file_livekit_sip_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -855,7 +1404,7 @@ func (x *SIPDispatchRuleInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SIPDispatchRuleInfo.ProtoReflect.Descriptor instead. func (*SIPDispatchRuleInfo) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{9} + return file_livekit_sip_proto_rawDescGZIP(), []int{17} } func (x *SIPDispatchRuleInfo) GetSipDispatchRuleId() string { @@ -916,7 +1465,7 @@ type ListSIPDispatchRuleRequest struct { func (x *ListSIPDispatchRuleRequest) Reset() { *x = ListSIPDispatchRuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[10] + mi := &file_livekit_sip_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -929,7 +1478,7 @@ func (x *ListSIPDispatchRuleRequest) String() string { func (*ListSIPDispatchRuleRequest) ProtoMessage() {} func (x *ListSIPDispatchRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[10] + mi := &file_livekit_sip_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -942,7 +1491,7 @@ func (x *ListSIPDispatchRuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSIPDispatchRuleRequest.ProtoReflect.Descriptor instead. func (*ListSIPDispatchRuleRequest) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{10} + return file_livekit_sip_proto_rawDescGZIP(), []int{18} } type ListSIPDispatchRuleResponse struct { @@ -956,7 +1505,7 @@ type ListSIPDispatchRuleResponse struct { func (x *ListSIPDispatchRuleResponse) Reset() { *x = ListSIPDispatchRuleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[11] + mi := &file_livekit_sip_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -969,7 +1518,7 @@ func (x *ListSIPDispatchRuleResponse) String() string { func (*ListSIPDispatchRuleResponse) ProtoMessage() {} func (x *ListSIPDispatchRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[11] + mi := &file_livekit_sip_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -982,7 +1531,7 @@ func (x *ListSIPDispatchRuleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSIPDispatchRuleResponse.ProtoReflect.Descriptor instead. func (*ListSIPDispatchRuleResponse) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{11} + return file_livekit_sip_proto_rawDescGZIP(), []int{19} } func (x *ListSIPDispatchRuleResponse) GetItems() []*SIPDispatchRuleInfo { @@ -1003,7 +1552,7 @@ type DeleteSIPDispatchRuleRequest struct { func (x *DeleteSIPDispatchRuleRequest) Reset() { *x = DeleteSIPDispatchRuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[12] + mi := &file_livekit_sip_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1016,7 +1565,7 @@ func (x *DeleteSIPDispatchRuleRequest) String() string { func (*DeleteSIPDispatchRuleRequest) ProtoMessage() {} func (x *DeleteSIPDispatchRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[12] + mi := &file_livekit_sip_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1029,7 +1578,7 @@ func (x *DeleteSIPDispatchRuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteSIPDispatchRuleRequest.ProtoReflect.Descriptor instead. func (*DeleteSIPDispatchRuleRequest) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{12} + return file_livekit_sip_proto_rawDescGZIP(), []int{20} } func (x *DeleteSIPDispatchRuleRequest) GetSipDispatchRuleId() string { @@ -1068,7 +1617,7 @@ type CreateSIPParticipantRequest struct { func (x *CreateSIPParticipantRequest) Reset() { *x = CreateSIPParticipantRequest{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[13] + mi := &file_livekit_sip_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1081,7 +1630,7 @@ func (x *CreateSIPParticipantRequest) String() string { func (*CreateSIPParticipantRequest) ProtoMessage() {} func (x *CreateSIPParticipantRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[13] + mi := &file_livekit_sip_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1094,7 +1643,7 @@ func (x *CreateSIPParticipantRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateSIPParticipantRequest.ProtoReflect.Descriptor instead. func (*CreateSIPParticipantRequest) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{13} + return file_livekit_sip_proto_rawDescGZIP(), []int{21} } func (x *CreateSIPParticipantRequest) GetSipTrunkId() string { @@ -1167,7 +1716,7 @@ type SIPParticipantInfo struct { func (x *SIPParticipantInfo) Reset() { *x = SIPParticipantInfo{} if protoimpl.UnsafeEnabled { - mi := &file_livekit_sip_proto_msgTypes[14] + mi := &file_livekit_sip_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1180,7 +1729,7 @@ func (x *SIPParticipantInfo) String() string { func (*SIPParticipantInfo) ProtoMessage() {} func (x *SIPParticipantInfo) ProtoReflect() protoreflect.Message { - mi := &file_livekit_sip_proto_msgTypes[14] + mi := &file_livekit_sip_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1193,7 +1742,7 @@ func (x *SIPParticipantInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SIPParticipantInfo.ProtoReflect.Descriptor instead. func (*SIPParticipantInfo) Descriptor() ([]byte, []int) { - return file_livekit_sip_proto_rawDescGZIP(), []int{14} + return file_livekit_sip_proto_rawDescGZIP(), []int{22} } func (x *SIPParticipantInfo) GetParticipantId() string { @@ -1228,7 +1777,7 @@ var File_livekit_sip_proto protoreflect.FileDescriptor var file_livekit_sip_proto_rawDesc = []byte{ 0x0a, 0x11, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x5f, 0x73, 0x69, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x22, 0xd9, 0x03, 0x0a, + 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x22, 0xdd, 0x03, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, @@ -1258,200 +1807,294 @@ var file_livekit_sip_proto_rawDesc = []byte{ 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa7, 0x04, 0x0a, 0x0c, 0x53, 0x49, 0x50, - 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x69, 0x70, - 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x69, 0x70, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x69, - 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x75, 0x74, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x09, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x12, 0x36, 0x0a, 0x15, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, - 0x42, 0x02, 0x18, 0x01, 0x52, 0x13, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, - 0x10, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, - 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x14, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, - 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x39, - 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x69, 0x70, 0x5f, 0x74, - 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x69, 0x70, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x15, 0x53, 0x49, 0x50, - 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x44, 0x69, 0x72, 0x65, - 0x63, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x70, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, - 0x6e, 0x22, 0x4e, 0x0a, 0x19, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x12, 0x1f, - 0x0a, 0x0b, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x6f, 0x6f, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, - 0x10, 0x0a, 0x03, 0x70, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, - 0x6e, 0x22, 0xcd, 0x01, 0x0a, 0x0f, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x52, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, - 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, - 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x44, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x75, 0x6c, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x5e, 0x0a, 0x18, 0x64, 0x69, 0x73, - 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x76, - 0x69, 0x64, 0x75, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x48, - 0x00, 0x52, 0x16, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, - 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, - 0x65, 0x22, 0xee, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, - 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, - 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x2a, 0x0a, - 0x11, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x68, 0x69, 0x64, 0x65, 0x50, 0x68, - 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x96, 0x02, 0x0a, 0x13, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x69, - 0x70, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x69, 0x70, 0x44, 0x69, 0x73, - 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x72, - 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, - 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x75, - 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x72, - 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x70, - 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0f, 0x68, 0x69, 0x64, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, - 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x4f, 0x0a, 0x1c, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x14, - 0x73, 0x69, 0x70, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x69, 0x70, 0x44, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xc6, 0x02, - 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x50, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xa6, 0x05, 0x0a, + 0x0c, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x69, 0x70, 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x69, 0x70, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x12, - 0x1e, 0x0a, 0x0b, 0x73, 0x69, 0x70, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x6f, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x6f, 0x12, - 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x72, 0x74, - 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x29, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x74, 0x6d, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x6d, - 0x66, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x74, 0x6f, - 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x69, - 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x12, 0x53, 0x49, 0x50, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, - 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x69, 0x70, 0x5f, 0x63, 0x61, 0x6c, 0x6c, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x70, 0x43, 0x61, - 0x6c, 0x6c, 0x49, 0x64, 0x2a, 0x6b, 0x0a, 0x0c, 0x53, 0x49, 0x50, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x49, 0x50, 0x5f, 0x54, 0x52, 0x41, 0x4e, - 0x53, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, - 0x53, 0x49, 0x50, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x44, - 0x50, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x49, 0x50, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, - 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x49, - 0x50, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x54, 0x4c, 0x53, 0x10, - 0x03, 0x32, 0xdd, 0x04, 0x0a, 0x03, 0x53, 0x49, 0x50, 0x12, 0x47, 0x0a, 0x0e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x1e, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, - 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x4b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, - 0x6e, 0x6b, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x47, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, - 0x6b, 0x12, 0x1e, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, - 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5c, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, - 0x65, 0x12, 0x25, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, - 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x60, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, - 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x2e, - 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x44, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, - 0x65, 0x12, 0x25, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x33, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x10, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x75, 0x74, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, + 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, + 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x36, 0x0a, 0x15, 0x69, 0x6e, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, + 0x67, 0x65, 0x78, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x13, 0x69, + 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x67, + 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x62, + 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, + 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, + 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x44, 0x0a, 0x09, 0x54, + 0x72, 0x75, 0x6e, 0x6b, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x52, 0x55, 0x4e, + 0x4b, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x52, + 0x55, 0x4e, 0x4b, 0x5f, 0x49, 0x4e, 0x42, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, + 0x0e, 0x54, 0x52, 0x55, 0x4e, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x42, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x02, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x52, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x49, 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, + 0x49, 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x05, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x22, 0xa1, 0x02, 0x0a, 0x13, 0x53, 0x49, + 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x69, 0x70, 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x69, 0x70, 0x54, 0x72, 0x75, 0x6e, + 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x0a, + 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, + 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, + 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x61, 0x75, 0x74, 0x68, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x54, 0x0a, + 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, + 0x0a, 0x05, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x74, 0x72, + 0x75, 0x6e, 0x6b, 0x22, 0x9b, 0x02, 0x0a, 0x14, 0x53, 0x49, 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0c, + 0x73, 0x69, 0x70, 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x73, 0x69, 0x70, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, 0x69, + 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x61, 0x75, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x22, 0x19, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x47, 0x0a, 0x14, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, + 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, + 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x49, 0x6e, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x49, + 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, + 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, + 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, + 0x49, 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x39, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x69, 0x70, 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x6b, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x69, 0x70, 0x54, 0x72, + 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x15, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x6e, 0x22, 0x4e, 0x0a, + 0x19, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, + 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, + 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x72, 0x6f, 0x6f, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x6e, 0x22, 0xcd, 0x01, + 0x0a, 0x0f, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, + 0x65, 0x12, 0x52, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, + 0x6c, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, + 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x48, + 0x00, 0x52, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x44, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x5e, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, + 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, + 0x65, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x16, 0x64, + 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x76, + 0x69, 0x64, 0x75, 0x61, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0xee, 0x01, + 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, + 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x69, 0x64, + 0x65, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x68, 0x69, 0x64, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, + 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x96, + 0x02, 0x0a, 0x13, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, + 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x69, 0x70, 0x5f, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x69, 0x70, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, + 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x49, + 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x68, + 0x69, 0x64, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, + 0x0a, 0x0f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, + 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, + 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x4f, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, - 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x59, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x53, 0x49, 0x50, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x24, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x69, 0x70, 0x5f, + 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x69, 0x70, 0x44, 0x69, 0x73, 0x70, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xc6, 0x02, 0x0a, 0x1b, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x69, 0x70, + 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x73, 0x69, 0x70, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, + 0x69, 0x70, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x69, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x6d, + 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x6d, 0x66, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x74, 0x6f, + 0x6e, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x12, 0x53, 0x49, 0x50, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x31, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x69, 0x70, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, + 0x2a, 0x6b, 0x0a, 0x0c, 0x53, 0x49, 0x50, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x16, 0x0a, 0x12, 0x53, 0x49, 0x50, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x52, + 0x54, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x49, 0x50, 0x5f, + 0x54, 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x44, 0x50, 0x10, 0x01, 0x12, + 0x15, 0x0a, 0x11, 0x53, 0x49, 0x50, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x52, 0x54, + 0x5f, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x49, 0x50, 0x5f, 0x54, 0x52, + 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x54, 0x4c, 0x53, 0x10, 0x03, 0x32, 0xed, 0x07, + 0x0a, 0x03, 0x53, 0x49, 0x50, 0x12, 0x4c, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x1e, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, + 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, + 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x03, + 0x88, 0x02, 0x01, 0x12, 0x50, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, + 0x75, 0x6e, 0x6b, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x03, 0x88, 0x02, 0x01, 0x12, 0x5c, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x49, 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x25, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x49, 0x50, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, - 0x49, 0x50, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x42, 0x46, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0xaa, 0x02, 0x0d, 0x4c, 0x69, 0x76, 0x65, 0x4b, - 0x69, 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xea, 0x02, 0x0e, 0x4c, 0x69, 0x76, 0x65, 0x4b, - 0x69, 0x74, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x49, 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, + 0x53, 0x49, 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x5f, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, + 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x26, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, + 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, + 0x53, 0x49, 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x60, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x49, + 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x23, 0x2e, 0x6c, 0x69, + 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x49, 0x6e, 0x62, + 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x49, 0x50, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, + 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x24, + 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, + 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, + 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x12, 0x1e, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, + 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x54, 0x72, 0x75, 0x6e, 0x6b, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5c, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, + 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x25, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, + 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, + 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x60, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, + 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x2e, 0x6c, 0x69, 0x76, 0x65, + 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x49, 0x50, + 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, + 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x25, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x49, + 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, + 0x49, 0x50, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x59, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x6c, 0x69, 0x76, + 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x49, 0x50, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x49, 0x50, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x46, 0x5a, + 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, + 0x6b, 0x69, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6c, 0x69, 0x76, + 0x65, 0x6b, 0x69, 0x74, 0xaa, 0x02, 0x0d, 0x4c, 0x69, 0x76, 0x65, 0x4b, 0x69, 0x74, 0x2e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0xea, 0x02, 0x0e, 0x4c, 0x69, 0x76, 0x65, 0x4b, 0x69, 0x74, 0x3a, 0x3a, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1466,53 +2109,76 @@ func file_livekit_sip_proto_rawDescGZIP() []byte { return file_livekit_sip_proto_rawDescData } -var file_livekit_sip_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_livekit_sip_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_livekit_sip_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_livekit_sip_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_livekit_sip_proto_goTypes = []any{ - (SIPTransport)(0), // 0: livekit.SIPTransport - (*CreateSIPTrunkRequest)(nil), // 1: livekit.CreateSIPTrunkRequest - (*SIPTrunkInfo)(nil), // 2: livekit.SIPTrunkInfo - (*ListSIPTrunkRequest)(nil), // 3: livekit.ListSIPTrunkRequest - (*ListSIPTrunkResponse)(nil), // 4: livekit.ListSIPTrunkResponse - (*DeleteSIPTrunkRequest)(nil), // 5: livekit.DeleteSIPTrunkRequest - (*SIPDispatchRuleDirect)(nil), // 6: livekit.SIPDispatchRuleDirect - (*SIPDispatchRuleIndividual)(nil), // 7: livekit.SIPDispatchRuleIndividual - (*SIPDispatchRule)(nil), // 8: livekit.SIPDispatchRule - (*CreateSIPDispatchRuleRequest)(nil), // 9: livekit.CreateSIPDispatchRuleRequest - (*SIPDispatchRuleInfo)(nil), // 10: livekit.SIPDispatchRuleInfo - (*ListSIPDispatchRuleRequest)(nil), // 11: livekit.ListSIPDispatchRuleRequest - (*ListSIPDispatchRuleResponse)(nil), // 12: livekit.ListSIPDispatchRuleResponse - (*DeleteSIPDispatchRuleRequest)(nil), // 13: livekit.DeleteSIPDispatchRuleRequest - (*CreateSIPParticipantRequest)(nil), // 14: livekit.CreateSIPParticipantRequest - (*SIPParticipantInfo)(nil), // 15: livekit.SIPParticipantInfo + (SIPTransport)(0), // 0: livekit.SIPTransport + (SIPTrunkInfo_TrunkKind)(0), // 1: livekit.SIPTrunkInfo.TrunkKind + (*CreateSIPTrunkRequest)(nil), // 2: livekit.CreateSIPTrunkRequest + (*SIPTrunkInfo)(nil), // 3: livekit.SIPTrunkInfo + (*CreateSIPInboundTrunkRequest)(nil), // 4: livekit.CreateSIPInboundTrunkRequest + (*SIPInboundTrunkInfo)(nil), // 5: livekit.SIPInboundTrunkInfo + (*CreateSIPOutboundTrunkRequest)(nil), // 6: livekit.CreateSIPOutboundTrunkRequest + (*SIPOutboundTrunkInfo)(nil), // 7: livekit.SIPOutboundTrunkInfo + (*ListSIPTrunkRequest)(nil), // 8: livekit.ListSIPTrunkRequest + (*ListSIPTrunkResponse)(nil), // 9: livekit.ListSIPTrunkResponse + (*ListSIPInboundTrunkRequest)(nil), // 10: livekit.ListSIPInboundTrunkRequest + (*ListSIPInboundTrunkResponse)(nil), // 11: livekit.ListSIPInboundTrunkResponse + (*ListSIPOutboundTrunkRequest)(nil), // 12: livekit.ListSIPOutboundTrunkRequest + (*ListSIPOutboundTrunkResponse)(nil), // 13: livekit.ListSIPOutboundTrunkResponse + (*DeleteSIPTrunkRequest)(nil), // 14: livekit.DeleteSIPTrunkRequest + (*SIPDispatchRuleDirect)(nil), // 15: livekit.SIPDispatchRuleDirect + (*SIPDispatchRuleIndividual)(nil), // 16: livekit.SIPDispatchRuleIndividual + (*SIPDispatchRule)(nil), // 17: livekit.SIPDispatchRule + (*CreateSIPDispatchRuleRequest)(nil), // 18: livekit.CreateSIPDispatchRuleRequest + (*SIPDispatchRuleInfo)(nil), // 19: livekit.SIPDispatchRuleInfo + (*ListSIPDispatchRuleRequest)(nil), // 20: livekit.ListSIPDispatchRuleRequest + (*ListSIPDispatchRuleResponse)(nil), // 21: livekit.ListSIPDispatchRuleResponse + (*DeleteSIPDispatchRuleRequest)(nil), // 22: livekit.DeleteSIPDispatchRuleRequest + (*CreateSIPParticipantRequest)(nil), // 23: livekit.CreateSIPParticipantRequest + (*SIPParticipantInfo)(nil), // 24: livekit.SIPParticipantInfo } var file_livekit_sip_proto_depIdxs = []int32{ - 0, // 0: livekit.SIPTrunkInfo.transport:type_name -> livekit.SIPTransport - 2, // 1: livekit.ListSIPTrunkResponse.items:type_name -> livekit.SIPTrunkInfo - 6, // 2: livekit.SIPDispatchRule.dispatch_rule_direct:type_name -> livekit.SIPDispatchRuleDirect - 7, // 3: livekit.SIPDispatchRule.dispatch_rule_individual:type_name -> livekit.SIPDispatchRuleIndividual - 8, // 4: livekit.CreateSIPDispatchRuleRequest.rule:type_name -> livekit.SIPDispatchRule - 8, // 5: livekit.SIPDispatchRuleInfo.rule:type_name -> livekit.SIPDispatchRule - 10, // 6: livekit.ListSIPDispatchRuleResponse.items:type_name -> livekit.SIPDispatchRuleInfo - 1, // 7: livekit.SIP.CreateSIPTrunk:input_type -> livekit.CreateSIPTrunkRequest - 3, // 8: livekit.SIP.ListSIPTrunk:input_type -> livekit.ListSIPTrunkRequest - 5, // 9: livekit.SIP.DeleteSIPTrunk:input_type -> livekit.DeleteSIPTrunkRequest - 9, // 10: livekit.SIP.CreateSIPDispatchRule:input_type -> livekit.CreateSIPDispatchRuleRequest - 11, // 11: livekit.SIP.ListSIPDispatchRule:input_type -> livekit.ListSIPDispatchRuleRequest - 13, // 12: livekit.SIP.DeleteSIPDispatchRule:input_type -> livekit.DeleteSIPDispatchRuleRequest - 14, // 13: livekit.SIP.CreateSIPParticipant:input_type -> livekit.CreateSIPParticipantRequest - 2, // 14: livekit.SIP.CreateSIPTrunk:output_type -> livekit.SIPTrunkInfo - 4, // 15: livekit.SIP.ListSIPTrunk:output_type -> livekit.ListSIPTrunkResponse - 2, // 16: livekit.SIP.DeleteSIPTrunk:output_type -> livekit.SIPTrunkInfo - 10, // 17: livekit.SIP.CreateSIPDispatchRule:output_type -> livekit.SIPDispatchRuleInfo - 12, // 18: livekit.SIP.ListSIPDispatchRule:output_type -> livekit.ListSIPDispatchRuleResponse - 10, // 19: livekit.SIP.DeleteSIPDispatchRule:output_type -> livekit.SIPDispatchRuleInfo - 15, // 20: livekit.SIP.CreateSIPParticipant:output_type -> livekit.SIPParticipantInfo - 14, // [14:21] is the sub-list for method output_type - 7, // [7:14] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 1, // 0: livekit.SIPTrunkInfo.kind:type_name -> livekit.SIPTrunkInfo.TrunkKind + 0, // 1: livekit.SIPTrunkInfo.transport:type_name -> livekit.SIPTransport + 5, // 2: livekit.CreateSIPInboundTrunkRequest.trunk:type_name -> livekit.SIPInboundTrunkInfo + 7, // 3: livekit.CreateSIPOutboundTrunkRequest.trunk:type_name -> livekit.SIPOutboundTrunkInfo + 0, // 4: livekit.SIPOutboundTrunkInfo.transport:type_name -> livekit.SIPTransport + 3, // 5: livekit.ListSIPTrunkResponse.items:type_name -> livekit.SIPTrunkInfo + 5, // 6: livekit.ListSIPInboundTrunkResponse.items:type_name -> livekit.SIPInboundTrunkInfo + 7, // 7: livekit.ListSIPOutboundTrunkResponse.items:type_name -> livekit.SIPOutboundTrunkInfo + 15, // 8: livekit.SIPDispatchRule.dispatch_rule_direct:type_name -> livekit.SIPDispatchRuleDirect + 16, // 9: livekit.SIPDispatchRule.dispatch_rule_individual:type_name -> livekit.SIPDispatchRuleIndividual + 17, // 10: livekit.CreateSIPDispatchRuleRequest.rule:type_name -> livekit.SIPDispatchRule + 17, // 11: livekit.SIPDispatchRuleInfo.rule:type_name -> livekit.SIPDispatchRule + 19, // 12: livekit.ListSIPDispatchRuleResponse.items:type_name -> livekit.SIPDispatchRuleInfo + 2, // 13: livekit.SIP.CreateSIPTrunk:input_type -> livekit.CreateSIPTrunkRequest + 8, // 14: livekit.SIP.ListSIPTrunk:input_type -> livekit.ListSIPTrunkRequest + 4, // 15: livekit.SIP.CreateSIPInboundTrunk:input_type -> livekit.CreateSIPInboundTrunkRequest + 6, // 16: livekit.SIP.CreateSIPOutboundTrunk:input_type -> livekit.CreateSIPOutboundTrunkRequest + 10, // 17: livekit.SIP.ListSIPInboundTrunk:input_type -> livekit.ListSIPInboundTrunkRequest + 12, // 18: livekit.SIP.ListSIPOutboundTrunk:input_type -> livekit.ListSIPOutboundTrunkRequest + 14, // 19: livekit.SIP.DeleteSIPTrunk:input_type -> livekit.DeleteSIPTrunkRequest + 18, // 20: livekit.SIP.CreateSIPDispatchRule:input_type -> livekit.CreateSIPDispatchRuleRequest + 20, // 21: livekit.SIP.ListSIPDispatchRule:input_type -> livekit.ListSIPDispatchRuleRequest + 22, // 22: livekit.SIP.DeleteSIPDispatchRule:input_type -> livekit.DeleteSIPDispatchRuleRequest + 23, // 23: livekit.SIP.CreateSIPParticipant:input_type -> livekit.CreateSIPParticipantRequest + 3, // 24: livekit.SIP.CreateSIPTrunk:output_type -> livekit.SIPTrunkInfo + 9, // 25: livekit.SIP.ListSIPTrunk:output_type -> livekit.ListSIPTrunkResponse + 5, // 26: livekit.SIP.CreateSIPInboundTrunk:output_type -> livekit.SIPInboundTrunkInfo + 7, // 27: livekit.SIP.CreateSIPOutboundTrunk:output_type -> livekit.SIPOutboundTrunkInfo + 11, // 28: livekit.SIP.ListSIPInboundTrunk:output_type -> livekit.ListSIPInboundTrunkResponse + 13, // 29: livekit.SIP.ListSIPOutboundTrunk:output_type -> livekit.ListSIPOutboundTrunkResponse + 3, // 30: livekit.SIP.DeleteSIPTrunk:output_type -> livekit.SIPTrunkInfo + 19, // 31: livekit.SIP.CreateSIPDispatchRule:output_type -> livekit.SIPDispatchRuleInfo + 21, // 32: livekit.SIP.ListSIPDispatchRule:output_type -> livekit.ListSIPDispatchRuleResponse + 19, // 33: livekit.SIP.DeleteSIPDispatchRule:output_type -> livekit.SIPDispatchRuleInfo + 24, // 34: livekit.SIP.CreateSIPParticipant:output_type -> livekit.SIPParticipantInfo + 24, // [24:35] is the sub-list for method output_type + 13, // [13:24] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_livekit_sip_proto_init() } @@ -1546,7 +2212,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ListSIPTrunkRequest); i { + switch v := v.(*CreateSIPInboundTrunkRequest); i { case 0: return &v.state case 1: @@ -1558,7 +2224,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*ListSIPTrunkResponse); i { + switch v := v.(*SIPInboundTrunkInfo); i { case 0: return &v.state case 1: @@ -1570,7 +2236,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*DeleteSIPTrunkRequest); i { + switch v := v.(*CreateSIPOutboundTrunkRequest); i { case 0: return &v.state case 1: @@ -1582,7 +2248,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*SIPDispatchRuleDirect); i { + switch v := v.(*SIPOutboundTrunkInfo); i { case 0: return &v.state case 1: @@ -1594,7 +2260,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*SIPDispatchRuleIndividual); i { + switch v := v.(*ListSIPTrunkRequest); i { case 0: return &v.state case 1: @@ -1606,7 +2272,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*SIPDispatchRule); i { + switch v := v.(*ListSIPTrunkResponse); i { case 0: return &v.state case 1: @@ -1618,7 +2284,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*CreateSIPDispatchRuleRequest); i { + switch v := v.(*ListSIPInboundTrunkRequest); i { case 0: return &v.state case 1: @@ -1630,7 +2296,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*SIPDispatchRuleInfo); i { + switch v := v.(*ListSIPInboundTrunkResponse); i { case 0: return &v.state case 1: @@ -1642,7 +2308,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*ListSIPDispatchRuleRequest); i { + switch v := v.(*ListSIPOutboundTrunkRequest); i { case 0: return &v.state case 1: @@ -1654,7 +2320,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*ListSIPDispatchRuleResponse); i { + switch v := v.(*ListSIPOutboundTrunkResponse); i { case 0: return &v.state case 1: @@ -1666,7 +2332,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*DeleteSIPDispatchRuleRequest); i { + switch v := v.(*DeleteSIPTrunkRequest); i { case 0: return &v.state case 1: @@ -1678,7 +2344,7 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*CreateSIPParticipantRequest); i { + switch v := v.(*SIPDispatchRuleDirect); i { case 0: return &v.state case 1: @@ -1690,6 +2356,102 @@ func file_livekit_sip_proto_init() { } } file_livekit_sip_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*SIPDispatchRuleIndividual); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*SIPDispatchRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[16].Exporter = func(v any, i int) any { + switch v := v.(*CreateSIPDispatchRuleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[17].Exporter = func(v any, i int) any { + switch v := v.(*SIPDispatchRuleInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[18].Exporter = func(v any, i int) any { + switch v := v.(*ListSIPDispatchRuleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[19].Exporter = func(v any, i int) any { + switch v := v.(*ListSIPDispatchRuleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[20].Exporter = func(v any, i int) any { + switch v := v.(*DeleteSIPDispatchRuleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[21].Exporter = func(v any, i int) any { + switch v := v.(*CreateSIPParticipantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_livekit_sip_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*SIPParticipantInfo); i { case 0: return &v.state @@ -1702,7 +2464,7 @@ func file_livekit_sip_proto_init() { } } } - file_livekit_sip_proto_msgTypes[7].OneofWrappers = []any{ + file_livekit_sip_proto_msgTypes[15].OneofWrappers = []any{ (*SIPDispatchRule_DispatchRuleDirect)(nil), (*SIPDispatchRule_DispatchRuleIndividual)(nil), } @@ -1711,8 +2473,8 @@ func file_livekit_sip_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_livekit_sip_proto_rawDesc, - NumEnums: 1, - NumMessages: 15, + NumEnums: 2, + NumMessages: 23, NumExtensions: 0, NumServices: 1, }, diff --git a/livekit/livekit_sip.twirp.go b/livekit/livekit_sip.twirp.go index 4b17d1b1f..e8ee0d8c1 100644 --- a/livekit/livekit_sip.twirp.go +++ b/livekit/livekit_sip.twirp.go @@ -31,6 +31,14 @@ type SIP interface { ListSIPTrunk(context.Context, *ListSIPTrunkRequest) (*ListSIPTrunkResponse, error) + CreateSIPInboundTrunk(context.Context, *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) + + CreateSIPOutboundTrunk(context.Context, *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) + + ListSIPInboundTrunk(context.Context, *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) + + ListSIPOutboundTrunk(context.Context, *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) + DeleteSIPTrunk(context.Context, *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) CreateSIPDispatchRule(context.Context, *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) @@ -48,7 +56,7 @@ type SIP interface { type sIPProtobufClient struct { client HTTPClient - urls [7]string + urls [11]string interceptor twirp.Interceptor opts twirp.ClientOptions } @@ -76,9 +84,13 @@ func NewSIPProtobufClient(baseURL string, client HTTPClient, opts ...twirp.Clien // Build method URLs: []/./ serviceURL := sanitizeBaseURL(baseURL) serviceURL += baseServicePath(pathPrefix, "livekit", "SIP") - urls := [7]string{ + urls := [11]string{ serviceURL + "CreateSIPTrunk", serviceURL + "ListSIPTrunk", + serviceURL + "CreateSIPInboundTrunk", + serviceURL + "CreateSIPOutboundTrunk", + serviceURL + "ListSIPInboundTrunk", + serviceURL + "ListSIPOutboundTrunk", serviceURL + "DeleteSIPTrunk", serviceURL + "CreateSIPDispatchRule", serviceURL + "ListSIPDispatchRule", @@ -186,6 +198,190 @@ func (c *sIPProtobufClient) callListSIPTrunk(ctx context.Context, in *ListSIPTru return out, nil } +func (c *sIPProtobufClient) CreateSIPInboundTrunk(ctx context.Context, in *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPInboundTrunk") + caller := c.callCreateSIPInboundTrunk + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPInboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPInboundTrunkRequest) when calling interceptor") + } + return c.callCreateSIPInboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPInboundTrunkInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPInboundTrunkInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPProtobufClient) callCreateSIPInboundTrunk(ctx context.Context, in *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { + out := new(SIPInboundTrunkInfo) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *sIPProtobufClient) CreateSIPOutboundTrunk(ctx context.Context, in *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPOutboundTrunk") + caller := c.callCreateSIPOutboundTrunk + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPOutboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPOutboundTrunkRequest) when calling interceptor") + } + return c.callCreateSIPOutboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPOutboundTrunkInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPOutboundTrunkInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPProtobufClient) callCreateSIPOutboundTrunk(ctx context.Context, in *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { + out := new(SIPOutboundTrunkInfo) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *sIPProtobufClient) ListSIPInboundTrunk(ctx context.Context, in *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "ListSIPInboundTrunk") + caller := c.callListSIPInboundTrunk + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPInboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPInboundTrunkRequest) when calling interceptor") + } + return c.callListSIPInboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPInboundTrunkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPInboundTrunkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPProtobufClient) callListSIPInboundTrunk(ctx context.Context, in *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { + out := new(ListSIPInboundTrunkResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *sIPProtobufClient) ListSIPOutboundTrunk(ctx context.Context, in *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "ListSIPOutboundTrunk") + caller := c.callListSIPOutboundTrunk + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPOutboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPOutboundTrunkRequest) when calling interceptor") + } + return c.callListSIPOutboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPOutboundTrunkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPOutboundTrunkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPProtobufClient) callListSIPOutboundTrunk(ctx context.Context, in *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { + out := new(ListSIPOutboundTrunkResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + func (c *sIPProtobufClient) DeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithServiceName(ctx, "SIP") @@ -217,7 +413,7 @@ func (c *sIPProtobufClient) DeleteSIPTrunk(ctx context.Context, in *DeleteSIPTru func (c *sIPProtobufClient) callDeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { out := new(SIPTrunkInfo) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) if err != nil { twerr, ok := err.(twirp.Error) if !ok { @@ -263,7 +459,7 @@ func (c *sIPProtobufClient) CreateSIPDispatchRule(ctx context.Context, in *Creat func (c *sIPProtobufClient) callCreateSIPDispatchRule(ctx context.Context, in *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { out := new(SIPDispatchRuleInfo) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out) if err != nil { twerr, ok := err.(twirp.Error) if !ok { @@ -309,7 +505,7 @@ func (c *sIPProtobufClient) ListSIPDispatchRule(ctx context.Context, in *ListSIP func (c *sIPProtobufClient) callListSIPDispatchRule(ctx context.Context, in *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { out := new(ListSIPDispatchRuleResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out) if err != nil { twerr, ok := err.(twirp.Error) if !ok { @@ -355,7 +551,7 @@ func (c *sIPProtobufClient) DeleteSIPDispatchRule(ctx context.Context, in *Delet func (c *sIPProtobufClient) callDeleteSIPDispatchRule(ctx context.Context, in *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { out := new(SIPDispatchRuleInfo) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out) if err != nil { twerr, ok := err.(twirp.Error) if !ok { @@ -401,7 +597,7 @@ func (c *sIPProtobufClient) CreateSIPParticipant(ctx context.Context, in *Create func (c *sIPProtobufClient) callCreateSIPParticipant(ctx context.Context, in *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { out := new(SIPParticipantInfo) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out) if err != nil { twerr, ok := err.(twirp.Error) if !ok { @@ -422,7 +618,7 @@ func (c *sIPProtobufClient) callCreateSIPParticipant(ctx context.Context, in *Cr type sIPJSONClient struct { client HTTPClient - urls [7]string + urls [11]string interceptor twirp.Interceptor opts twirp.ClientOptions } @@ -450,9 +646,13 @@ func NewSIPJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOpt // Build method URLs: []/./ serviceURL := sanitizeBaseURL(baseURL) serviceURL += baseServicePath(pathPrefix, "livekit", "SIP") - urls := [7]string{ + urls := [11]string{ serviceURL + "CreateSIPTrunk", serviceURL + "ListSIPTrunk", + serviceURL + "CreateSIPInboundTrunk", + serviceURL + "CreateSIPOutboundTrunk", + serviceURL + "ListSIPInboundTrunk", + serviceURL + "ListSIPOutboundTrunk", serviceURL + "DeleteSIPTrunk", serviceURL + "CreateSIPDispatchRule", serviceURL + "ListSIPDispatchRule", @@ -560,26 +760,26 @@ func (c *sIPJSONClient) callListSIPTrunk(ctx context.Context, in *ListSIPTrunkRe return out, nil } -func (c *sIPJSONClient) DeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { +func (c *sIPJSONClient) CreateSIPInboundTrunk(ctx context.Context, in *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithServiceName(ctx, "SIP") - ctx = ctxsetters.WithMethodName(ctx, "DeleteSIPTrunk") - caller := c.callDeleteSIPTrunk + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPInboundTrunk") + caller := c.callCreateSIPInboundTrunk if c.interceptor != nil { - caller = func(ctx context.Context, req *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { + caller = func(ctx context.Context, req *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { resp, err := c.interceptor( func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteSIPTrunkRequest) + typedReq, ok := req.(*CreateSIPInboundTrunkRequest) if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteSIPTrunkRequest) when calling interceptor") + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPInboundTrunkRequest) when calling interceptor") } - return c.callDeleteSIPTrunk(ctx, typedReq) + return c.callCreateSIPInboundTrunk(ctx, typedReq) }, )(ctx, req) if resp != nil { - typedResp, ok := resp.(*SIPTrunkInfo) + typedResp, ok := resp.(*SIPInboundTrunkInfo) if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*SIPTrunkInfo) when calling interceptor") + return nil, twirp.InternalError("failed type assertion resp.(*SIPInboundTrunkInfo) when calling interceptor") } return typedResp, err } @@ -589,8 +789,8 @@ func (c *sIPJSONClient) DeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRe return caller(ctx, in) } -func (c *sIPJSONClient) callDeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { - out := new(SIPTrunkInfo) +func (c *sIPJSONClient) callCreateSIPInboundTrunk(ctx context.Context, in *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { + out := new(SIPInboundTrunkInfo) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) if err != nil { twerr, ok := err.(twirp.Error) @@ -606,26 +806,26 @@ func (c *sIPJSONClient) callDeleteSIPTrunk(ctx context.Context, in *DeleteSIPTru return out, nil } -func (c *sIPJSONClient) CreateSIPDispatchRule(ctx context.Context, in *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { +func (c *sIPJSONClient) CreateSIPOutboundTrunk(ctx context.Context, in *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithServiceName(ctx, "SIP") - ctx = ctxsetters.WithMethodName(ctx, "CreateSIPDispatchRule") - caller := c.callCreateSIPDispatchRule + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPOutboundTrunk") + caller := c.callCreateSIPOutboundTrunk if c.interceptor != nil { - caller = func(ctx context.Context, req *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + caller = func(ctx context.Context, req *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { resp, err := c.interceptor( func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateSIPDispatchRuleRequest) + typedReq, ok := req.(*CreateSIPOutboundTrunkRequest) if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateSIPDispatchRuleRequest) when calling interceptor") + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPOutboundTrunkRequest) when calling interceptor") } - return c.callCreateSIPDispatchRule(ctx, typedReq) + return c.callCreateSIPOutboundTrunk(ctx, typedReq) }, )(ctx, req) if resp != nil { - typedResp, ok := resp.(*SIPDispatchRuleInfo) + typedResp, ok := resp.(*SIPOutboundTrunkInfo) if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*SIPDispatchRuleInfo) when calling interceptor") + return nil, twirp.InternalError("failed type assertion resp.(*SIPOutboundTrunkInfo) when calling interceptor") } return typedResp, err } @@ -635,8 +835,8 @@ func (c *sIPJSONClient) CreateSIPDispatchRule(ctx context.Context, in *CreateSIP return caller(ctx, in) } -func (c *sIPJSONClient) callCreateSIPDispatchRule(ctx context.Context, in *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { - out := new(SIPDispatchRuleInfo) +func (c *sIPJSONClient) callCreateSIPOutboundTrunk(ctx context.Context, in *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { + out := new(SIPOutboundTrunkInfo) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) if err != nil { twerr, ok := err.(twirp.Error) @@ -652,26 +852,26 @@ func (c *sIPJSONClient) callCreateSIPDispatchRule(ctx context.Context, in *Creat return out, nil } -func (c *sIPJSONClient) ListSIPDispatchRule(ctx context.Context, in *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { +func (c *sIPJSONClient) ListSIPInboundTrunk(ctx context.Context, in *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithServiceName(ctx, "SIP") - ctx = ctxsetters.WithMethodName(ctx, "ListSIPDispatchRule") - caller := c.callListSIPDispatchRule + ctx = ctxsetters.WithMethodName(ctx, "ListSIPInboundTrunk") + caller := c.callListSIPInboundTrunk if c.interceptor != nil { - caller = func(ctx context.Context, req *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { + caller = func(ctx context.Context, req *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { resp, err := c.interceptor( func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListSIPDispatchRuleRequest) + typedReq, ok := req.(*ListSIPInboundTrunkRequest) if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListSIPDispatchRuleRequest) when calling interceptor") + return nil, twirp.InternalError("failed type assertion req.(*ListSIPInboundTrunkRequest) when calling interceptor") } - return c.callListSIPDispatchRule(ctx, typedReq) + return c.callListSIPInboundTrunk(ctx, typedReq) }, )(ctx, req) if resp != nil { - typedResp, ok := resp.(*ListSIPDispatchRuleResponse) + typedResp, ok := resp.(*ListSIPInboundTrunkResponse) if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListSIPDispatchRuleResponse) when calling interceptor") + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPInboundTrunkResponse) when calling interceptor") } return typedResp, err } @@ -681,8 +881,8 @@ func (c *sIPJSONClient) ListSIPDispatchRule(ctx context.Context, in *ListSIPDisp return caller(ctx, in) } -func (c *sIPJSONClient) callListSIPDispatchRule(ctx context.Context, in *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { - out := new(ListSIPDispatchRuleResponse) +func (c *sIPJSONClient) callListSIPInboundTrunk(ctx context.Context, in *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { + out := new(ListSIPInboundTrunkResponse) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) if err != nil { twerr, ok := err.(twirp.Error) @@ -698,26 +898,26 @@ func (c *sIPJSONClient) callListSIPDispatchRule(ctx context.Context, in *ListSIP return out, nil } -func (c *sIPJSONClient) DeleteSIPDispatchRule(ctx context.Context, in *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { +func (c *sIPJSONClient) ListSIPOutboundTrunk(ctx context.Context, in *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithServiceName(ctx, "SIP") - ctx = ctxsetters.WithMethodName(ctx, "DeleteSIPDispatchRule") - caller := c.callDeleteSIPDispatchRule + ctx = ctxsetters.WithMethodName(ctx, "ListSIPOutboundTrunk") + caller := c.callListSIPOutboundTrunk if c.interceptor != nil { - caller = func(ctx context.Context, req *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + caller = func(ctx context.Context, req *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { resp, err := c.interceptor( func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteSIPDispatchRuleRequest) + typedReq, ok := req.(*ListSIPOutboundTrunkRequest) if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteSIPDispatchRuleRequest) when calling interceptor") + return nil, twirp.InternalError("failed type assertion req.(*ListSIPOutboundTrunkRequest) when calling interceptor") } - return c.callDeleteSIPDispatchRule(ctx, typedReq) + return c.callListSIPOutboundTrunk(ctx, typedReq) }, )(ctx, req) if resp != nil { - typedResp, ok := resp.(*SIPDispatchRuleInfo) + typedResp, ok := resp.(*ListSIPOutboundTrunkResponse) if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*SIPDispatchRuleInfo) when calling interceptor") + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPOutboundTrunkResponse) when calling interceptor") } return typedResp, err } @@ -727,8 +927,8 @@ func (c *sIPJSONClient) DeleteSIPDispatchRule(ctx context.Context, in *DeleteSIP return caller(ctx, in) } -func (c *sIPJSONClient) callDeleteSIPDispatchRule(ctx context.Context, in *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { - out := new(SIPDispatchRuleInfo) +func (c *sIPJSONClient) callListSIPOutboundTrunk(ctx context.Context, in *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { + out := new(ListSIPOutboundTrunkResponse) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) if err != nil { twerr, ok := err.(twirp.Error) @@ -744,26 +944,26 @@ func (c *sIPJSONClient) callDeleteSIPDispatchRule(ctx context.Context, in *Delet return out, nil } -func (c *sIPJSONClient) CreateSIPParticipant(ctx context.Context, in *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { +func (c *sIPJSONClient) DeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithServiceName(ctx, "SIP") - ctx = ctxsetters.WithMethodName(ctx, "CreateSIPParticipant") - caller := c.callCreateSIPParticipant + ctx = ctxsetters.WithMethodName(ctx, "DeleteSIPTrunk") + caller := c.callDeleteSIPTrunk if c.interceptor != nil { - caller = func(ctx context.Context, req *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { + caller = func(ctx context.Context, req *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { resp, err := c.interceptor( func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateSIPParticipantRequest) + typedReq, ok := req.(*DeleteSIPTrunkRequest) if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateSIPParticipantRequest) when calling interceptor") + return nil, twirp.InternalError("failed type assertion req.(*DeleteSIPTrunkRequest) when calling interceptor") } - return c.callCreateSIPParticipant(ctx, typedReq) + return c.callDeleteSIPTrunk(ctx, typedReq) }, )(ctx, req) if resp != nil { - typedResp, ok := resp.(*SIPParticipantInfo) + typedResp, ok := resp.(*SIPTrunkInfo) if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*SIPParticipantInfo) when calling interceptor") + return nil, twirp.InternalError("failed type assertion resp.(*SIPTrunkInfo) when calling interceptor") } return typedResp, err } @@ -773,8 +973,8 @@ func (c *sIPJSONClient) CreateSIPParticipant(ctx context.Context, in *CreateSIPP return caller(ctx, in) } -func (c *sIPJSONClient) callCreateSIPParticipant(ctx context.Context, in *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { - out := new(SIPParticipantInfo) +func (c *sIPJSONClient) callDeleteSIPTrunk(ctx context.Context, in *DeleteSIPTrunkRequest) (*SIPTrunkInfo, error) { + out := new(SIPTrunkInfo) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) if err != nil { twerr, ok := err.(twirp.Error) @@ -790,21 +990,205 @@ func (c *sIPJSONClient) callCreateSIPParticipant(ctx context.Context, in *Create return out, nil } -// ================== -// SIP Server Handler -// ================== - -type sIPServer struct { - SIP - interceptor twirp.Interceptor - hooks *twirp.ServerHooks - pathPrefix string // prefix for routing - jsonSkipDefaults bool // do not include unpopulated fields (default values) in the response - jsonCamelCase bool // JSON fields are serialized as lowerCamelCase rather than keeping the original proto names +func (c *sIPJSONClient) CreateSIPDispatchRule(ctx context.Context, in *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPDispatchRule") + caller := c.callCreateSIPDispatchRule + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPDispatchRuleRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPDispatchRuleRequest) when calling interceptor") + } + return c.callCreateSIPDispatchRule(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPDispatchRuleInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPDispatchRuleInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) } -// NewSIPServer builds a TwirpServer that can be used as an http.Handler to handle -// HTTP requests that are routed to the right method in the provided svc implementation. +func (c *sIPJSONClient) callCreateSIPDispatchRule(ctx context.Context, in *CreateSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + out := new(SIPDispatchRuleInfo) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *sIPJSONClient) ListSIPDispatchRule(ctx context.Context, in *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "ListSIPDispatchRule") + caller := c.callListSIPDispatchRule + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPDispatchRuleRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPDispatchRuleRequest) when calling interceptor") + } + return c.callListSIPDispatchRule(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPDispatchRuleResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPDispatchRuleResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPJSONClient) callListSIPDispatchRule(ctx context.Context, in *ListSIPDispatchRuleRequest) (*ListSIPDispatchRuleResponse, error) { + out := new(ListSIPDispatchRuleResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *sIPJSONClient) DeleteSIPDispatchRule(ctx context.Context, in *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "DeleteSIPDispatchRule") + caller := c.callDeleteSIPDispatchRule + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeleteSIPDispatchRuleRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeleteSIPDispatchRuleRequest) when calling interceptor") + } + return c.callDeleteSIPDispatchRule(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPDispatchRuleInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPDispatchRuleInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPJSONClient) callDeleteSIPDispatchRule(ctx context.Context, in *DeleteSIPDispatchRuleRequest) (*SIPDispatchRuleInfo, error) { + out := new(SIPDispatchRuleInfo) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *sIPJSONClient) CreateSIPParticipant(ctx context.Context, in *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "SIP") + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPParticipant") + caller := c.callCreateSIPParticipant + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPParticipantRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPParticipantRequest) when calling interceptor") + } + return c.callCreateSIPParticipant(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPParticipantInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPParticipantInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *sIPJSONClient) callCreateSIPParticipant(ctx context.Context, in *CreateSIPParticipantRequest) (*SIPParticipantInfo, error) { + out := new(SIPParticipantInfo) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +// ================== +// SIP Server Handler +// ================== + +type sIPServer struct { + SIP + interceptor twirp.Interceptor + hooks *twirp.ServerHooks + pathPrefix string // prefix for routing + jsonSkipDefaults bool // do not include unpopulated fields (default values) in the response + jsonCamelCase bool // JSON fields are serialized as lowerCamelCase rather than keeping the original proto names +} + +// NewSIPServer builds a TwirpServer that can be used as an http.Handler to handle +// HTTP requests that are routed to the right method in the provided svc implementation. // The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks). func NewSIPServer(svc SIP, opts ...interface{}) TwirpServer { serverOpts := newServerOpts(opts) @@ -893,6 +1277,18 @@ func (s *sIPServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { case "ListSIPTrunk": s.serveListSIPTrunk(ctx, resp, req) return + case "CreateSIPInboundTrunk": + s.serveCreateSIPInboundTrunk(ctx, resp, req) + return + case "CreateSIPOutboundTrunk": + s.serveCreateSIPOutboundTrunk(ctx, resp, req) + return + case "ListSIPInboundTrunk": + s.serveListSIPInboundTrunk(ctx, resp, req) + return + case "ListSIPOutboundTrunk": + s.serveListSIPOutboundTrunk(ctx, resp, req) + return case "DeleteSIPTrunk": s.serveDeleteSIPTrunk(ctx, resp, req) return @@ -1275,6 +1671,726 @@ func (s *sIPServer) serveListSIPTrunkProtobuf(ctx context.Context, resp http.Res callResponseSent(ctx, s.hooks) } +func (s *sIPServer) serveCreateSIPInboundTrunk(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveCreateSIPInboundTrunkJSON(ctx, resp, req) + case "application/protobuf": + s.serveCreateSIPInboundTrunkProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *sIPServer) serveCreateSIPInboundTrunkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPInboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(CreateSIPInboundTrunkRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.SIP.CreateSIPInboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPInboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPInboundTrunkRequest) when calling interceptor") + } + return s.SIP.CreateSIPInboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPInboundTrunkInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPInboundTrunkInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *SIPInboundTrunkInfo + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *SIPInboundTrunkInfo and nil error while calling CreateSIPInboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveCreateSIPInboundTrunkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPInboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(CreateSIPInboundTrunkRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.SIP.CreateSIPInboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateSIPInboundTrunkRequest) (*SIPInboundTrunkInfo, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPInboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPInboundTrunkRequest) when calling interceptor") + } + return s.SIP.CreateSIPInboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPInboundTrunkInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPInboundTrunkInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *SIPInboundTrunkInfo + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *SIPInboundTrunkInfo and nil error while calling CreateSIPInboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveCreateSIPOutboundTrunk(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveCreateSIPOutboundTrunkJSON(ctx, resp, req) + case "application/protobuf": + s.serveCreateSIPOutboundTrunkProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *sIPServer) serveCreateSIPOutboundTrunkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPOutboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(CreateSIPOutboundTrunkRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.SIP.CreateSIPOutboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPOutboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPOutboundTrunkRequest) when calling interceptor") + } + return s.SIP.CreateSIPOutboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPOutboundTrunkInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPOutboundTrunkInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *SIPOutboundTrunkInfo + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *SIPOutboundTrunkInfo and nil error while calling CreateSIPOutboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveCreateSIPOutboundTrunkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateSIPOutboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(CreateSIPOutboundTrunkRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.SIP.CreateSIPOutboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateSIPOutboundTrunkRequest) (*SIPOutboundTrunkInfo, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateSIPOutboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateSIPOutboundTrunkRequest) when calling interceptor") + } + return s.SIP.CreateSIPOutboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*SIPOutboundTrunkInfo) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*SIPOutboundTrunkInfo) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *SIPOutboundTrunkInfo + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *SIPOutboundTrunkInfo and nil error while calling CreateSIPOutboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveListSIPInboundTrunk(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListSIPInboundTrunkJSON(ctx, resp, req) + case "application/protobuf": + s.serveListSIPInboundTrunkProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *sIPServer) serveListSIPInboundTrunkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListSIPInboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ListSIPInboundTrunkRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.SIP.ListSIPInboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPInboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPInboundTrunkRequest) when calling interceptor") + } + return s.SIP.ListSIPInboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPInboundTrunkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPInboundTrunkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListSIPInboundTrunkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListSIPInboundTrunkResponse and nil error while calling ListSIPInboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveListSIPInboundTrunkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListSIPInboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ListSIPInboundTrunkRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.SIP.ListSIPInboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListSIPInboundTrunkRequest) (*ListSIPInboundTrunkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPInboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPInboundTrunkRequest) when calling interceptor") + } + return s.SIP.ListSIPInboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPInboundTrunkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPInboundTrunkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListSIPInboundTrunkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListSIPInboundTrunkResponse and nil error while calling ListSIPInboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveListSIPOutboundTrunk(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListSIPOutboundTrunkJSON(ctx, resp, req) + case "application/protobuf": + s.serveListSIPOutboundTrunkProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *sIPServer) serveListSIPOutboundTrunkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListSIPOutboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ListSIPOutboundTrunkRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.SIP.ListSIPOutboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPOutboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPOutboundTrunkRequest) when calling interceptor") + } + return s.SIP.ListSIPOutboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPOutboundTrunkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPOutboundTrunkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListSIPOutboundTrunkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListSIPOutboundTrunkResponse and nil error while calling ListSIPOutboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *sIPServer) serveListSIPOutboundTrunkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListSIPOutboundTrunk") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ListSIPOutboundTrunkRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.SIP.ListSIPOutboundTrunk + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListSIPOutboundTrunkRequest) (*ListSIPOutboundTrunkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListSIPOutboundTrunkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListSIPOutboundTrunkRequest) when calling interceptor") + } + return s.SIP.ListSIPOutboundTrunk(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListSIPOutboundTrunkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListSIPOutboundTrunkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListSIPOutboundTrunkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListSIPOutboundTrunkResponse and nil error while calling ListSIPOutboundTrunk. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + func (s *sIPServer) serveDeleteSIPTrunk(ctx context.Context, resp http.ResponseWriter, req *http.Request) { header := req.Header.Get("Content-Type") i := strings.Index(header, ";") @@ -2191,74 +3307,95 @@ func (s *sIPServer) PathPrefix() string { } var twirpFileDescriptor3 = []byte{ - // 1098 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0xdf, 0x4e, 0xe3, 0xc6, - 0x17, 0x26, 0x4e, 0x08, 0xc9, 0x09, 0x84, 0x30, 0x90, 0x95, 0x7f, 0x81, 0xdf, 0x16, 0x99, 0x5d, - 0x95, 0x6e, 0x2b, 0x50, 0x59, 0xa9, 0x52, 0xf7, 0x8e, 0x3f, 0xda, 0xdd, 0x68, 0x29, 0xb8, 0x4e, - 0xb8, 0x68, 0xb5, 0xaa, 0x6b, 0xe2, 0x01, 0x46, 0x38, 0xb6, 0xeb, 0x19, 0xd3, 0xdd, 0x17, 0xe9, - 0x2b, 0x54, 0x6a, 0xdf, 0xa3, 0x77, 0x7d, 0x80, 0x5e, 0xf4, 0x05, 0x7a, 0xd1, 0x67, 0xa8, 0x66, - 0x3c, 0x76, 0x6c, 0xc7, 0x0e, 0xc9, 0x9d, 0xfd, 0x9d, 0x33, 0xc7, 0xe7, 0x7c, 0xe7, 0x9b, 0x33, - 0x63, 0xd8, 0x70, 0xc8, 0x03, 0xbe, 0x27, 0xcc, 0xa4, 0xc4, 0x3f, 0xf0, 0x03, 0x8f, 0x79, 0x68, - 0x45, 0x42, 0xda, 0x5f, 0x55, 0xe8, 0x9e, 0x06, 0xd8, 0x62, 0x78, 0xd0, 0xd7, 0x87, 0x41, 0xe8, - 0xde, 0x1b, 0xf8, 0xa7, 0x10, 0x53, 0x86, 0x3e, 0x87, 0x0d, 0xe2, 0x5e, 0x7b, 0xa1, 0x6b, 0x9b, - 0x96, 0x6d, 0x07, 0x98, 0x52, 0x4c, 0xd5, 0xca, 0x6e, 0x75, 0xbf, 0x69, 0x74, 0xa4, 0xe1, 0x38, - 0xc6, 0xd1, 0x67, 0xd0, 0xf1, 0x42, 0x96, 0xf1, 0x56, 0x95, 0xdd, 0xca, 0x7e, 0xd3, 0x58, 0x8f, - 0x71, 0xe9, 0x8c, 0x3e, 0x85, 0x04, 0x32, 0xdd, 0x70, 0x7c, 0x8d, 0x03, 0xb5, 0x2a, 0x3c, 0xdb, - 0x31, 0x7c, 0x21, 0x50, 0xf4, 0x15, 0x74, 0xe3, 0x04, 0x22, 0x3f, 0x6a, 0x06, 0xf8, 0x16, 0x7f, - 0x50, 0x6b, 0x3c, 0x89, 0x13, 0x45, 0xad, 0x18, 0x9b, 0xd2, 0x21, 0x5a, 0x41, 0x0d, 0x6e, 0xe6, - 0x1f, 0xc8, 0xad, 0x53, 0x9b, 0x22, 0xed, 0x76, 0xd6, 0x9b, 0x27, 0x1d, 0x3b, 0x86, 0x14, 0x07, - 0xae, 0x35, 0xc6, 0xea, 0x72, 0x94, 0xb4, 0xc4, 0xaf, 0x24, 0x9c, 0x76, 0xf5, 0x2d, 0x4a, 0x7f, - 0xf6, 0x02, 0x5b, 0xad, 0x67, 0x5c, 0x75, 0x09, 0x73, 0xde, 0x92, 0xfa, 0x92, 0xb0, 0x2b, 0xc2, - 0x37, 0xe1, 0x28, 0x89, 0x9b, 0x76, 0x4e, 0x02, 0x37, 0xb2, 0xce, 0x49, 0x64, 0x04, 0x35, 0x11, - 0x0c, 0x84, 0x5d, 0x3c, 0xa3, 0x1e, 0x34, 0xc6, 0x98, 0x59, 0xb6, 0xc5, 0x2c, 0xb5, 0x25, 0xf0, - 0xe4, 0x5d, 0xfb, 0xb5, 0x06, 0xab, 0x71, 0x57, 0xfb, 0xee, 0x8d, 0x87, 0x76, 0x61, 0x95, 0x12, - 0xdf, 0x64, 0x1c, 0x30, 0x89, 0xad, 0x56, 0xc4, 0x02, 0xa0, 0xc4, 0x8f, 0x7c, 0xec, 0xe2, 0xa6, - 0x2b, 0x0b, 0x34, 0xbd, 0x3a, 0x77, 0xd3, 0x6b, 0x85, 0x4d, 0x7f, 0x09, 0x4d, 0x16, 0x58, 0x2e, - 0xf5, 0xbd, 0x80, 0xa9, 0x6b, 0xbb, 0x95, 0xfd, 0xf6, 0x51, 0xf7, 0x40, 0x8a, 0xf5, 0x40, 0x14, - 0x23, 0x8d, 0xc6, 0xc4, 0xaf, 0x5c, 0x29, 0xcb, 0x0b, 0x2b, 0x05, 0xe6, 0x56, 0x4a, 0x7d, 0x7e, - 0xa5, 0xac, 0x2c, 0xa0, 0x94, 0xc6, 0x22, 0x4a, 0x69, 0x3e, 0xa2, 0x94, 0x56, 0x89, 0x52, 0x56, - 0x73, 0x4a, 0xe9, 0xc2, 0xe6, 0x39, 0xa1, 0x2c, 0x37, 0x02, 0xb4, 0x53, 0xd8, 0xca, 0xc2, 0xd4, - 0xf7, 0x5c, 0xca, 0x73, 0x59, 0x26, 0x0c, 0x8f, 0xa3, 0x71, 0xd0, 0xca, 0x37, 0x48, 0xaa, 0xcd, - 0x88, 0x7c, 0xb4, 0xaf, 0xa1, 0x7b, 0x86, 0x1d, 0x3c, 0x3d, 0x60, 0x1e, 0x55, 0xa3, 0xf6, 0x1a, - 0xba, 0x83, 0xbe, 0x7e, 0x46, 0xa8, 0x6f, 0xb1, 0xd1, 0x9d, 0x11, 0x3a, 0xf8, 0x8c, 0x04, 0x78, - 0xc4, 0xd0, 0x36, 0x34, 0x03, 0xcf, 0x1b, 0x9b, 0xa2, 0xc8, 0x68, 0x5d, 0x83, 0x03, 0x17, 0xbc, - 0xd0, 0x0e, 0x54, 0x7d, 0xe2, 0xca, 0xf1, 0xc3, 0x1f, 0xb5, 0x0b, 0xf8, 0x5f, 0x2e, 0x4e, 0xdf, - 0xb5, 0xc9, 0x03, 0xb1, 0x43, 0xcb, 0x41, 0x9f, 0x40, 0x4b, 0xc4, 0xf2, 0x03, 0x7c, 0x43, 0x3e, - 0xc4, 0x59, 0x70, 0x48, 0x17, 0x48, 0x41, 0xbc, 0x3f, 0x2b, 0xb0, 0x9e, 0x0b, 0x88, 0x0c, 0xd8, - 0xb2, 0xe5, 0xbb, 0x19, 0x84, 0x0e, 0x36, 0x6d, 0x91, 0xaa, 0x88, 0xd7, 0x3a, 0x7a, 0x9a, 0xa6, - 0x68, 0xba, 0xa0, 0xb7, 0x4b, 0x06, 0xb2, 0xa7, 0xcb, 0xfc, 0x01, 0xd4, 0x6c, 0x4c, 0x92, 0xa4, - 0x2d, 0xd2, 0x69, 0x1d, 0x69, 0x65, 0x71, 0x27, 0x05, 0xbe, 0x5d, 0x32, 0x9e, 0xd8, 0x85, 0x96, - 0x93, 0x3a, 0xd4, 0x78, 0x58, 0xed, 0xdf, 0x0a, 0xec, 0x24, 0x87, 0x40, 0x3a, 0x4a, 0xdc, 0xaa, - 0x2f, 0x22, 0x47, 0x59, 0x8c, 0x5a, 0xf6, 0x51, 0x43, 0x78, 0xf1, 0xee, 0xc4, 0x4d, 0x8d, 0x87, - 0x47, 0x83, 0x45, 0x2d, 0xa5, 0xe8, 0x05, 0x6c, 0xdc, 0x11, 0x1b, 0x9b, 0xfe, 0x9d, 0xe7, 0xe2, - 0xf4, 0x01, 0xd0, 0x30, 0xd6, 0xb9, 0x41, 0xe7, 0xb8, 0x1c, 0x06, 0x05, 0xfb, 0xb3, 0x5e, 0xb8, - 0x3f, 0x63, 0xbd, 0xd7, 0x4a, 0xf4, 0xbe, 0x9c, 0xd3, 0xfb, 0x2f, 0x0a, 0x6c, 0x4e, 0x11, 0x76, - 0xe3, 0xa1, 0x43, 0xd8, 0xe2, 0x92, 0xcc, 0x91, 0x1e, 0x4b, 0x73, 0x83, 0x12, 0x3f, 0xb3, 0xc4, - 0x4e, 0x88, 0x51, 0x16, 0x27, 0xa6, 0x3a, 0x0f, 0x31, 0xb5, 0xb9, 0x89, 0x59, 0x99, 0x49, 0xcc, - 0x72, 0x09, 0x31, 0xf5, 0x1c, 0x31, 0x3b, 0xd0, 0x93, 0x3b, 0xbe, 0x40, 0x06, 0xda, 0xb7, 0xb0, - 0x5d, 0x68, 0x95, 0x63, 0xe1, 0x28, 0x3b, 0x16, 0x76, 0xca, 0xb5, 0x39, 0x99, 0x0e, 0x97, 0xb0, - 0x93, 0x4c, 0x87, 0x22, 0xe5, 0x2d, 0xda, 0x11, 0xed, 0x0f, 0x05, 0xb6, 0x13, 0x2d, 0xeb, 0x56, - 0xc0, 0xc8, 0x88, 0xf8, 0x96, 0xcb, 0xe6, 0x9e, 0x3a, 0xe8, 0x29, 0xb4, 0xb8, 0xc7, 0xc8, 0x72, - 0x1c, 0x93, 0x79, 0x72, 0xdf, 0x37, 0x29, 0xf1, 0x4f, 0x2d, 0xc7, 0x19, 0x7a, 0xd9, 0xe1, 0x53, - 0xcd, 0x0d, 0x9f, 0x2f, 0x61, 0xcb, 0x9f, 0x7c, 0xd4, 0x24, 0x36, 0x76, 0x19, 0x61, 0x1f, 0xa5, - 0x32, 0x37, 0x53, 0xb6, 0xbe, 0x34, 0xf1, 0x13, 0x23, 0xbd, 0x24, 0x75, 0x5f, 0x58, 0x4f, 0xe1, - 0x45, 0xd1, 0x93, 0x36, 0x36, 0xa6, 0xa2, 0x7f, 0x23, 0x4d, 0x5c, 0x01, 0x36, 0x1b, 0xdf, 0xc4, - 0x0a, 0xe0, 0xcf, 0x68, 0x0f, 0xd6, 0x7c, 0xc7, 0xfa, 0x68, 0x06, 0xc4, 0xbd, 0x65, 0x9e, 0x1b, - 0x9d, 0x65, 0x0d, 0x63, 0x95, 0x83, 0x86, 0xc4, 0xb4, 0xdf, 0x2b, 0x80, 0xb2, 0x14, 0x8a, 0x2d, - 0xf2, 0x1c, 0xda, 0xd9, 0x02, 0x25, 0x83, 0x6b, 0x99, 0xd2, 0x4a, 0x79, 0x50, 0xca, 0x79, 0x98, - 0xc9, 0x6b, 0xba, 0x29, 0xc4, 0x96, 0x74, 0xc6, 0x4d, 0xe9, 0xdb, 0x2f, 0xee, 0xe5, 0x55, 0x27, - 0xbe, 0x12, 0x3c, 0x11, 0xc9, 0x9b, 0x43, 0xe3, 0xf8, 0x62, 0xa0, 0x5f, 0x1a, 0x43, 0xf3, 0xf8, - 0x6a, 0x78, 0xd9, 0x59, 0x42, 0x5d, 0xd8, 0xc8, 0xe2, 0x57, 0x67, 0x7a, 0xa7, 0x32, 0x0d, 0x0f, - 0x4f, 0xf5, 0x8e, 0x52, 0x00, 0x9f, 0x0f, 0x3a, 0xd5, 0xa3, 0xbf, 0x6b, 0x50, 0x1d, 0xf4, 0x75, - 0xf4, 0x06, 0xda, 0xd9, 0xbb, 0x33, 0x9a, 0xcc, 0xf9, 0xc2, 0x4b, 0x75, 0xaf, 0xf8, 0xa8, 0x44, - 0xef, 0x60, 0x35, 0x7d, 0xd0, 0xa2, 0xc9, 0xd6, 0x29, 0x38, 0x96, 0x7b, 0xff, 0x2f, 0xb1, 0xca, - 0x6d, 0xf8, 0x06, 0xda, 0xd9, 0x03, 0x37, 0x95, 0x55, 0xe1, 0x49, 0x5c, 0x96, 0xd5, 0xfb, 0xd4, - 0xaf, 0x41, 0xe6, 0xac, 0x7b, 0x3e, 0x5d, 0x65, 0xc1, 0xde, 0xed, 0xcd, 0x1c, 0x00, 0xe8, 0xc7, - 0xe4, 0xce, 0x91, 0x89, 0xbd, 0x97, 0x2f, 0xae, 0x28, 0xf2, 0xb3, 0xd9, 0x4e, 0x92, 0x88, 0xf7, - 0xa9, 0x9b, 0x47, 0x49, 0xfe, 0xb3, 0x66, 0xcf, 0x23, 0xf9, 0x7f, 0x07, 0x5b, 0x45, 0x73, 0x06, - 0x3d, 0x9b, 0x26, 0x67, 0x7a, 0x0c, 0xf5, 0xb6, 0xd3, 0xb1, 0x73, 0x7b, 0xec, 0xe4, 0xf5, 0xf7, - 0x7b, 0xb7, 0x84, 0xdd, 0x85, 0xd7, 0x07, 0x23, 0x6f, 0x7c, 0x28, 0x1d, 0x0f, 0xc5, 0x9f, 0xdb, - 0xc8, 0x73, 0x62, 0xe0, 0x37, 0x65, 0xed, 0x9c, 0x3c, 0xe0, 0x77, 0x84, 0x1d, 0xe8, 0xdc, 0xf4, - 0x8f, 0xd2, 0x96, 0xef, 0xaf, 0x5e, 0x09, 0xe0, 0xba, 0x2e, 0x96, 0xbc, 0xfc, 0x2f, 0x00, 0x00, - 0xff, 0xff, 0x9b, 0x32, 0x67, 0x4e, 0x01, 0x0e, 0x00, 0x00, + // 1431 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xb6, 0xa8, 0x1f, 0x4b, 0x23, 0x59, 0x96, 0xd7, 0x76, 0xc0, 0xc8, 0x76, 0x62, 0x30, 0x49, + 0x93, 0xa6, 0x85, 0x83, 0xda, 0x40, 0x81, 0xe6, 0xe6, 0x9f, 0x26, 0x11, 0xe2, 0xca, 0x2a, 0x2d, + 0x1f, 0x52, 0x04, 0x65, 0x69, 0x91, 0x8e, 0x17, 0xa6, 0x48, 0x96, 0xa4, 0xf2, 0xf3, 0x06, 0x7d, + 0x82, 0x5e, 0x7a, 0xea, 0xa5, 0x87, 0xf6, 0x3d, 0x7a, 0xeb, 0x23, 0xf4, 0x05, 0x0a, 0xb4, 0xcf, + 0x50, 0xec, 0x72, 0x97, 0xda, 0xa5, 0x56, 0xb2, 0x0c, 0xb4, 0x37, 0x71, 0xe6, 0xdb, 0xd9, 0xd9, + 0x6f, 0xbe, 0x9d, 0x1d, 0x1b, 0x56, 0x3c, 0xfc, 0xd6, 0xbd, 0xc2, 0x89, 0x15, 0xe3, 0x70, 0x27, + 0x8c, 0x82, 0x24, 0x40, 0x8b, 0xcc, 0x64, 0xfc, 0x59, 0x84, 0xf5, 0xc3, 0xc8, 0xb5, 0x13, 0xf7, + 0xb4, 0xd3, 0xeb, 0x47, 0x23, 0xff, 0xca, 0x74, 0xbf, 0x1f, 0xb9, 0x71, 0x82, 0x3e, 0x81, 0x15, + 0xec, 0x9f, 0x07, 0x23, 0xdf, 0xb1, 0x6c, 0xc7, 0x89, 0xdc, 0x38, 0x76, 0x63, 0xbd, 0xb0, 0x5d, + 0x7c, 0x54, 0x33, 0x5b, 0xcc, 0xb1, 0xcf, 0xed, 0xe8, 0x63, 0x68, 0x05, 0xa3, 0x44, 0x42, 0xeb, + 0xda, 0x76, 0xe1, 0x51, 0xcd, 0x5c, 0xe6, 0x76, 0x06, 0x46, 0x0f, 0x21, 0x33, 0x59, 0xfe, 0x68, + 0x78, 0xee, 0x46, 0x7a, 0x91, 0x22, 0x9b, 0xdc, 0xdc, 0xa5, 0x56, 0xf4, 0x39, 0xac, 0xf3, 0x04, + 0x52, 0x5c, 0x6c, 0x45, 0xee, 0x1b, 0xf7, 0xbd, 0x5e, 0x22, 0x49, 0x1c, 0x68, 0x7a, 0xc1, 0x5c, + 0x65, 0x80, 0x74, 0x45, 0x6c, 0x12, 0x37, 0xd9, 0x20, 0xb7, 0x4e, 0xaf, 0xd1, 0xb4, 0x9b, 0x32, + 0x9a, 0x24, 0xcd, 0x81, 0xa3, 0xd8, 0x8d, 0x7c, 0x7b, 0xe8, 0xea, 0xe5, 0x34, 0x69, 0x66, 0x3f, + 0x63, 0x66, 0x11, 0x1a, 0xda, 0x71, 0xfc, 0x2e, 0x88, 0x1c, 0xbd, 0x22, 0x41, 0x7b, 0xcc, 0x4c, + 0x78, 0xcb, 0xce, 0x97, 0x85, 0x5d, 0xa4, 0xd8, 0x8c, 0xa3, 0x2c, 0xae, 0x08, 0xce, 0x02, 0x57, + 0x65, 0x70, 0x16, 0x19, 0x41, 0x89, 0x06, 0x03, 0xea, 0xa7, 0xbf, 0x51, 0x1b, 0xaa, 0x43, 0x37, + 0xb1, 0x1d, 0x3b, 0xb1, 0xf5, 0x3a, 0xb5, 0x67, 0xdf, 0x4f, 0x35, 0xbd, 0x60, 0xfc, 0x52, 0x86, + 0x06, 0xaf, 0x6c, 0xc7, 0xbf, 0x08, 0xd0, 0x36, 0x34, 0x62, 0x1c, 0x5a, 0x09, 0x31, 0x58, 0xd8, + 0xd1, 0x0b, 0x74, 0x11, 0xc4, 0x38, 0x4c, 0x31, 0x0e, 0xda, 0x83, 0xd2, 0x15, 0xf6, 0x1d, 0xbd, + 0xb9, 0x5d, 0x78, 0xd4, 0xdc, 0xbd, 0xbb, 0xc3, 0xa4, 0xb2, 0x23, 0x86, 0xd9, 0xa1, 0xbf, 0x5e, + 0x62, 0xdf, 0x31, 0x29, 0x58, 0xad, 0x16, 0xed, 0x06, 0x6a, 0x29, 0xce, 0xad, 0x96, 0x92, 0x52, + 0x2d, 0x7b, 0x50, 0x4b, 0x22, 0xdb, 0x8f, 0xc3, 0x20, 0x4a, 0xf4, 0x25, 0x9a, 0xfa, 0xba, 0x9c, + 0x3a, 0x73, 0x9a, 0x63, 0xdc, 0x74, 0x89, 0x95, 0x6f, 0x2c, 0x31, 0x98, 0x5b, 0x62, 0x95, 0xf9, + 0x25, 0xb6, 0x78, 0x03, 0x89, 0x55, 0x6f, 0x22, 0xb1, 0xda, 0x35, 0x12, 0xab, 0x4f, 0x91, 0x58, + 0x43, 0x96, 0x98, 0x71, 0x04, 0xb5, 0x4c, 0x09, 0xa8, 0x05, 0x8d, 0xbe, 0x79, 0xd6, 0x7d, 0x69, + 0x1d, 0x7f, 0xf9, 0x7c, 0xff, 0xf0, 0x55, 0x6b, 0x01, 0xad, 0xc0, 0x52, 0x6a, 0xe9, 0x74, 0x0f, + 0x4e, 0xce, 0xba, 0x47, 0xad, 0x02, 0x42, 0xd0, 0x4c, 0x4d, 0x27, 0x67, 0xfd, 0xd4, 0xa6, 0x51, + 0xa1, 0x9a, 0xb0, 0x99, 0xf5, 0xa1, 0x4e, 0x7a, 0x5e, 0xa9, 0x1d, 0xed, 0x42, 0x99, 0x6a, 0x96, + 0x0a, 0xb6, 0xbe, 0xbb, 0x29, 0xd6, 0x56, 0xc4, 0x13, 0x75, 0x9a, 0x29, 0xd4, 0xf8, 0x59, 0x83, + 0x55, 0x85, 0x7b, 0x8e, 0x3b, 0xc0, 0x79, 0xd0, 0xa6, 0xf0, 0x50, 0x94, 0x79, 0x40, 0x3a, 0x2c, + 0x72, 0x21, 0xd0, 0xee, 0x64, 0xf2, 0x4f, 0x42, 0xbf, 0xed, 0x79, 0xc1, 0x3b, 0x57, 0xbc, 0x18, + 0xe5, 0xf4, 0x62, 0x30, 0xc7, 0xf8, 0x62, 0x3c, 0x84, 0x65, 0x0e, 0xe6, 0xe1, 0x2a, 0xa9, 0xae, + 0x98, 0x99, 0xeb, 0xea, 0x1e, 0x2c, 0xd9, 0xa3, 0xe4, 0x32, 0xdf, 0x60, 0x1a, 0xc4, 0x98, 0x55, + 0x9e, 0x83, 0x72, 0x8d, 0x85, 0x82, 0x78, 0xc5, 0x8d, 0x3e, 0x6c, 0x65, 0xbc, 0x9f, 0x30, 0x39, + 0x48, 0xc4, 0xef, 0xc9, 0xc4, 0x6f, 0x89, 0xc4, 0x4b, 0x0b, 0x44, 0xe6, 0x7f, 0xd2, 0x60, 0x4d, + 0xe5, 0xff, 0x7f, 0xa8, 0xe7, 0x3d, 0x24, 0xed, 0x0c, 0xfc, 0x53, 0x6e, 0x09, 0xe5, 0x39, 0x5b, + 0x82, 0x50, 0xc9, 0x8a, 0x5c, 0xc9, 0xff, 0x8e, 0xf3, 0xdb, 0xb0, 0x7a, 0x8c, 0xe3, 0x24, 0xf7, + 0xe2, 0xd2, 0x6b, 0xf0, 0x1c, 0xd6, 0x64, 0x57, 0x1c, 0x06, 0x7e, 0x4c, 0x6e, 0x71, 0x19, 0x27, + 0xee, 0x30, 0x7d, 0x81, 0xeb, 0xf9, 0x73, 0x64, 0xec, 0x53, 0x0c, 0x0d, 0xb4, 0x09, 0x6d, 0x16, + 0x48, 0x71, 0x9b, 0x8c, 0xaf, 0x61, 0x43, 0xe9, 0x65, 0xbb, 0xed, 0xca, 0xbb, 0x5d, 0x73, 0xd9, + 0x28, 0xd4, 0xd8, 0xca, 0x42, 0xaa, 0x64, 0x64, 0x9c, 0xc2, 0xa6, 0xda, 0xcd, 0xb6, 0xdc, 0x93, + 0xb7, 0xbc, 0x4e, 0x66, 0xe9, 0x9e, 0x5f, 0xc0, 0xfa, 0x91, 0xeb, 0xb9, 0x93, 0xc3, 0xcb, 0xb5, + 0x32, 0x33, 0x9e, 0xc1, 0xfa, 0x69, 0xa7, 0x77, 0x84, 0xe3, 0xd0, 0x4e, 0x06, 0x97, 0xe6, 0xc8, + 0x73, 0x8f, 0x70, 0xe4, 0x0e, 0x12, 0xb4, 0x01, 0xb5, 0x28, 0x08, 0x86, 0x16, 0x2d, 0x71, 0xba, + 0xae, 0x4a, 0x0c, 0x5d, 0x52, 0xde, 0x16, 0x14, 0x43, 0xec, 0x33, 0x6d, 0x92, 0x9f, 0x46, 0x17, + 0x6e, 0xe7, 0xe2, 0x74, 0x7c, 0x07, 0xbf, 0xc5, 0xce, 0xc8, 0xf6, 0xd0, 0x5d, 0xa8, 0xd3, 0x58, + 0x61, 0xe4, 0x5e, 0xe0, 0xf7, 0x3c, 0x0b, 0x62, 0xea, 0x51, 0x8b, 0x22, 0xde, 0x1f, 0x05, 0x58, + 0xce, 0x05, 0x44, 0x26, 0xac, 0x39, 0xec, 0xdb, 0x8a, 0x46, 0x9e, 0x6b, 0x39, 0x34, 0x55, 0x76, + 0x23, 0xef, 0x88, 0x54, 0x4d, 0x1e, 0xe8, 0xc5, 0x82, 0x89, 0x9c, 0xc9, 0x63, 0x7e, 0x0b, 0xba, + 0x1c, 0x13, 0x67, 0x69, 0xd3, 0x74, 0xea, 0xbb, 0xc6, 0xb4, 0xb8, 0xe3, 0x03, 0xbe, 0x58, 0x30, + 0x6f, 0x39, 0x4a, 0xcf, 0x41, 0x05, 0x4a, 0x24, 0xac, 0xf1, 0x4f, 0x41, 0x68, 0xec, 0x62, 0x14, + 0x5e, 0xaa, 0x4f, 0x53, 0x20, 0x3b, 0x8c, 0x3e, 0x6d, 0x53, 0x93, 0xa2, 0x48, 0x75, 0x78, 0x51, + 0xf9, 0x7c, 0x51, 0x4d, 0xd2, 0x92, 0xc6, 0xe8, 0x31, 0xac, 0x5c, 0x62, 0xc7, 0xb5, 0xc2, 0xcb, + 0xc0, 0x77, 0xc5, 0xe1, 0xb2, 0x6a, 0x2e, 0x13, 0x47, 0x8f, 0xd8, 0xd9, 0xbc, 0xa0, 0x78, 0xc2, + 0x2b, 0xca, 0x27, 0x9c, 0xf7, 0xa3, 0xd2, 0x94, 0x7e, 0x54, 0xce, 0x3d, 0x89, 0x3f, 0xa6, 0x8f, + 0x8e, 0x4c, 0xd8, 0x45, 0x80, 0x9e, 0xc0, 0x1a, 0x91, 0x64, 0x8e, 0x74, 0x2e, 0xcd, 0x95, 0x18, + 0x87, 0xd2, 0x12, 0x27, 0x23, 0x46, 0xbb, 0x39, 0x31, 0xc5, 0x79, 0x88, 0x29, 0xcd, 0x4d, 0xcc, + 0xe2, 0x4c, 0x62, 0xca, 0x53, 0x88, 0xa9, 0xe4, 0x88, 0x19, 0x77, 0x24, 0x85, 0x0c, 0x84, 0x8e, + 0x24, 0x7b, 0xe7, 0xe8, 0x48, 0x79, 0xaa, 0x79, 0x77, 0x38, 0x81, 0xcd, 0xac, 0x3b, 0xa8, 0x94, + 0x77, 0xd3, 0x8a, 0x18, 0xbf, 0x6b, 0xb0, 0x91, 0x69, 0xb9, 0x67, 0x47, 0x09, 0x1e, 0xe0, 0xd0, + 0xf6, 0x93, 0xb9, 0xbb, 0x0e, 0xba, 0x03, 0x75, 0x82, 0x18, 0xd8, 0x9e, 0x67, 0x25, 0x01, 0xbb, + 0xf7, 0xb5, 0x18, 0x87, 0x87, 0xb6, 0xe7, 0xf5, 0x03, 0xb9, 0xf9, 0x14, 0x73, 0xcd, 0xe7, 0x33, + 0x58, 0x0b, 0xc7, 0x9b, 0x5a, 0xd8, 0x71, 0xfd, 0x04, 0x27, 0x1f, 0x98, 0x32, 0x57, 0x05, 0x5f, + 0x87, 0xb9, 0xc8, 0x50, 0x29, 0x2e, 0x11, 0x9e, 0xad, 0x65, 0xc1, 0xae, 0x8a, 0x9e, 0x95, 0xb1, + 0x3a, 0x11, 0xfd, 0x2b, 0xfe, 0xf4, 0x22, 0x28, 0x39, 0xc9, 0xf0, 0x82, 0x2b, 0x80, 0xfc, 0x26, + 0x0f, 0x60, 0xe8, 0xd9, 0x1f, 0xac, 0x08, 0xfb, 0x6f, 0x92, 0xc0, 0x4f, 0xc7, 0xdd, 0xaa, 0xd9, + 0x20, 0x46, 0x93, 0xd9, 0x8c, 0xdf, 0x0a, 0x80, 0x64, 0x0a, 0xe9, 0x15, 0x79, 0x00, 0x4d, 0xf9, + 0x80, 0x8c, 0xc1, 0x25, 0xe9, 0x68, 0x53, 0x79, 0xd0, 0xa6, 0xf3, 0x30, 0x93, 0x57, 0xb1, 0x28, + 0xd8, 0x61, 0x74, 0xf2, 0xa2, 0x74, 0x9c, 0xc7, 0x57, 0xec, 0x4f, 0x28, 0x3e, 0x22, 0xdc, 0xa2, + 0xc9, 0x5b, 0x7d, 0x73, 0xbf, 0x7b, 0xda, 0x3b, 0x31, 0xfb, 0xd6, 0xfe, 0x59, 0xff, 0xa4, 0xb5, + 0x80, 0xd6, 0x61, 0x45, 0xb6, 0x9f, 0x1d, 0xf5, 0x5a, 0x85, 0x49, 0x73, 0xff, 0xb0, 0xd7, 0xd2, + 0x14, 0xe6, 0xe3, 0xd3, 0x56, 0x71, 0xf7, 0xef, 0x45, 0x28, 0x9e, 0x76, 0x7a, 0xe8, 0x18, 0x9a, + 0xf2, 0xdf, 0xe5, 0x68, 0xdc, 0xe7, 0x95, 0x7f, 0xb0, 0xb7, 0xd5, 0x33, 0x81, 0x51, 0xfc, 0x41, + 0x2b, 0xa0, 0x1e, 0x34, 0xc4, 0xb1, 0x02, 0x8d, 0xef, 0x8f, 0x62, 0x10, 0x69, 0x6f, 0x4d, 0xf1, + 0xa6, 0x77, 0x31, 0x8d, 0xf8, 0x5a, 0xf8, 0xbf, 0x81, 0x38, 0x12, 0xa0, 0x07, 0x93, 0x69, 0x2a, + 0x26, 0x90, 0xf6, 0xcc, 0x99, 0x02, 0x59, 0x70, 0x4b, 0x3d, 0x95, 0xa2, 0x8f, 0x26, 0xc3, 0xab, + 0xe6, 0x8d, 0xf6, 0xec, 0x01, 0x02, 0x7d, 0x97, 0x8d, 0x60, 0x52, 0xf2, 0xf7, 0xf2, 0x27, 0x57, + 0xa5, 0x7e, 0x7f, 0x36, 0x88, 0x75, 0xac, 0x41, 0x36, 0xc9, 0xc9, 0x07, 0x98, 0x58, 0xad, 0x4c, + 0xff, 0xc1, 0x35, 0x28, 0xb6, 0xc9, 0x73, 0x68, 0xca, 0x03, 0x90, 0xa0, 0x12, 0xe5, 0x64, 0x34, + 0x45, 0x25, 0x52, 0x39, 0xa5, 0xd9, 0x43, 0x51, 0x4e, 0x45, 0x2f, 0x6d, 0xcf, 0x6c, 0xc8, 0x02, + 0xdb, 0x52, 0xec, 0x09, 0xb6, 0x55, 0x91, 0xef, 0xcf, 0x06, 0x31, 0x22, 0x5e, 0x0b, 0x93, 0xe0, + 0x94, 0xfc, 0x67, 0xbd, 0x05, 0xd7, 0xe4, 0xff, 0x0a, 0xd6, 0x54, 0x7d, 0x5f, 0xa8, 0xe5, 0x8c, + 0x67, 0xa1, 0xbd, 0x21, 0xc6, 0xce, 0xf5, 0xbc, 0x83, 0x67, 0xdf, 0xdc, 0x7b, 0x83, 0x93, 0xcb, + 0xd1, 0xf9, 0xce, 0x20, 0x18, 0x3e, 0x61, 0xc0, 0x27, 0xf4, 0xbf, 0x74, 0x83, 0xc0, 0xe3, 0x86, + 0x5f, 0xb5, 0xa5, 0x63, 0xfc, 0xd6, 0x7d, 0x89, 0x93, 0x9d, 0x1e, 0x71, 0xfd, 0xa5, 0x35, 0xd9, + 0xf7, 0xd3, 0xa7, 0xd4, 0x70, 0x5e, 0xa1, 0x4b, 0xf6, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x9b, + 0x8f, 0xc0, 0x08, 0xed, 0x13, 0x00, 0x00, } diff --git a/livekit/sip.go b/livekit/sip.go new file mode 100644 index 000000000..3b3ade6c9 --- /dev/null +++ b/livekit/sip.go @@ -0,0 +1,96 @@ +package livekit + +// ToProto implements DataPacket in Go SDK. +func (p *SipDTMF) ToProto() *DataPacket { + return &DataPacket{ + Value: &DataPacket_SipDtmf{ + SipDtmf: p, + }, + } +} + +// AsInbound converts legacy SIPTrunkInfo to SIPInboundTrunkInfo. +func (p *SIPTrunkInfo) AsInbound() *SIPInboundTrunkInfo { + if p == nil || p.Kind == SIPTrunkInfo_TRUNK_OUTBOUND { + return nil + } + var nums []string + if p.OutboundNumber != "" { + nums = []string{p.OutboundNumber} + } + return &SIPInboundTrunkInfo{ + SipTrunkId: p.SipTrunkId, + Name: p.Name, + Metadata: p.Metadata, + Numbers: nums, + AllowedAddresses: p.InboundAddresses, + AllowedNumbers: p.InboundNumbers, + AuthUsername: p.InboundUsername, + AuthPassword: p.InboundPassword, + } +} + +// AsTrunkInfo converts SIPInboundTrunkInfo to legacy SIPTrunkInfo. +func (p *SIPInboundTrunkInfo) AsTrunkInfo() *SIPTrunkInfo { + if p == nil { + return nil + } + var num string + if len(p.Numbers) != 0 { + num = p.Numbers[0] + } + return &SIPTrunkInfo{ + SipTrunkId: p.SipTrunkId, + Kind: SIPTrunkInfo_TRUNK_INBOUND, + Name: p.Name, + Metadata: p.Metadata, + OutboundNumber: num, + InboundAddresses: p.AllowedAddresses, + InboundNumbers: p.AllowedNumbers, + InboundUsername: p.AuthUsername, + InboundPassword: p.AuthPassword, + } +} + +// AsOutbound converts legacy SIPTrunkInfo to SIPOutboundTrunkInfo. +func (p *SIPTrunkInfo) AsOutbound() *SIPOutboundTrunkInfo { + if p == nil || p.Kind == SIPTrunkInfo_TRUNK_INBOUND { + return nil + } + var nums []string + if p.OutboundNumber != "" { + nums = []string{p.OutboundNumber} + } + return &SIPOutboundTrunkInfo{ + SipTrunkId: p.SipTrunkId, + Name: p.Name, + Metadata: p.Metadata, + Address: p.OutboundAddress, + Transport: p.Transport, + Numbers: nums, + AuthUsername: p.InboundUsername, + AuthPassword: p.InboundPassword, + } +} + +// AsTrunkInfo converts SIPOutboundTrunkInfo to legacy SIPTrunkInfo. +func (p *SIPOutboundTrunkInfo) AsTrunkInfo() *SIPTrunkInfo { + if p == nil { + return nil + } + var num string + if len(p.Numbers) != 0 { + num = p.Numbers[0] + } + return &SIPTrunkInfo{ + SipTrunkId: p.SipTrunkId, + Kind: SIPTrunkInfo_TRUNK_OUTBOUND, + Name: p.Name, + Metadata: p.Metadata, + OutboundAddress: p.Address, + Transport: p.Transport, + OutboundNumber: num, + OutboundUsername: p.AuthUsername, + OutboundPassword: p.AuthPassword, + } +} diff --git a/livekit/types.go b/livekit/types.go index d93c56176..899fc638f 100644 --- a/livekit/types.go +++ b/livekit/types.go @@ -57,12 +57,3 @@ type Guid interface { } type GuidBlock [9]byte - -// ToProto implements DataPacket in Go SDK. -func (p *SipDTMF) ToProto() *DataPacket { - return &DataPacket{ - Value: &DataPacket_SipDtmf{ - SipDtmf: p, - }, - } -} diff --git a/protobufs/livekit_sip.proto b/protobufs/livekit_sip.proto index 807a13ca9..489348182 100644 --- a/protobufs/livekit_sip.proto +++ b/protobufs/livekit_sip.proto @@ -47,8 +47,13 @@ option ruby_package = "LiveKit::Proto"; service SIP { - rpc CreateSIPTrunk(CreateSIPTrunkRequest) returns (SIPTrunkInfo); - rpc ListSIPTrunk(ListSIPTrunkRequest) returns (ListSIPTrunkResponse); + rpc CreateSIPTrunk(CreateSIPTrunkRequest) returns (SIPTrunkInfo) { option deprecated = true; }; + rpc ListSIPTrunk(ListSIPTrunkRequest) returns (ListSIPTrunkResponse) { option deprecated = true; }; + + rpc CreateSIPInboundTrunk(CreateSIPInboundTrunkRequest) returns (SIPInboundTrunkInfo); + rpc CreateSIPOutboundTrunk(CreateSIPOutboundTrunkRequest) returns (SIPOutboundTrunkInfo); + rpc ListSIPInboundTrunk(ListSIPInboundTrunkRequest) returns (ListSIPInboundTrunkResponse); + rpc ListSIPOutboundTrunk(ListSIPOutboundTrunkRequest) returns (ListSIPOutboundTrunkResponse); rpc DeleteSIPTrunk(DeleteSIPTrunkRequest) returns (SIPTrunkInfo); rpc CreateSIPDispatchRule(CreateSIPDispatchRuleRequest) returns (SIPDispatchRuleInfo); @@ -60,6 +65,7 @@ service SIP { message CreateSIPTrunkRequest { + option deprecated = true; // CIDR or IPs that traffic is accepted from // An empty list means all inbound traffic is accepted. repeated string inbound_addresses = 1; @@ -98,7 +104,16 @@ enum SIPTransport { } message SIPTrunkInfo { + option deprecated = true; + + enum TrunkKind { + TRUNK_LEGACY = 0; + TRUNK_INBOUND = 1; + TRUNK_OUTBOUND = 2; + } + string sip_trunk_id = 1; + TrunkKind kind = 14; // CIDR or IPs that traffic is accepted from // An empty list means all inbound traffic is accepted. @@ -132,16 +147,90 @@ message SIPTrunkInfo { // User-defined metadata for the Trunk. string metadata = 12; - // NEXT ID: 14 + // NEXT ID: 15 +} + +message CreateSIPInboundTrunkRequest { + SIPInboundTrunkInfo trunk = 1; // Trunk ID is ignored +} + +message SIPInboundTrunkInfo { + string sip_trunk_id = 1; + + // Human-readable name for the Trunk. + string name = 2; + // User-defined metadata for the Trunk. + string metadata = 3; + + // Numbers associated with LiveKit SIP. The Trunk will only accept calls made to these numbers. + // Creating multiple Trunks with different phone numbers allows having different rules for a single provider. + repeated string numbers = 4; + + // CIDR or IPs that traffic is accepted from. + // An empty list means all inbound traffic is accepted. + repeated string allowed_addresses = 5; + + // Numbers that are allowed to make calls to this Trunk. + // An empty list means calls from any phone number is accepted. + repeated string allowed_numbers = 6; + + // Username and password used to authenticate inbound SIP invites. + // May be empty to have no authentication. + string auth_username = 7; + string auth_password = 8; +} + +message CreateSIPOutboundTrunkRequest { + SIPOutboundTrunkInfo trunk = 1; // Trunk ID is ignored +} + +message SIPOutboundTrunkInfo { + string sip_trunk_id = 1; + + // Human-readable name for the Trunk. + string name = 2; + // User-defined metadata for the Trunk. + string metadata = 3; + + // Hostname or IP that SIP INVITE is sent too. + // Note that this is not a SIP URI and should not contain the 'sip:' protocol prefix. + string address = 4; + + // SIP Transport used for outbound call. + SIPTransport transport = 5; + + // Numbers used to make the calls. Random one from this list will be selected. + repeated string numbers = 6; + + // Username and password used to authenticate with SIP server. + // May be empty to have no authentication. + string auth_username = 7; + string auth_password = 8; } message ListSIPTrunkRequest { + option deprecated = true; } message ListSIPTrunkResponse { + option deprecated = true; repeated SIPTrunkInfo items = 1; } +message ListSIPInboundTrunkRequest { +} + +message ListSIPInboundTrunkResponse { + repeated SIPInboundTrunkInfo items = 1; +} + +message ListSIPOutboundTrunkRequest { +} + +message ListSIPOutboundTrunkResponse { + repeated SIPOutboundTrunkInfo items = 1; +} + message DeleteSIPTrunkRequest { string sip_trunk_id = 1; } diff --git a/rpc/sip.go b/rpc/sip.go index 516da473e..b09edf84e 100644 --- a/rpc/sip.go +++ b/rpc/sip.go @@ -1,6 +1,8 @@ package rpc import ( + "errors" + "math/rand/v2" "strings" "github.com/livekit/protocol/livekit" @@ -11,15 +13,18 @@ import ( func NewCreateSIPParticipantRequest( callID, wsUrl, token string, req *livekit.CreateSIPParticipantRequest, - trunk *livekit.SIPTrunkInfo, -) *InternalCreateSIPParticipantRequest { + trunk *livekit.SIPOutboundTrunkInfo, +) (*InternalCreateSIPParticipantRequest, error) { + if len(trunk.Numbers) == 0 { + return nil, errors.New("no numbers on outbound trunk") + } + outboundNumber := trunk.Numbers[rand.IntN(len(trunk.Numbers))] // A sanity check for the number format for well-known providers. - outboundNumber := trunk.OutboundNumber switch { - case strings.HasSuffix(trunk.OutboundAddress, "telnyx.com"): + case strings.HasSuffix(trunk.Address, "telnyx.com"): // Telnyx omits leading '+' by default. outboundNumber = strings.TrimPrefix(outboundNumber, "+") - case strings.HasSuffix(trunk.OutboundAddress, "twilio.com"): + case strings.HasSuffix(trunk.Address, "twilio.com"): // Twilio requires leading '+'. if !strings.HasPrefix(outboundNumber, "+") { outboundNumber = "+" + outboundNumber @@ -27,11 +32,11 @@ func NewCreateSIPParticipantRequest( } return &InternalCreateSIPParticipantRequest{ SipCallId: callID, - Address: trunk.OutboundAddress, + Address: trunk.Address, Transport: trunk.Transport, Number: outboundNumber, - Username: trunk.OutboundUsername, - Password: trunk.OutboundPassword, + Username: trunk.AuthUsername, + Password: trunk.AuthPassword, CallTo: req.SipCallTo, WsUrl: wsUrl, Token: token, @@ -41,5 +46,5 @@ func NewCreateSIPParticipantRequest( ParticipantMetadata: req.ParticipantMetadata, Dtmf: req.Dtmf, PlayRingtone: req.PlayRingtone, - } + }, nil } diff --git a/sip/sip.go b/sip/sip.go index 6ca46f841..fc2d65a0b 100644 --- a/sip/sip.go +++ b/sip/sip.go @@ -18,9 +18,7 @@ import ( "fmt" "math" "net/netip" - "regexp" "sort" - "strconv" "strings" "golang.org/x/exp/slices" @@ -183,11 +181,11 @@ func GetPinAndRoom(info *livekit.SIPDispatchRuleInfo) (room, pin string, err err return room, pin, nil } -func printNumber(s string) string { - if s == "" { +func printNumbers(numbers []string) string { + if len(numbers) == 0 { return "" } - return strconv.Quote(s) + return fmt.Sprintf("%q", numbers) } func normalizeNumber(num string) string { @@ -202,37 +200,53 @@ func normalizeNumber(num string) string { return num } +func validateTrunkInbound(byInbound map[string]*livekit.SIPInboundTrunkInfo, t *livekit.SIPInboundTrunkInfo) error { + if len(t.AllowedNumbers) == 0 { + if t2 := byInbound[""]; t2 != nil { + return fmt.Errorf("Conflicting inbound SIP Trunks: %q and %q, using the same number(s) %s without AllowedNumbers set", + printID(t.SipTrunkId), printID(t2.SipTrunkId), printNumbers(t.Numbers)) + } + byInbound[""] = t + } else { + for _, num := range t.AllowedNumbers { + inboundKey := normalizeNumber(num) + t2 := byInbound[inboundKey] + if t2 != nil { + return fmt.Errorf("Conflicting inbound SIP Trunks: %q and %q, using the same number(s) %s and AllowedNumber %q", + printID(t.SipTrunkId), printID(t2.SipTrunkId), printNumbers(t.Numbers), num) + } + byInbound[inboundKey] = t + } + } + return nil +} + // ValidateTrunks checks a set of trunks for conflicts. -func ValidateTrunks(trunks []*livekit.SIPTrunkInfo) error { +func ValidateTrunks(trunks []*livekit.SIPInboundTrunkInfo) error { if len(trunks) == 0 { return nil } - byOutboundAndInbound := make(map[string]map[string]*livekit.SIPTrunkInfo) + byOutboundAndInbound := make(map[string]map[string]*livekit.SIPInboundTrunkInfo) for _, t := range trunks { - if len(t.InboundNumbersRegex) != 0 { - continue // can't effectively validate these - } - outboundKey := normalizeNumber(t.OutboundNumber) - byInbound := byOutboundAndInbound[outboundKey] - if byInbound == nil { - byInbound = make(map[string]*livekit.SIPTrunkInfo) - byOutboundAndInbound[outboundKey] = byInbound - } - if len(t.InboundNumbers) == 0 { - if t2 := byInbound[""]; t2 != nil { - return fmt.Errorf("Conflicting SIP Trunks: %q and %q, using the same OutboundNumber %s without InboundNumbers set", - printID(t.SipTrunkId), printID(t2.SipTrunkId), printNumber(t.OutboundNumber)) + if len(t.Numbers) == 0 { + byInbound := byOutboundAndInbound[""] + if byInbound == nil { + byInbound = make(map[string]*livekit.SIPInboundTrunkInfo) + byOutboundAndInbound[""] = byInbound + } + if err := validateTrunkInbound(byInbound, t); err != nil { + return err } - byInbound[""] = t } else { - for _, num := range t.InboundNumbers { - inboundKey := normalizeNumber(num) - t2 := byInbound[inboundKey] - if t2 != nil { - return fmt.Errorf("Conflicting SIP Trunks: %q and %q, using the same OutboundNumber %s and InboundNumber %q", - printID(t.SipTrunkId), printID(t2.SipTrunkId), printNumber(t.OutboundNumber), num) + for _, num := range t.Numbers { + byInbound := byOutboundAndInbound[num] + if byInbound == nil { + byInbound = make(map[string]*livekit.SIPInboundTrunkInfo) + byOutboundAndInbound[num] = byInbound + } + if err := validateTrunkInbound(byInbound, t); err != nil { + return err } - byInbound[inboundKey] = t } } } @@ -281,49 +295,36 @@ func matchNumbers(num string, allowed []string) bool { // MatchTrunk finds a SIP Trunk definition matching the request. // Returns nil if no rules matched or an error if there are conflicting definitions. -func MatchTrunk(trunks []*livekit.SIPTrunkInfo, srcIP, calling, called string) (*livekit.SIPTrunkInfo, error) { +func MatchTrunk(trunks []*livekit.SIPInboundTrunkInfo, srcIP, calling, called string) (*livekit.SIPInboundTrunkInfo, error) { var ( - selectedTrunk *livekit.SIPTrunkInfo - defaultTrunk *livekit.SIPTrunkInfo + selectedTrunk *livekit.SIPInboundTrunkInfo + defaultTrunk *livekit.SIPInboundTrunkInfo defaultTrunkCnt int // to error in case there are multiple ones ) calledNorm := normalizeNumber(called) for _, tr := range trunks { // Do not consider it if number doesn't match. - if !matchNumbers(calling, tr.InboundNumbers) { + if !matchNumbers(calling, tr.AllowedNumbers) { continue } - if !matchAddrMasks(srcIP, tr.InboundAddresses) { - continue - } - // Deprecated, but we still check it for backward compatibility. - matchesRe := len(tr.InboundNumbersRegex) == 0 - for _, reStr := range tr.InboundNumbersRegex { - // TODO: we should cache it - re, err := regexp.Compile(reStr) - if err != nil { - logger.Errorw("cannot parse SIP trunk regexp", err, "trunkID", tr.SipTrunkId) - continue - } - if re.MatchString(calling) { - matchesRe = true - break - } - } - if !matchesRe { + if !matchAddrMasks(srcIP, tr.AllowedAddresses) { continue } - if tr.OutboundNumber == "" { + if len(tr.Numbers) == 0 { // Default/wildcard trunk. defaultTrunk = tr defaultTrunkCnt++ - } else if normalizeNumber(tr.OutboundNumber) == calledNorm { - // Trunk specific to the number. - if selectedTrunk != nil { - return nil, fmt.Errorf("Multiple SIP Trunks matched for %q", called) + } else { + for _, num := range tr.Numbers { + if normalizeNumber(num) == calledNorm { + // Trunk specific to the number. + if selectedTrunk != nil { + return nil, fmt.Errorf("Multiple SIP Trunks matched for %q", called) + } + selectedTrunk = tr + // Keep searching! We want to know if there are any conflicting Trunk definitions. + } } - selectedTrunk = tr - // Keep searching! We want to know if there are any conflicting Trunk definitions. } } if selectedTrunk != nil { @@ -338,7 +339,7 @@ func MatchTrunk(trunks []*livekit.SIPTrunkInfo, srcIP, calling, called string) ( // MatchDispatchRule finds the best dispatch rule matching the request parameters. Returns an error if no rule matched. // Trunk parameter can be nil, in which case only wildcard dispatch rules will be effective (ones without Trunk IDs). -func MatchDispatchRule(trunk *livekit.SIPTrunkInfo, rules []*livekit.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*livekit.SIPDispatchRuleInfo, error) { +func MatchDispatchRule(trunk *livekit.SIPInboundTrunkInfo, rules []*livekit.SIPDispatchRuleInfo, req *rpc.EvaluateSIPDispatchRulesRequest) (*livekit.SIPDispatchRuleInfo, error) { // Trunk can still be nil here in case none matched or were defined. // This is still fine, but only in case we'll match exactly one wildcard dispatch rule. if len(rules) == 0 { diff --git a/sip/sip_test.go b/sip/sip_test.go index 93dc51dce..037ca5550 100644 --- a/sip/sip_test.go +++ b/sip/sip_test.go @@ -90,13 +90,6 @@ var trunkCases = []struct { }, exp: -1, }, - { - name: "not matching regexp", - trunks: []*livekit.SIPTrunkInfo{ - {SipTrunkId: "aaa", OutboundNumber: sipNumber2, InboundNumbersRegex: []string{`^\d+$`}}, - }, - exp: -1, - }, { name: "one match", trunks: []*livekit.SIPTrunkInfo{ @@ -135,15 +128,6 @@ var trunkCases = []struct { }, exp: 1, }, - { - name: "regexp", - trunks: []*livekit.SIPTrunkInfo{ - {SipTrunkId: "aaa", OutboundNumber: sipNumber3}, - {SipTrunkId: "bbb", OutboundNumber: sipNumber2}, - {SipTrunkId: "ccc", OutboundNumber: sipNumber2, InboundNumbersRegex: []string{`^\d+$`}}, - }, - exp: 1, - }, { name: "multiple defaults", trunks: []*livekit.SIPTrunkInfo{ @@ -212,6 +196,14 @@ var trunkCases = []struct { }, } +func toInboundTrunks(trunks []*livekit.SIPTrunkInfo) []*livekit.SIPInboundTrunkInfo { + out := make([]*livekit.SIPInboundTrunkInfo, 0, len(trunks)) + for _, t := range trunks { + out = append(out, t.AsInbound()) + } + return out +} + func TestSIPMatchTrunk(t *testing.T) { for _, c := range trunkCases { c := c @@ -226,15 +218,16 @@ func TestSIPMatchTrunk(t *testing.T) { if src == "" { src = "1.1.1.1" } - got, err := MatchTrunk(c.trunks, src, from, to) + trunks := toInboundTrunks(c.trunks) + got, err := MatchTrunk(trunks, src, from, to) if c.expErr { require.Error(t, err) require.Nil(t, got) t.Log(err) } else { - var exp *livekit.SIPTrunkInfo + var exp *livekit.SIPInboundTrunkInfo if c.exp >= 0 { - exp = c.trunks[c.exp] + exp = trunks[c.exp] } require.NoError(t, err) require.Equal(t, exp, got) @@ -252,7 +245,7 @@ func TestSIPValidateTrunks(t *testing.T) { r.SipTrunkId = strconv.Itoa(i) } } - err := ValidateTrunks(c.trunks) + err := ValidateTrunks(toInboundTrunks(c.trunks)) if c.invalid { require.Error(t, err) } else { @@ -547,7 +540,7 @@ func TestSIPMatchDispatchRule(t *testing.T) { name = "no pin" } t.Run(name, func(t *testing.T) { - got, err := MatchDispatchRule(c.trunk, c.rules, newSIPReqDispatch(pin, c.noPin)) + got, err := MatchDispatchRule(c.trunk.AsInbound(), c.rules, newSIPReqDispatch(pin, c.noPin)) if c.expErr { require.Error(t, err) require.Nil(t, got)