[cisco-voip] H323 dial-peers question
Andre Beck
cisco-voip at ibh.net
Mon Oct 29 08:43:18 EDT 2007
Hi Nikola,
On Sun, Oct 28, 2007 at 08:20:42PM -0400, Nikola Stojsin wrote:
>
> voice translation-rule 10
> rule 1 /......4300/ /4900/
> rule 2 /......4301/ /4301/
> rule 3 /......4302/ /4302/
> rule 4 /......4303/ /4303/
> rule 5 /......4304/ /4304/
> rule 6 /......4305/ /4305/
> rule 7 /......4306/ /4306/
> rule 8 /......4307/ /4307/
> rule 9 /......4308/ /4308/
> rule 10 /.*/ /4900/
Independent of everything else, you could merge rules 2..9 into a single
one, using regular subexpression backreference (ed-style):
rule 2 /......\(430[1-8]\)/ /\1/
With your catch-all rule 10, you can also leave out rule 1. So as a result,
you end up with just
rule 2 /......\(430[1-8]\)/ /\1/
rule 10 /.*/ /4900/
doing the exact same thing. As there are only 15 rules available,
compacting them as much as possible is a relevant art, just hindered
by the regex model used here not implementing | slices.
BTW, you should think about anchoring your regexps. It may not seem
necessary now, but it makes things clearer and less error prone over
time, when the environment changes unexpectedly.
BTW^2, called party number translations are highly sensitive to
overlap receiving situations. Seems you don't have to deal with one,
but if you had to, be aware that /.*/ on the LHS might terminate an
overlap receiving in progress, routing every call to 4900 instantly.
In such situations, I'm using a construct like
rule 15 /^123456\(..*\)$/ /\1/
to force the overlap receiving to continue. Don't ask me why exactly
it works (even with extensions longer than two digits), but it does,
while \(.*\) does not. I assume it's because .* can match nothing, so
123456.* will match 123456 before any overlap receiving is invoked,
while 123456..* will require at least another digit, which allows overlap
receiving to start, and after that IOS somehow manages to complete it
correctly (on T302 expiry).
HTH,
Andre.
--
.sig making fun of Santa Claus Operation currently unavailable
-> Andre Beck +++ ABP-RIPE +++ IBH Prof. Dr. Horn GmbH, Dresden <-
More information about the cisco-voip
mailing list