Sending SMS messages is easy, although there are some details that need attention. There is, for instance, quite some confusion in how to format telephone numbers correctly.
The most important part to remember is to add the international country code. A mobile phone number in the United Kingdom always starts with the digits '07', for instance ‘07911 123456’. If you would not add an international country code, the computer might interpret that phone number otherwise. The country code for Russia is ‘+7’, and Russian mobile phone numbers start with ‘+79’, so ‘+7911 123456’ might be a Russian mobile phone as well.
Therefore you should add ‘+44’ UK’s country code to make the number unambiguous; ‘+44 7911 123456’ will always lead to a mobile phone in the UK.
It might be clever to format numbers using the E.164 recommendation. An international E.164 number is designed to include all of the necessary information to successfully route a call or SMS message to an individual subscriber on a nation's public telephone network.
Here's how the E.164 numbering plan works:
• A telephone number can have a maximum of 15 digits
• The first part of the telephone number is the country code (one to three digits)
• The second part is the national destination code (NDC)
• The last part is the subscriber number (SN)
• The NDC and SN together are collectively called the national (significant) number
To use the previous example:
Two important things to note: First of all, in the international E.164 notation a leading ‘0’ is removed. The UK mobile phone number ‘07911 123456’ in international format is ‘+44 7911 123456’, so without the first zero. Secondly in the E.164 notation all spaces, dashes [‘-‘] and parentheses [ ‘(‘ and ‘)’] are removed, besides the leading ‘+’ all characters should be numeric.
A great way to check whether a phone number is correct or how it should look in E.164 formatting is using the Phone Number Parser demo. That is part of a piece of software that Google uses to check phone number formatting in Android phones.
The website ‘howstuffworks’ has more valuable background information on the origin of International Telecommunication Unit (ITU) and the numbering plan E.164.
Enjoyed this article? Please share the news!