Translation-rule Invalid Strings

Answered Question
Jul 1st, 2010
User Badges:

Hello All,

I'm trying to set up a translation rule and I'm getting invalid string as return, for me the command is correct. I saw the exactly command on a different router.

Any help appreciated


RIO1RT009448(config-translate)#rule 1 /^.*/ /9&/ subscriber subscriber
Incorrect format for Translation Match Pattern
        regular expression must be of the form  ^(\^)?(\+)?([0-9,A-F.*%?#]+)$


Invalid match pattern string input /^.*/


Cisco IOS Software, 3800 Software (C3825-SPSERVICESK9-M), Version 12.4(23), RELEASE SOFTWARE (fc1)


There were any changes on the command syntax?

Correct Answer by William Bell about 6 years 10 months ago

Rafael,


No, not a defect. I just noticed the prompt in your samples. You are using

a "translation-rule" as opposed to a "voice translation-rule". I just

confirmed on my lab router that I have the same syntax error message when

applying the configure to a "translation-rule".


Can you try:


Voice translation-rule 10

rule 1 /.*/ /9&/ type subscriber subscriber

!

Voice translation-profile testprofile

translate called 10

!


The translation-rule tag (10 in the example) is arbitrary as is the profile

name (testprofile). Use whatever makes sense in your environment. The

distinction of called vs. calling is to define which information element you

want to tweak. You can assign the translation profile as ingress or egress

on whatever dial-peer makes sense.


HTH.


Regards,

Bill




On 7/2/10 8:10 AM, "rafaelchavantes"

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
William Bell Thu, 07/01/2010 - 20:39
User Badges:
  • Purple, 4500 points or more

Rafael,


I tested this out on my lab system. On 12.4(24)T2 I can use the following

syntax:


voice translation-rule 5055


rule 1 /^.*/ /9&/ type subscriber subscriber


Test:

iecube01#test voice translation-rule 5055 5551212 type subscriber

Matched

with rule 1

Original number: 5551212 Translated number:

95551212

Original number type: subscriber Translated number type:

subscriber

Original number plan: none Translated number plan: none


So, first on the 12.4(24)T train I can use the carrot symbol. Which appears

to not work in your version. Second, I had to specify the keyword type.


I also tested this config:


voice translation-rule 5055


rule 1 /.*/ /9&/ type subscriber subscriber


And it worked fine. There is no need to use the carrot to designate the

start of a string when you are actually consuming the entire string anyway.

Just a thought.


HTH.


Regards,

Bill

Please remember to rate helpful posts.




On 7/1/10 11:18 PM, "rafaelchavantes"

Rafael Chavantes Fri, 07/02/2010 - 05:10
User Badges:

Bill,

In my version of IOS it does not ask for the type command as follows:


RIO1RT009448(config-translate)#rule 1 /.*/ /9&/ ?

abbreviated The numbering type is abbreviated

any Any numbering type

international The numbering type is international

national The numbering type is national

network The numbering type is network

reserved The numbering type is reserved

subscriber The numbering type is subscriber

unknown The numbering type is unknown


RIO1RT009448(config-translate)#rule 1 /.*/ /9&/ subs

RIO1RT009448(config-translate)#rule 1 /.*/ /9&/ subscriber subs

RIO1RT009448(config-translate)#rule 1 /.*/ /9&/ subscriber subscriber

Incorrect format for Translation Match Pattern

regular expression must be of the form ^(\^)?(\+)?(+)$


Invalid match pattern string input /.*/


But continue to say that is an invalid string, do you think that could be a IOS bug?

Correct Answer
William Bell Fri, 07/02/2010 - 05:56
User Badges:
  • Purple, 4500 points or more

Rafael,


No, not a defect. I just noticed the prompt in your samples. You are using

a "translation-rule" as opposed to a "voice translation-rule". I just

confirmed on my lab router that I have the same syntax error message when

applying the configure to a "translation-rule".


Can you try:


Voice translation-rule 10

rule 1 /.*/ /9&/ type subscriber subscriber

!

Voice translation-profile testprofile

translate called 10

!


The translation-rule tag (10 in the example) is arbitrary as is the profile

name (testprofile). Use whatever makes sense in your environment. The

distinction of called vs. calling is to define which information element you

want to tweak. You can assign the translation profile as ingress or egress

on whatever dial-peer makes sense.


HTH.


Regards,

Bill




On 7/2/10 8:10 AM, "rafaelchavantes"

Rafael Chavantes Fri, 07/02/2010 - 06:32
User Badges:

Thanks Bill.

I couldn't believe I've didn't notice that before.


Just another question I've just made here a sample test but did not work.

In case of changing the calling number to make the user able to redial the call, in what dial-peer I should put this?

William Bell Fri, 07/02/2010 - 06:55
User Badges:
  • Purple, 4500 points or more

Rafael,


I assume you mean ingress from PSTN and presented to IP phones?  Well, there are multiple ways I am sure, but sticking with the theme of the thread:


If we assume I live in 703 area code:


voice translation-rule 10

rule 1 /^703/ /9703/

rule 2 /^202/ /9202/

rule 3 /^571/ /9571/

rule 4 /.*/ /91&/

!

voice translation-profile testprofile

translate calling 10

!



Just a rough example.  From 703, there are several areas that are local to me. Like 202 and portions of 571.  Anything outside of those areas I will stick a 91 (i.e. long distance).  This is all for the NANP and is a simplistic example.  I am not sure what would make sense for your operating area.


HTH.


Regards,
Bill

Please remember to rate helpful posts!

Rafael Chavantes Fri, 07/02/2010 - 09:29
User Badges:

Bill,

I've made a translation here according to my operator and the test works, but the question is where to apply it.

I've made a test doing a inbound call and checked which dial-peer matched and applied the translation-profile to that dial-peer.

Now I have two questions:

a) The TON (Type of number) is applied to E1 R2? ==> this is being discussed on the this topic => https://supportforums.cisco.com/message/3130696#3130696


b) I'm doing this on the wrong dial-peer?

Actions

This Discussion