Voximplant Platform allows developers with any expertise level to send SMS messages in minutes. In this article, we’ll guide you through this development process. You can also watch a video version of this tutorial.
Each country has established an independent phone number format valid only for local communications. To reach customers worldwide, you should apply the E.164 phone number format.
When companies enter the international market and start attracting customers from different countries, they face a problem: text messages and phone calls destined for a foreign country sometimes don’t reach the customer’s phone.
This is likely because the number is not correctly formatted. Local and international number formats are different and the correct format must be used to ensure your calls are successful.
Each country has a local phone number format. Depending on the caller country, the same number can vary:
- In Germany: 001-541-768-3296
- In France: 191 541 768 3296
If you dial a Germany-based phone number from a France endpoint, the call fails to reach the customer. This way, local formats cannot ensure international deliverability.
To correctly route phone calls and messages to different countries, the ITU-T implemented an E.164 international public numbering plan. It describes a unified format for all phone numbers.
Use E.164 Formatting
The E.164 format is designed to route text messages and phone calls from/to any endpoint in the world over the Public Switched Telephone Network or simply PSTN. Sometimes E.164 is called an ‘international format’. E.164 establishes a unique set of prefixes that differentiate local from international calls.
To enable global service, PSTN carriers in each country route calls based on both E.164 and their own local format. This enables in-country calls to use the shorter dialing sequences established by local standards while also providing global service via the E.164 format.
An E.164 format includes four components:
- The + call prefix
- The country code, or national destination code
- The local area code
- The subscriber number
To make it clear, let’s take a look at three E.164 formatted dialing sequences for the same subscriber number: +30217683296, +8137683296, and +12027683296.
|Prefix||Country code||Аrea code||Subscriber number|
|+||30 (Greece)||21 (Athens)||7683296|
|+||81 (Japan)||3 (Tokyo)||7683296|
|+||1 (North America)||202 (Washington)||7683296|
If you want to call an Athens-based customer from any country, you will need to dial +30217683296. The same goes for Tokyo, Washington and all other cities.
Voximplant recommends using the internationally-recognized E.164 format for all communications.
Manual Converting of Local Formats
If you have a small customer base, you can convert telephone numbers manually. To do this, you need to know the country and city your customer is from. The process is broken down into four steps:
- Remove spaces, parentheses and other punctuation marks
- If the phone number starts with a zero, remove the master zero
- Place the country and area codes at the beginning of the number
- Place ‘+’ before the country code
For instance, take this UK-based phone number: (020) 768-3296.
- Remove punctuation. (020) 768-3296 → 0207683296
- Remove zero. 0207683296 → 207683296
- Add country and area codes. 207683296 → 1202207683296
- Add prefix. 4420207683296 → +4420207683296
Automated Phone Number Formatting
If you have a constant flow of new customer records and don’t have time to convert the numbers manually, you can automate the process. It’s more efficient to capture phone numbers in the correct E.164 format initially rather than fix them later.
One way is to design a visual prompt for valid input. The element may look as follows:
However, some customers may ignore this prompt and enter an invalid format. To avoid this, you can implement a plugin for real-time validation of phone numbers. With plugins, you can implement the following features:
- A country dropdown to select the proper codes
- Pre-populate the country code based on the IP address
- Automated conversion of an entered phone number to the E.164 format
- Displaying a country flag icon and other design elements