diff --git a/.changeset/legal-paths-chew.md b/.changeset/legal-paths-chew.md new file mode 100644 index 000000000..761a60342 --- /dev/null +++ b/.changeset/legal-paths-chew.md @@ -0,0 +1,5 @@ +--- +"github.com/livekit/protocol": minor +--- + +Utilities for phone number functionality diff --git a/go.mod b/go.mod index 25fa18de8..0accc6f55 100644 --- a/go.mod +++ b/go.mod @@ -63,6 +63,7 @@ require ( github.com/nats-io/nats.go v1.43.0 // indirect github.com/nats-io/nkeys v0.4.11 // indirect github.com/nats-io/nuid v1.0.1 // indirect + github.com/nyaruka/phonenumbers v1.6.5 // indirect github.com/pion/datachannel v1.5.10 // indirect github.com/pion/dtls/v3 v3.0.6 // indirect github.com/pion/ice/v4 v4.0.10 // indirect diff --git a/go.sum b/go.sum index a884cfd09..e9c05d2c8 100644 --- a/go.sum +++ b/go.sum @@ -117,6 +117,8 @@ github.com/nats-io/nkeys v0.4.11 h1:q44qGV008kYd9W1b1nEBkNzvnWxtRSQ7A8BoqRrcfa0= github.com/nats-io/nkeys v0.4.11/go.mod h1:szDimtgmfOi9n25JpfIdGw12tZFYXqhGxjhVxsatHVE= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nyaruka/phonenumbers v1.6.5 h1:aBCaUhfpRA7hU6fsXk+p7KF1aNx4nQlq9hGeo2qdFg8= +github.com/nyaruka/phonenumbers v1.6.5/go.mod h1:7gjs+Lchqm49adhAKB5cdcng5ZXgt6x7Jgvi0ZorUtU= github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= diff --git a/livekit/livekit_phone_number.pb.go b/livekit/livekit_phone_number.pb.go index b8a58b2e0..50b720867 100644 --- a/livekit/livekit_phone_number.pb.go +++ b/livekit/livekit_phone_number.pb.go @@ -75,6 +75,59 @@ func (PhoneNumberStatus) EnumDescriptor() ([]byte, []int) { return file_livekit_phone_number_proto_rawDescGZIP(), []int{0} } +// Phone number type enumeration +type PhoneNumberType int32 + +const ( + PhoneNumberType_PHONE_NUMBER_TYPE_UNKNOWN PhoneNumberType = 0 // Default value - unknown or parsing error + PhoneNumberType_PHONE_NUMBER_TYPE_MOBILE PhoneNumberType = 1 // Mobile phone number + PhoneNumberType_PHONE_NUMBER_TYPE_LOCAL PhoneNumberType = 2 // Local/fixed line number + PhoneNumberType_PHONE_NUMBER_TYPE_TOLL_FREE PhoneNumberType = 3 // Toll-free number +) + +// Enum value maps for PhoneNumberType. +var ( + PhoneNumberType_name = map[int32]string{ + 0: "PHONE_NUMBER_TYPE_UNKNOWN", + 1: "PHONE_NUMBER_TYPE_MOBILE", + 2: "PHONE_NUMBER_TYPE_LOCAL", + 3: "PHONE_NUMBER_TYPE_TOLL_FREE", + } + PhoneNumberType_value = map[string]int32{ + "PHONE_NUMBER_TYPE_UNKNOWN": 0, + "PHONE_NUMBER_TYPE_MOBILE": 1, + "PHONE_NUMBER_TYPE_LOCAL": 2, + "PHONE_NUMBER_TYPE_TOLL_FREE": 3, + } +) + +func (x PhoneNumberType) Enum() *PhoneNumberType { + p := new(PhoneNumberType) + *p = x + return p +} + +func (x PhoneNumberType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PhoneNumberType) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_phone_number_proto_enumTypes[1].Descriptor() +} + +func (PhoneNumberType) Type() protoreflect.EnumType { + return &file_livekit_phone_number_proto_enumTypes[1] +} + +func (x PhoneNumberType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PhoneNumberType.Descriptor instead. +func (PhoneNumberType) EnumDescriptor() ([]byte, []int) { + return file_livekit_phone_number_proto_rawDescGZIP(), []int{1} +} + // SearchPhoneNumbersRequest - Request to search available phone numbers type SearchPhoneNumbersRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -722,21 +775,21 @@ func (*ReleasePhoneNumbersResponse) Descriptor() ([]byte, []int) { // PhoneNumber - Unified phone number type for inventory and purchased numbers type PhoneNumber struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier - E164Format string `protobuf:"bytes,2,opt,name=e164_format,json=e164Format,proto3" json:"e164_format,omitempty"` // Phone number in E.164 format (e.g., "+14155552671") - CountryCode string `protobuf:"bytes,3,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` // Country code (e.g., "US") - AreaCode string `protobuf:"bytes,4,opt,name=area_code,json=areaCode,proto3" json:"area_code,omitempty"` // Area code (e.g., "415") - NumberType string `protobuf:"bytes,5,opt,name=number_type,json=numberType,proto3" json:"number_type,omitempty"` // Number type (e.g., local, toll-free, national, mobile) - Locality string `protobuf:"bytes,6,opt,name=locality,proto3" json:"locality,omitempty"` // City/locality (e.g., "San Francisco") - Region string `protobuf:"bytes,7,opt,name=region,proto3" json:"region,omitempty"` // State/region (e.g., "CA") - SpamScore float64 `protobuf:"fixed64,8,opt,name=spam_score,json=spamScore,proto3" json:"spam_score,omitempty"` // Spam score for fraud detection - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Creation timestamp - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Last update timestamp - Capabilities []string `protobuf:"bytes,11,rep,name=capabilities,proto3" json:"capabilities,omitempty"` // Available capabilities (e.g., "voice", "sms") - Status PhoneNumberStatus `protobuf:"varint,12,opt,name=status,proto3,enum=livekit.PhoneNumberStatus" json:"status,omitempty"` // Current status - AssignedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=assigned_at,json=assignedAt,proto3" json:"assigned_at,omitempty"` // Assignment timestamp - ReleasedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=released_at,json=releasedAt,proto3" json:"released_at,omitempty"` // Release timestamp (if applicable) - SipDispatchRuleId string `protobuf:"bytes,15,opt,name=sip_dispatch_rule_id,json=sipDispatchRuleId,proto3" json:"sip_dispatch_rule_id,omitempty"` // Associated SIP dispatch rule ID + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier + E164Format string `protobuf:"bytes,2,opt,name=e164_format,json=e164Format,proto3" json:"e164_format,omitempty"` // Phone number in E.164 format (e.g., "+14155552671") + CountryCode string `protobuf:"bytes,3,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` // Country code (e.g., "US") + AreaCode string `protobuf:"bytes,4,opt,name=area_code,json=areaCode,proto3" json:"area_code,omitempty"` // Area code (e.g., "415") + NumberType PhoneNumberType `protobuf:"varint,5,opt,name=number_type,json=numberType,proto3,enum=livekit.PhoneNumberType" json:"number_type,omitempty"` // Number type (mobile, local, toll-free, unknown) + Locality string `protobuf:"bytes,6,opt,name=locality,proto3" json:"locality,omitempty"` // City/locality (e.g., "San Francisco") + Region string `protobuf:"bytes,7,opt,name=region,proto3" json:"region,omitempty"` // State/region (e.g., "CA") + SpamScore float64 `protobuf:"fixed64,8,opt,name=spam_score,json=spamScore,proto3" json:"spam_score,omitempty"` // Spam score for fraud detection + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Creation timestamp + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Last update timestamp + Capabilities []string `protobuf:"bytes,11,rep,name=capabilities,proto3" json:"capabilities,omitempty"` // Available capabilities (e.g., "voice", "sms") + Status PhoneNumberStatus `protobuf:"varint,12,opt,name=status,proto3,enum=livekit.PhoneNumberStatus" json:"status,omitempty"` // Current status + AssignedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=assigned_at,json=assignedAt,proto3" json:"assigned_at,omitempty"` // Assignment timestamp + ReleasedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=released_at,json=releasedAt,proto3" json:"released_at,omitempty"` // Release timestamp (if applicable) + SipDispatchRuleId string `protobuf:"bytes,15,opt,name=sip_dispatch_rule_id,json=sipDispatchRuleId,proto3" json:"sip_dispatch_rule_id,omitempty"` // Associated SIP dispatch rule ID unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -799,11 +852,11 @@ func (x *PhoneNumber) GetAreaCode() string { return "" } -func (x *PhoneNumber) GetNumberType() string { +func (x *PhoneNumber) GetNumberType() PhoneNumberType { if x != nil { return x.NumberType } - return "" + return PhoneNumberType_PHONE_NUMBER_TYPE_UNKNOWN } func (x *PhoneNumber) GetLocality() string { @@ -920,14 +973,14 @@ const file_livekit_phone_number_proto_rawDesc = "" + "\x1aReleasePhoneNumbersRequest\x12\x10\n" + "\x03ids\x18\x01 \x03(\tR\x03ids\x12#\n" + "\rphone_numbers\x18\x02 \x03(\tR\fphoneNumbers\"\x1d\n" + - "\x1bReleasePhoneNumbersResponse\"\xeb\x04\n" + + "\x1bReleasePhoneNumbersResponse\"\x85\x05\n" + "\vPhoneNumber\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" + "\ve164_format\x18\x02 \x01(\tR\n" + "e164Format\x12!\n" + "\fcountry_code\x18\x03 \x01(\tR\vcountryCode\x12\x1b\n" + - "\tarea_code\x18\x04 \x01(\tR\bareaCode\x12\x1f\n" + - "\vnumber_type\x18\x05 \x01(\tR\n" + + "\tarea_code\x18\x04 \x01(\tR\bareaCode\x129\n" + + "\vnumber_type\x18\x05 \x01(\x0e2\x18.livekit.PhoneNumberTypeR\n" + "numberType\x12\x1a\n" + "\blocality\x18\x06 \x01(\tR\blocality\x12\x16\n" + "\x06region\x18\a \x01(\tR\x06region\x12\x1d\n" + @@ -949,7 +1002,12 @@ const file_livekit_phone_number_proto_rawDesc = "" + "\x1fPHONE_NUMBER_STATUS_UNSPECIFIED\x10\x00\x12\x1e\n" + "\x1aPHONE_NUMBER_STATUS_ACTIVE\x10\x01\x12\x1f\n" + "\x1bPHONE_NUMBER_STATUS_PENDING\x10\x02\x12 \n" + - "\x1cPHONE_NUMBER_STATUS_RELEASED\x10\x032\xcb\x04\n" + + "\x1cPHONE_NUMBER_STATUS_RELEASED\x10\x03*\x8c\x01\n" + + "\x0fPhoneNumberType\x12\x1d\n" + + "\x19PHONE_NUMBER_TYPE_UNKNOWN\x10\x00\x12\x1c\n" + + "\x18PHONE_NUMBER_TYPE_MOBILE\x10\x01\x12\x1b\n" + + "\x17PHONE_NUMBER_TYPE_LOCAL\x10\x02\x12\x1f\n" + + "\x1bPHONE_NUMBER_TYPE_TOLL_FREE\x10\x032\xcb\x04\n" + "\x12PhoneNumberService\x12_\n" + "\x12SearchPhoneNumbers\x12\".livekit.SearchPhoneNumbersRequest\x1a#.livekit.SearchPhoneNumbersResponse\"\x00\x12b\n" + "\x13PurchasePhoneNumber\x12#.livekit.PurchasePhoneNumberRequest\x1a$.livekit.PurchasePhoneNumberResponse\"\x00\x12Y\n" + @@ -970,59 +1028,61 @@ func file_livekit_phone_number_proto_rawDescGZIP() []byte { return file_livekit_phone_number_proto_rawDescData } -var file_livekit_phone_number_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_livekit_phone_number_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_livekit_phone_number_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_livekit_phone_number_proto_goTypes = []any{ (PhoneNumberStatus)(0), // 0: livekit.PhoneNumberStatus - (*SearchPhoneNumbersRequest)(nil), // 1: livekit.SearchPhoneNumbersRequest - (*SearchPhoneNumbersResponse)(nil), // 2: livekit.SearchPhoneNumbersResponse - (*PurchasePhoneNumberRequest)(nil), // 3: livekit.PurchasePhoneNumberRequest - (*PurchasePhoneNumberResponse)(nil), // 4: livekit.PurchasePhoneNumberResponse - (*ListPhoneNumbersRequest)(nil), // 5: livekit.ListPhoneNumbersRequest - (*ListPhoneNumbersResponse)(nil), // 6: livekit.ListPhoneNumbersResponse - (*GetPhoneNumberRequest)(nil), // 7: livekit.GetPhoneNumberRequest - (*GetPhoneNumberResponse)(nil), // 8: livekit.GetPhoneNumberResponse - (*UpdatePhoneNumberRequest)(nil), // 9: livekit.UpdatePhoneNumberRequest - (*UpdatePhoneNumberResponse)(nil), // 10: livekit.UpdatePhoneNumberResponse - (*ReleasePhoneNumbersRequest)(nil), // 11: livekit.ReleasePhoneNumbersRequest - (*ReleasePhoneNumbersResponse)(nil), // 12: livekit.ReleasePhoneNumbersResponse - (*PhoneNumber)(nil), // 13: livekit.PhoneNumber - (*TokenPagination)(nil), // 14: livekit.TokenPagination - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp + (PhoneNumberType)(0), // 1: livekit.PhoneNumberType + (*SearchPhoneNumbersRequest)(nil), // 2: livekit.SearchPhoneNumbersRequest + (*SearchPhoneNumbersResponse)(nil), // 3: livekit.SearchPhoneNumbersResponse + (*PurchasePhoneNumberRequest)(nil), // 4: livekit.PurchasePhoneNumberRequest + (*PurchasePhoneNumberResponse)(nil), // 5: livekit.PurchasePhoneNumberResponse + (*ListPhoneNumbersRequest)(nil), // 6: livekit.ListPhoneNumbersRequest + (*ListPhoneNumbersResponse)(nil), // 7: livekit.ListPhoneNumbersResponse + (*GetPhoneNumberRequest)(nil), // 8: livekit.GetPhoneNumberRequest + (*GetPhoneNumberResponse)(nil), // 9: livekit.GetPhoneNumberResponse + (*UpdatePhoneNumberRequest)(nil), // 10: livekit.UpdatePhoneNumberRequest + (*UpdatePhoneNumberResponse)(nil), // 11: livekit.UpdatePhoneNumberResponse + (*ReleasePhoneNumbersRequest)(nil), // 12: livekit.ReleasePhoneNumbersRequest + (*ReleasePhoneNumbersResponse)(nil), // 13: livekit.ReleasePhoneNumbersResponse + (*PhoneNumber)(nil), // 14: livekit.PhoneNumber + (*TokenPagination)(nil), // 15: livekit.TokenPagination + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp } var file_livekit_phone_number_proto_depIdxs = []int32{ - 14, // 0: livekit.SearchPhoneNumbersRequest.page_token:type_name -> livekit.TokenPagination - 13, // 1: livekit.SearchPhoneNumbersResponse.items:type_name -> livekit.PhoneNumber - 14, // 2: livekit.SearchPhoneNumbersResponse.next_page_token:type_name -> livekit.TokenPagination - 13, // 3: livekit.PurchasePhoneNumberResponse.phone_numbers:type_name -> livekit.PhoneNumber + 15, // 0: livekit.SearchPhoneNumbersRequest.page_token:type_name -> livekit.TokenPagination + 14, // 1: livekit.SearchPhoneNumbersResponse.items:type_name -> livekit.PhoneNumber + 15, // 2: livekit.SearchPhoneNumbersResponse.next_page_token:type_name -> livekit.TokenPagination + 14, // 3: livekit.PurchasePhoneNumberResponse.phone_numbers:type_name -> livekit.PhoneNumber 0, // 4: livekit.ListPhoneNumbersRequest.status:type_name -> livekit.PhoneNumberStatus - 14, // 5: livekit.ListPhoneNumbersRequest.page_token:type_name -> livekit.TokenPagination - 13, // 6: livekit.ListPhoneNumbersResponse.items:type_name -> livekit.PhoneNumber - 14, // 7: livekit.ListPhoneNumbersResponse.next_page_token:type_name -> livekit.TokenPagination - 13, // 8: livekit.GetPhoneNumberResponse.phone_number:type_name -> livekit.PhoneNumber - 13, // 9: livekit.UpdatePhoneNumberResponse.phone_number:type_name -> livekit.PhoneNumber - 15, // 10: livekit.PhoneNumber.created_at:type_name -> google.protobuf.Timestamp - 15, // 11: livekit.PhoneNumber.updated_at:type_name -> google.protobuf.Timestamp - 0, // 12: livekit.PhoneNumber.status:type_name -> livekit.PhoneNumberStatus - 15, // 13: livekit.PhoneNumber.assigned_at:type_name -> google.protobuf.Timestamp - 15, // 14: livekit.PhoneNumber.released_at:type_name -> google.protobuf.Timestamp - 1, // 15: livekit.PhoneNumberService.SearchPhoneNumbers:input_type -> livekit.SearchPhoneNumbersRequest - 3, // 16: livekit.PhoneNumberService.PurchasePhoneNumber:input_type -> livekit.PurchasePhoneNumberRequest - 5, // 17: livekit.PhoneNumberService.ListPhoneNumbers:input_type -> livekit.ListPhoneNumbersRequest - 7, // 18: livekit.PhoneNumberService.GetPhoneNumber:input_type -> livekit.GetPhoneNumberRequest - 9, // 19: livekit.PhoneNumberService.UpdatePhoneNumber:input_type -> livekit.UpdatePhoneNumberRequest - 11, // 20: livekit.PhoneNumberService.ReleasePhoneNumbers:input_type -> livekit.ReleasePhoneNumbersRequest - 2, // 21: livekit.PhoneNumberService.SearchPhoneNumbers:output_type -> livekit.SearchPhoneNumbersResponse - 4, // 22: livekit.PhoneNumberService.PurchasePhoneNumber:output_type -> livekit.PurchasePhoneNumberResponse - 6, // 23: livekit.PhoneNumberService.ListPhoneNumbers:output_type -> livekit.ListPhoneNumbersResponse - 8, // 24: livekit.PhoneNumberService.GetPhoneNumber:output_type -> livekit.GetPhoneNumberResponse - 10, // 25: livekit.PhoneNumberService.UpdatePhoneNumber:output_type -> livekit.UpdatePhoneNumberResponse - 12, // 26: livekit.PhoneNumberService.ReleasePhoneNumbers:output_type -> livekit.ReleasePhoneNumbersResponse - 21, // [21:27] is the sub-list for method output_type - 15, // [15:21] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 15, // 5: livekit.ListPhoneNumbersRequest.page_token:type_name -> livekit.TokenPagination + 14, // 6: livekit.ListPhoneNumbersResponse.items:type_name -> livekit.PhoneNumber + 15, // 7: livekit.ListPhoneNumbersResponse.next_page_token:type_name -> livekit.TokenPagination + 14, // 8: livekit.GetPhoneNumberResponse.phone_number:type_name -> livekit.PhoneNumber + 14, // 9: livekit.UpdatePhoneNumberResponse.phone_number:type_name -> livekit.PhoneNumber + 1, // 10: livekit.PhoneNumber.number_type:type_name -> livekit.PhoneNumberType + 16, // 11: livekit.PhoneNumber.created_at:type_name -> google.protobuf.Timestamp + 16, // 12: livekit.PhoneNumber.updated_at:type_name -> google.protobuf.Timestamp + 0, // 13: livekit.PhoneNumber.status:type_name -> livekit.PhoneNumberStatus + 16, // 14: livekit.PhoneNumber.assigned_at:type_name -> google.protobuf.Timestamp + 16, // 15: livekit.PhoneNumber.released_at:type_name -> google.protobuf.Timestamp + 2, // 16: livekit.PhoneNumberService.SearchPhoneNumbers:input_type -> livekit.SearchPhoneNumbersRequest + 4, // 17: livekit.PhoneNumberService.PurchasePhoneNumber:input_type -> livekit.PurchasePhoneNumberRequest + 6, // 18: livekit.PhoneNumberService.ListPhoneNumbers:input_type -> livekit.ListPhoneNumbersRequest + 8, // 19: livekit.PhoneNumberService.GetPhoneNumber:input_type -> livekit.GetPhoneNumberRequest + 10, // 20: livekit.PhoneNumberService.UpdatePhoneNumber:input_type -> livekit.UpdatePhoneNumberRequest + 12, // 21: livekit.PhoneNumberService.ReleasePhoneNumbers:input_type -> livekit.ReleasePhoneNumbersRequest + 3, // 22: livekit.PhoneNumberService.SearchPhoneNumbers:output_type -> livekit.SearchPhoneNumbersResponse + 5, // 23: livekit.PhoneNumberService.PurchasePhoneNumber:output_type -> livekit.PurchasePhoneNumberResponse + 7, // 24: livekit.PhoneNumberService.ListPhoneNumbers:output_type -> livekit.ListPhoneNumbersResponse + 9, // 25: livekit.PhoneNumberService.GetPhoneNumber:output_type -> livekit.GetPhoneNumberResponse + 11, // 26: livekit.PhoneNumberService.UpdatePhoneNumber:output_type -> livekit.UpdatePhoneNumberResponse + 13, // 27: livekit.PhoneNumberService.ReleasePhoneNumbers:output_type -> livekit.ReleasePhoneNumbersResponse + 22, // [22:28] is the sub-list for method output_type + 16, // [16:22] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_livekit_phone_number_proto_init() } @@ -1036,7 +1096,7 @@ func file_livekit_phone_number_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_livekit_phone_number_proto_rawDesc), len(file_livekit_phone_number_proto_rawDesc)), - NumEnums: 1, + NumEnums: 2, NumMessages: 13, NumExtensions: 0, NumServices: 1, diff --git a/livekit/livekit_phone_number.twirp.go b/livekit/livekit_phone_number.twirp.go index 67ace85f8..2ae1be3bd 100644 --- a/livekit/livekit_phone_number.twirp.go +++ b/livekit/livekit_phone_number.twirp.go @@ -1919,66 +1919,70 @@ func (s *phoneNumberServiceServer) PathPrefix() string { } var twirpFileDescriptor6 = []byte{ - // 965 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xe1, 0x8e, 0xdb, 0x44, - 0x10, 0x3e, 0x27, 0xb9, 0xeb, 0x65, 0x7c, 0x77, 0xcd, 0x2d, 0x47, 0x71, 0x7d, 0xb4, 0x49, 0x7d, - 0x20, 0x45, 0xfd, 0x91, 0x13, 0x01, 0x51, 0x55, 0xfc, 0x21, 0xbd, 0x4b, 0x4b, 0x50, 0x09, 0xc1, - 0xce, 0x21, 0x40, 0x48, 0xd6, 0xc6, 0xde, 0x26, 0xab, 0xda, 0x5e, 0xe3, 0x5d, 0x57, 0xdc, 0x1f, - 0x1e, 0x80, 0x57, 0xe0, 0x09, 0xe0, 0x55, 0x10, 0x4f, 0xc2, 0x4b, 0x20, 0xdb, 0x1b, 0xd7, 0x97, - 0xd8, 0xc9, 0x49, 0x20, 0xf1, 0x2f, 0xfe, 0xe6, 0x9b, 0xd9, 0x6f, 0x67, 0x76, 0x66, 0x02, 0xba, - 0x47, 0xdf, 0x90, 0xd7, 0x54, 0xd8, 0xe1, 0x82, 0x05, 0x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 0xaf, 0x4c, 0xe5, 0x7f, 0x15, 0xfd, 0x6c, 0x23, 0x47, 0x76, 0xe0, 0x0e, 0x9a, 0xc1, 0x3b, 0x25, - 0x2b, 0x14, 0xbd, 0xf5, 0xae, 0x5e, 0xea, 0xfa, 0x07, 0x9b, 0x49, 0xf9, 0x19, 0xdf, 0x43, 0x6b, - 0x75, 0xf7, 0xa0, 0x4e, 0xee, 0x5b, 0xb1, 0x66, 0xf5, 0x47, 0x1b, 0x18, 0x79, 0x68, 0x0b, 0x8e, - 0x6e, 0xce, 0x77, 0xf4, 0x30, 0x77, 0x2b, 0x5d, 0x22, 0x7a, 0xbb, 0xd2, 0x9e, 0x07, 0xfd, 0x11, - 0x8e, 0xd7, 0x26, 0x2c, 0x7a, 0x2b, 0xa7, 0x6a, 0xfa, 0xeb, 0xc6, 0x26, 0x4a, 0x31, 0xe3, 0x25, - 0x43, 0xb1, 0x90, 0xf1, 0xea, 0x39, 0x5c, 0xc8, 0xf8, 0xa6, 0xb9, 0xba, 0xf3, 0xec, 0xc3, 0x1f, - 0xce, 0xe6, 0x54, 0x2c, 0xe2, 0x59, 0xcf, 0x61, 0xfe, 0xb9, 0xf4, 0xc9, 0xfe, 0x0b, 0x3b, 0xcc, - 0x5b, 0x02, 0xb3, 0xbd, 0x14, 0xf9, 0xf8, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xd7, 0xf6, - 0x4b, 0x52, 0x0b, 0x00, 0x00, + // 1032 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xae, 0x93, 0xa6, 0xdb, 0x1c, 0xf7, 0x27, 0x1d, 0xca, 0xae, 0xeb, 0x6c, 0x37, 0x59, 0x17, + 0xa4, 0xa8, 0x17, 0xa9, 0x08, 0x88, 0x55, 0xc5, 0x0d, 0x69, 0xea, 0x2e, 0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0x62, 0x0a, 0xbb, 0x75, 0xae, 0xc1, 0xb7, 0x84, 0x66, 0x44, 0xaf, 0x39, 0xf6, + 0xa5, 0x43, 0x3c, 0xa3, 0x26, 0x66, 0xd4, 0x32, 0x95, 0xb2, 0x8f, 0x0d, 0x84, 0xd2, 0xaf, 0x1c, + 0x88, 0x59, 0x64, 0x5d, 0xdb, 0x32, 0x5d, 0x82, 0x2e, 0xa1, 0x44, 0x19, 0x59, 0xb8, 0x02, 0x57, + 0x2f, 0x36, 0xf8, 0xd6, 0x69, 0xec, 0x32, 0x81, 0x56, 0x42, 0x08, 0xfa, 0x1c, 0x8e, 0x4d, 0xf2, + 0x13, 0x53, 0x13, 0x44, 0x0a, 0x5b, 0x88, 0x1c, 0xfa, 0x06, 0xc3, 0x98, 0x8c, 0x03, 0xe2, 0xd0, + 0x73, 0xb4, 0x39, 0x76, 0x49, 0xd2, 0x7f, 0x14, 0xb9, 0x0b, 0x38, 0x4c, 0x66, 0x2b, 0xe4, 0x54, + 0x56, 0x0e, 0xec, 0x04, 0x71, 0x74, 0x05, 0xa7, 0x2e, 0xb5, 0x55, 0x9d, 0xba, 0x36, 0x66, 0xda, + 0x5c, 0x75, 0x3c, 0x83, 0xa8, 0x54, 0x8f, 0xc2, 0x78, 0xe2, 0x52, 0xfb, 0x36, 0x52, 0x29, 0x9e, + 0x41, 0xba, 0xba, 0xf4, 0x1d, 0x54, 0x33, 0xcf, 0x8c, 0x02, 0x70, 0x9d, 0x75, 0x68, 0x5e, 0x20, + 0x56, 0xa8, 0x48, 0x7f, 0x73, 0xf0, 0xa8, 0x47, 0x5d, 0x96, 0x55, 0x05, 0x71, 0x16, 0xb9, 0x64, + 0x16, 0x5b, 0xb0, 0xe7, 0x32, 0xcc, 0x3c, 0x37, 0xa0, 0x7b, 0xd4, 0x12, 0xb3, 0x4e, 0x19, 0x05, + 0x08, 0x25, 0x42, 0xae, 0x65, 0xbe, 0xf8, 0xce, 0x99, 0xcf, 0x8d, 0xd4, 0x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d, + 0xec, 0xf4, 0x07, 0x38, 0x49, 0xad, 0x02, 0xf4, 0x96, 0x4e, 0xde, 0x9a, 0x12, 0xa5, 0x4d, 0x90, + 0x64, 0xc4, 0x33, 0xa6, 0x77, 0x22, 0xe2, 0xf9, 0x0b, 0x23, 0x11, 0xf1, 0x4d, 0x0b, 0x60, 0xe7, + 0xe6, 0xc3, 0xef, 0x2f, 0x66, 0x94, 0xcd, 0xbd, 0x69, 0x53, 0xb3, 0x16, 0x57, 0x91, 0x4d, 0xf8, + 0x68, 0xd7, 0x2c, 0x63, 0x29, 0x98, 0xee, 0x05, 0x92, 0x8f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, + 0x87, 0x94, 0x0e, 0xf4, 0xfb, 0x0b, 0x00, 0x00, } diff --git a/protobufs/livekit_phone_number.proto b/protobufs/livekit_phone_number.proto index ef23df625..94ca0a1e0 100644 --- a/protobufs/livekit_phone_number.proto +++ b/protobufs/livekit_phone_number.proto @@ -16,6 +16,14 @@ enum PhoneNumberStatus { PHONE_NUMBER_STATUS_RELEASED = 3; // Number has been released } +// Phone number type enumeration +enum PhoneNumberType { + PHONE_NUMBER_TYPE_UNKNOWN = 0; // Default value - unknown or parsing error + PHONE_NUMBER_TYPE_MOBILE = 1; // Mobile phone number + PHONE_NUMBER_TYPE_LOCAL = 2; // Local/fixed line number + PHONE_NUMBER_TYPE_TOLL_FREE = 3; // Toll-free number +} + // Public Phone Number Service - External API for phone number management service PhoneNumberService { // Search available phone numbers in inventory @@ -123,7 +131,7 @@ message PhoneNumber { string e164_format = 2; // Phone number in E.164 format (e.g., "+14155552671") string country_code = 3; // Country code (e.g., "US") string area_code = 4; // Area code (e.g., "415") - string number_type = 5; // Number type (e.g., local, toll-free, national, mobile) + PhoneNumberType number_type = 5; // Number type (mobile, local, toll-free, unknown) string locality = 6; // City/locality (e.g., "San Francisco") string region = 7; // State/region (e.g., "CA") double spam_score = 8; // Spam score for fraud detection diff --git a/sip/phonenumber.go b/sip/phonenumber.go new file mode 100644 index 000000000..d13b1b9e6 --- /dev/null +++ b/sip/phonenumber.go @@ -0,0 +1,55 @@ +package sip + +import ( + "github.com/livekit/protocol/livekit" + "github.com/nyaruka/phonenumbers" +) + +// ExtractAreaCode extracts the area code from a phone number using the phonenumbers library +func ExtractAreaCode(phoneNumber string) string { + // Parse the phone number without defaulting to any country + num, err := phonenumbers.Parse(phoneNumber, "") + if err != nil { + // If parsing fails, fall back to empty string + return "" + } + + // Get the country code + countryCode := phonenumbers.GetRegionCodeForNumber(num) + + // Only handle US numbers for now + if countryCode != "US" { + return "" + } + + // Get the national number and extract first 3 digits (area code for US) + nationalNumber := phonenumbers.GetNationalSignificantNumber(num) + if len(nationalNumber) < 3 { + return "" + } + return nationalNumber[:3] +} + +// DetermineNumberType determines the phone number type using the phonenumbers library +func DetermineNumberType(phoneNumber string) livekit.PhoneNumberType { + // Parse the phone number without defaulting to any country + num, err := phonenumbers.Parse(phoneNumber, "") + if err != nil { + // If parsing fails, fall back to unknown + return livekit.PhoneNumberType_PHONE_NUMBER_TYPE_UNKNOWN + } + + numberType := phonenumbers.GetNumberType(num) + + // We are excluding a bunch of number types for now + switch numberType { + case phonenumbers.MOBILE: + return livekit.PhoneNumberType_PHONE_NUMBER_TYPE_MOBILE + case phonenumbers.FIXED_LINE: + return livekit.PhoneNumberType_PHONE_NUMBER_TYPE_LOCAL + case phonenumbers.TOLL_FREE: + return livekit.PhoneNumberType_PHONE_NUMBER_TYPE_TOLL_FREE + default: + return livekit.PhoneNumberType_PHONE_NUMBER_TYPE_UNKNOWN + } +} diff --git a/utils/guid/id.go b/utils/guid/id.go index 68ebba0d9..046cc32da 100644 --- a/utils/guid/id.go +++ b/utils/guid/id.go @@ -60,6 +60,8 @@ const ( CloudAgentSecretPrefix = "CAS_" CloudAgentWorkerPrefix = "CAW_" AgentGatewayPrefix = "GW_" + CarrierPrefix = "CR_" + PhoneNumberPrefix = "PN_" ) var guidGeneratorPool = sync.Pool{