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

voice translation-rule help

Sam Oesterling
Level 1
Level 1

OK, so I am having a hard time really understanding translation-rules.  What I want to do seems pretty simple, but it is not working.

When the following three numbers are called, I want the translation rule to send the digits as dialed.  (these are not real numbers we own, fyi)

555.222.5551

555.222.5552

555.222.5553

Here is that I have

voice translation-rule 1
rule 1 /5552227564/ /\1/
rule 2 /555222555[1-3]/ /\1/
rule 3 /5552227610/ /6000/
rule 4 /\(.*\)/ /6001/

When I tried to call 5552225551, I can't complete the call.  When I debug the translation, I see that is replaced the patten with NULL (at least that is how is looks to me).  Is my translation-rule the problem, so is it somewhere else?


-----------

Dec 17 14:53:44.116: //-1/4751A48A899F/RXRULE/sed_subst: Successful substitution; pattern=5552225551 matchPattern=555222555[1-3] replacePattern= replaced pattern=

collocation_router#test voice translation-rule 1 5552225551
Matched with rule 2
Original number: 5552225551     Translated number:
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

1 Accepted Solution

Accepted Solutions

Works for me


CME#sh voice translation-rule 1
Translation-rule tag: 1

        Rule 1:
        Match pattern: \(555222555[1-3]\)
        Replace pattern: \1
        Match type: none                Replace type: none
        Match plan: none                Replace plan: none

CME#test voice translation-rule 1 5552225551
Matched with rule 1
Original number: 5552225551     Translated number: 5552225551
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

Likely there is another reason for fast-busy.

View solution in original post

6 Replies 6

paolo bevilacqua
Hall of Fame
Hall of Fame

You need round brackets (parenthesis mark) for pattern match recall.

rule 3 /\(555222555[1-3]\)/ /\1/

p.bevilacqua wrote:

You need round brackets (parenthesis mark) for pattern match recall.

rule 3 /\(555222555[1-3]\)/ /\1/

Dec 17 16:34:27.772: //-1/599DDF6189B5/RXRULE/sed_subst: Successful substitution; pattern=5552225551 matchPattern=555222555[1-3] replacePattern=\1 replaced pattern=

Here is the debug log.  I still got a fast busy.

Works for me


CME#sh voice translation-rule 1
Translation-rule tag: 1

        Rule 1:
        Match pattern: \(555222555[1-3]\)
        Replace pattern: \1
        Match type: none                Replace type: none
        Match plan: none                Replace plan: none

CME#test voice translation-rule 1 5552225551
Matched with rule 1
Original number: 5552225551     Translated number: 5552225551
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

Likely there is another reason for fast-busy.

p.bevilacqua wrote:

Works for me


CME#sh voice translation-rule 1
Translation-rule tag: 1

        Rule 1:
        Match pattern: \(555222555[1-3]\)
        Replace pattern: \1
        Match type: none                Replace type: none
        Match plan: none                Replace plan: none

CME#test voice translation-rule 1 5552225551
Matched with rule 1
Original number: 5552225551     Translated number: 5552225551
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

Likely there is another reason for fast-busy.

I got it working!  I was missing some the \ and \ in the match pattern.  I do not understand how to write these AT ALL!  What did not make a lot of sense is that the first backslash is outside of the parentheses and the second backslash in inside the parentheses.  I've read the document explaining this from Cisco's website, but it still has not sunk in.

What got it working:

voice translation-rule 2
rule 1 /5552227564/ /\1/
rule 2 /\(555222555[1-3]\)/ /\1/
rule 3 /5552227610/ /6000/
rule 4 /\(.*\)/ /6001/

What I had before:

voice translation-rule 2
rule 1 /5552227564/ /\1/
rule 2 /(555222555[1-3])/ /\1/
rule 3 /5552227610/ /6000/
rule 4 /\(.*\)/ /6001/

I did not catch that. The backslash does a function called "quoting", to prevent interpreting a special character as parenthesis .

I understand that in these days of pervasive GUIs, such concepts are not common knowledge as they were once.

Thank you for the nice rating and good luck!

Sam Oesterling
Level 1
Level 1

I figured it out from looking at the output that you provided!  Thanks!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: