24. World Class Routing – part 5 – The link between the DID and extension

So, we spoke about how a call is going out when we spoke about the ARS tables. However, you might ask yourself how does the system know what number to display when you make that outbound call? If you remember, when you're dialing that 9 you're going out a trunk but you are going out as extension 1234 (let's say). However,if you dial an external number from that extension to a mobile let's say, you will notice a DID (like 416-900-1234 for example). We are going to discuss this process in this article. Not hard if you know where to look. PUBLIC-UNKNOWN-NUMBERING is the key word here.

We have the usual trinity of commands here (display/change/list)...
1. display public-unknown-numbering
2. change public-unknown-numbering
3. list public-unknown-numbering

However, we tend to use options 2 and 3 more as usually you either want to add a new range a dids to the system or to confirm the numbering system. If you remember we spoke in past that we defined the dialplan as we wish and we tend to link the last digits of the did's that the telco is assigning to us to the last numbers. Eg ... if the DID is 416-123-1234 and we have a 4 digit numbering plan then the extension would be 1234.

So, if we wish to know what are our did's assigned to the extension we would use the command list public-unknown-numbering.  The output is bellow.

As you can see the screen you can assign different numbering system depending on the trunk that you will be using. There are 5 columns of data that you can use.

So the way it works is that the system looks for the closest match for a extension with the length of ext len starting with ext code that goes over the trk. group specifed. If these conditions match then the system will add the CPN up to the total cpn lenght.

For example, in the table above you can see that any 4 digit extension startig with number 7 will have 416227 added in front. So any extension in the format 7000 to 7999 (4 digits) would present hereself outside as 416-227-7000 to 416-227-7999. You notice that we are using 10 digits in the DID number because we have 10 digits defined in the Total CPN len.

You can also program the system in a way that would replace any number for which you don't have a DID to present a generic number. So let's say that you have the following scenario (and please ignore the absurd in it).

You have bought this range of Did's 416-227-7000 to 416-227-7099. However 416-227-7009 is no available so the telco gives you 416-730-7009. However the branch that you're programming has 200 extensions in the range, but you don't care for the extra 100 so you will be displaying the genering reception number of 4167301234.  The way you would have to program this range would be like bellow.

Remember that we spoke about having the closest match ? Well, you will begin by finding the groups where numbers have the same prefix. Here are our matches/groups...

1. 7009 will have it's own entry as it will display 416-730-7009
2. 70xx will have it's own entry as it will display 416-227-70xx
3. 7xxx will have it's own entry as it will display 416-227-1234

The way to program this is like in the previous image. All three groups have a ext code of 4, however the ext code will be 7009 for (1), 70 for (2) and 7 for (3). The trunk will always be 1 as this is our main trunk and the CPN will wary according to what our company boght from the telcom. The total CPN lenght is 10 as we will be always displaying 10 digits.

Not to forget, the command to implement the changes would be change public-unknown-numbering 4 (we want to change the extensions that are 4 digits in length). Don't be scared if you don't see all the entries in the display table. Always confirm the change by issuing the command list public-unknown-numbering.

Hope that this article solved the mystery around how DID's are created.


  1. Great article! What does the TRK GRP colum do? For example
    7xxx 416-227-1234 is on TRK GRP 1 and 7 appears again on TRK GRP 95 with no CPN.

    • Jon, you can generate different numbers depending on the trunk that the extension will be taking. So, if you read the trunk lesson or the world class routing then you can see that a call can take different trunks depending on the route that you define. Now, if you want you can present a number on a trunk group but another on another trunk… I’ll give you an example. You can have a trunk that handles only international calling but you want to present 011 for the beginning of the call as you know if people would like to call you back they need to add a 011. In my case for example group 95 is OneX Speech (not yet implemented btw) so that application might expect numbers coming in a different format.
      To sum up, you could display different numbers for different trunks. I can have 416-123-1234 displayed if the call is going out on trunk 1 or 51234 is the call is going on trunk 2.

      Remember that the DID is used mainly for call back so you have to make sure you generate the right number otherwise when people redial might reach a wrong number. You can fake the number of the president of the USA when you call but when somebody will try to call that number back they will reach the president of the USA. This is also called phone spoofing and you can read more about it here.


  3. Really appreciate for such a knowledge share!!!

  4. Nice Article! Let me ask you: public unknown numbering configurations work only in isdn trunks, right?

  5. How do you remove a Public unknown number? I added one in error and I cannot remove it

  6. I also made an entry in the table and can not remove it.

Leave a Reply

Your email address will not be published. Required fields are marked *