12-17-2010 07:16 AM - edited 03-16-2019 02:29 AM
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
Solved! Go to Solution.
12-17-2010 08:46 AM
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.
12-17-2010 08:15 AM
You need round brackets (parenthesis mark) for pattern match recall.
rule 3 /\(555222555[1-3]\)/ /\1/
12-17-2010 08:38 AM
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.
12-17-2010 08:46 AM
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.
12-17-2010 09:01 AM
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: noneLikely 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/
12-17-2010 09:04 AM
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!
12-17-2010 09:18 AM
I figured it out from looking at the output that you provided! Thanks!
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: