cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
662
Views
0
Helpful
6
Replies

simbols used in translation rules

rwawrig
Level 1
Level 1

Hi everybody

I have the following translation rule which is doing the following: if is

coming a number which is starting with 00, is adding 1111 in front of it. If

is coming a number which is starting with 0[1-9] is adding 2222 in front.

translation-rule 1

Rule 0 ^00 111100 ANY unknown

Rule 1 ^01 222201 ANY unknown

Rule 2 ^02 222202 ANY unknown

Rule 3 ^03 222203 ANY unknown

Rule 4 ^04 222204 ANY unknown

Rule 5 ^05 222205 ANY unknown

Rule 6 ^06 222206 ANY unknown

Rule 7 ^07 222207 ANY unknown

Rule 8 ^08 222208 ANY unknown

Rule 9 ^09 222209 ANY unknown

Now, my question is how i can write the translation rule in a short way ?

I tried to use symbols used in dial-peers and regular expression comparison:

Gateway(config-translate)# Rule 1 ^0[1-9] 22220[1-9] ANY unknown

Incorrect format for Translation Match Pattern

regular expression must be of the form

^(\^)?(\+)?([0-9,A-F.*%?#]+)$

Invalid match pattern string input ^0[1-9]

Do u have an idea how i can write the translation shorter?

Thanks

Robert

6 Replies 6

Aaron Harrison
VIP Alumni
VIP Alumni

As far as I'm aware you can't.

I think this is just the way it works - hence why you can add 10 sub-rules to a rule (10 digits diallable)..

See cisco's own examples of a similar config:

http://www.cisco.com/en/US/tech/tk652/tk90/technologies_configuration_example09186a0080094681.shtml

I think you've got it as clear as it will get...

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

hmm..this is not very encouraging and not very nice if is true.

curious is that when you are configuring this message is coming:

"regular expression must be of the form

^(\^)?(\+)?([0-9,A-F.*%?#]+)$"

so, how are you using this expression ?

Thanks for the answer

Robert

Hi,

There is a new command "voice translation rule" which might solve your problem.

http://www.cisco.com/en/US/tech/tk652/tk90/technologies_tech_note09186a0080325e8e.shtml

It can handle regular expressions...

/Martin

thanks - i will have a look and test it on a new installation.

Robert

Yup - just been learning this new command myself.... For the example you gave above, you could use the commands shown below to set up the translation-rule, translation-profile, and test it.

All you need to do then is apply it to whatever you want....

voice translation-rule 1

rule 1 /\(^00\)/ /1111\1/

rule 2 /\(^0[1-9]\)/ /2222\1/

!

!

voice translation-profile TRANS

translate called 1

!

!

!

Router#test voice translation-rule 1 001234

Matched with rule 1

Original number: 001234 Translated number: 1111001234

Original number type: none Translated number type: none

Original number plan: none Translated number plan: none

Router#test voice translation-rule 1 011234

Matched with rule 2

Original number: 011234 Translated number: 2222011234

Original number type: none Translated number type: none

Original number plan: none Translated number plan: none

Router#test voice translation-rule 1 051234

Matched with rule 2

Original number: 051234 Translated number: 2222051234

Original number type: none Translated number type: none

Original number plan: none Translated number plan: none

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

looking good

Thanks