02-03-2020 05:27 AM
With the help of the following two pages, i tried to create a couple of voice translation rules:
My goal: Create rules that translate E.164 format number coming from CUCM to numbers that go out an ISDN Interface. This is in Australia.
Now i have encountered an issue that confuses me.
Here is my rule-set:
voice translation-rule 10
rule 1 /\+000/ /000/
rule 2 /^\+618\(........\)/ /\1/
rule 3 /^\+61\(.........\)/ /0\1/
rule 4 /^\+\(.*\)/ /0011\1/
Rule 1 and rule 2 seem to work as intended for emergency and international calls. But rules 2 and 3 have an odd "quirk".
Numbers starting with +618xxxxxxxx are local and should be going out as xxxxxxxx.
Numbers starting with +61Yxxxxxxxx (with Y anything but 8) should go out as 0Yxxxxxxxx.
That works, but what confuses me is that numbers longer that those that should match are still matching anyways:
#test voice translation-rule 10 +61812345678555
Matched with rule 2
Original number: +61812345678555 Translated number: 12345678555
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
#test voice translation-rule 10 +61512345678555
Matched with rule 3
Original number: +61512345678555 Translated number: 0512345678555
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
Why do these still match? Is that a side effect of the "+" character? If so, what is the proper way of translating E.164 to localized numbers? I will do length matching on the CUCM anyway, so no +61 numbers should hit the VGW with improper length, but i want to understand the issue.
If relevant, all these tests were made on a ISR 4331 with IOS 16.06.07.
02-03-2020 06:05 AM
I was able to solve my issue. I forgot to "close" my patterns with a $. This seems to work, mostly. Now anything not matching rules 1, 2 or 3 will fall to rule 4:
voice translation-rule 10
rule 1 /\+000$/ /000/
rule 2 /^\+618\(........\)$/ /\1/
rule 3 /^\+61\(.........\)$/ /0\1/
rule 4 /^\+\(.*\)/ /0011\1/
I do not think i can properly catch that though, since international can be anything anyway...
02-03-2020 07:49 AM
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