
- Details
- Category: Technology
When you see a number, have you asked if it is a random number?
Short answer: no. There is logic behind it. That logic is written on the E.164. The E.164 is the standard that dictates the nomenclature of the telephone numbers. In this article, I will try to explain the logic of that document easily.
The Structure of the International ITU-T E.164 Number
The first thing to understand is that the numbers are classified into geographical, global services, network, groups, trials. Geographical numbers are the ones that are tied to a specific geographical area (although we already know you can have a New York City number if you live in Los Angeles, but let's bear with this).
Geographical Numbers
The geographical number is composed of decimal digits that form the country code (CC) and the national significant number (NSN). Each country will divide their NSN according to its needs. There are some basic rules:
GN = CC + NDC + SN
- The total length of the number can not exceed 15 digits.
- The Country Code (CC) length is between 1 and 3 digits.
- The National Destination Code (NDC) length depends on the Country Code:
- four digits if the CC has three digits,
- five digits if the CC has two digits, or
- six digits if the CC has one digit.
International Global Services Numbers
International global services number follows these rules:
IGSN = CC + GSN
- The total length of the number can not exceed 15 digits.
- The Country Code (CC) length is three digits.
- The Global Subscriber Number (GSN) can not exceed 12 digits.
International Network Numbers
This kind of number is composed of three code fields as follows:
NN = CC + IC + SN
- The total length of the number can not exceed 15 digits.
- The Country Code (CC) length is three digits.
- The Identification Code (IC) length is from one to four digits.
- The Subscriber Number (SN) maximum length is 12. However, there is a minimum length that varies:
- nine digits with a one-digit IC,
- eight digits with a two-digit IC,
- seven digits with a three-digit IC, and
- six digits with a four-digit IC.
- The length of the IC and SN cannot exceed 12 digits altogether.
International Group Numbers
This kind of numbers is composed of three code fields:
IGN = CC + GIC + SN
- The total length of the number can not exceed 15 digits.
- The Country Code (CC) length is three digits.
- The Group Identification Code (GIC) length is one digit.
- The Subscriber Number (SN) maximum length is 11.
- The length of the GIC and SN cannot exceed 12 digits altogether.
Trial Numbers
Trail Numbers have two mandatory and one optional code field as follows:
TN = 991 + TIC + SN
- The total length of the number can not exceed 15 digits.
- The first prefix length is three digits, and it always seems to be 991.
- The Trial Identification Code (TIC) length is one digit.
- The Subscriber Number (SN) length is 11 digits maximum.
- The length of the TIC and SN cannot exceed 12 digits altogether.
Country Code Assignation
Canada doesn't get the +1 just for fun, Mexico +52 or Australia +61. There is logic within, and the best way to understand is through this graphic.
The + Sign
Commonly substituted by 00 in some PBXes, the + sign is a suggestion from the E.123 to indicate that an international prefix is required. This could make a difference, for example:
- 6138007370, depending on the context, could be an Ottawa, ON number or an Australian one.
- +6138007370, refers to an Australian number.
The Zero
The zero has a special meaning. Commonly used to identify Global or Service numbers. Depending on the Country, the zero can make a difference between a valid number and an invalid one. For example, +1100XXXYYYY is an invalid geographic number, but it could be a valid service or network number.
I will keep updating this article as I understand more about this subject.
Good luck!

- Details
- Category: Technology
I would be surprised if someone told me they don't get marketing calls. There are many ways to mitigate them, yet they are still here. Implementing the STIR/SHAKEN protocol and rejecting all the non-signed INVITES to your PBX is the best way to minimize a suspicious call. However, at this point, not everybody is signing the calls; therefore, you could have false positives (blocking legitimate calls).
In this article, I will explain how to implement the two recommendations from the CRTC for those PBXes that are not offering an opt-in call filtering system.
Read more: Basic Protection against Telemarketing and Unwanted Calls with FreeSWITCH

- Details
- Category: Technology
So I was asked to add OKTA authentication to FusionPBX/CoolPBX. Yes! Why not? I have seen more than one customer using OKTA.
The first thing we need to demystify is what OKTA is. OKTA is many things, but for the effects of this article, OKTA is an OpenID implementation (a very popular one). You also need to know that you can't talk about OpenID without talking about OAuth. Yes, it is a little confusing, I highly recommend watching the following video.
- Details
- Category: Technology
As I am making my fork of FusionPBX, CoolPBX more MariaDB/MySQL compatible, I have found that the DATE_TRUNC() function doesn't work.
After googling, I found that some people suggest that the PostgreSQL DATE_TRUNC() function to MariaDB/MySQL is EXTRACT(), but it is not. For example, in PostgreSQL:
SELECT DATE_TRUNC('hour', NOW()) + (INTERVAL '1 hour') AS h;
It will return something like 2024-08-09 09:00:00-04. While in MariaDB:
SELECT EXTRACT(hour FROM NOW() + INTERVAL 1 HOUR AS h;
It will return only 9.
- Details
- Category: Technology
Syncing a filesystem in a cluster is one of the most challenging things. There are many ways to do it:
- iSCSI with GFS2: you require local computers with a fast iSCSI connection to make it work;
- Glusterfs: it is slow if your nodes are far from each other (as it is a synchronous filesystem);
- NFS: famous because it is one of the slowest filesystems;
- Syncthing: big footprint, especially when scanning the filesystem, file synchronization could be delayed.
These are some of the many approaches you may take. I am going to talk about a new one.
- CSync2 with Lsyncd: small footprint with almost real-time synchronization.
Read more: Filesystem Cluster Synchronization with Small Footprint