cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
261
Views
0
Helpful
4
Replies

Translation-pattern help

I need to create a translation pattern to strip the ANI and * from the following string:

*1235551212*8500*

I'm not very good at regular expressions and I can't seem to get the expression to recognize the *. Can anyone help?

Thanx.

4 Replies 4

anup.anand
Level 5
Level 5

From what I infer, 1235551212 is the ANI and you need to get rid of that and just send 8500. Please correct me if I am wrong.

If that is what you need, then use this translation rule

voice translation-rule 100

rule 1 /\(\*1235551212\*\)\(8500\)\*/ /\2/

To get the expression to recognoze*, use backslash in front of it, like \*

Regards,

Anup

That's perfect. I was close, but couldn't quite get it. Now I see what I was doing wrong.

Thanx.

I spoke too soon. When I try to enter the command, I get:

PremierTel(config-translate)#rule 1 /\(\*1235551212\*\)\(8500\)\*/ /\2/

Incorrect format for Translation Match Pattern

regular expression must be of the form ^(\^)?(\+)?([0-9,A-F.*%?#]+)$

Invalid match pattern string input /\(\*1235551212\*\)\(8500\)\*/

PremierTel(config-translate)#

This is IOS 12.4(7a), if that helps. This is very strang because the expression looks good.

-Tim

Hmm. Just tried the same (copied from your post) in c3745-ipvoice-mz.123-11.T7.bin:

VG(config)#voice translation-rule 999

VG(cfg-translation-rule)#rule 1 /\(\*1235551212\*\)\(8500\)\*/ /\2/

VG(cfg-translation-rule)#

VG#test voice translation-rule 999 *1235551212*8500*

Matched with rule 1

Original number: *1235551212*8500* Translated number: 8500

Original number type: none Translated number type: none

Original number plan: none Translated number plan: none

Worked fine. Smells like a bug or copy/paste error of some sort.

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: