To define a
translation rule, use the
rule command
in voice translation-rule configuration mode. To delete the translation rule,
use the
no
form of this command.
Match and
Replace Rule
rule precedence /match-pattern/
/replace-pattern/ [ type
{match-type
replace-type} [ plan {match-type replace-type} ]]
no rule precedence
Reject
Rule
rule predence rejectprecedence /match-pattern/ /replace-pattern/ /match-pattern/[ type
{match-type [ plan {match-type r ]]
no rule precedence
Syntax Description
precedence
|
Priority of the translation rule. Range is from 1 to 15.
|
/ match -pattern /
|
Stream
editor (SED) expression used to match incoming call information. The slash ‘/’
is a delimiter in the pattern.
|
/ replace -pattern /
|
SED
expression used to replace the match pattern in the call information. The slash
‘/’ is a delimiter in the pattern.
|
type
match -type
replace-type
|
(Optional) Number type of the call. Valid values for the
match-type
argument are as follows:
- abbreviated —Abbreviated representation of the
complete number as supported by this network.
- any —Any type of called number.
- international —Number called to reach a subscriber
in another country.
- national —Number called to reach a subscriber in
the same country, but outside the local network.
- network —Administrative or service number specific
to the serving network.
- reserved —Reserved for extension.subscriber —Number called to reach a subscriber in
the same local network.
- unknown —Number of a type that is unknown by the
network.
Valid
values for the
replace-type
argument are as follows:
- abbreviated —Abbreviated representation of the
complete number as supported by this network.
- international —Number called to reach a subscriber
in another country.
- national —Number called to reach a subscriber in
the same country, but outside the local network.
|
type
match -type
replace -type
(continued)
|
- network —Administrative or service number specific
to the serving network.
- reserved —Reserved for extension.
- subscriber —Number called to reach a subscriber in
the same local network.
- unknown —Number of a type that is unknown by the
network.
|
plan
match -type
replace -type
|
(Optional) Numbering plan of the call. Valid values for the
match -type
argument are as follows:
- any —Any
type of dialed number.
- data
- ermes
- isdn
- national —Number called to reach a subscriber in
the same country, but outside the local network.
- private
- reserved —Reserved for extension.
- telex
- unknown —Number of a type that is unknown by the
network.
Valid
values for the
replace-type argument are as follows:
- data
- ermes
- isdn
- national —Number called to reach a subscriber in
the same country, but outside the local network.
- private
- reserved —Reserved for extension.
- telex
- unknown —Number of a type that is unknown by the
network.
|
reject
|
The
match pattern of a translation rule is used for call-reject purposes.
|
Command Default
No default
behavior or values
Command Modes
Voice translation-rule configuration
Command History
Release
|
Modification
|
12.2(11)T
|
This
command was introduced with a new syntax in voice-translation-rule
configuration mode.
|
15.1(4)M
|
This
command was introduced with an increase in the maximum value of the precidence
variable from 15 to 100.
|
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