ā08-02-2017 05:12 AM - edited ā03-17-2019 10:56 AM
i have a customer with a cme issue but im trying to understand his setup , among it there is these translation rules which i cant understand their meaning
voice translation-rule 1
rule 1 /^2227\(....\)/ /\1/
!
voice translation-rule 2
rule 1 /.*/ /2227\0/
!
voice translation-rule 3
rule 1 /^7100/ //
rule 2 /^7300/ //
kindly explain them?
Solved! Go to Solution.
ā08-02-2017 05:35 AM
voice translation-rule 1
rule 1 /^2227\(....\)/ /\1/ --- Any number begining with 2227 followed by any 4 digits will be converted to last 4 digits only , example 22272222 will be converted to 2222.
voice translation-rule 3
rule 1 /^7100/ //
rule 2 /^7300/ // - matches any numbers begining with 7100 and 7300 and replaces them with Null
You can use the following for reference
Match String | Replace String | Dialed String | Replaced String | Comments |
---|---|---|---|---|
/^$/ |
/ / |
NULL | NULL | Simple Null to Null translation. |
/^.*/ |
/ / |
9195551212 | NULL | Any to Null translation. |
// |
// |
9195551212 | 9195551212 | Match any string but no replacement. Use this to manipulate the call plan or call type. |
/^392\(.*\)/ |
/555\1/ |
3921212 | 5551212 | Match the beginning of a variable length string. |
/^\(555\)\(....\)/ |
/444\2/ |
5551212 | 4441212 | Match the beginning of the string. The second paren structure is pulled to the new string. |
/^555\(....\)/ |
/444\1/ |
5551212 | 4441212 | Match the beginning of the string. Notice the \1 replaces the first group of the regular expression within parenthesis. |
/\(^...\)555\(....\)/ |
/\1444\2/ |
9195551212 | 9194441212 | Match the middle of a string. |
/\(^...\)\(555\)\(....\)/ |
/\1444\3/ |
9195551212 | 9194441212 | Match the middle of a string. |
/\(.*\)1212$/ |
/\13434/ |
9195551212 555121212 | 9195553434 555123434 | Match the end of a string. |
/\(.*\)1212/ |
/\13434/ |
9195551212 555121212 | 9195553434 555123434 | Match the end of a string. There is no need for an implicit $ at the end for this particular example. |
/444/ |
/555/ |
4441212 44441212 44414441212 | 5551212 55541212 55514441212 | Match the substring. |
/^[135]/ |
/9/ |
12345 22345 32345 | 92345 22345 93245 | Match certain numbers. |
/^[1-35]/ |
/9/ |
1234 2345 4567 8456 | 9234 9345 4567 8456 | Match a range. |
/^[^1-35]/ |
/9/ |
1234 2345 4567 8456 | 1234 2345 9567 9456 | The ^ in the list means do not match these items. |
/^1#/ |
// |
1#456 | 456 | Match 1# at the beginning and replace it with Null. |
/^1\#\(.*\)/ |
/\1/ |
1#456 | 456 | The same as the previous expression, but composed differently. |
/^1\*/ |
// |
1*456 | 456 | Match 1* in a pattern and replace it with Null. |
/^1\*\(.*\)/ |
/\1/ |
1*456 | 456 | The same as the previous expression but composed slightly different. |
/^5+/ |
/9/ |
5888 55888 555888 5588855 | 9888 9888 9888 988855 | This is an example of the use of the '+' option. |
/^\(555\)+\(.*\)/ |
/444\2/ |
5551212 555551212 5555551212 5551212555 | 4441212 444551212 4441212 4441212555 | This is another example of the '+' option. This searches for the 555 pattern repeated at the beginning. |
/^9?1?\(919\)/ |
/\1/ |
9195551212 19195551212 919195551212 99195551212 | 9195551212 9195551212 9195551212 9195551212 | Here is how the '?' string can be used. For example, if you want to strip some preceding digits that are or are not present. In this case you want to strip the leading 9 or 1 or 9 and 1 together. |
/1234/ |
/00&00/ |
5551234 | 55500123400 | Match the substring. |
/1234/ |
/00\000/ |
5551234 | 55500123400 | Match the substring (same as &). |
HTH
Manish
ā08-02-2017 05:26 AM
Find the below link helpful
http://www.cisco.com/c/en/us/support/docs/voice/call-routing-dial-plans/61083-voice-transla-rules.html
You can find more helpful links on google to understand voice translation rules.
Regards
Abhay
ā08-02-2017 05:35 AM
voice translation-rule 1
rule 1 /^2227\(....\)/ /\1/ --- Any number begining with 2227 followed by any 4 digits will be converted to last 4 digits only , example 22272222 will be converted to 2222.
voice translation-rule 3
rule 1 /^7100/ //
rule 2 /^7300/ // - matches any numbers begining with 7100 and 7300 and replaces them with Null
You can use the following for reference
Match String | Replace String | Dialed String | Replaced String | Comments |
---|---|---|---|---|
/^$/ |
/ / |
NULL | NULL | Simple Null to Null translation. |
/^.*/ |
/ / |
9195551212 | NULL | Any to Null translation. |
// |
// |
9195551212 | 9195551212 | Match any string but no replacement. Use this to manipulate the call plan or call type. |
/^392\(.*\)/ |
/555\1/ |
3921212 | 5551212 | Match the beginning of a variable length string. |
/^\(555\)\(....\)/ |
/444\2/ |
5551212 | 4441212 | Match the beginning of the string. The second paren structure is pulled to the new string. |
/^555\(....\)/ |
/444\1/ |
5551212 | 4441212 | Match the beginning of the string. Notice the \1 replaces the first group of the regular expression within parenthesis. |
/\(^...\)555\(....\)/ |
/\1444\2/ |
9195551212 | 9194441212 | Match the middle of a string. |
/\(^...\)\(555\)\(....\)/ |
/\1444\3/ |
9195551212 | 9194441212 | Match the middle of a string. |
/\(.*\)1212$/ |
/\13434/ |
9195551212 555121212 | 9195553434 555123434 | Match the end of a string. |
/\(.*\)1212/ |
/\13434/ |
9195551212 555121212 | 9195553434 555123434 | Match the end of a string. There is no need for an implicit $ at the end for this particular example. |
/444/ |
/555/ |
4441212 44441212 44414441212 | 5551212 55541212 55514441212 | Match the substring. |
/^[135]/ |
/9/ |
12345 22345 32345 | 92345 22345 93245 | Match certain numbers. |
/^[1-35]/ |
/9/ |
1234 2345 4567 8456 | 9234 9345 4567 8456 | Match a range. |
/^[^1-35]/ |
/9/ |
1234 2345 4567 8456 | 1234 2345 9567 9456 | The ^ in the list means do not match these items. |
/^1#/ |
// |
1#456 | 456 | Match 1# at the beginning and replace it with Null. |
/^1\#\(.*\)/ |
/\1/ |
1#456 | 456 | The same as the previous expression, but composed differently. |
/^1\*/ |
// |
1*456 | 456 | Match 1* in a pattern and replace it with Null. |
/^1\*\(.*\)/ |
/\1/ |
1*456 | 456 | The same as the previous expression but composed slightly different. |
/^5+/ |
/9/ |
5888 55888 555888 5588855 | 9888 9888 9888 988855 | This is an example of the use of the '+' option. |
/^\(555\)+\(.*\)/ |
/444\2/ |
5551212 555551212 5555551212 5551212555 | 4441212 444551212 4441212 4441212555 | This is another example of the '+' option. This searches for the 555 pattern repeated at the beginning. |
/^9?1?\(919\)/ |
/\1/ |
9195551212 19195551212 919195551212 99195551212 | 9195551212 9195551212 9195551212 9195551212 | Here is how the '?' string can be used. For example, if you want to strip some preceding digits that are or are not present. In this case you want to strip the leading 9 or 1 or 9 and 1 together. |
/1234/ |
/00&00/ |
5551234 | 55500123400 | Match the substring. |
/1234/ |
/00\000/ |
5551234 | 55500123400 | Match the substring (same as &). |
HTH
Manish
ā08-02-2017 03:21 PM
thank you very much , but regarding first rule which part in the first rule says to convert to the last 4 digits? the /\1/ ?
also what is the point in the translation rule 3 to match 7100 and 7300 and replaces them with Null ? like if a person dials 7100 or 7400 it will replace them with nothing? is it like a person dials 7100 999 and the 7100 will be removed leaving 999 to dial?
do you know the what is the translation rule 2 meaning?
ā08-02-2017 07:52 PM
The syntax for voice translation rules is the following:
rule precedence /match pattern/ /replacement pattern/
You can use the test voice translation-rule command to test all these translation rules on the same router. Basically you just use a sample number in the match pattern to test by specifying the translation rule number in the command and it shows you what the output ( replacement pattern ) will be. You can test it for all your translation rules like the following and check the output
router#test voice translation-rule 1 22272234
router#test voice translation-rule 2 2255667
router#test voice translation-rule 3 7100
router#test voice translation-rule 3 7100225566
You can try all combinations to see what these rules will do to the match pattern
For example, the following replaces the first occurrence of the number "123" with "456".
voice translation-rule 1 rule 1 /123/ /456/
Now, we test using the test voice translation-rule command with different 'match patterns':
router#test voice translation-rule 1 123 Matched with rule 1 Original number: 123 Translated number: 456 router#test voice translation-rule 1 1234 Matched with rule 1 Original number: 1234 Translated number: 4564 router#test voice translation-rule 1 6123 Matched with rule 1 Original number: 6123 Translated number: 6456
ā08-03-2017 07:13 AM
Hi
voice translation-rule 1
rule 1 /^2227\(....\)/
The first part matches the pattern , ie any no beginning with 2227 followed by any 4 digits which are defined in a bracket as a subset 1.
This subset 1 is defined in the replacement pattern as /\1/.
Both match and replacement patterns are delineated by forward slashes.
The output of the above translation for a no like 22279090 will be 9090( which is a translated no )
Regarding the voice translation 3 , whatever it matches in the match pattern is not forwarded to the replaced pattern.
So , in your case it will match 7100 or 7300 and since there is nothing defined in the replacement pattern ie // it will be NULL in your case.So it there is anything defined after 7100 or 7300 will be forwarded to the replacement pattern ie 999 in your case.
For voice translation rule 2, it will match any number defined in the match pattern ie rule 1 /.*/
, and in the replacement pattern /2227\0/ , you are adding 2227 as a prefix to that number defined by \0.
Eg 909090 will be translated into 2227909090
Regards
Inderpsi
ā08-03-2017 12:56 PM
https://supportforums.cisco.com/document/31816/custom-made-guide-translation-rulesprofiles-and-some-common-uses
Regards
Deepak
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide