Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

CUBE translation-rule replace called range with specific number

Hello,

 

I have a translation rule where I'm attempting to replace a called range with a specific number:

voice translation-rule 998

rule 1 /\(\+4922126103[1-399]\)/ /+49221261030/

 

This works as expected on a single digit in the range:

test voice translation-rule 998 +49221261031 
Matched with rule 1
Original number: +49221261031 Translated number: +49221261030
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
 
 

But if the number is more than one digit in the range, only the first digit is replaced:

test voice translation-rule 998 +492212610311
Matched with rule 1
Original number: +492212610311 Translated number: +492212610301
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
 
Any suggestions on how to get this to work?
 
Thanks,
Steve
1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Silver

Use this instead:rule 1 /\(\

Use this instead:

rule 1 /\(\+4922126103[1-3]..\)/ /+49221261030/

 

Chris

6 REPLIES
Hall of Fame Super Silver

What is the range as 

What is the range as +4922126103[1-399] implies +49221261031 - +49221261033, +49221261039

the digits in bracket substitue one digit, so it is either 1 through 3, or 9 which you list twice.

Chris

New Member

Makes sense, but the docs don

Makes sense, but the docs don't say single digit, kind of confusing... "Indicates a range when not in the first/last position. Used with the'[' and ']'."

My intended range is 49 221 261 031 to 49 221 261 03399 (399 numbers) and rewrite them to 49 221 261 030

Maybe I'm using the wrong method, is there another way I could accomplish this?

Thanks,

Steve

Hall of Fame Super Silver

Use this instead:rule 1 /\(\

Use this instead:

rule 1 /\(\+4922126103[1-3]..\)/ /+49221261030/

 

Chris

New Member

Was just playing with that as

Was just playing with that as well. Only seems to match if there are 2 digits after the 1-3 range:

rule 1 /\(\+4922126103[1-3]..\)/ /+49221261030/
test voice translation-rule 998 +49221261031  
test voice translation-rule 998 +49221261032
test voice translation-rule 998 +492212610311
test voice translation-rule 998 +4922126103111
Matched with rule 1
Original number: +4922126103111 Translated number: +49221261030
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
Hall of Fame Super Silver

I dont follow, how many

I dont follow, how many digits would you like to see after 1-3?  Your range was 199-399 hence [1-3].., where .. covers 00-99

Chris

New Member

Right you are.. got it,

Right you are.. got it, thanks.

204
Views
0
Helpful
6
Replies
CreatePlease login to create content