phone number standards
phone number standards
Tokelau Phone Numbers: +690 Country Code, E.164 Format & Validation Guide (2025)
Complete guide to Tokelau phone numbers with +690 country code. Master E.164 formatting, atoll-based number allocation, ITU-T validation patterns, JavaScript regex examples, and TELETOK integration for international dialing.
Tokelau Phone Numbers: E.164 Format, +690 Country Code & Validation Guide
Learn how to format, validate, and integrate Tokelau phone numbers (+690 country code) using the E.164 international standard. This comprehensive guide covers atoll-based number allocation (Atafu, Nukunonu, Fakaofo), ITU-T compliance, JavaScript validation regex, SMS delivery, geographic routing, and TELETOK telecommunications integration for developers building international calling systems.
What is the Tokelau Country Code and Phone Number Format?
Tokelau uses country code +690 for international calls. The territory, a New Zealand dependency composed of three coral atolls—Atafu, Nukunonu, and Fakaofo—operates a unique telecommunications system. With a population of 1,499 (2016 Census, de jure usually resident population: Atafu 541, Fakaofo 506, Nukunonu 452), the territory relies on specialized infrastructure managed by TELETOK, the Telecommunications Tokelau Corporation. (Source: Tokelau National Statistics Office, October 2016 Census, verified January 2025)
TELETOK, a government-owned corporation operating under the Office of the Council for the Ongoing Government of Tokelau (OCOG), provides all fixed and wireless services as the sole operator. TELETOK operates a 4G LTE tower on each atoll, delivering both VoLTE and data services over B28 (700 MHz) since May 2017. This single-provider system influences many aspects of number allocation and service provision.
Connectivity Infrastructure and Performance
Submarine Cable Upgrade (2021-2023): In September 2021, Tokelau connected to the Southern Cross NEXT submarine cable system, achieving full operational status in late 2023. This replaced previous satellite-only connectivity via Intelsat IS18 through Spark New Zealand. The submarine cable connects all three atolls with direct links to Auckland, New Zealand. (Source: UN Doc A/AC.109/2025/14, January 2025)
Network Performance Metrics:
- Previous satellite capacity: 32.5 Mbps total (25 Mbps down shared, 7.5 Mbps up divided among three atolls, approximately 2.5 Mbps per atoll)
- Target speed: 20 Mbps per citizen minimum (New Zealand ICT roadmap target effective 2020)
- Latency improvement: Submarine cable reduces round-trip latency from 600ms+ (satellite) to typically <100ms (fiber-optic)
- Reliability: Submarine cable provides significantly higher reliability than satellite links, which weather conditions affect
- Domestic network upgrade: Infrastructure improvements scheduled for completion in 2025 to fully realize submarine cable benefits across all households
Backup and Disaster Recovery: The submarine cable infrastructure includes built-in redundancy. While TELETOK manages specific disaster recovery protocols, the territory's investment analysis (2017) indicated that satellite backup antennas would remain in place if submarine cable became the primary connectivity method. From a cost perspective, over a 25-year period, submarine cable investment proved more economical than continued satellite connectivity at equivalent bandwidth. (Source: ITU-D Country Paper on Connectivity in Tokelau, 2017)
Network Coverage: Each atoll has 4G LTE coverage across inhabited areas. Coverage reaches 95% for fixed (landline) services and serves 400+ individual mobile customers (including devices, dongles, and MiFi units). As small, low-lying coral atolls with maximum elevation of 5 meters and land strips typically 200 meters wide, geographic coverage is comprehensive within populated zones. (Source: ITU-D Country Paper, 2017)
Time Zone: Tokelau observes UTC+13 year-round with no Daylight Saving Time changes.
Tokelau Phone Number Quick Reference: +690 Country Code Essentials
Essential information for developers working with Tokelau phone numbers and the +690 country code:
- Country: Tokelau
- Country Code: +690
- International Prefix: 00
- National Prefix: None
- Time Zone: UTC+13 (no DST)
- Regulatory Body/Primary Operator: Office of the Council for the Ongoing Government of Tokelau (OCOG)/TELETOK
- ITU-T Recommendation: E.164
- Number Length: 5-8 digits (after country code)
- E.164 Format:
+690XXXXXXX(country code +690 followed by 5-8 digits) - Emergency Services: 999 (police, fire, ambulance) – Note: Tokelau has no hospitals or ambulance services; serious medical cases require evacuation
Developer Support and Operational Considerations
Contact for Technical Requirements:
- Primary Contact: TELETOK (Telecommunications Tokelau Corporation) via Government of Tokelau
- Regulatory Authority: Office of the Council for the Ongoing Government of Tokelau (OCOG)
- Note: As of January 2025, TELETOK does not publish public APIs or developer documentation. Contact TELETOK/OCOG directly for number allocation, technical integration requirements, and service-level agreements.
Operational Framework:
- Legal Basis: Telecommunication Tokelau Corporation Rules 1996 establish TELETOK as the sole provider, operator, and maintainer of telecommunication services. (Source: PacLII Tokelau Legislation)
- Monopoly Status: TELETOK is legislated as the only telecommunications operator and also functions as the de facto regulator.
- Service Obligations: TELETOK must promote telecommunications development in accordance with international standards and provide services at reasonable prices while maintaining financial viability.
E.164 Phone Number Format for Tokelau
What is E.164 format? E.164 is the ITU-T international standard for formatting phone numbers globally. For Tokelau, the E.164 format ensures proper international call routing and SMS delivery.
Format Tokelau phone numbers according to the E.164 international standard:
- Format:
+690XXXXXXX(country code +690 followed by 5-8 digits) - Total length: 9-12 characters including the + symbol
- Example:
+690221234(landline),+6907212345(mobile) - Always include the country code when integrating with APIs
- Tokelau does not use national prefixes or area codes domestically
Note: Tokelau uses country code +690 as assigned by ITU-T E.164. (Source: ITU-T International Numbering Resources, verified January 2025)
How Are Tokelau Phone Numbers Allocated by Atoll?
Understanding Tokelau's atoll-based phone number allocation is essential for geographic routing and validation. Each of the three atolls—Atafu, Nukunonu, and Fakaofo—has dedicated number ranges within the +690 country code system.
Regional Distribution and Service Categories
The following table outlines the primary number ranges for each atoll:
| Atoll | Primary Ranges | Services |
|---|---|---|
| Atafu | 2xx, 72x | Landline, Mobile |
| Nukunonu | 3xx, 73x | Landline, Mobile |
| Fakaofo | 4xx, 74x | Landline, Mobile |
Within these ranges, a hierarchical structure further categorizes services:
2xx - Landline Services (Atafu)
├── 22x - Residential
├── 23x - Business
└── 24x - Government Facilities
3xx - Essential Services (Nukunonu)
├── 31x - Emergency (Police, Fire, Medical)
├── 32x - Utilities
└── 33x - Public Services
4xx - Administrative (Fakaofo)
├── 41x - Government Offices
├── 42x - Educational Institutions
└── 43x - Healthcare Facilities
7xx - Mobile Services
├── 72x - Atafu Region
├── 73x - Nukunonu Region
└── 74x - Fakaofo Region
Emergency and Special Service Numbers
Universal Emergency Number: 999 (Police, Fire, Ambulance/Medical)
This emergency number follows the British Commonwealth standard and operates across all three atolls. When calling 999 from within Tokelau, dial the three digits directly. From international locations, dial +690 followed by the local emergency contact numbers for the relevant atoll.
Critical Healthcare Note: Tokelau has no hospitals or ambulance services. Each atoll has a health clinic staffed by nurses and visiting doctors. Serious medical emergencies require patient evacuation to Samoa (480 km south, 30+ hours by ship) or New Zealand. The Government of Tokelau's patient referral scheme manages evacuations. (Source: UK Foreign Office Travel Advice, verified January 2025)
Number Allocation Process
Requesting New Numbers: TELETOK manages all phone number allocations directly. To request new numbers:
- Contact TELETOK via the Government of Tokelau portal
- Specify the required service type (residential, business, government, mobile)
- Indicate the atoll location
- TELETOK assigns numbers based on availability within the appropriate range
Number Capacity: With 5-8 digit subscriber numbers and dedicated ranges per atoll, the current numbering scheme provides substantial capacity relative to population (approximately 500 residents per atoll). The 7xx mobile ranges and 2xx/3xx/4xx landline ranges offer thousands of possible combinations per atoll. No evidence of number exhaustion or capacity constraints exists as of January 2025.
Design your systems to validate both service category and geographic allocation to ensure accurate routing. This is crucial for directing calls and messages to the correct destination within Tokelau.
How to Call Tokelau: International Dialing Instructions
To call Tokelau from abroad: Dial your country's exit code (e.g., 011 from USA), then +690 (Tokelau country code), followed by the local number. Tokelau's dialing system is streamlined for simplicity, with no area codes or additional prefixes required.
Domestic Calls Within Tokelau
Make domestic calls within Tokelau using direct dialing. Dial the number directly, whether landline or mobile, without any area codes or prefixes. This applies to calls between all three atolls.
- Landline to Landline: Dial the number directly (e.g., 2224434)
- Landline to Mobile: Dial the mobile number directly (e.g., 7224625)
- Mobile to Mobile: Dial the mobile number directly (e.g., 7224625)
Due to Tokelau's compact nature, no regional codes are necessary. This simplifies domestic dialing significantly.
International Calls to and from Tokelau
Make international calls using standard procedures, incorporating the international prefix and country codes.
-
Outgoing International Calls:
- Dial the international prefix:
00 - Dial the country code (e.g.,
1for USA) - Dial the area code (if applicable)
- Dial the local number
Example:
00 + 1 + 212 + 5551234(calling New York, USA) - Dial the international prefix:
-
Incoming International Calls:
- Dial the country code:
+690 - Dial the local Tokelau number
Example:
+690 47247036 - Dial the country code:
International Calling Notes:
- Costs: TELETOK sets international calling rates. Specific pricing requires direct inquiry with TELETOK, as rates are not publicly published.
- Restricted Destinations: No publicly documented restrictions exist on outgoing international calls. However, given the single-provider model and regulatory framework, TELETOK has authority to manage international routing.
- Reliability: With submarine cable connectivity operational since late 2023, international call quality has substantially improved compared to previous satellite-only links.
For reliable international connectivity, always normalize phone numbers to the E.164 format (+690XXXXXXX) in your applications. This ensures compatibility with global telecommunications standards.
Character Encoding for SMS
Character Encoding Limits:
- GSM-7 encoding: 160 characters (single SMS), 153 characters per segment (multi-part)
- UCS-2/Unicode encoding: 70 characters (single SMS), 67 characters per segment (multi-part)
- Messages exceeding these limits are automatically split into multiple segments
- Each segment counts as a separate SMS for billing purposes
- Use GSM-7 encoding when possible to maximize character limits
SMS Delivery and Reliability:
- Network Support: TELETOK's 4G LTE network supports standard SMS delivery across all three atolls
- Delivery Reports: SMS delivery confirmation depends on TELETOK implementation. For mission-critical messaging, confirm delivery report capabilities directly with TELETOK.
- Retry Logic: Standard GSM retry mechanisms apply. Messages that fail initial delivery are automatically retried by the network for a limited period (typically 24-48 hours).
- Inter-Atoll Messaging: SMS between atolls routes through TELETOK's central infrastructure and operates reliably over the submarine cable links established between atolls.
MMS (Multimedia Messaging Service) Support:
- Status: MMS capability is technically supported on 4G LTE networks. However, specific MMS implementation details, size limits, and pricing for Tokelau require confirmation with TELETOK.
- Recommended Alternative: For multimedia content delivery, consider internet-based messaging (WhatsApp, etc.) given the improved broadband connectivity since submarine cable deployment.
GSM-7 Character Set: GSM-7 supports standard Latin characters (A-Z, a-z, 0-9), basic punctuation, and specific symbols. Characters requiring Unicode/UCS-2 encoding include emoji, non-Latin scripts (Chinese, Arabic, Cyrillic, etc.), special symbols (™, ©, ®), and extended punctuation. When a message contains even one Unicode character, the entire message uses UCS-2 encoding with the reduced 70-character limit.
How to Validate Tokelau Phone Numbers: JavaScript Implementation
Implement robust Tokelau phone number validation using JavaScript regex patterns and the E.164 format. These code examples ensure your application correctly validates +690 country code numbers:
Security Note: Never commit API credentials or sensitive configuration to version control. Add .env to your .gitignore file:
# Add to .gitignore
.env
.env.local
.env.*.localAuthentication and Error Handling Considerations
TELETOK API Integration: As of January 2025, TELETOK does not offer public REST APIs for developers. For programmatic integration with Tokelau telecommunications services:
- Contact TELETOK directly through the Government of Tokelau portal
- Inquire about technical integration options for your specific use case
- Discuss authentication mechanisms (if API access is granted)
- Confirm rate limits, throttling policies, and usage quotas
General Error Handling Patterns: Build applications that handle Tokelau phone numbers with robust error handling:
function sendSMSToTokelau(phoneNumber, message) {
try {
// Validate phone number format
if (!tokelauIntlFormat.test(phoneNumber)) {
throw new Error('Invalid Tokelau phone number format');
}
// Validate message length (GSM-7)
if (message.length > 160) {
console.warn(`Message will be split into ${Math.ceil(message.length / 153)} segments`);
}
// Send message (pseudo-code – actual implementation depends on SMS provider)
const result = smsProvider.send({
to: phoneNumber,
body: message,
maxRetries: 3,
timeout: 30000
});
return result;
} catch (error) {
// Log error details
console.error('SMS sending failed:', error.message);
// Implement retry logic with exponential backoff
if (error.isRetryable) {
// Retry after delay
return retryWithBackoff(() => sendSMSToTokelau(phoneNumber, message));
}
throw error;
}
}Retry Strategy Recommendations:
- Initial retry after 1 second
- Exponential backoff: 1s, 2s, 4s, 8s
- Maximum 3-5 retry attempts
- Distinguish between transient errors (network issues) and permanent errors (invalid number)
Phone Number Format Validation with Regex
Use this regex pattern to validate Tokelau phone numbers in E.164 format:
// Validate Tokelau numbers in E.164 format
const tokelauIntlFormat = /^\+690[2-4,7][0-9]\d{3,6}$/;
// Example usage
if (tokelauIntlFormat.test("+690221234")) {
console.log("Valid Tokelau number");
} else {
console.log("Invalid Tokelau number");
}
// Enhanced validation with detailed error messages
function validateTokelauNumber(number) {
// Remove whitespace
const cleaned = number.replace(/\s+/g, '');
// Check for country code
if (!cleaned.startsWith('+690')) {
return { valid: false, error: 'Missing +690 country code' };
}
// Check overall format
if (!tokelauIntlFormat.test(cleaned)) {
return { valid: false, error: 'Invalid number format or length' };
}
// Extract first digit after country code
const serviceDigit = cleaned.substring(4, 5);
const validServiceDigits = ['2', '3', '4', '7'];
if (!validServiceDigits.includes(serviceDigit)) {
return { valid: false, error: 'Invalid service category digit' };
}
return { valid: true, number: cleaned };
}
// Test cases
console.log(validateTokelauNumber("+690221234")); // Valid landline
console.log(validateTokelauNumber("+6907212345")); // Valid mobile
console.log(validateTokelauNumber("+690612345")); // Invalid – 6 not valid service digit
console.log(validateTokelauNumber("690221234")); // Invalid – missing + prefixThis code snippet checks for the correct country code, initial digits based on service type and atoll, and the appropriate length of the local number. Test your validation against various valid and invalid inputs to ensure robustness.
Geographic Routing Logic
Implement logic to determine the atoll based on the number prefix.
function validateGeographicRoute(number) {
// Input sanitization
if (typeof number !== 'string') {
throw new TypeError('Phone number must be a string');
}
const cleaned = number.replace(/\s+/g, '');
// Validate format first
if (!cleaned.startsWith('+690') || cleaned.length < 8) {
throw new Error('Invalid Tokelau phone number format');
}
// Extract first two digits after +690
const prefix = cleaned.substring(4, 6);
const atollMap = {
'22': 'Atafu',
'23': 'Atafu',
'24': 'Atafu',
'31': 'Nukunonu',
'32': 'Nukunonu',
'33': 'Nukunonu',
'41': 'Fakaofo',
'42': 'Fakaofo',
'43': 'Fakaofo',
'72': 'Atafu',
'73': 'Nukunonu',
'74': 'Fakaofo'
};
const atoll = atollMap[prefix];
if (!atoll) {
throw new Error(`Unknown atoll for prefix ${prefix}`);
}
return {
atoll: atoll,
prefix: prefix,
number: cleaned
};
}
// Example usage with error handling
try {
console.log(validateGeographicRoute("+690221234")); // { atoll: 'Atafu', prefix: '22', number: '+690221234' }
console.log(validateGeographicRoute("+690735678")); // { atoll: 'Nukunonu', prefix: '73', number: '+690735678' }
console.log(validateGeographicRoute("+690412345")); // { atoll: 'Fakaofo', prefix: '41', number: '+690412345' }
} catch (error) {
console.error('Routing validation failed:', error.message);
}This code extracts the two digits after the country code (+690) and maps them to the appropriate atoll based on the hierarchical structure. The mapping correctly reflects that 2xx ranges belong to Atafu, 3xx to Nukunonu, and 4xx to Fakaofo. The function includes comprehensive input sanitization and error handling for invalid prefixes.
ITU-T E.164 Compliance for Tokelau Phone Numbers
Why is E.164 compliance important? ITU-T E.164 compliance ensures Tokelau phone numbers work correctly with international telecommunications systems, SMS gateways, and VoIP services worldwide. Tokelau strictly adheres to ITU-T E.164 recommendations for global interoperability. As a developer, understanding these recommendations is essential for building compliant systems. The E.164 standard, titled "The international public telecommunication numbering plan," defines a global numbering plan for telephony and some data networks. It specifies a maximum length of 15 digits and structures numbers with a country code (1-3 digits) followed by the subscriber number (up to 12 digits). This ensures consistent number formatting for international calls. (Source: ITU-T E.164 Recommendation, verified January 2025)
Compliance Testing and Certification
Regulatory Framework: Under the Telecommunication Tokelau Corporation Rules 1996, TELETOK is mandated to "promote the development of telecommunication in accordance with, as far as practicable, recognised international standards practice." This includes ITU-T E.164 compliance. (Source: PacLII)
Testing Procedures: For applications requiring formal compliance verification:
- Implement E.164 formatting as documented in this guide
- Test against Tokelau-specific number ranges (2xx, 3xx, 4xx, 7xx series)
- Verify international dialing compatibility (00 prefix for outbound, +690 for inbound)
- For mission-critical applications, coordinate testing with TELETOK directly
Compliance Checklist:
- Numbers conform to +690XXXXXXX format (5-8 digit subscriber numbers)
- Validation accepts all valid service categories (2, 3, 4, 7)
- Geographic routing correctly identifies all three atolls
- International prefix handling (00 for outbound, + for E.164 format)
- Character encoding properly handles GSM-7 and Unicode
- Error handling distinguishes between format errors and routing errors
Technical Implementation Considerations
Here are key considerations for implementing ITU-T compliant systems:
- Variable Length Support: Tokelau numbers vary in length. Handle numbers with 5-8 digits, normalize international prefixes, and support multiple format conversions.
function normalizeTokelauNumber(number) {
// Input validation
if (typeof number !== 'string' || !number.trim()) {
return null;
}
// Remove all non-numeric characters except leading +
const cleaned = number.replace(/[^\d+]/g, '');
// Check if international format with +690
if (cleaned.startsWith('+690')) {
// Validate length: +690 (4 chars) + 5-8 digits = 9-12 total
if (cleaned.length >= 9 && cleaned.length <= 12) {
return cleaned;
}
return null;
}
if (cleaned.startsWith('690')) {
const withPlus = '+' + cleaned;
// Validate length after adding +
if (withPlus.length >= 9 && withPlus.length <= 12) {
return withPlus;
}
return null;
}
// Add country code if local format (5-8 digits)
if (/^\d{5,8}$/.test(cleaned)) {
return '+690' + cleaned;
}
return null; // Invalid format
}
// Example usage with comprehensive tests
console.log(normalizeTokelauNumber("221234")); // Output: +690221234
console.log(normalizeTokelauNumber("+6907212345")); // Output: +6907212345
console.log(normalizeTokelauNumber("690 72 12345")); // Output: +6907212345
console.log(normalizeTokelauNumber("123")); // Output: null (too short)
console.log(normalizeTokelauNumber("+690123456789")); // Output: null (too long)
console.log(normalizeTokelauNumber("")); // Output: null (empty)This function cleans the input by removing non-numeric characters (except the leading +), validates number length (5-8 digits), and adds the +690 country code if missing. This ensures all processed numbers conform to the E.164 standard. Returns null for invalid formats to enable proper error handling.
Additional Language Examples:
# Python implementation
import re
def normalize_tokelau_number(number):
"""Normalize Tokelau phone number to E.164 format."""
if not isinstance(number, str) or not number.strip():
return None
# Remove all non-numeric characters except leading +
cleaned = re.sub(r'[^\d+]', '', number)
# Check if international format with +690
if cleaned.startswith('+690'):
if 9 <= len(cleaned) <= 12:
return cleaned
return None
if cleaned.startswith('690'):
with_plus = '+' + cleaned
if 9 <= len(with_plus) <= 12:
return with_plus
return None
# Add country code if local format (5-8 digits)
if re.match(r'^\d{5,8}$', cleaned):
return '+690' + cleaned
return None
# Test cases
print(normalize_tokelau_number("221234")) # +690221234
print(normalize_tokelau_number("+6907212345")) # +6907212345
print(normalize_tokelau_number("690 72 12345")) # +6907212345// PHP implementation
function normalizeTokelauNumber($number) {
if (!is_string($number) || trim($number) === '') {
return null;
}
// Remove all non-numeric characters except leading +
$cleaned = preg_replace('/[^\d+]/', '', $number);
// Check if international format with +690
if (strpos($cleaned, '+690') === 0) {
$length = strlen($cleaned);
if ($length >= 9 && $length <= 12) {
return $cleaned;
}
return null;
}
if (strpos($cleaned, '690') === 0) {
$withPlus = '+' . $cleaned;
$length = strlen($withPlus);
if ($length >= 9 && $length <= 12) {
return $withPlus;
}
return null;
}
// Add country code if local format (5-8 digits)
if (preg_match('/^\d{5,8}$/', $cleaned)) {
return '+690' . $cleaned;
}
return null;
}
// Test cases
echo normalizeTokelauNumber("221234") . "\n"; // +690221234
echo normalizeTokelauNumber("+6907212345") . "\n"; // +6907212345// Java implementation
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class TokelauPhoneValidator {
private static final Pattern LOCAL_FORMAT = Pattern.compile("^\\d{5,8}$");
public static String normalizeTokelauNumber(String number) {
if (number == null || number.trim().isEmpty()) {
return null;
}
// Remove all non-numeric characters except leading +
String cleaned = number.replaceAll("[^\\d+]", "");
// Check if international format with +690
if (cleaned.startsWith("+690")) {
int length = cleaned.length();
if (length >= 9 && length <= 12) {
return cleaned;
}
return null;
}
if (cleaned.startsWith("690")) {
String withPlus = "+" + cleaned;
int length = withPlus.length();
if (length >= 9 && length <= 12) {
return withPlus;
}
return null;
}
// Add country code if local format (5-8 digits)
Matcher matcher = LOCAL_FORMAT.matcher(cleaned);
if (matcher.matches()) {
return "+690" + cleaned;
}
return null;
}
// Test
public static void main(String[] args) {
System.out.println(normalizeTokelauNumber("221234")); // +690221234
System.out.println(normalizeTokelauNumber("+6907212345")); // +6907212345
}
}- Service Category Validation: Validate the service category based on the first digit of the number.
const serviceCategories = {
'2': 'Landline',
'3': 'Essential Services',
'4': 'Administrative',
'7': 'Mobile'
};
function validateServiceCategory(number) {
// Input validation and normalization
if (typeof number !== 'string') {
throw new TypeError('Phone number must be a string');
}
const cleaned = number.replace(/\D/g, '');
// Ensure we have enough digits (at least country code + 1 digit)
if (cleaned.length < 4) {
throw new Error('Phone number too short');
}
// Extract first digit after +690 (country code is 690, so position 3)
const firstDigit = cleaned.substring(3, 4);
const category = serviceCategories[firstDigit];
if (!category) {
throw new Error(`Invalid service category digit: ${firstDigit}`);
}
return category;
}
// Example usage with error handling
try {
console.log(validateServiceCategory("+690221234")); // Output: Landline
console.log(validateServiceCategory("+6907212345")); // Output: Mobile
console.log(validateServiceCategory("+690312345")); // Output: Essential Services
console.log(validateServiceCategory("690412345")); // Output: Administrative
} catch (error) {
console.error('Service category validation failed:', error.message);
}This code correctly extracts the first digit of the subscriber number (after the country code) to determine the service category. This is important for routing and handling calls appropriately.
- Geographic Routing Implementation: Implement routing logic based on the atoll. Consider using a class-based approach for more complex routing scenarios. Tokelau's telecommunications infrastructure is managed by TELETOK, the sole provider in the territory. This simplifies routing as you don't need to consider multiple carriers. However, you should still account for the different atolls and their respective number ranges. Maintain a mapping of prefixes to atolls and use this mapping to route calls effectively.
Class-Based Routing Implementation:
class TokelauPhoneRouter {
constructor() {
this.atollMap = {
'22': { atoll: 'Atafu', type: 'Residential' },
'23': { atoll: 'Atafu', type: 'Business' },
'24': { atoll: 'Atafu', type: 'Government' },
'31': { atoll: 'Nukunonu', type: 'Emergency Services' },
'32': { atoll: 'Nukunonu', type: 'Utilities' },
'33': { atoll: 'Nukunonu', type: 'Public Services' },
'41': { atoll: 'Fakaofo', type: 'Government Offices' },
'42': { atoll: 'Fakaofo', type: 'Educational' },
'43': { atoll: 'Fakaofo', type: 'Healthcare' },
'72': { atoll: 'Atafu', type: 'Mobile' },
'73': { atoll: 'Nukunonu', type: 'Mobile' },
'74': { atoll: 'Fakaofo', type: 'Mobile' }
};
this.serviceCategories = {
'2': 'Landline',
'3': 'Essential Services',
'4': 'Administrative',
'7': 'Mobile'
};
}
/**
* Parse and validate a Tokelau phone number
* @param {string} number - Phone number to parse
* @returns {Object} Parsed number details
*/
parse(number) {
// Normalize first
const normalized = this.normalize(number);
if (!normalized) {
throw new Error('Invalid phone number format');
}
const cleaned = normalized.replace(/\D/g, '');
const prefix = cleaned.substring(3, 5); // First 2 digits after country code
const serviceDigit = cleaned.substring(3, 4);
const routingInfo = this.atollMap[prefix];
if (!routingInfo) {
throw new Error(`Unknown routing prefix: ${prefix}`);
}
return {
original: number,
normalized: normalized,
countryCode: '+690',
prefix: prefix,
atoll: routingInfo.atoll,
serviceType: this.serviceCategories[serviceDigit],
specificCategory: routingInfo.type,
isEmergency: prefix === '31',
isMobile: serviceDigit === '7'
};
}
/**
* Normalize phone number to E.164 format
*/
normalize(number) {
if (typeof number !== 'string' || !number.trim()) {
return null;
}
const cleaned = number.replace(/[^\d+]/g, '');
if (cleaned.startsWith('+690')) {
if (cleaned.length >= 9 && cleaned.length <= 12) {
return cleaned;
}
return null;
}
if (cleaned.startsWith('690')) {
const withPlus = '+' + cleaned;
if (withPlus.length >= 9 && withPlus.length <= 12) {
return withPlus;
}
return null;
}
if (/^\d{5,8}$/.test(cleaned)) {
return '+690' + cleaned;
}
return null;
}
/**
* Route a call based on the destination number
* Returns routing instructions for the telecommunications system
*/
route(fromNumber, toNumber) {
const from = this.parse(fromNumber);
const to = this.parse(toNumber);
return {
from: from,
to: to,
isDomestic: true, // All Tokelau numbers are domestic
requiresInterAtollRouting: from.atoll !== to.atoll,
priority: to.isEmergency ? 'EMERGENCY' : 'NORMAL',
estimatedLatency: from.atoll !== to.atoll ? '<50ms' : '<10ms'
};
}
}
// Usage example
const router = new TokelauPhoneRouter();
try {
// Parse a number
const parsed = router.parse("+690221234");
console.log(parsed);
// {
// original: "+690221234",
// normalized: "+690221234",
// countryCode: "+690",
// prefix: "22",
// atoll: "Atafu",
// serviceType: "Landline",
// specificCategory: "Residential",
// isEmergency: false,
// isMobile: false
// }
// Route a call
const route = router.route("+6907212345", "+690312345");
console.log(route);
// {
// from: { atoll: "Atafu", isMobile: true, … },
// to: { atoll: "Nukunonu", isEmergency: true, … },
// isDomestic: true,
// requiresInterAtollRouting: true,
// priority: "EMERGENCY",
// estimatedLatency: "<50ms"
// }
} catch (error) {
console.error('Routing error:', error.message);
}Performance Optimization for High-Volume Scenarios:
For applications processing thousands of phone numbers per second:
- Caching: Pre-compute and cache parsed number information
- Batch Processing: Process numbers in batches rather than individually
- Lazy Validation: Defer expensive validation until necessary
- Immutable Data Structures: Use immutable objects to enable safe caching
class HighPerformanceRouter extends TokelauPhoneRouter {
constructor() {
super();
this.cache = new Map();
this.cacheMaxSize = 10000;
}
parse(number) {
// Check cache first
const cached = this.cache.get(number);
if (cached) {
return cached;
}
// Perform parsing
const result = super.parse(number);
// Cache result
if (this.cache.size >= this.cacheMaxSize) {
// Remove oldest entry (simple FIFO)
const firstKey = this.cache.keys().next().value;
this.cache.delete(firstKey);
}
this.cache.set(number, result);
return result;
}
batchParse(numbers) {
return numbers.map(num => {
try {
return { success: true, data: this.parse(num) };
} catch (error) {
return { success: false, error: error.message, number: num };
}
});
}
}
// Usage for high-volume processing
const perfRouter = new HighPerformanceRouter();
const numbers = ["+690221234", "+6907212345", "+690312345", "invalid"];
const results = perfRouter.batchParse(numbers);
console.log(results);What About Number Portability and Multiple Carriers?
Tokelau does not support number portability. This is due to the single-provider system managed by TELETOK/OCOG. This centralized approach simplifies number management and infrastructure development.
Regulatory Status: The Telecommunication Tokelau Corporation Rules 1996 establish TELETOK as "the sole provider, operator and maintainer of telecommunication services in the interests of the people of Tokelau." The legislation creates a legally mandated monopoly, with the Council for the Ongoing Government serving as TELETOK's Board of Directors. (Source: PacLII)
Developer Compliance Requirements:
- All telecommunications services must route through TELETOK infrastructure
- Third-party carrier integration is not permitted under current regulations
- Applications must comply with TELETOK's service terms and conditions
- For commercial applications, coordinate with TELETOK regarding:
- Acceptable use policies
- Service-level agreements
- Technical integration requirements
- Billing and settlement procedures
Future Developments: Tokelau's National Strategic Plan 2021-2026 focuses on improved connectivity, infrastructure development, and good governance. However, no public plans exist to liberalize the telecommunications market or introduce competition. The strategic plan emphasizes working with New Zealand as the administering power to meet social and economic requirements.
If you're developing applications for Tokelau, stay in contact with OCOG/TELETOK for updates on number allocation policies and technical requirements. This ensures your systems remain compliant with any changes. Tokelau's telecommunications system, while relatively simple, is constantly evolving. Stay informed about these developments to build robust and future-proof applications.
Contact Information:
- TELETOK/OCOG: Government of Tokelau
- Minister for Telecommunications: Contact through the Office of the Council for the Ongoing Government
- General Fono (National Legislature): Meets quarterly; next election scheduled for January 2026
Phone Number Validation Libraries and Resources
Recommended SDKs and Libraries for Phone Number Validation
JavaScript/Node.js:
-
libphonenumber-js – Lightweight port of Google's libphonenumber. Supports Tokelau (+690) validation.
bashnpm install libphonenumber-jsjavascriptimport { parsePhoneNumber } from 'libphonenumber-js' const phoneNumber = parsePhoneNumber('+690221234') console.log(phoneNumber.country) // 'TK' console.log(phoneNumber.isValid()) // true -
google-libphonenumber – Official Google libphonenumber JavaScript port
-
phone – Simple phone number validation with country detection
Python:
- phonenumbers – Python port of Google's libphonenumber
bash
pip install phonenumberspythonimport phonenumbers number = phonenumbers.parse("+690221234", None) print(phonenumbers.is_valid_number(number)) # True
PHP:
- giggsey/libphonenumber-for-php – PHP port of Google's libphonenumber
Java:
- libphonenumber – Official Google library (original implementation)
Open Source Examples:
- E.164 Validation Examples – Community examples on GitHub
- Pacific Islands Phone Number Validators – Regional implementations
Technical Standards:
- ITU-T E.164 Numbering Resources – International phone number format specifications
- E.164 Phone Number Format Guide – Detailed E.164 implementation guide
Tokelau Government:
- Office of the Council for the Ongoing Government of Tokelau – Official government portal
- Tokelau National Statistics Office – Census data and statistics
Legal and Regulatory:
- Telecommunication Tokelau Corporation Rules 1996 – Legal framework for TELETOK (PacLII)
- Tokelau Legislation Database – Pacific Islands Legal Information Institute
Related Phone Number Guides:
- International Phone Number Formatting Standards
- SMS API Integration Best Practices
- ITU-T E.164 Compliance for Small Territories
Next Steps
Build effective telecommunications solutions for Tokelau by following the best practices and guidelines outlined here. Your applications can be compliant, efficient, and tailored to the specific needs of this unique territory.
Pre-Deployment Checklist
Before deploying your Tokelau telecommunications integration to production:
Technical Validation:
- Phone number validation handles all valid formats (5-8 digit subscriber numbers)
- E.164 normalization correctly adds +690 country code
- Geographic routing identifies all three atolls (Atafu, Nukunonu, Fakaofo)
- Service category detection works for all types (Landline, Mobile, Essential Services, Administrative)
- Error handling distinguishes between format errors, invalid prefixes, and routing failures
- SMS character encoding properly handles GSM-7 (160 chars) and Unicode (70 chars)
- Message segmentation correctly calculates multi-part SMS costs
Integration Preparation:
- Contacted TELETOK for technical integration requirements
- Confirmed API access or integration method (if programmatic access needed)
- Obtained necessary credentials and added to secure environment variables
- Established error handling and retry logic with exponential backoff
- Implemented logging for debugging and compliance monitoring
- Configured timeout values appropriate for submarine cable latency (<100ms)
Compliance and Regulatory:
- Application complies with Telecommunication Tokelau Corporation Rules 1996
- Reviewed acceptable use policies with TELETOK
- Emergency number handling (999) properly prioritized if applicable
- Data privacy requirements understood (contact TELETOK for specifics)
- Billing and cost tracking implemented for SMS/call usage
Operational Readiness:
- Monitoring and alerting configured for service availability
- Fallback procedures documented for connectivity issues
- Support contact information for TELETOK documented
- User documentation includes Tokelau-specific dialing instructions
- Testing completed with real Tokelau numbers (coordinate with TELETOK)
Common Issues and Troubleshooting
Problem: Phone numbers fail validation despite correct format Solution: Verify the prefix is valid for Tokelau (2xx, 3xx, 4xx, 7xx series). Check that subscriber number length is 5-8 digits. Ensure +690 country code is present.
Problem: SMS delivery failures or delays Solution: Confirm number is correctly formatted in E.164. Check that message length accounts for encoding (160 chars GSM-7, 70 chars Unicode). Verify TELETOK service status. Implement retry logic with exponential backoff.
Problem: Inter-atoll call quality issues Solution: Verify submarine cable connectivity status (operational since late 2023). If issues persist, contact TELETOK. Note that the domestic network upgrade completes in 2025, which may improve quality.
Problem: Unable to determine routing destination Solution: Ensure your atoll mapping includes all valid prefixes. The geographic routing function must recognize 22/23/24 (Atafu), 31/32/33 (Nukunonu), 41/42/43 (Fakaofo), and 72/73/74 (mobile by atoll).
Problem: Emergency calls not prioritized Solution: Check for prefix '31' (Nukunonu emergency services) and route with highest priority. Implement special handling for 999 emergency number.
Implementation Workflow
- Validate inputs thoroughly using the regex patterns and validation functions provided
- Test with TELETOK before production deployment to confirm integration works with live infrastructure
- Implement robust error handling with proper logging for debugging and compliance
- Monitor performance to ensure latency remains acceptable (<100ms for submarine cable connectivity)
- Prioritize clear communication with proper error messages and user feedback
- Stay updated on changes in Tokelau's telecommunications landscape, especially the 2025 domestic network upgrade completion
- Contact TELETOK/OCOG for current technical requirements and number allocation policies before major deployments
- Document thoroughly for your team, including Tokelau-specific considerations and emergency contact procedures