06-21-2012 12:33 PM - edited 03-16-2019 11:47 AM
Hello,
is there a way to combine these 3 rules to 1'
!
voice translation-rule 1
rule 5 /8881211/ /0051211/
rule 5 /8881212/ /0051212/
rule 5 /8881213/ /0051213/
!
Thaks
hasrat
Solved! Go to Solution.
06-21-2012 12:57 PM
Yes there is:
voice translation-rule 1
rule 1 /888121\([1-3]\)/ /005121\1/
!
This takes the last digit: either a 1, 2, or 3 (as indicated by [1-3]) and then places it in the replace string with the stored reference of \1.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
06-21-2012 12:57 PM
Yes there is:
voice translation-rule 1
rule 1 /888121\([1-3]\)/ /005121\1/
!
This takes the last digit: either a 1, 2, or 3 (as indicated by [1-3]) and then places it in the replace string with the stored reference of \1.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
06-21-2012 01:44 PM
Anthony,
Thank you for your help.
Regards,
hasrat
06-21-2012 01:58 PM
It would have been smart on my part, to actually test this before posting it. Thankfully I nailed it blind.
Test Results
Router#! Show voice translation-rule 1
Router#sh run | sec rule 1
voice translation-rule 1
rule 1 /888121\([1-3]\)/ /005121\1/
Router#
Router#! Test rule 1 with a non-matching number of 8881210
Router#test voice translation-rule 1 8881210
8881210 Didn't match with any of rules
Router#! Test rule 1 with a matching number of 8881211
Router#test voice translation-rule 1 8881211
Matched with rule 1
Original number: 8881211 Translated number: 0051211
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
Router#! Test rule 1 with a matching number of 8881212
Router#test voice translation-rule 1 8881212
Matched with rule 1
Original number: 8881212 Translated number: 0051212
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
Router#! Test rule 1 with a matching number of 8881213
Router#test voice translation-rule 1 8881213
Matched with rule 1
Original number: 8881213 Translated number: 0051213
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
Router#! Test rule 1 with a non-matching number of 8881214
Router#test voice translation-rule 1 8881214
8881214 Didn't match with any of rules
Router#
Router#! Done
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: