Mailing List Archive

translation-rule - what in the hell.
'lo

I have some issues with translation-rules statement.
It basicly looks like this:

s5300-tester#sh translation-rule 30000
Translation rule address: 0x63AE67B4
Tag name: 30000
Translation rule in_used 1
**** Xrule rule table *******
Rule : 0
in_used state: 1
Match pattern: ^71.......
Sub pattern: 71
**** Xrule rule table *******
Rule : 1
in_used state: 1
Match pattern: ^61.......
Sub pattern: 61
**** Xrule rule table *******
Rule : 2
in_used state: 1
Match pattern: ^8000
Sub pattern: 128000000
**** Xrule rule table *******
Rule : 10
in_used state: 1
Match pattern: any
Sub pattern: 713333333

Now, a little testing:

as5300-tester#test translation-rule 30000 711234567
The replaced number: 711234567
as5300-tester#test translation-rule 30000 71123456
The replaced number: 71123456
as5300-tester#test translation-rule 30000 611234567
The replaced number: 611234567
as5300-tester#test translation-rule 30000 61123456
The replaced number: 61123456
as5300-tester#test translation-rule 30000 8000
The replaced number: 128000000
as5300-tester#test translation-rule 30000 344321
The replaced number: 713333333

Ok, I wanted the patterns to be matched exact, but it seems they are not.
Why in the hell seven dots (.) in the first two rules aren't matched exactly?
Why a six digits after the initial prefix are ok for the rule?

The docs say explicitly:

. Indicates a single character.

But doesn't seem to work for me.

Am i doing something wrong, or is it just a 'feature' i have to live with?

--
k.
RE: translation-rule - what in the hell. [ In reply to ]
Jakub,

The regular expression can match any PART of the number.
In normal REGEX $ is used to indicate EOL so you might try using this,
thought I don't have access to a router currently to confirm if this works.

/Wes

> -----Original Message-----
> From: cisco-voip-bounces@puck.nether.net
> [mailto:cisco-voip-bounces@puck.nether.net]On Behalf Of Jakub Klausa
> Sent: Saturday, August 02, 2003 10:54 AM
> To: cisco-voip@puck.nether.net
> Subject: [cisco-voip] translation-rule - what in the hell.
>
>
> 'lo
>
> I have some issues with translation-rules statement.
> It basicly looks like this:
>
> s5300-tester#sh translation-rule 30000
> Translation rule address: 0x63AE67B4
> Tag name: 30000
> Translation rule in_used 1
> **** Xrule rule table *******
> Rule : 0
> in_used state: 1
> Match pattern: ^71.......
> Sub pattern: 71
> **** Xrule rule table *******
> Rule : 1
> in_used state: 1
> Match pattern: ^61.......
> Sub pattern: 61
> **** Xrule rule table *******
> Rule : 2
> in_used state: 1
> Match pattern: ^8000
> Sub pattern: 128000000
> **** Xrule rule table *******
> Rule : 10
> in_used state: 1
> Match pattern: any
> Sub pattern: 713333333
>
> Now, a little testing:
>
> as5300-tester#test translation-rule 30000 711234567
> The replaced number: 711234567
> as5300-tester#test translation-rule 30000 71123456
> The replaced number: 71123456
> as5300-tester#test translation-rule 30000 611234567
> The replaced number: 611234567
> as5300-tester#test translation-rule 30000 61123456
> The replaced number: 61123456
> as5300-tester#test translation-rule 30000 8000
> The replaced number: 128000000
> as5300-tester#test translation-rule 30000 344321
> The replaced number: 713333333
>
> Ok, I wanted the patterns to be matched exact, but it seems they are not.
> Why in the hell seven dots (.) in the first two rules aren't
> matched exactly?
> Why a six digits after the initial prefix are ok for the rule?
>
> The docs say explicitly:
>
> . Indicates a single character.
>
> But doesn't seem to work for me.
>
> Am i doing something wrong, or is it just a 'feature' i have to live with?
>
> --
> k.
>