8/14/2019 CVOICE 6.0 S04 L03
1/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-1
Implementing Dial Plans on Voice Gateways
Configuring DigitManipulation
8/14/2019 CVOICE 6.0 S04 L03
2/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-2
Digit Manipulation
Various mechanisms for digit manipulations: Simple digit manipulation for dial peers:
digit-strip
forward-digits
prefix
clid
Number expansion to globally inflate or deflate numbers:
num-exp
Global command
Typically used for short dials and site codes
Voice translation rules and profiles:
Powerful and complex digit manipulation using regular expressions
Digit translation rules used to manipulate the calling number digits (ANI), thecalled number digits (DNIS), or the redirect number digits for a voice call
8/14/2019 CVOICE 6.0 S04 L03
3/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-3
Digit Manipulation (Cont.)
1. Inbound voice-port translationprofile
2. Number expansion3. Match inbound dial peer4. CLID
5. Dial-peer voice translation profile
1. Match outbound dial peer2. Dial-peer voice translation
profile
3. CLID
1. Match outbound dial peer2. Dial-peer voice translationprofile
3. CLID4. Digit strip5. Prefix digits6. Forward digits
1. Global voice translation profiles2. Number expansion3. Match inbound dial peer4. CLID5. Dial peer voice translation profile
POTS
POTS VoIP
VoIP
IncomingCall
8/14/2019 CVOICE 6.0 S04 L03
4/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-4
Digit Consumption and Forwarding
POTS dial peers:
By default, the router consumes the left-justified digits thatexplicitly match the destination pattern and forwards theremaining digits.
Use the no digit-strip command to disable the automatic digit-stripping function.
VoIP dial peers: By default, the router forwards all digits collected.
Example 1: Dialed digits 5550124 Example 2: Dialed digits 5550124dial-peer voice 1 potsdestination-pattern 555....port 0/1:1
dial-peer voice 1 potsdestination-pattern 555....no digit-stripport 0/1:1
Explicitly matched digits 555 areconsumed and 0124 is forwarded. Digits 555 0124 are forwarded.
8/14/2019 CVOICE 6.0 S04 L03
5/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-5
Digit Collection
1. The router collects digits, one at a time, until it can match anoutbound dial peer.
2. After a match is made, the router immediately places the call.
3. No further digits are collected.
Example 1: Dialed digits 5550124 Example 2: Dialed digits 5550124
dial-peer voice 1 voipdestination-pattern 555session target ipv4:10.18.0.1
dial-peer voice 2 voip
destination-pattern 5550124session target ipv4:10.18.0.2
dial-peer voice 1 potsdestination-pattern 555....session target ipv4:10.18.0.1
dial-peer voice 2 voip
destination-pattern 5550124session target ipv4:10.18.0.2
Dial peer 1 will match first. Only thecollected digits of 555 will beforwarded.
Dial peer 2 will match first. Thecollected digits of 5550124 will be
forwarded.
8/14/2019 CVOICE 6.0 S04 L03
6/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-6
dial-peer voice 9 potsdestination-pattern 9T
dial-peer voice 911 potsdestination-pattern 911
PSTN
Dialed number:92815551234
Transmitted number:2815551234
Dialed number:911
Transmitted number:None!
dial-peer voice 911 potsdestination-pattern 911
no digit-strip
Dialed number:911
Transmitted number:911
Reordertone
Digit Stripping
8/14/2019 CVOICE 6.0 S04 L03
7/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-7
Digit Forwarding
dial-peer voice 1000 potsdestination-pattern 1
dial-peer voice 1000 potsdestination-pattern 1forward-digits 4
Dialed number:1234
Transmitted number:234
Dialed number:1234
Transmitted number:1234
Ext.1234PBX
8/14/2019 CVOICE 6.0 S04 L03
8/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-8
Digit Prefixing
dial-peer voice 2001 potsdestination-pattern 2preference 1prefix 5125552port 0/1:23
dial-peer voice 2000 voipdestination-pattern 2session target ipv4:10.1.1.1
PSTN
Dialed number:2123
Tran
smitted
num
ber:
5125
552123
WAN512-555-212310.1.1.1
WAN is down!0/
1
8/14/2019 CVOICE 6.0 S04 L03
9/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-9
Number Expansion
PSTN
Dialed number:5551234 Transmitted number:2815551234
num-exp 5551... 2815551...dial-peer voice 2000 pots
destination-pattern 2815551... no digit-strip
port 0/1:23
281-555-1234
8/14/2019 CVOICE 6.0 S04 L03
10/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-10
Simple Digit Manipulation for POTSDial Peer
PSTN
Phone1-12001 3125550123
913125550123no digit-strip
prefix 9 and digit-strip
forward-digits 4
digit-strip (default)
Command
913125550123
0123
13125550123
DNIS
dial-peer voice 9 potsdestination-pattern 9T
H.323 GatewayDID: 4085552XXX
User dials913125550123.
8/14/2019 CVOICE 6.0 S04 L03
11/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-11
Digit Manipulation with NumberExpansion
PSTN
13125550123
num-exp 1... 913125550...dial-peer voice 9 potsdestination-pattern 9T
User dials 0123. Number is expandedto 13125550123 and
routed to PSTN.
Phone rings.
1 2 3
Gateway
2001
8/14/2019 CVOICE 6.0 S04 L03
12/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-12
Caller ID Number Manipulation
The clid command is used to modify the calling number:
clid network-numbernumber [second-number strip]
Configures a network number in the router for CLID
clid second-number strip Prevents the second network number from being sent in the
CLID information
clid restrict
Prevents the calling party number from being presented clid strip [name]
Removes the calling party number or name information fromthe CLID information and prevents the calling party numberfrom being presented
8/14/2019 CVOICE 6.0 S04 L03
13/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-13
Caller ID Number Manipulation (Cont.)
voice-port 0/0/0station-id name HQ Faxstation-id number 7135551003
WAN
FXS Port
0/0/0
8/14/2019 CVOICE 6.0 S04 L03
14/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-14
Caller ID Information
router# show dialplan number 914085551234
Macro Exp.: 914085551234
VoiceEncapPeer91
peer type = voice, information type = voice,
description = `',
tag = 91, destination-pattern = `91..........',
answer-address = `', preference=0,
CLID Restriction = None
CLID Network Number = `'
CLID Second Number sent
CLID Override RDNIS = disabled,source carrier-id = `', target carrier-id = `',
source trunk-group-label = `', target trunk-group-label =`', numbering Type = `unknown'
8/14/2019 CVOICE 6.0 S04 L03
15/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-15
Caller ID Information (Cont.)
router(config-dial-peer)# clid network-number 5551234
router# show dialplan number 914085551234
Macro Exp.: 914085551234
VoiceEncapPeer91peer type = voice, information type = voice,
description = `',
tag = 91, destination-pattern = `91..........',
answer-address = `', preference=0,
CLID Restriction = None
CLID Network Number = `5551234'CLID Second Number sent
CLID Override RDNIS = disabled,
source carrier-id = `', target carrier-id = `',
source trunk-group-label = `', target trunk-group-label = `',numbering Type = `unknown'
8/14/2019 CVOICE 6.0 S04 L03
16/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-16
Caller ID Information (Cont.)
router(config-dial-peer)# clid strip
router# show dialplan number 914085551234
Macro Exp.: 914085551234
VoiceEncapPeer91
peer type = voice, information type = voice,
description = `',
tag = 91, destination-pattern = `91..........',
answer-address = `', preference=0,
CLID Restriction = clid strip
CLID Network Number = `'
CLID Second Number sent
CLID Override RDNIS = disabled,
source carrier-id = `', target carrier-id = `',
source trunk-group-label = `', target trunk-group-label = `',numbering Type = `unknown'
8/14/2019 CVOICE 6.0 S04 L03
17/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-17
Voice Translation Rules and Profiles
Voice translation rules define up to 15 subrules to manipulatedigits, TONs, and numbering plans.
Voice translation profiles reference up to three rules:
Called: Translation rule for the called number
Calling: Translation rule for the calling number
Redirect-called: Translation rule for the redirect number
Voice translation profiles can be referenced by
VoIP dial peers, voice ports, any inbound VoIP call, specificrange of source IP addresses in VoIP calls, trunk groups,NFAS controllers, or SRST
8/14/2019 CVOICE 6.0 S04 L03
18/37
8/14/2019 CVOICE 6.0 S04 L03
19/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-19
Voice Translation Rules and Profiles(Cont.)
Match the substring (matched string). You may also use \0.&
Groups regular expressions. Use \1-9 to refer to matched groups.()
Repeat the previous regular expression zero or one time (use CTRL-V in order to enterin IOS).
?
Repeat the previous regular expression one or more times.+
Repeat the previous regular expression zero or more times.*
Match any single character..
Do not match a single character specified in the list.[^list]
Match a single character in a list.[list]Indicates a range when used within brackets.-
Escape the special meaning of the next character.\
Delimiter that marks the start and end of both the matching and replacement strings./
Match the expression at the end of the line.$
Match the expression at the start of a line.^
DescriptionChar
8/14/2019 CVOICE 6.0 S04 L03
20/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-20
rule 1 /1/ /4085551/This regex says
match 1 and change to 4085551
PSTN
San JoseAustin
User dials 1001 toreach a San Jose
extension but has to gothrough the PSTN
3XXX
WAN
PSTN-Out
PSTN-In
Regular Expressions in TranslationRules
8/14/2019 CVOICE 6.0 S04 L03
21/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-21
Prepending Digits
PSTN
User dials 5125550101to reach a PSTN phone.
5125550101
Gateway needs toadd a 9 to route
through the PSTN.
rule 1 /\(^[2-9].........\)/ /9\1/
\ = escape character
\1
8/14/2019 CVOICE 6.0 S04 L03
22/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-22
913125552001 type national3125552001 type national/.*/ /91&/ type national national
2001
2001
2025 or 3051
2001
914085550123
Input String
8012001/^2/ /801\0/
8012001/^2/ /801&/
4000/^[23]/ /4000/
3001/^2001/ /3001/
14085550123/^9/ //
Output StringRule
You may use & or \0to replace with theoriginal digits input.
Voice Translation Rule Search-and-Replace Examples
8/14/2019 CVOICE 6.0 S04 L03
23/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-23
\(9\) \([^01].*\) \1 \21408
9 5550134 9 55501341408
/ / / /
Search Replace
OutputInput
Translation Rule: /\(9\)\([^01].*\)/ /\11408\2/
Voice Translation Rule Search-and-Replace Examples (Cont.)
8/14/2019 CVOICE 6.0 S04 L03
24/37 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-24
Voice Translation Profiles
Defines the translation profile rule for the redirect-called number.
redirect-called
Defines the translation profile rule for the callingnumber.
calling
Defines the translation profile rule for the called
number.
called
DescriptionAttribute
8/14/2019 CVOICE 6.0 S04 L03
25/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-25
Translation Profile Order
Processing Order
24Dial Peer
13Global
32Trunk Group/Source IP
41Voice Port/NFAS
OutboundInbound
Applied
8/14/2019 CVOICE 6.0 S04 L03
26/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-26
PSTN-IN
Called Rule 1
Rule 2Calling
RedirectedCalled
1 /^4085552/ /2/
/^.*/ /9011&/ type international international3
/^.*/ /91&/ type national national2
1 /^.*/ /9&/ type subscriber subscriber
voice translation-rule 1rule 1 /^4085552/ /2/
voice translation-rule 2
rule 1 /^.*/ /9&/ type subscriber subscriberrule 2 /^.*/ /91&/ type national nationalrule 3 /^.*/ /9011&/ type international international
voice translation-profile pstn-intranslate called 1translate calling 2
Voice Translation Profile Search-and-Replace Example
8/14/2019 CVOICE 6.0 S04 L03
27/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-27
Voice Translation Profile Call BlockingExample
BLOCK
Called
Rule 1Calling
RedirectedCalled
1 reject /^408555/
voice translation-rule 1
rule 1 reject /^408555/voice translation profile blocktranslate calling 1
dial-peer voice 111 potscall-block translation-profile incoming blockcall-block disconnect-cause incoming invalid_number
8/14/2019 CVOICE 6.0 S04 L03
28/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-28
dialplan-pattern for Cisco Unified CommunicationsManager Express and Cisco Unified SRST:
Creates another dial peer for every ephone-dn:
Destination pattern = DID number of the directory number
Also used for outbound PSTN calls for correct ANI
Can be used to register the DID number with a gatekeeper
Problem:
Increases the number of dial peers and works only for
ephone-dn
Solution:
Use voice translation profiles on the voice port
Voice Translation Profiles vs.dialplan-pattern
8/14/2019 CVOICE 6.0 S04 L03
29/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-29
Analog Phone1-12001
PSTN
telephony-servicedialplan-pattern 1 4085552... extension-length 4dial-peer voice 2001 potsdestination-pattern 2001port 1/0/0
13125550123
Analog phone willnot ring.
No match on4085552001
User dials14085552001.
3 2 1
Easy to deploy, withsome caveats ondial peers that are
not ephone-dn.
Cisco Unified CMEDID: 4085552XXX
X
1/0/0
Cisco Unified Communications ManagerExpress with dialplan-pattern
*Cisco Unified CME = Cisco Unified
Communications Manager Express
8/14/2019 CVOICE 6.0 S04 L03
30/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-30
Cisco Unified Communications ManagerExpress with Voice Translation Profiles
PSTN
voice translation-rule 1rule 1 /^4085552/ /2/
voice translation-profile pstn-intranslate called 1
voice-port 0/0/0:23
translation-profile incoming pstn-indial-peer voice 2001 potsdestination-pattern 2001port 1/0/0
13125550123
Phone rings. Profile modifies DNISto 2001
User dials14085552001.
3 2 1
Replaces the dial planpattern and coversinbound and outbound
routing of any dialpeers
FXS Phone1-12001
Cisco Unified CMEDID: 4085552XXX
8/14/2019 CVOICE 6.0 S04 L03
31/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-31
router# test voice translation-rule 5 2015550101
Matched with rule 5Original number:2015550101 Translated number:1025550101Original number type: none Translated number type: noneOriginal number plan: none Translated number plan: none
router# test voice translation-rule 6 2015550101
Error: Ruleset 6 not found
router# test voice translation-rule 5 2125550101
2125550101 Didn't match with any rules
Verifying Translation Rules and Profiles
8/14/2019 CVOICE 6.0 S04 L03
32/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-32
router# show voice translation-rule 1Translation-rule tag: 1
Rule 1:
Match pattern: ^555\(....\)
Replace pattern: 444\1
Match type: none Replace type: none
Match plan: none Replace plan: none
Rule 2:
Match pattern: 777
Replace pattern: 888
Match type: national Replace type: unknown
Match plan: any Replace plan: isdn
router# show voice translation-profile
Translation Profile: mytranslation
Rule for Calling number:
Rule for Called number: 1
Rule for Redirect number:
Verifying Translation Rules and Profiles(Cont.)
8/14/2019 CVOICE 6.0 S04 L03
33/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-33
WAN
PSTN 2XXX
3XXX
5125551234
281555XXXX408555XXXX
num-exp 4 7135554dial-peer voice 4000 pots
destination-pattern 7135554forward-digits allport0/1:23
dial-peer voice 3000 voipdestination-pattern 3
session target ipv4:10.10.0.1dial-peer voice 3001 potsdestination-pattern 3prefix 12815553preference 1port 0/1:23
dial-peer voice 911 potsdestination-pattern 911no digit-strip
port 0/1:23
dial-peer voice 3000 pots
destination-pattern 3forward-digits 4port 0/0:23
4XXX713555XXXX
1XXX
0/0
San Jose
Houston
0/0
0/1
10.10.0.1
Configuring Basic Digit Manipulation
8/14/2019 CVOICE 6.0 S04 L03
34/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-34
Configuring Translation Rules
PSTN
voice translation-rule 1rule 1 /^4085552/ /2/
voice translation-profile pstn-intranslate called 1
voice-port 0/1:23
translation-profile incoming pstn-indial-peer voice 2001 pots
destination-pattern 2001port 1/0/0
Dials: 4085552001
FXS Phone1-12001
DID: 4085552XXX
0/1 1/0/0
8/14/2019 CVOICE 6.0 S04 L03
35/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-35
Summary
Digit manipulation is the task of adding or subtracting digits fromthe original dialed number to accommodate user dialing habits orgateway needs.
Digit stripping strips off any outbound digits that explicitly match
the destination pattern of a particular dial peer. Digit forwarding specifies the number of digits that must be
forwarded to the telephony interface.
Digit prefixing adds digits to the front of the dial string before it isforwarded to the telephony interface.
Number expansion is applied globally to all calls, not just to callsmatching a single designated dial peer.
8/14/2019 CVOICE 6.0 S04 L03
36/37
2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.04-36
By default, when the terminating router matches a dial string to anoutbound POTS dial peer, the router strips off the left-justifieddigits that explicitly match the destination pattern.
You can use the clid command to modify caller ID information.
Digit translation is a two-step configuration process.
You can use voice translation profiles to replace the Cisco UnifiedCommunications Manager Express dialplan-pattern.
Configuring digit manipulation may require the use of basiccommands as well as voice translation rules and profiles.
Summary (Cont.)
8/14/2019 CVOICE 6.0 S04 L03
37/37