Discovery 15: Implement and Troubleshoot Digit Manipulation on a
Cisco IOS Gateway
Introduction
Implementing digit manipulation on Cisco IOS gateways is a complex task that includes manipulation of the called
numbers, calling numbers, redirected numbers, and the number type.
You will configure the Cisco IOS gateway (SJC-GW) to support calls from the HQ-UCM using SIP as a signaling
protocol.
You will implement outbound PSTN calls by creating a dial plan on SJC-GW and configure digit manipulation on the
Cisco IOS gateway. The dial plan is already configured on the HQ-UCM to send all the calls needed in this lab to
the SJC-GW.
There are two Cisco IP Communicator phones. One is located on PC-1 (CIPC-1) and one is located on PC-3
(PSTN). Cisco Unified Communications Manager Express acts as the PSTN gateway (PSTN-GW) and is
preconfigured to accept register messages from the PSTN phone. CIPC-1 is located in the SJC (San Jose)
location. You do not have access to PSTN-GW. It is preconfigured with all the necessary commands to perform this
lab.
The PSTN phone can be reached by local calls from CIPC-1 (408[2-9]XXXXXX), by national calls (1[2-9]XXXXXX),
by international calls (011!), and by emergency calls (911). Each type of call is linked to the corresponding line on
the PSTN phone, for example: when dialing an international number from CIPC-1, the international line (line 3) on
the PSTN phone will ring.
The connection between SJC-GW and PSTN-GW is an ISDN Link.
This lab will take approximately 30 minutes to complete.
Topology
Job Aid
Device Information
Device Description IP Address Credentials
PC-1 PC running Cisco IP Communicator HQ-CIPC-1 [Link] Student, C0ll@B
PC-3 PC running Cisco IP Communicator PSTN [Link] Student, C0ll@B
HQ-CUCM Cisco Unified Communications Manager [Link] Administrator, C0ll@B
SJC-GW Router [Link] Administrator, C0ll@B
Command List
The table describes the commands that are used in this activity. The commands are listed in alphabetical order so
that you can easily locate the information that you need. Refer to this list if you need configuration command
assistance during the lab activity.
Command Description
This command specifies the prefix of the dialed digits for
prefix digits
a dial peer.
This command specifies which digits to forward for voice
forward-digits [0-32]| all | extra
calls.
This command defines a voice translation rule for voice
voice translation-rule rule tag
calls.
rule precedence /match/ /replace/ [type {match-type replace-type} [plan This command defines a rule within a voice translation
{match-plan replace-plan}]] rule.
This command specifies a translation profile for all
voice translation-profile profile-name
incoming VoIP calls.
This command associates a translation rule with a voice
translate {called | calling | redirect-called} translation-rule-number
translation profile.
translation-profile {incoming | outgoing} name This command assigns a translation profile to a dial peer.
Command Description
test voice translation-rule number input-test-string [type match-type [plan
This command tests the functionality of a translation rule.
match-type]
Task 1: Register Endpoints
Activity
Step 1
On PC-1, open Google Chrome and navigate to Cisco Unified Communications Manager Administration
([Link] Log in using Administrator for the username and C0ll@B for the password.
Step 2
Select Device > Phone, click Find and observe if Cisco IP Communicator phones are displayed. If phones are
not displayed wait a while for the automation system to finish configuring Cisco Unified Communicacitons
Manager and then click Find again. Continue only when phones are displayed.
Step 3
On PC-1, start Cisco IP Communicator and configure it with the following settings:
Device Name: CIPC-1
TFTP Servers: [Link]
Step 4
On PC-3, ping PSTN-GW with IP address [Link]. If ping is not successful wait for a while and try
again. Continue with next step only if ping success.
Step 5
On PC-3, start the Cisco IP Communicator and configure it with the following settings:
Device Name: PSTN
TFTP Servers: [Link]
Task 2: Configure Dial-Peers on Cisco IOS Gateway
Activity
Step 1
Open Putty from the desktop, select Router 1 from the saved sessions, click Load, then click Open.
Step 2
Login using Administrator for the username and C0ll@B for the password.
Step 3
Configure a dial peer with the following parameters to route local calls from SJC-GW to the PSTN.
Parameter Value
Dial-peer voice pots 1
Destination-pattern [2-9]..[2-9]……$
Port 0/1/0:23
Forward-digits 10
SJC-GW(config-dial-peer)# dial-peer voice 1 pots
SJC-GW(config-dial-peer)# destination-pattern [2-9]..[2-9]......$
SJC-GW(config-dial-peer)# port 0/1/0:23
SJC-GW(config-dial-peer)# forward-digits 10
Step 4
Configure a dial peer with the following parameters to accept calls from Cisco Unified Communications Manager.
Parameter Value
Parameter Value
Dial-peer voice 10
Incoming called-number . (dot)
Session target Ipv4:[Link]
Session protocol SIPV2
SJC-GW(config)# dial-peer voice 10 voip
SJC-GW(config-dial-peer)# session target ipv4:[Link]
SJC-GW(config-dial-peer)# session protocol sipv2
SJC-GW(config-dial-peer)# incoming called-number .
Step 5
Configure a dial peer with the following parameters to route national calls from SJC-GW to the PSTN.
Parameter Value
Dial-peer voice pots 2
Destination-pattern 1[2-9]..[2-9]……$
Port 0/1/0:23
Forward-digits 11
SJC-GW(config-dial-peer)# dial-peer voice 2 pots
SJC-GW(config-dial-peer)# destination-pattern 1[2-9]..[2-9]......$
SJC-GW(config-dial-peer)# port 0/1/0:23
SJC-GW(config-dial-peer)# forward-digits 11
Step 6
Configure a dial peer with the following parameters to route emergency calls from SJC-GW to the PSTN.
Parameter Value
Dial-peer voice pots 3
Destination-pattern 911$
Port 0/1/0:23
Prefix 911
SJC-GW(config-dial-peer)# dial-peer voice 3 pots
SJC-GW(config-dial-peer)# destination-pattern 911$
SJC-GW(config-dial-peer)# port 0/1/0:23
SJC-GW(config-dial-peer)# prefix 911
Step 7
Place a call from CIPC-1 to the local PSTN number 94085551234 and observe the status of the call on the
PSTN emulator.
On the HQ-UCM, there is a route pattern for 9.[2-9]XX[2-9]XXXXXX, which matches the local number
94085551234. The route pattern points to the route list named SIP ROUTE LIST. The route list includes
the SIP ROUTE GROUP which contains the SIP TRUNK. The gateway was configured with a dial peer
that accepts calls from Cisco Unified Communications Manager and a dial peer to route your calls to the
ISDN.
Step 8
Place a call from CIPC-1 to the national PSTN number 919195551234 and observe the status of the call on the
PSTN emulator.
On the HQ-UCM, there is a route pattern for 9.1[2-9]XX[2-9]XXXXXX, which matches the national
number 919195551234. The rest of the configuration is the same as the previous step. Therefore, your
call works.
Step 9
Place a call from CIPC-1 to the emergency PSTN number 9911 and observe the status of the call on the PSTN
emulator.
On the HQ-UCM, there is a route pattern for 9.911, which matches the emergency number. The rest of
the configuration is the same as the previous step. Therefore, your call works.
Step 10
Configure a dial peer with the following parameters to route international calls from SJC-GW to the PSTN.
Parameter Value
Dial-peer voice pots 4
Destination-pattern 011T
Port 0/1/0:23
Prefix 011
Enter the following information:
SJC-GW(config-dial-peer)# dial-peer voice 4 pots
SJC-GW(config-dial-peer)# destination-pattern 011T
SJC-GW(config-dial-peer)# port 0/1/0:23
SJC-GW(config-dial-peer)# prefix 011
Step 11
Place a call from CIPC-1 to the international PSTN number 9 011 44 207 946 0132 and observe the status of the
call on the PSTN phone.
In general, the number that you send looks correct and the call should work. After checking with your
service provider, you find that the service provider requires another format for international calls. The
called-party number should be provided in E.164 format and the type of number field has to be set to
international.
Task 3: Digit Manipulation
Digit manipulation includes a wide variety of tools. Often, it is possible to make a mistake when you perform digit
manipulation on Cisco IOS gateways.
You will configure digit manipulation by configuring voice translation rules and apply translation patterns on the
POTS dial peer to change called- and calling-party numbers.
Voice Translation Rule Operations
Use the voice translation-rule command to create the definition of a translation rule. When the router evaluates a
translation rule, it is performing a “match XXX and change to YYY” operation on the regular expression.
Consider the following examples:
This rule will be used to change the outgoing called number to a 10-digit number for routing across the PSTN.
The rule will be applied outgoing on an interface, port, or dial peer.
Router(config)# voice translation-rule PSTN-out
Router(cfg-translation-rule)# rule 1 /^821...$/ /3005551.../
This rule will be used to change the incoming calling number to a four-digit number after routing across the
PSTN. The rule will be applied incoming on an interface, port, or dial peer.
Router(config)# voice translation-rule PSTN-in
Router(cfg-translation-rule)# rule 1 /^2005553...$/ /1.../
This table shows the match-and-replace operations for each rule:
Rule Match This Change To
/^821...$/ /3005551.../ 821... 3005551...
/^200553...$/ /1.../ /2005553.../ /1.../
The following table describes the most important regular expressions.
Voice Translation Rule
Description
Character
^ This expression matches the expression at the start of a line.
$ This expression matches the expression at the end of the line.
This expression is a delimiter that marks the start and end of both the matching and replacement
/
strings.
\ This expression escapes the special meaning of the next character.
- This expression indicates a range when not in the first or last position and is used with '[' and ']'.
[list] This expression matches a single character in a list.
[^list] This expression indicates that a single character that is specified in the list is not matched.
. This expression matches any single character.
* This expression repeats the previous regular expression zero or more times.
+ This expression repeats the previous regular expression one or more times.
? This expression repeats the previous regular expression zero times or one time.
() This expression groups regular expressions.
Type of Number
The ISDN Type of Number (TON) is used to specify the format in which a number (such as calling number or called
number) is represented. To have a unique, standardized way to represent PSTN numbers in Cisco Unified
Communications Manager, the numbers have to be transformed based on the TON.
For example, if the calling number of an incoming PSTN call is received with a TON subscriber, the PSTN access
code can be prefixed so the user can place a callback without editing the number. If the calling number is in
national format, then the PSTN access code and the national access code are prefixed. If a calling number is
received with an international TON, the PSTN access code and the international access code are prefixed.
In countries with fixed-length numbering plans, transforming the numbers is not required, because the length of the
calling number allows users to identify the type of calling number. In this case, users can manually prefix the
necessary access codes. In countries with variable-length numbering plans, however, it can be impossible to
identify if the call was received from the local area code, from another area code of the same country, or from
another country by just looking at the number. In such cases, the calling numbers of incoming PSTN calls have to
be transformed based on the TON.
Configure a Voice Translation Rule to Translate Called Numbers from SJC-GW to PSTN-GW
You will configure a voice translation rule and a voice translation profile to translate the called-party number that is
used from SJC-GW to PSTN-GW to the E.164 numbering format with the international TON. Then you will verify
and test your configuration.
Activity
Step 1
Previously, you configured a dial peer to route international calls from SJC-GW to the PSTN with the prefix 011
on dial-peer voice 4 pots. Now, delete the prefix 011.
SJC-GW(config)# dial-peer voice 4 pots
SJC-GW(config-dial-peer)# no prefix 011
Step 2
In global configuration mode, create a new voice translation-rule by entering the command, voice translation-
rule 1. Then define the rule by entering the command, rule 1 /^011/ // type any international. This will match
any number that starts with 011 and has a TON of any type. It will then replace 011 with nothing “//” therefore
removing the 011 from the number. Finally, it will set the ISDN TON to type international.
SJC-GW(config-dial-peer)# exit
SJC-GW(config)# voice translation-rule 1
SJC-GW(cfg-translation-rule)# rule 1 /^011/ // type any international
Step 3
Create a translation profile called to-PSTN by entering the command, voice translation-profile to-PSTN. Then
enter the command, translate called 1. This defines that translation-rule 1, created in the previous step, will be
used to manipulate the digits of the called number.
SJC-GW(cfg-translation-rule)# voice translation-profile to-PSTN
SJC-GW(cfg-translation-profile)# translate called 1
Step 4
Test the voice translation rule 1 by entering the command, test voice translation-rule 1 011442079460132.
This will show you how the translation rule will be applied to the number specified.
SJC-GW(cfg-translation-profile)# exit
SJC-GW(config)# exit
SJC-GW# test voice translation-rule 1 011442079460132
Matched with rule 1
Original number: 011442079460132 Translated number: 442079460132
Original number type: none Translated number type: international
Original number plan: none Translated number plan: none
Step 5
Apply the voice translation profile to-PSTN to the dial-peer voice 4 pots, by entering the command, translation-
profile outgoing to-PSTN under dial-peer voice 4 pots.
SJC-GW# configure terminal
SJC-GW(config)# dial-peer voice 4 pots
SJC-GW(config-dial-peer)# translation-profile outgoing to-PSTN
Step 6
Place a call from CIPC-1 to the international PSTN number 9 011 44 207 946 0132 and observe the status of the
call and the called number on the CIPC-1 phone.
The call still works, and the called number has been translated into E.164 format.
The calling number on the PSTN phone however is still showing the call from 4085551001, so you need to
translate the calling number now.
Configure a Voice Translation Rule to Translate Calling-Party Numbers from SJC-GW to PSTN
You will configure a voice translation rule to translate the calling-party numbers that are used from SJC-GW to
PSTN-GW to the E.164 numbering format. Then you will verify and test your configuration.
Step 7
Configure a second voice translation rule by entering the command, voice translation-rule 2. Configure the rule
by entering the command, rule 1 /^408/ /1408/ . This will translate a number that starts with 408 into a number
that starts with 1408. This therefore is prepending the number 1 to the front of the number matched.
SJC-GW(config-dial-peer)# exit
SJC-GW(config)# voice translation-rule 2
SJC-GW(cfg-translation-rule)# rule 1 /^408/ /1408/
Step 8
Configure the voice translation profile to-PSTN by entering the command, voice translation-profile to-PSTN.
Enter the command, translate calling 2. This will use the translation rule 2 that you configured in the previous
step to manipulate the digits of the calling number.
SJC-GW(cfg-translation-rule)# voice translation-profile to-PSTN
SJC-GW(cfg-translation-profile)# translate calling 2
Step 9
Test the second voice translation rule with the calling number 4085551001 by entering the command, test voice
translation-rule 2 4085551001.
SJC-GW(cfg-translation-profile)# exit
SJC-GW(config)# exit
SJC-GW# test voice translation-rule 2 4085551001
Matched with rule 1
Original number: 4085551001 Translated number: 14085551001
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
Step 10
Place a call from CIPC-1 to the international PSTN number 9 011 44 207 946 0132 and observe the status of the
call on the PSTN phone.
The call works, and the calling number is now in E.164 format.