Usage Guidelines
Note |
Use this
command in conjunction after the
voice
translation-rule command. An earlier version of
this command uses the same name but is used after the
translation-rule command and has a slightly
different command syntax. In the older version, you cannot use the square
brackets when you are entering command syntax. They appear in the syntax only
to indicate optional parameters, but are not accepted as delimiters in actual
command entries. In the newer version, you can use the square brackets as
delimiters. Going forward, we recommend that you use this newer version to
define rules for call matching. Eventually, the
translation-rule
command will not be supported.
|
A translation
rule applies to a calling party number (automatic number identification [ANI])
or a called party number (dialed number identification service [DNIS]) for
incoming, outgoing, and redirected calls within Cisco H.323 voice-enabled
gateways.
Number
translation occurs several times during the call routing process. In both the
originating and terminating gateways, the incoming call is translated before an
inbound dial peer is matched, before an outbound dial peer is matched, and
before a call request is set up. Your dial plan should account for these
translation steps when translation rules are defined.
The below table
shows examples of match patterns, input strings, and result strings for the
rule (voice translation-rule) command.
Table 1 Match
Patterns, Input Strings and Result Strings
Match
Pattern
|
Replacement Pattern
|
Input
String
|
Result
String
|
Description
|
/^.*/
|
//
|
4085550100
|
|
Any
string to null string.
|
//
|
//
|
4085550100
|
4085550100
|
Match
any string but no replacement. Use this to manipulate the call plan or call
type.
|
/\(^...\)456\(...\)/
|
/\1555\2/
|
4084560177
|
4085550177
|
Match
from the middle of the input string.
|
/\(.*\)0120/
|
/\10155/
|
4081110120
|
4081110155
|
Match
from the end of the input string.
|
/^1#\(.*\)/
|
/\1/
|
1#2345
|
2345
|
Replace
match string with null string.
|
/^408...\(8333\)/
|
/555\1/
|
4087770100
|
5550100
|
Match
multiple patterns.
|
/1234/
|
/00&00/
|
5550100
|
55500010000
|
Match
the substring.
|
/1234/
|
/00\000/
|
5550100
|
55500010000
|
Match
the substring (same as &).
|
The software
verifies that a replacement pattern is in a valid E.164 format that can include
the permitted special characters. If the format is not valid, the expression is
treated as an unrecognized command.
The number type
and calling plan are optional parameters for matching a call. If either
parameter is defined, the call is checked against the match pattern and the
selected type or plan value. If the call matches all the conditions, the call
is accepted for additional processing, such as number translation.
Several rules
may be grouped together into a translation rule, which gives a name to the rule
set. A translation rule may contain up to 15 rules. All calls that refer to
this translation rule are translated against this set of criteria.
The precedence
value of each rule may be used in a different order than that in which they
were typed into the set. Each rule’s precedence value specifies the priority
order in which the rules are to be used. For example, rule 3 may be entered
before rule 1, but the software uses rule 1 before rule 3.
The software
supports up to 128 translation rules. A translation profile collects and
identifies a set of these translation rules for translating called, calling,
and redirected numbers. A translation profile is referenced by trunk groups,
source IP groups, voice ports, dial peers, and interfaces for handling call
translation.
Examples
The following
example applies a translation rule. If a called number starts with 5550105 or
70105, translation rule 21 uses the rule command to forward the number to
14085550105 instead.
Router(config)# voice translation-rule 21
Router(cfg-translation-rule)# rule 1 /^5550105/ /14085550105/
Router(cfg-translation-rule)# rule 2 /^70105/ /14085550105/
In the next
example, if a called number is either 14085550105 or 014085550105, after the
execution of translation rule 345, the forwarding digits are 50105. If the
match type is configured and the type is not “unknown,” dial-peer matching is
required to match the input string numbering type.
Router(config)# voice translation-rule 345
Router(cfg-translation-rule)# rule 1 /^14085550105/ /50105/ plan any national
Router(cfg-translation-rule)# rule 2 /^014085550105/ /50105/ plan any national