cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
643
Views
35
Helpful
13
Replies

Translation Rule HELP!

msturtev
Level 1
Level 1

Hello all, 

 

I cannot get this translation rule to take. It is not accepting the match string and I cannot see what is wrong with it. 

 

Here is the rule - /^1919454\(....\)$/ /\1/

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

DHCP_ROUTER(config-translate)#Rule 1 /^1919454\(....\)$/ /\1/
Incorrect format for Translation Match Pattern
        regular expression must be of the form  ^(\^)?(\+)?([0-9,A-F.*%?#]+)$
 
Invalid match pattern string input /^1919454\(....\)$/
 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
It seems to not like the match string but I cannot figure out why. 
 
I have attempted this on a 1760
Cisco IOS Software, C1700 Software (C1700-ADVENTERPRISEK9-M), Version 12.4(15)T10, RELEASE SOFTWARE (fc3)
 
and also on a 2801
Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9_IVS-M), Version 15.1(4)M, RELEASE SOFTWARE (fc1)
 
 
Any ideas?
 
 
2 Accepted Solutions

Accepted Solutions

Hi.

You are configuring a translation-rule but you should configure a voice translation-rule

 

Voice translation-rule 1

Rule 1 /^1919454\(....\)$/ /\1/  is ok

 

HTH

 

Regards

 

Carlo

 

 

Please rate all helpful posts "The more you help the more you learn"

View solution in original post

Hi.

Correct.

In order to be more specific and match number range of the other side (1919454[2-489]...) as per dialpeer 2, you can modify you rule as follows

voice translation-rule 1

rule 1 /^1919454\([2-489]...\)$/ /\1/

 

HTH

 

Regards

 

Carlo

Please rate all helpful posts "The more you help the more you learn"

View solution in original post

13 Replies 13

Hi.

You are configuring a translation-rule but you should configure a voice translation-rule

 

Voice translation-rule 1

Rule 1 /^1919454\(....\)$/ /\1/  is ok

 

HTH

 

Regards

 

Carlo

 

 

Please rate all helpful posts "The more you help the more you learn"

Amit Kumar
Cisco Employee
Cisco Employee

Hi,

 

Can you try it this way:

 

Rule 1 /^1919454\(....$\)/ /\1/

Usually this rule, should preserve last 4 digit of the string after match is done. $ is basically used to indicate end of string. So makes less usage outside of set.

 

 

So if initial number is 19194541234, then after translation it would be 1234.

 

Hope that helps.

 

msturtev
Level 1
Level 1

Carlo, 

 

Thank you so much, I was racking my brain trying to figure that out. Such a simple fix.... Anyways, again, thank you!

msturtev
Level 1
Level 1

I will put my config below, but let me explain the issue first. I am having trouble making outbound calls to my other network. I have the translation rule in place and I thought that alone would route the calls, but I cannot get them to route without dial-peer 2 (see below). I checked the debug and the calls are not being translated from an 11 digit number to a 4 digit number as I had hoped. Any thoughts?

 

 

voice translation-rule 1
 rule 1 /^1919454\(....\)$/ /\1
!
voice-port 2/0
!
voice-port 2/1
!
voice-port 3/0
 station-id name White_Uniden
 station-id number 1000
 caller-id enable type 1
!
voice-port 3/1
 station-id name Orange_Uniden
 station-id number 1001
 caller-id enable type 1
!
dial-peer voice 1000 pots
 destination-pattern 1000
 port 3/0
 forward-digits all
!
dial-peer voice 1001 pots
 destination-pattern 1001
 port 3/1
 forward-digits all
!
dial-peer voice 1 voip
 destination-pattern [2-489]...
 session target ipv4:172.16.1.1
!
dial-peer voice 2 voip
 destination-pattern 1919454[2-489]...
 translate-outgoing called 1
 session target ipv4:172.16.1.1

!
dial-peer voice 3 pots
 description 10 DIGIT DIALING FOR 3/0
 destination-pattern 14043191000
 port 3/0
!
dial-peer voice 4 pots
 description 10 DIGIT DIALING FOR 3/1
 destination-pattern 14043191001
 port 3/1

 

 

Hi.

Please give an example of an example of what you dial and what you expect to route out and I can elaborate a config for you.

 

Thanks

 

Regards

 

Carlo

Please rate all helpful posts "The more you help the more you learn"

Carlo, 

I would like to be able to dial 1919454[2-489]...   |  This is the range of extensions I have on a neighboring network. Right now, as the config sits, the calls route without issue. I was just under the impression that the translation rule I created would strip the first 7 digits off and only forward out the final 4 dialed digits. 

Hi.

Sure.

rule 1 /^1919454\(....\)$/ /\1/

means if you match something starting with 1919454 followed by other 4 digits, translate it with rule set 1 (....) 

So in this case, with dp 2, you are sending only the last 4 digits following number 1919454.

 

Is this what you need?

 

Let me know

 

Regards

Carlo

Please rate all helpful posts "The more you help the more you learn"

Ok, great, I understand. So dial-peer 2 is necessary in order for the calls to route? But it is only sending out the last 4 digits? So on the other network it will receive only a four digit number. 

Hi.

Correct.

In order to be more specific and match number range of the other side (1919454[2-489]...) as per dialpeer 2, you can modify you rule as follows

voice translation-rule 1

rule 1 /^1919454\([2-489]...\)$/ /\1/

 

HTH

 

Regards

 

Carlo

Please rate all helpful posts "The more you help the more you learn"

Carlo, 

I am running into an issue.

 

So, I am attempting to call the number 1-919-454-4000 from the router with the translation rule I have been having issues with. If everything works as it should, the router should be stripping off "1-919-454" and forwarding out "4000"

To verify, I removed the secondary number of 19194544000 on the dn that number is assigned to and the call fails.

  • ephone-dn  5  dual-line
  •  number 4000

 

If I revert the number back to its original state, the call routes. 

 

  • ephone-dn  5  dual-line
  •  number 4000 secondary 19194544000

 

++++++++++++++++++++++++++++++++++

Just for reference, this is my outbound dial-peer for this number range

  • dial-peer voice 2 voip
  •  destination-pattern 1919454[2-489]...
  •  translate-outgoing called 1
  •  session target ipv4:172.16.1.1

 

 

 

Hi.

So let's try in this way.

voice translation-profile OUT

translate called 1

 

dial-peer voice 2

no translate-out 1

translation outgoing OUT

 

Please let me know 

 

Regards

 

Carlo

Please rate all helpful posts "The more you help the more you learn"

Carlo, 

That did it! Again, thank you very much for taking the time to help me through this learning process. 

You are welcome my friend and it's a true pleasure helping you.

 

Regards

 

Carlo

Please rate all helpful posts "The more you help the more you learn"