cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2093
Views
0
Helpful
2
Replies

Proper handling of E.164 numbers in voice translation rules

mpieper
Level 1
Level 1

With the help of the following two pages, i tried to create a couple of voice translation rules:

https://www.cisco.com/c/en/us/support/docs/voice/call-routing-dial-plans/61083-voice-transla-rules.html

https://community.cisco.com/t5/collaboration-voice-and-video/a-custom-made-guide-on-translation-rules-profiles-and-some/ta-p/3123597

 

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.

2 Replies 2

mpieper
Level 1
Level 1

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...

 

Generally, unless you have explicit patterns, you want your last rule to be the catch all international pattern so unless you have more specific rules after 2/3, then this should be good for most calls.