| technology | networking - Erik Mikac
What Are Route Pattern Wildcards?
It is estimated that there are more than 10 billion possible phone numbers in the United States. When configuring routes in CUCM, it would simply be untenable to list every possible number required in a route table.
In this post, we will discuss how to create generalized route patterns. These generalized route patterns will allow you to easily cover a wide swath of numbers without sacrificing hundreds of hours of configuration. First however, let's briefly review what a route pattern is. Then, we'll discuss how to implement route pattern wildcards.
What is a Route Pattern?
A route pattern is a string of numbers that CUCM uses to determine where to route calls. For example, a simple route pattern could be a number like 812-555-4001. A route pattern has a route list associated with that route pattern. However, as we'll see later this does not take into account the external routing number, which is usually 9.
So if an end user calls the aforementioned number, CUCM finds it in the route pattern table. Then, it looks at the associated route list and group to determine how that external call should be routed. For instance, the call can either be routed through a SIP Trunk or a Gateway. The key takeaway is this: a route pattern gives CUCM the ability to call numbers outside of itself — whether that is to a PTSN, ITSP, or some other CUCM Cluster. Entering a route pattern is simple enough, but what if there are hundreds of numbers to enter? That's where wildcards come into play.
What is a Wildcard?
To put it simply, a wildcard in computer science is a symbol attached to a string of information. The symbol essentially says, "apply a specified pattern on the given number sequence." In CUCM, a wildcard can be displayed as an X. However, there are several other route pattern wildcards at our disposal.
The purpose of a wildcard in CUCM is to make route patterns more concise and easier to read. After all, the only alternative would be to program thousands of route patterns for every possible phone number! Let's take a look at some examples to make it more clear.
The X wildcard is used to specify a number in the range 0-9. It is probably the most common wildcard seen on a route table. Let's say you work on a sales team that needs to reach out to all potential customers whose numbers begin with 812-365. So 812-365-8888 would be a valid phone number, but 812-555-1234 would not. In CUCM, one option would be to add each possible number individually. Unfortunately this would mean creating nearly 10,000 different phone numbers. No thanks!
Instead, use wildcards to create one route pattern that would look like this: 812-356-XXXX. Each of these Xs represents a digit 0-9. This is far easier to write, maintain, and troubleshoot.
Discard Digit Wildcard
The discard digit wildcard is represented as a dot. The dot wildcard separates the CUCM access code from the directory number. For example, say your organization requires a user to dial 9 before making an external call.
That would mean if they wanted to call a family member, they'd have to dial 9-<the phone number>—so 9-808-555-1234. However, the discard wildcard removes that necessity. In CUCM, the discard wildcard could be used like this: 9.[2-9]XXXX. This wildcard expression can be translated to, "exclude nine when users make local calls."
You may have noticed that this pattern sequence leveraged a wildcard we have not discussed, yet: the bracket sign. Let's delve into that one right now.
The bracket () means that the number must be in the specified range between the brackets. Recall our previous example, 9.[2-9]XXXX. In that example, the numbers 2 through 9 are enclosed in brackets. In the United States, numbers that begin in that number range are public or private telephone listings. In other words, local phone calls.
Notice that 1 is omitted. If a phone number begins with a 1 then it is some sort of 1-800 number, which is generally a customer service line. Because we do not want employees calling 1-800 numbers on company time, it can be omitted using the bracket wild card.
The @(At) Wildcard
The @ wildcard is an especially convenient tool, but can only be used once per route pattern. The @ wildcard matches all National Numbering Plan numbers. So for instance, you may have certain employees that need to have access to every phone number they could possibly call. The pattern sequence 9.@ would take care of that perfectly. (Assuming external routing is done with a nine.)
Keep in mind that this allows for any phone number — including 1-800 numbers and international calls.
The Question Mark Wildcard
In our previous example, we looked at the number 9.[2-9]XXXX. Recall that 4 X's means that the user can dial four numbers, each of them being 0-9. However, what if we wanted to allow them to dial as many numbers as they want? One example of this could be handling international calls. It may not be clear how long phone numbers may be in each country. The Question Mark (?) Wildcard is the perfect solution when you need to handle an indeterminate amount of numbers.
The Question Mark matches zero or more occurrences of the preceding digit or wildcard value. Our previous example could have been replaced with the following wildcard: 9.[2-9]X?. In this example, we are allowing any phone call that begins with 2 through 9, but then allows as many digits as the user desires after they meet that requirement. Notice that the previous example limits the user to four digits, while the question mark give them access to pass as many numbers as they would like.
Remember, that the Question Mark wildcard is also valid if they do not match the previous symbol at all. So in our previous example, simply dialing the number 2 would be a valid sequence.
To understand CUCM, it is a requirement to have a thorough understanding of route pattern wildcards. One of the most important aspects of CUCM administration is writing, reading, and designing them.
In this post, we discussed what a route pattern is—it is a sequence of numbers and/or wildcards that are used for SIP routing. After that, we went over what a wildcard is. A wildcard is just a symbol used to represent a blanket of possibilities.
After that, this article explained the five following wildcards:
- X Wildcard. Specifies any digit between 0 and 9.
- Bracket Wildcard. Specifies a range of numbers that the user is required to dial.
- Discard Digit Wildcard. A wildcard represented by a dot that omits the number that precedes it. Discard Wildcard is generally used to omit the external digit number. (In this instance, the number 9.)
- The @ Wildcard. A wildcard that symbolizes all numbers in the National Numbering Plan.
- Question Mark Wildcard. The last wildcard we discussed allows a user to enter an indeterminate amount of symbols that precede the question mark. Up to and including zero amount of times.
While we may have gone over several wildcards, route patterns allow for seven more. Wildcards may seem like a small step in getting a CCNA certification, but they are the backbone of route tables. Once these are memorized, I encourage you to understand what the rest of them do.