In this blog we will continue our conversation of translation rules that we began in the last blog. Router(cfg-translation-rule)#rule 5 /^9(845)([2-9]……)/ /2/ Rule 5 above matches on any pattern that begins with an access code of a 9, followed by an area code of 845 and a 7-digit number with an additional digit in the range of 2 through 9. The replace operator of 2 brings of the second set in parenthesis (7 digit phone number). The rule essentially matches on an outbound call with an 845 area code and strips the 9 access code and 845. Router(cfg-translation-rule)#rule 6 /^2125511$/ /11/ Rule 6 above matches on a 10 digit string beginning with 212 and replaces the 10 digit pattern with the last 5 digits of the pattern. This type of translation rule could be used if 10 digits were received from the PSTN and the internal dialplan was based on 5 digit abbreviated dialing. Notice the use of both the ^ (begins with) and $ (ends with) regular expressions. Using these qualifiers guarantees that only 10 digit patterns are matched. Rule 5 will match on any digits that begin with a 9, followed by 10 or more digits. The intent of the rule was to match on 10 digits prefixed with a 9, but the pattern would match on 12 digits as long as the string began with 9 845 [2-9]XXXXXX. The X in the pattern is being used to represent a wildcard digit even though the router does not recognize the X as a wildcard digit. CUCM uses X in route patterns to match on any digit, but the X must be uppercase. CUCM will not accept a lower case x. Router(cfg-translation-rule)#rule 7 /^21255/ // Rule 7 above matches on any string that begins with the number 21255 and replaces them with a null set (nothing). This rule could be used to match on incoming 10 digit patterns and convert them to 5 digits. If 212-551-1212 was received, the pattern would be replaced with 11212 which could then match on a voip dial peer to route the call to CUCM. The objective is similar to rule 6, but the application of the regular expression rules are very different. Router(cfg-translation-rule)#rule 8 /21255/ // Rule 8 is near identical to rule 7, but the ^ (begins with) regular expression was not utilized. The rule will still achieve the objective states in the explanation paragraph of rule 6, but the pattern would also be able to match on 9 212 551 1212 since we did not specify that the match set needed to start with a 2. Router(cfg-translation-rule)#rule 9 /^21255(…..)/ /1/ Rule 9 is matches on the same pattern discussed in rule 7 and 8, but a set object has been defined in the match criteria. The parenthesis creates set number 1 which is called in the replace set (1). Rule 9 matches on 10 digits and replaces the 10 digits with 5. Rule 9 could match on more than 10 digits since we did not specify the $ (ends with) regular expression (regexp). Router(cfg-translation-rule)#rule 10 /^1/ /1212551/ Rule 10 has a match set that matches on any digit string that begins with a 1 and replaces the 1 with 1212551. The intent of the rule is to match on 5 digits and replace the 5 digits with an 11 digit pattern. Since the match and replace set do not do anything with the last 4 digits, they will not be removed. I’m personally not a big fan of this usage because it’s confusing. It’s my personal opinion that rule 11 is much clearer than rule 10. You be the judge. Router(cfg-translation-rule)#rule 11 /^11$/ /12125511/ Rule 11 matches on any 5 digit pattern beginning with 11 and replaces it with 11 digits. Rule 10 or 11 could be used to re-route calls over the PSTN if the 5 digit inter-site dialing used over the WAN was not successful. There would need to be dial peers provisioned to match on the 5 and 11 digit patterns. Router(cfg-translation-rule)#rule 12 /.*/ /9/ Rule 12 matches on any digit string (.*) and replaces the pattern with a 9. This rule could be used if CUCM is routing calls to the gateway (H.323 or SIP) without the access code of 9 and the dial peers of the gateway all required digit strings beginning with a 9. Rule 12 only exists to prefix a 9 before the dialed pattern. Router(cfg-translation-rule)#rule 13 /^[2-9]………/ /9
Cisco IOS Dial Peers: Translation Profiles (part 2)
Analysis
May 14, 20095 mins




