phone number standards
phone number standards
Eritrean Phone Numbers: Format, Area Code & Validation Guide
Learn how to validate, format, and process Eritrean phone numbers (+291) in your applications. This comprehensive guide covers Eritrea's phone number format, E.164 validation, mobile vs. landline detection, and code examples for developers.
Eritrean Phone Numbers: Format, Area Code & Validation Guide
Learn how to validate, format, and process Eritrean phone numbers (+291) in your applications. This comprehensive guide covers Eritrea's phone number format, E.164 validation, mobile vs. landline detection, and code examples for developers working with SMS gateways, payment systems, authentication services, and CRM platforms. Understand the +291 7XX XXXX mobile format, area codes for Asmara and other regions, and best practices for handling Eritrean telecommunications in your software.
Eritrea's Telecommunications Landscape (+291 Country Code)
The Eritrean government controls Eritrea's telecommunications sector through a state-managed model. EriTel (Eritrean Telecommunication Services Corporation), a state-owned operator, provides all telecommunications services. EriTel holds a monopoly over fixed-line and mobile services, while internet service provision is open to a limited number of other providers.
Regulatory Framework
Legal Notice No. 43/1998 – Regulations on Telecommunications Networks and Services governs telecommunications in Eritrea. The Ministry of Transport and Communications issued this notice under the Communications Proclamation (Proclamation No. 102/1998).
Licensing Requirements:
- Exclusive Rights Activities (EriTel monopoly): establishment and operation of public telecommunications networks, domestic and international public telephony services (excluding cellular), and leased lines. Requires permit under Article 12 of Proclamation No. 102/1998.
- Limited Competition Activities: public data transmission (email, internet), public cellular mobile telephone services, paging services, and global mobile satellite personal communications. Requires Article 12 permit.
- Open Competition Activities: value-added services, equipment importation/installation, and public payphone services (with permit exceptions for ≤3 units or hotel/retail premises).
Business Compliance Requirements:
- Obtain permits from the Ministry of Transport and Communications (Department of Telecommunications)
- Define and control technical quality, delivery time, fault frequency, and restoration time per Article 9 of Legal Notice 43/1998
- Implement cost-oriented pricing with transparent, non-discriminatory tariffs (Article 26)
- Maintain separate accounting for public networks, telephony services, and leased lines
- Submit annual reports on user numbers, traffic volume, and trading conditions
- Use equipment that complies with relevant ITU, ISO, or IEC standards or national specifications approved by the Department
Consult the Ministry of Transport and Communications and EriTel for current permit requirements when integrating with Eritrean telecommunications.
Key characteristics of Eritrea's telecommunications landscape:
| Characteristic | Description |
|---|---|
| Centralized Management | EriTel manages all fixed-line, mobile, and most internet services |
| Developing Infrastructure | Ongoing infrastructure modernization and 3G expansion; less developed compared to other African countries; investment extends services to remote areas |
| Urban-centric Coverage | Concentrated in urban centers and major transportation corridors; limited rural coverage with ongoing expansion |
| Limited Competition | Monopoly status slows telecommunications market development |
| Low Penetration Rates | ~20% mobile penetration; significantly lower fixed-line and internet penetration due to limited technology access and restricted SIM card availability |
Understanding Eritrea's Phone Number Format and Numbering Plan
Eritrea uses a closed numbering plan that conforms to international standards. Each Eritrean phone number (excluding the country code) is consistently 7 digits, simplifying validation and processing.
- Country Code: +291 (ITU-T E.164 format)
- International Prefix: 00 (used when dialing out of Eritrea)
- National Prefix: 0 (used for domestic calls within Eritrea)
- Number Length: 7 digits after country code (consistent format)
When to Use Prefixes:
- International prefix (00 or +): Use when calling Eritrea from abroad. The + symbol replaces your country's international dialing code (e.g., 011 from US/Canada). Format:
+291 [area code] [subscriber number]or00 291 [area code] [subscriber number](from countries using 00). - National prefix (0): Use when dialing domestically within Eritrea. Format:
0 [area code] [subscriber number]. Drop the leading 0 when using the international format. - No prefix: Store phone numbers in E.164 format (international standard for phone numbering) without the leading + for database storage:
291[area code][subscriber number].
Number Portability: Eritrea does not have mobile number portability per the ITU. Users cannot transfer phone numbers between operators (though this is moot given EriTel's monopoly status). EriTel manages number allocation centrally under Ministry of Transport and Communications supervision.
Eritrean Phone Number Format Structure
The general structure of an Eritrean phone number:
+291 [Area/Service Code] [Subscriber Number]
Eritrea Landline Phone Numbers (+291 1, +291 2, +291 8)
- Format:
+291 [1-2 Digit Area Code] [5-6 Digit Subscriber Number]
Examples:
Asmara: +291 1 234567
Other regions: +291 2 123456
Area Codes:
The ITU allocated area codes progressively in 1999, 2001, and 2009.
| Area Code | Region/City | Notes |
|---|---|---|
| 1 | Asmara (Capital) | Primary urban center |
| 1 | Agordat | Allocated in 2001 (prefix 71XXXX) |
| 1 | Tessenei | Allocated in 2001 (prefix 72XXXX) |
| 1 | Barentu | Allocated in 2001 (prefix 73XXXX) |
| 2 | Other regions | General regional allocation |
| 8 | Fixed CDMA services | Allocated in 2009 (8XXXXXX) |
Source: Telephone numbers in Eritrea – Wikipedia and ITU allocations (1999-2009)
Eritrea Mobile Phone Numbers (+291 7XX XXXX)
EriTel provides all mobile numbers in this format:
- Format:
+291 7XX XXXX(7 digits after country code) - Service Type: Mobile services (allocated 2004)
- National Destination Code (NDC): 7
Examples:
+291 721 2345
+291 731 6789
Mobile telephone services in Eritrea began in May 2001. The ITU formally allocated the mobile NDC "7" in 2004. While older sources may reference prefixes like 71X, 72X, and 73X for different service types, all mobile numbers now use the 7XXXXXX format (7 followed by 6 digits). Validate against the most up-to-date information available from EriTel.
Prefix Allocation: EriTel centrally manages mobile prefix allocation. No carrier-specific prefix differentiation exists since EriTel is the sole mobile operator. All 7XX XXXX numbers are EriTel mobile numbers.
Developer Guide: How to Validate Eritrean Phone Numbers
This section provides practical guidance and code examples for working with Eritrean phone numbers.
Detecting Mobile vs Landline in Eritrean Numbers
Use this decision tree to identify Eritrean phone number types:
Input: Normalized number (digits only, with or without country code)
1. Strip country code (291) and national prefix (0) → Get 7-digit local number
2. Check first digit:
- '7' → Mobile number
- '1' → Landline (Asmara and specific cities)
- '2' → Landline (other regions)
- '8' → Landline (fixed CDMA services)
- Other → Invalid
3. Validate length: Must be exactly 7 digits
4. Return: {type: 'mobile'|'landline', valid: true|false}
Phone Number Validation: Code Examples for +291 Numbers
Handle edge cases including optional country code, national prefix, whitespace, and formatting characters.
JavaScript/TypeScript:
// Landline validation (area codes 1, 2, 8)
const landlineRegex = /^(\+?291|0)?[128]\d{5,6}$/;
// Mobile validation (7 followed by 6 digits)
const mobileRegex = /^(\+?291|0)?7\d{6}$/;
// Combined validation
function validateEritreanNumber(phoneNumber) {
// Remove whitespace and common separators
const cleaned = phoneNumber.replace(/[\s\-\(\)]/g, '');
return landlineRegex.test(cleaned) || mobileRegex.test(cleaned);
}
// Validate and return type
function validateWithType(phoneNumber) {
const cleaned = phoneNumber.replace(/[\s\-\(\)]/g, '');
if (mobileRegex.test(cleaned)) return { valid: true, type: 'mobile' };
if (landlineRegex.test(cleaned)) return { valid: true, type: 'landline' };
return { valid: false, type: null };
}Python:
import re
# Landline validation
landline_pattern = r'^(\+?291|0)?[128]\d{5,6}$'
# Mobile validation
mobile_pattern = r'^(\+?291|0)?7\d{6}$'
def validate_eritrean_number(phone_number):
"""Validate Eritrean phone number (landline or mobile)"""
# Remove whitespace and common separators
cleaned = re.sub(r'[\s\-\(\)]', '', phone_number)
return bool(re.match(landline_pattern, cleaned) or re.match(mobile_pattern, cleaned))
def validate_with_type(phone_number):
"""Validate and return phone number type"""
cleaned = re.sub(r'[\s\-\(\)]', '', phone_number)
if re.match(mobile_pattern, cleaned):
return {'valid': True, 'type': 'mobile'}
if re.match(landline_pattern, cleaned):
return {'valid': True, 'type': 'landline'}
return {'valid': False, 'type': None}Java:
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class EritreanPhoneValidator {
// Landline pattern
private static final Pattern LANDLINE_PATTERN =
Pattern.compile("^(\\+?291|0)?[128]\\d{5,6}$");
// Mobile pattern
private static final Pattern MOBILE_PATTERN =
Pattern.compile("^(\\+?291|0)?7\\d{6}$");
public static boolean validateEritreanNumber(String phoneNumber) {
// Remove whitespace and common separators
String cleaned = phoneNumber.replaceAll("[\\s\\-\\(\\)]", "");
return LANDLINE_PATTERN.matcher(cleaned).matches() ||
MOBILE_PATTERN.matcher(cleaned).matches();
}
public static ValidationResult validateWithType(String phoneNumber) {
String cleaned = phoneNumber.replaceAll("[\\s\\-\\(\\)]", "");
if (MOBILE_PATTERN.matcher(cleaned).matches()) {
return new ValidationResult(true, "mobile");
}
if (LANDLINE_PATTERN.matcher(cleaned).matches()) {
return new ValidationResult(true, "landline");
}
return new ValidationResult(false, null);
}
public static class ValidationResult {
public final boolean valid;
public final String type;
public ValidationResult(boolean valid, String type) {
this.valid = valid;
this.type = type;
}
}
}Edge Cases to Handle:
- Numbers with/without country code (+291 vs 291 vs local format)
- Numbers with national prefix (0) for domestic dialing
- Whitespace and formatting characters:
+291 7 123456,+291-7-123456,(291) 7 123456 - Leading zeros in subscriber numbers
- Invalid area codes (must be 1, 2, 7, or 8)
- Incorrect length (must be exactly 7 digits after country code)
Converting to E.164 Format: Eritrean Phone Numbers
Format numbers consistently for better readability and data handling:
function formatEritreanNumber(phoneNumber) {
// Strip non-numeric characters except leading +
const cleaned = phoneNumber.replace(/[^\d+]/g, '');
// Remove leading + temporarily
let digits = cleaned.replace(/^\+/, '');
// Handle national prefix (0)
if (digits.startsWith('0')) {
digits = digits.substring(1);
}
// Add country code if missing
const withCountryCode = digits.startsWith('291') ? digits : `291${digits}`;
// Validate length (should be 291 + 7 digits = 10 total)
if (withCountryCode.length !== 10) {
throw new Error('Invalid Eritrean phone number length');
}
// Format based on number type
const areaCode = withCountryCode[3];
if (areaCode === '7') {
// Mobile: +291 7XX XXXX
return `+${withCountryCode.slice(0, 3)} ${withCountryCode.slice(3, 6)} ${withCountryCode.slice(6)}`;
} else if (['1', '2', '8'].includes(areaCode)) {
// Landline: +291 [1/2/8] XXXXX or XXXXXX
return `+${withCountryCode.slice(0, 3)} ${withCountryCode.slice(3, 4)} ${withCountryCode.slice(4)}`;
} else {
throw new Error('Invalid Eritrean area code');
}
}Error Handling and Common Validation Issues
Implement robust error handling to manage invalid input:
// Error types
const ErrorTypes = {
REQUIRED: 'PHONE_REQUIRED',
INVALID_FORMAT: 'INVALID_FORMAT',
INVALID_AREA_CODE: 'INVALID_AREA_CODE',
INVALID_LENGTH: 'INVALID_LENGTH'
};
function validateAndFormatNumber(input) {
try {
if (!input) {
throw { type: ErrorTypes.REQUIRED, message: 'Enter a phone number.' };
}
const cleaned = input.replace(/[^\d+]/g, '').replace(/^\+/, '').replace(/^0/, '');
const withCode = cleaned.startsWith('291') ? cleaned : `291${cleaned}`;
if (withCode.length !== 10) {
throw { type: ErrorTypes.INVALID_LENGTH, message: 'Eritrean phone numbers must be 7 digits (excluding country code).' };
}
const areaCode = withCode[3];
if (!['1', '2', '7', '8'].includes(areaCode)) {
throw { type: ErrorTypes.INVALID_AREA_CODE, message: `Invalid area code: ${areaCode}. Valid codes are 1, 2, 7, or 8.` };
}
const formatted = formatEritreanNumber(input);
return { success: true, formatted, type: areaCode === '7' ? 'mobile' : 'landline' };
} catch (error) {
console.error(`Validation error: ${error.message}`);
return { success: false, error: error.type, message: error.message };
}
}Common Validation Errors:
| Error Type | Description | Solution |
|---|---|---|
| PHONE_REQUIRED | Empty or null input | Prompt user for phone number |
| INVALID_LENGTH | Number has ≠7 digits after country code | Verify correct number format (7 digits) |
| INVALID_AREA_CODE | Area code not in [1, 2, 7, 8] | Check number source; may be outdated or incorrect |
| INVALID_FORMAT | Contains invalid characters or structure | Strip to digits and revalidate |
Additional Considerations for Eritrean Telecommunications
- Data Services: EriTel offers 3G and is expanding its network. ADSL internet access is also available.
- International SMS: Eritrea may restrict outbound international SMS. Confirm with EriTel for the latest information.
- SIM Card Restrictions: The government controls SIM card access and may require an application process.
Troubleshooting Common Eritrean Phone Number Integration Issues
Issue: Numbers fail validation despite appearing correct
- Solution: Handle both international (+291) and national (0) prefix formats. Strip whitespace and formatting characters before validation.
Issue: Cannot determine if number is mobile or landline
- Solution: Check the first digit after country code. 7 = mobile, 1/2/8 = landline/fixed.
Issue: SMS delivery failures
- Solution: Verify the number is in E.164 format (+291XXXXXXX). Check with EriTel for restrictions on international SMS routing. Confirm the number is active (low penetration rates mean many numbers may be inactive).
Issue: Inconsistent number formats in database
- Solution: Normalize all numbers to E.164 format (+291XXXXXXX) on input. Store without formatting characters. Format for display only.
Best Practices for Working with Eritrean Phone Numbers
- Consult Official Sources: Refer to the Ministry of Transportation and Communications and EriTel's website for current regulations and numbering plans.
- Handle Edge Cases: Consider scenarios like invalid input, missing area codes, and formatting variations.
- Test Thoroughly: Test your implementations with various valid and invalid phone numbers to ensure accuracy.
Security Best Practices for Phone Number Handling
Phone numbers are classified as personal data under GDPR and similar data protection regulations. Implement these security measures:
Storage and Encryption:
- Encrypt at rest: Store phone numbers in encrypted database columns using AES-256 or equivalent
- Encrypt in transit: Use TLS 1.2+ for all API communications transmitting phone numbers
- Pseudonymization: Consider hashing phone numbers for analytics/logging purposes (note: hashing alone does not provide anonymization)
- Access controls: Limit database access to phone number columns via role-based access control (RBAC)
Data Minimization and Retention:
- Purpose limitation: Only collect phone numbers when necessary for service delivery (e.g., authentication, SMS notifications)
- Retention limits: Define and enforce data retention policies. Delete phone numbers when no longer needed or upon user request
- User consent: Obtain explicit consent before storing or processing phone numbers, especially for marketing
Processing and Validation:
- Input sanitization: Always sanitize phone number input to prevent SQL injection and XSS attacks
- Rate limiting: Implement rate limits on phone validation/SMS endpoints to prevent enumeration attacks
- Audit logging: Log all access to phone number data with timestamps and user IDs for compliance auditing
- Secure transmission: Never log phone numbers in plaintext. Mask or redact in application logs (e.g.,
+291 7XX XX45)
Compliance Considerations:
- Right to erasure: Provide mechanisms for users to delete their phone numbers (GDPR Article 17)
- Data portability: Allow users to export their phone number data in machine-readable format
- Breach notification: Establish procedures to notify authorities and affected users within 72 hours of a phone number data breach
- Vendor management: Ensure third-party SMS providers (if used) comply with data protection regulations and have appropriate data processing agreements (DPAs)
Performance Optimization:
- Database indexing: Create indexes on phone number columns for faster lookups, but consider index size with encryption
- Caching: Cache validation results for frequently validated numbers (with appropriate TTLs)
- Batch processing: Process bulk validations in batches to reduce database load
- Lazy loading: Only load phone number data when explicitly needed in user interfaces
By following these guidelines, you can effectively work with Eritrean phone numbers, ensuring accurate validation, formatting, and integration with your applications while maintaining security and regulatory compliance.