PhoneNumberUtil
Namespace: cc_truedial
Class: PhoneNumberUtil
Methods
getAsYouTypeFormatter
cc_truedial.AsYouTypeFormatter getAsYouTypeFormatter(String regionCode)
Retrieves a formatter object that automatically formats phone numbers as digits are entered one by one, specific to the provided region.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter('US');
formatter.inputDigit('6'); // Returns: 6
formatter.inputDigit('5'); // Returns: 65
formatter.inputDigit('0'); // Returns: 650
formatter.inputDigit('2'); // Returns: 650-2
formatter.inputDigit('5'); // Returns: 650-25
formatter.inputDigit('3'); // Returns: 650-253
canBeInternationallyDialled
Boolean canBeInternationallyDialled(cc_truedial.PhoneNumber phoneNumber)
Determines whether a phone number can be called from outside its home region. Returns true for internationally dialable numbers or when the status is unknown. Returns false if the phone number can only be dialed domestically. Note that this method doesn't validate whether the phone number itself is valid.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
Boolean canDial = phoneUtil.canBeInternationallyDialled(phoneNumber);
// Returns: true (US numbers can be dialed internationally)
convertAlphaCharactersInNumber
String convertAlphaCharactersInNumber(String phoneNumber)
Transforms alphabetic characters in a phone number into their corresponding numeric values based on a telephone keypad, while preserving the original formatting characters.
Example:
String converted = PhoneNumberUtil.convertAlphaCharactersInNumber('1-800-FLOWERS');
// Returns: '1-800-3569377'
extractCountryCode
Integer extractCountryCode(cc_truedial.PhoneNumberStringBuilder fullnumber, cc_truedial.PhoneNumberStringBuilder nationalNumber)
Separates the country calling code from a complete phone number and stores the remaining digits in the nationalNumber parameter. This method expects any leading plus sign or international dialing prefix to have been removed beforehand. Returns 0 and leaves nationalNumber unchanged if no valid country code is detected at the beginning.
Example:
cc_truedial.PhoneNumberStringBuilder fullNumber = new cc_truedial.PhoneNumberStringBuilder('16502530000');
cc_truedial.PhoneNumberStringBuilder nationalNumber = new cc_truedial.PhoneNumberStringBuilder();
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
Integer countryCode = phoneUtil.extractCountryCode(fullNumber, nationalNumber);
// Returns: 1
// nationalNumber contains: '6502530000'
extractPossibleNumber
String extractPossibleNumber(String phoneNumber)
Tries to isolate a phone number from a string by removing any text prefixes (like "Tel:"). Returns the extracted phone number starting from the first valid phone number character (such as + or a digit), or an empty string if no phone number can be identified.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
String extracted = phoneUtil.extractPossibleNumber('Tel: +1-650-253-0000');
// Returns: '+1-650-253-0000'
format
String format(cc_truedial.PhoneNumber phoneNumber, cc_truedial.PhoneNumberFormat numberFormat)
Converts a phone number into a string representation using standard formatting rules for the specified format type.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
String formatted = phoneUtil.format(phoneNumber, cc_truedial.PhoneNumberFormat.INTERNATIONAL);
// Returns: '+1 650-253-0000'
String national = phoneUtil.format(phoneNumber, cc_truedial.PhoneNumberFormat.NATIONAL);
// Returns: '(650) 253-0000'
formatByPattern
String formatByPattern(cc_truedial.PhoneNumber phoneNumber, cc_truedial.PhoneNumberFormat numberFormat, List<cc_truedial.NumberFormat> userDefinedFormats)
Applies custom formatting patterns defined by the client to format a phone number, rather than using the library's default formatting rules.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
List<cc_truedial.NumberFormat> formats = new List<cc_truedial.NumberFormat>();
// Add custom NumberFormat objects to the list
String formatted = phoneUtil.formatByPattern(phoneNumber, cc_truedial.PhoneNumberFormat.NATIONAL, formats);
// Returns: Formatted phone number using custom patterns
formatInOriginalFormat
String formatInOriginalFormat(cc_truedial.PhoneNumber phoneNumber, String regionCallingFrom)
Recreates the phone number in the same format it was originally entered when parsed, preserving the original formatting style.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('650-253-0000', 'US');
String formatted = phoneUtil.formatInOriginalFormat(phoneNumber, 'US');
// Returns: '650-253-0000' (preserves original formatting)
formatNationalNumberWithCarrierCode
String formatNationalNumberWithCarrierCode(cc_truedial.PhoneNumber phoneNumber, String carrierCode)
Formats a phone number for domestic dialing with a specific carrier code included, which is required in certain countries when making calls.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+5491187654321', 'AR');
String formatted = phoneUtil.formatNationalNumberWithCarrierCode(phoneNumber, '15');
// Returns: '011 15 8765-4321'
formatNationalNumberWithPreferredCarrierCode
String formatNationalNumberWithPreferredCarrierCode(cc_truedial.PhoneNumber phoneNumber, String carrierCode)
Formats a phone number for domestic dialing, using the carrier code stored in the PhoneNumber object's preferredDomesticCarrierCode field if available. If that field is empty, the provided carrierCode parameter is used instead. If both are empty, the phone number is formatted without any carrier code.
Parameters:
carrierCode- The carrier selection code to be used, if none is found in the phone number itself
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+5491187654321', 'AR');
phoneNumber.setPreferredDomesticCarrierCode('15');
String formatted = phoneUtil.formatNationalNumberWithPreferredCarrierCode(phoneNumber, '');
// Returns: '011 15 8765-4321' (uses preferred carrier code from phoneNumber)
formatNumberForMobileDialing
String formatNumberForMobileDialing(cc_truedial.PhoneNumber phoneNumber, String regionCallingFrom, Boolean withFormatting)
Produces a phone number string optimized for dialing from a mobile device in a specified region. Returns an empty string if the phone number cannot be reached from the given region (for example, some countries restrict calling toll-free numbers from abroad).
Parameters:
withFormatting- Whether the phone number should be returned with formatting symbols, such as spaces and dashes
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
String formatted = phoneUtil.formatNumberForMobileDialing(phoneNumber, 'GB', true);
// Returns: '+1 650-253-0000' (formatted for dialing from UK mobile)
String unformatted = phoneUtil.formatNumberForMobileDialing(phoneNumber, 'GB', false);
// Returns: '+16502530000' (without formatting)
formatOutOfCountryCallingNumber
String formatOutOfCountryCallingNumber(cc_truedial.PhoneNumber phoneNumber, String regionCallingFrom)
Formats a phone number for international dialing from a specified region. Uses international format when no calling region is provided. Switches to national format when the destination phone number's country code matches the calling region's country code.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
String formatted = phoneUtil.formatOutOfCountryCallingNumber(phoneNumber, 'GB');
// Returns: '00 1 650-253-0000' (formatted for calling from UK)
String domestic = phoneUtil.formatOutOfCountryCallingNumber(phoneNumber, 'US');
// Returns: '(650) 253-0000' (national format when calling from same country)
formatOutOfCountryKeepingAlphaChars
String formatOutOfCountryKeepingAlphaChars(cc_truedial.PhoneNumber phoneNumber, String regionCallingFrom)
Formats a phone number for international dialing while maintaining any alphabetic characters that were in the original input. This method preserves vanity phone number letters (like 1-800-FLOWERS) instead of converting them to digits, along with any grouping symbols like dashes and spaces.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('1-800-FLOWERS', 'US');
String formatted = phoneUtil.formatOutOfCountryKeepingAlphaChars(phoneNumber, 'GB');
// Returns: '00 1 800-FLOWERS' (preserves alpha characters)
getCountryCodeForRegion
Integer getCountryCodeForRegion(String regionCode)
Retrieves the international calling code associated with a specific two-letter region code.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
Integer code = phoneUtil.getCountryCodeForRegion('US');
// Returns: 1
Integer gbCode = phoneUtil.getCountryCodeForRegion('GB');
// Returns: 44
getCountryMobileToken
String getCountryMobileToken(Integer countryCallingCode)
Returns the mobile prefix token for a given country calling code. This token is a digit sequence that must be inserted before the area code when dialing mobile numbers in that country from abroad. Returns an empty string if no mobile token exists for the country.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
String token = phoneUtil.getCountryMobileToken(54); // Argentina
// Returns: '9'
String noToken = phoneUtil.getCountryMobileToken(1); // US
// Returns: '' (empty string - no mobile token)
getExampleNumber
cc_truedial.PhoneNumber getExampleNumber(String regionCode)
Generates a sample valid phone number for a given region. Returns null if the metadata doesn't include example phone numbers for the region, or if the special region code 001 is provided.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber exampleNumber = phoneUtil.getExampleNumber('US');
// Returns: PhoneNumber object for a valid US number (e.g., +1 201-555-0123)
getExampleNumberForType
cc_truedial.PhoneNumber getExampleNumberForType(String regionCode, cc_truedial.PhoneNumberType type)
Generates a sample valid phone number for a specific region and number type (such as mobile, toll-free, or fixed-line).
Available Types:
- Fixed-line
- Mobile
- Toll-free
- Premium Rate
- Shared Cost
- VoIP
- Personal Numbers
- UAN
- Pager
- Voicemail
Returns null when the metadata does not contain such information, or the region 001 is passed in.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber mobileExample = phoneUtil.getExampleNumberForType('US', cc_truedial.PhoneNumberType.MOBILE);
// Returns: PhoneNumber object for a valid US mobile number
cc_truedial.PhoneNumber tollFreeExample = phoneUtil.getExampleNumberForType('US', cc_truedial.PhoneNumberType.TOLL_FREE);
// Returns: PhoneNumber object for a valid US toll-free number (e.g., +1 800-555-0123)
getExampleNumberForNonGeoEntity
cc_truedial.PhoneNumber getExampleNumberForNonGeoEntity(Integer countryCallingCode)
Provides a sample phone number for non-geographical services (like international toll-free numbers) associated with a specific country calling code. Returns null if no metadata exists or if the country code doesn't correspond to a non-geographical entity.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber exampleNumber = phoneUtil.getExampleNumberForNonGeoEntity(800); // International freephone
// Returns: PhoneNumber object for +800 number
getInstance
cc_truedial.PhoneNumberUtil getInstance()
Creates and returns a PhoneNumberUtil instance preloaded with all phone number metadata, ready to perform formatting, parsing, and validation operations on international phone numbers.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
// Now you can use phoneUtil to call other methods
parse
cc_truedial.PhoneNumber parse(String numberToParse, String defaultRegion)
Converts a phone number string into a PhoneNumber object. The method parses the provided phone number string and uses the default region to determine the correct country code when the phone number is not in international format. Throws a NumberParseException if the phone number cannot be parsed.
Parameters:
numberToParse- The phone number string to parse (may include formatting characters)defaultRegion- The ISO 3166-1 two-letter region code to use as default when the phone number is not in international format
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
// Returns: PhoneNumber object for +1 650-253-0000
cc_truedial.PhoneNumber localPhoneNumber = phoneUtil.parse('(650) 253-0000', 'US');
// Returns: PhoneNumber object, defaulting to US country code
getInvalidExampleNumber
cc_truedial.PhoneNumber getInvalidExampleNumber(String regionCode)
Generates an intentionally invalid phone number for a specific region, which is useful for testing error handling and validation logic. Returns null for unsupported or invalid region codes, including the special region 001.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber invalidNumber = phoneUtil.getInvalidExampleNumber('US');
// Returns: PhoneNumber object that is invalid for US (useful for testing)
getLengthOfGeographicalAreaCode
Integer getLengthOfGeographicalAreaCode(cc_truedial.PhoneNumber phoneNumber)
Calculates how many digits comprise the geographical area code portion of a phone number. This enables splitting the national significant phone number into area code and subscriber number components in a way that produces a dialable subscriber number.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
Integer areaCodeLength = phoneUtil.getLengthOfGeographicalAreaCode(phoneNumber);
// Returns: 3 (for area code '650')
getLengthOfNationalDestinationCode
Integer getLengthOfNationalDestinationCode(cc_truedial.PhoneNumber phoneNumber)
Determines the length of the National Destination Code (NDC), which typically appears as the first group of digits following the country code in internationally formatted phone numbers, before the subscriber number portion.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+442079460123', 'GB');
Integer ndcLength = phoneUtil.getLengthOfNationalDestinationCode(phoneNumber);
// Returns: 2 (for London area code '20')
getMetadataForRegion
cc_truedial.PhoneMetadata getMetadataForRegion(String regionCode)
Retrieves the complete metadata object containing all phone number rules, patterns, and formatting information for a specified region. Returns null for invalid or unknown region codes.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneMetadata metadata = phoneUtil.getMetadataForRegion('US');
// Returns: PhoneMetadata object containing US phone number rules and patterns
getMetadataForNonGeographicalRegion
cc_truedial.PhoneMetadata getMetadataForNonGeographicalRegion(Integer countryCallingCode)
Retrieves the metadata object for non-geographical services identified by a country calling code. Returns null if the calling code is invalid, unknown, or doesn't correspond to a non-geographical entity.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneMetadata metadata = phoneUtil.getMetadataForNonGeographicalRegion(800);
// Returns: PhoneMetadata object for international freephone service (+800)
getNationalSignificantNumber
String getNationalSignificantNumber(cc_truedial.PhoneNumber phoneNumber)
Extracts the nationally significant portion of a phone number, excluding the country code, national prefix, and all formatting characters.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', 'US');
String nsn = phoneUtil.getNationalSignificantNumber(phoneNumber);
// Returns: '6502530000'
getNddPrefixForRegion
String getNddPrefixForRegion(String regionCode, Boolean stripNonDigits)
Returns the domestic dialing prefix (trunk code) used within a region. For instance, this would be 1 for the US and 0 for countries like the UK and New Zealand. The stripNonDigits parameter controls whether to remove non-numeric symbols such as "~" (wait for dial tone). Returns null if the region has no national prefix.
Parameters:
stripNonDigits- Should be true to strip non-digits from the national dialing prefix
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
String prefix = phoneUtil.getNddPrefixForRegion('NZ', true);
// Returns: '0'
String gbPrefix = phoneUtil.getNddPrefixForRegion('GB', true);
// Returns: '0'
getNumberType
cc_truedial.PhoneNumberType getNumberType(cc_truedial.PhoneNumber phoneNumber)
Analyzes a phone number to determine its type classification, such as fixed-line, mobile, toll-free, premium rate, shared cost, VoIP, personal, UAN, pager, or voicemail. Returns UNKNOWN for invalid phone numbers or when the type cannot be determined.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber mobileNumber = phoneUtil.parse('+14155551234', 'US');
cc_truedial.PhoneNumberType type = phoneUtil.getNumberType(mobileNumber);
// Returns: cc_truedial.PhoneNumberType.MOBILE or cc_truedial.PhoneNumberType.FIXED_LINE_OR_MOBILE
cc_truedial.PhoneNumber tollFreeNumber = phoneUtil.parse('+18005551234', 'US');
cc_truedial.PhoneNumberType tfType = phoneUtil.getNumberType(tollFreeNumber);
// Returns: cc_truedial.PhoneNumberType.TOLL_FREE
getRegionCodeForCountryCode
String getRegionCodeForCountryCode(Integer countryCallingCode)
Returns the primary region code associated with a specific international calling code.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
String region = phoneUtil.getRegionCodeForCountryCode(1);
// Returns: 'US' (or could be CA, BS, etc. - returns the main region)
getRegionCodesForCountryCode
List<String> getRegionCodesForCountryCode(Integer countryCallingCode)
Provides a complete list of all region codes that share the same international calling code.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
List<String> regions = phoneUtil.getRegionCodesForCountryCode(1);
// Returns: ['US', 'AG', 'AI', 'AS', 'BB', 'BM', 'BS', 'CA', ...] (NANPA countries)
getRegionCodeForNumber
String getRegionCodeForNumber(cc_truedial.PhoneNumber phoneNumber)
Identifies which region a phone number belongs to, useful for basic geographical location purposes. Only provides accurate results for complete, valid phone numbers (not shortcodes or invalid entries).
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+442079460123', 'GB');
String region = phoneUtil.getRegionCodeForNumber(phoneNumber);
// Returns: 'GB'
getRegionCodeForNumberFromRegionList
String getRegionCodeForNumberFromRegionList(cc_truedial.PhoneNumber phoneNumber, List<String> regionCodes)
Identifies which region a phone number belongs to by searching only within a specified list of possible regions. Only guarantees accurate results for complete, valid phone numbers.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
cc_truedial.PhoneNumber phoneNumber = phoneUtil.parse('+16502530000', null);
List<String> regions = new List<String>{'US', 'CA'};
String region = phoneUtil.getRegionCodeForNumberFromRegionList(phoneNumber, regions);
// Returns: 'US'
getSupportedCallingCodes
Set<Integer> getSupportedCallingCodes()
Returns a set containing all international calling codes that the library has metadata for. The set is unordered.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
Set<Integer> codes = phoneUtil.getSupportedCallingCodes();
// Returns: Set containing {1, 7, 20, 27, 30, 31, 32, 33, 34, ...}
getSupportedRegions
Set<String> getSupportedRegions()
Returns a set of all two-letter ISO region codes for which the library has geographical phone number metadata. The set is unordered.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
Set<String> regions = phoneUtil.getSupportedRegions();
// Returns: Set containing {'US', 'GB', 'FR', 'DE', 'AU', 'CA', ...}
getSupportedTypesForNonGeoEntity
Set<cc_truedial.PhoneNumberType> getSupportedTypesForNonGeoEntity(Integer countryCallingCode)
Returns all phone number types available for a non-geographical country code. The returned set excludes FIXED_LINE_OR_MOBILE (showing FIXED_LINE and MOBILE separately instead) and UNKNOWN. Returns an empty set for calling codes that don't belong to non-geographical entities.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
Set<cc_truedial.PhoneNumberType> types = phoneUtil.getSupportedTypesForNonGeoEntity(800);
// Returns: Set containing {cc_truedial.PhoneNumberType.TOLL_FREE}
getSupportedTypesForRegion
Set<cc_truedial.PhoneNumberType> getSupportedTypesForRegion(String regionCode)
Returns all phone number types that the library has metadata for in a specific region. The set excludes FIXED_LINE_OR_MOBILE (listing FIXED_LINE and MOBILE separately instead) and UNKNOWN. Returns an empty set for invalid or unknown region codes.
Example:
cc_truedial.PhoneNumberUtil phoneUtil = cc_truedial.PhoneNumberUtil.getInstance();
Set<cc_truedial.PhoneNumberType> types = phoneUtil.getSupportedTypesForRegion('US');
// Returns: Set containing {PhoneNumberType.FIXED_LINE, cc_truedial.PhoneNumberType.MOBILE,
// cc_truedial.PhoneNumberType.TOLL_FREE, PhoneNumberType.PREMIUM_RATE, ...}
isAlphaNumber
Boolean isAlphaNumber(String phoneNumber)
Verifies whether a phone number qualifies as a valid vanity number (containing letters like 800-FLOWERS). To be valid, the phone number must begin with at least 3 digits and include 3 or more alphabetic characters. This validation is not region-specific. Returns true for valid vanity numbers.
isMobileNumberPortableRegion
Boolean isMobileNumberPortableRegion(String regionCode)
Checks whether a region supports the ability to transfer mobile phone numbers between carriers (number portability). Returns true for regions with mobile number portability support, and false for invalid, unknown, or unsupported regions.
isNANPACountry
Boolean isNANPACountry(String regionCode)
Verifies whether a region is part of the North American Numbering Plan Administration (NANPA), which includes the US, Canada, and several Caribbean nations. Returns true for NANPA member regions.
isNumberGeographical (by PhoneNumber)
Boolean isNumberGeographical(cc_truedial.PhoneNumber phoneNumber)
Determines whether a phone number is associated with a specific geographical location.
isNumberGeographical (by Type)
Boolean isNumberGeographical(cc_truedial.PhoneNumberType type, Integer countryCallingCode)
Determines whether a particular phone number type and country calling code combination represents a geographically-bound number.