Voice translation profiles allow administrators granular control of digit translation. Translation profiles can also be leveraged to block incoming calls based on a caller ID range of numbers. A translation profile is a logical collection of translation rules. A translation profile can utilize up to three translation rules in the following way: • one rule for manipulating calling party digits • one rule for manipulating called party digits • one rule for redirected called party digits Each rule in the translation rule is given a number. If a translation rule has multiple rules in it, the rules are evaluated in a top down manner beginning with rule 1. A voice translation-rule can have up to 15 individual rules. I have created 15 individual rules for the purpose of understanding the regular expression used in translation rules. These 15 rules are not intended to be used together. Router(config)# Voice translation-rule 1 Router(cfg-translation-rule)#rule 1 /11001/ /16001/ Rule 1 in the example above matches on 11001 and converts the number to 16001. The first two forward slashes in rule 1 define the match set, while the second two forward slashes represent the replace set. Rule 1 would also change 551-1001 to 16001 because the match set doesn’t specify the match should only be on 11001, not any other patterns with 11001 in them. If the match set was set to /^11001$/, the rule would only match on 11001. The ^ specifies the match must begin with 1 and the $ specifies the match should end with 1. Router(cfg-translation-rule)#rule 2 /^9.*/ // Rule 2 specifies a rule that matches any pattern beginning with a 9. The . represents any single digit and the * specifies that the previous character can occur one of more times (.* matches on every pattern). The replace rule states the matched pattern should be replaced with a null said (nothing). The rule essentially strips a leading 9 from a pattern. If a 9 is used as an access code for outbound PSTN dialing, rule 2 would strip the 9 before forwarding the call to the PSTN. Router(cfg-translation-rule)#rule 3 /^91[2-9]..[2-9]……$/ /………./ Rule 3 matches on an 11 digit long distance number prefixed with an access code of 9. The replace set replaces the 9 + 11 digit pattern with a 10 digit pattern. Some long distance carriers (AT&T in particular) expect the customer to only route 10 digits on their long distance circuits. The customer is expected strip the long distance carrier code (1). Router(cfg-translation-rule)#rule 4 /^([^01]………$)/ /91/ Rule 4 matches on a 10 digit pattern beginning with any digit BUT a zero or a one (i.e. match on any digit 2 through 9). I don’t personally ever use this match string because the use of the ^ character within the brackets is confusing. I believe in the KISS rule… Keep It Simple Stupid! Don’t over-engineer the solution. A ^ in the match set specifies begins with, but if it is used in brackets the ^ means match on anything BUT the digits specified in the brackets. Using a match rule of [2-9] is much easier. The brackets only match on a single digit. If [12-49] was used in brackets, the resulting match would consist of a 1, 2, 3, 4, or 9 (only one digit). In the next blog we will continue to go over translation rule examples.
Cisco IOS Dial Peers: Translation Profiles
Analysis
May 11, 20093 mins




