05-26-2006 08:42 PM - last edited on 03-25-2019 06:51 PM by ciscomoderator
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.
05-26-2006 10:24 PM
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
05-28-2006 06:33 AM
That's perfect. I was close, but couldn't quite get it. Now I see what I was doing wrong.
Thanx.
05-30-2006 05:24 AM
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
05-30-2006 08:05 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide