You are on page 1of 37

Configuring Digit

Manipulation

Implementing Dial Plans on Voice Gateways

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-1


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), the
called number digits (DNIS), or the redirect number digits for a voice call

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-2


Digit Manipulation (Cont.)
POTS VoIP
1. Inbound voice-port translation
profile
1. Match outbound dial peer
2. Number expansion
2. Dial-peer voice translation
3. Match inbound dial peer
profile
4. CLID
3. CLID
5. Dial-peer voice translation profile
Incoming Call

VoIP POTS
1. Match outbound dial peer
1. Global voice translation profiles
2. Dial-peer voice translation
2. Number expansion
profile
3. Match inbound dial peer
3. CLID
4. CLID
4. Digit strip
5. Dial peer voice translation profile
5. Prefix digits
6. Forward digits

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-3


Digit Consumption and Forwarding

 POTS dial peers:


– By default, the router consumes the left-justified digits that
explicitly match the destination pattern and forwards the
remaining 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 5550124


dial-peer voice 1 pots dial-peer voice 1 pots
destination-pattern 555.... destination-pattern 555....
port 0/1:1 no digit-strip
port 0/1:1
Explicitly matched digits 555 are
consumed and 0124 is forwarded. Digits 555 0124 are forwarded.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-4


Digit Collection
1. The router collects digits, one at a time, until it can match an
outbound 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 voip dial-peer voice 1 pots


destination-pattern 555 destination-pattern 555....
session target ipv4:10.18.0.1 session target ipv4:10.18.0.1
dial-peer voice 2 voip dial-peer voice 2 voip
destination-pattern 5550124 destination-pattern 5550124
session target ipv4:10.18.0.2 session target ipv4:10.18.0.2

Dial peer 1 will match first. Only the Dial peer 2 will match first. The
collected digits of 555 will be collected digits of 5550124 will be
forwarded. forwarded.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-5


Digit Stripping
dial-peer voice 9 pots
destination-pattern 9T

Dialed number: Transmitted number:


92815551234 2815551234

PSTN

Dialed number: Transmitted number:


911 None!
Reorder
dial-peer voice 911 pots tone
destination-pattern 911

Dialed number: Transmitted number:


911 911

dial-peer voice 911 pots


destination-pattern 911
no digit-strip
© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-6
Digit Forwarding

dial-peer voice 1000 pots


destination-pattern 1…

Transmitted number: Dialed number:


234 1234

PBX
Ext.1234
Transmitted number: Dialed number:
1234 1234

dial-peer voice 1000 pots


destination-pattern 1…
forward-digits 4

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-7


Digit Prefixing

dial-peer voice 2001 pots


destination-pattern 2…
preference 1 PSTN
prefix 5125552 er:
b
port 0/1:23 n um
d
m itte 23
a ns 5521
Tr 25
51
1
0/
WAN is down!

Dialed number: 10.1.1.1 512-555-2123


2123 WAN
dial-peer voice 2000 voip
destination-pattern 2…
session target ipv4:10.1.1.1

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-8


Number Expansion

Dialed number: Transmitted number:


5551234 2815551234

PSTN

281-555-1234
num-exp 5551... 2815551...
dial-peer voice 2000 pots
destination-pattern 2815551...
no digit-strip
port 0/1:23

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-9


Simple Digit Manipulation for POTS
Dial Peer

User dials dial-peer voice 9 pots


913125550123. destination-pattern 9T

PSTN
Phone1-1 H.323 Gateway
2001 DID: 4085552XXX 3125550123

Command DNIS
no digit-strip 913125550123
digit-strip (default) 13125550123
forward-digits 4 0123
prefix 9 and digit-strip 913125550123

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-10


Digit Manipulation with Number
Expansion

num-exp 1... 913125550...


dial-peer voice 9 pots
destination-pattern 9T
Gateway

PSTN
2001
13125550123
1 2 3
User dials 0123. Number is expanded Phone rings.
to 13125550123 and
routed to PSTN.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-11


Caller ID Number Manipulation

The clid command is used to modify the calling number:


 clid network-number number [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 from
the CLID information and prevents the calling party number
from being presented

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-12


Caller ID Number Manipulation (Cont.)

FXS Port

WAN
0/0/0

voice-port 0/0/0
station-id name HQ Fax
station-id number 7135551003

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-13


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'

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-14


Caller ID Information (Cont.)
router(config-dial-peer)# clid network-number 5551234

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 = `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'

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-15


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'

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-16


Voice Translation Rules and Profiles

 Voice translation rules define up to 15 subrules to manipulate


digits, 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, specific
range of source IP addresses in VoIP calls, trunk groups,
NFAS controllers, or SRST

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-17


Voice Translation Rules and Profiles
(Cont.)
Profile

1 2 3 4 5

VoIP Dial Peer Called Rule 6 7 8 9 10

11 12 13 14 15
Voice Port

VoIP Incoming
1 2 3 4 5
Incoming
Source IP Group Calling Rule 6 7 8 9 10
Outgoing
Trunk Group 11 12 13 14 15

NFAS
1 2 3 4 5
SRST Redirected
Rule 6 7 8 9 10
Called
11 12 13 14 15

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-18


Voice Translation Rules and Profiles
(Cont.)
Char Description
^ Match the expression at the start of a line.
$ Match the expression at the end of the line.
/ Delimiter that marks the start and end of both the matching and replacement strings.
\ Escape the special meaning of the next character.
- Indicates a range when used within brackets.
[list] Match a single character in a list.
[^list] Do not match a single character specified in the list.
. Match any single character.
* Repeat the previous regular expression zero or more times.
+ Repeat the previous regular expression one or more times.
Repeat the previous regular expression zero or one time (use CTRL-V in order to enter
?
in IOS).
() Groups regular expressions. Use \1-9 to refer to matched groups.
& Match the substring (matched string). You may also use \0.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-19


Regular Expressions in Translation
Rules

This regex rule 1 /1…/ /4085551…/ says

match 1… and change to 4085551…

Austin San Jose


PSTN-Out
PSTN
PSTN-In

User dials “1001” to


reach a San Jose
extension but has to go
through the PSTN WAN
3XXX

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-20


Prepending Digits

\1
\ = escape character

rule 1 /\(^[2-9].........\)/ /9\1/


5125550101

PSTN

Gateway needs to
User dials 5125550101 add a 9 to route
to reach a PSTN phone. through the PSTN.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-21


Voice Translation Rule Search-and-
Replace Examples

You may use “&” or “\0”


to replace with the
original digits input.

Rule Input String Output String


/^9/ // 914085550123 14085550123
/^2001/ /3001/ 2001 3001
/^[23]…/ /4000/ 2025 or 3051 4000
/^2…/ /801&/ 2001 8012001
/^2…/ /801\0/ 2001 8012001
/.*/ /91&/ type national national 3125552001 type national 913125552001 type national

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-22


Voice Translation Rule Search-and-
Replace Examples (Cont.)
Translation Rule: /\(9\)\([^01].*\)/ /\11408\2/

Search Replace

/ \(9\) \([^01].*\) / / \1 1408 \2 /

Input Output

9 5550134 9 1408 5550134

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-23


Voice Translation Profiles

Attribute Description
called Defines the translation profile rule for the called
number.
calling Defines the translation profile rule for the calling
number.
redirect-called Defines the translation profile rule for the redirect-
called number.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-24


Translation Profile Order

Processing Order
Applied
Inbound Outbound

Voice Port/NFAS 1 4

Trunk Group/Source IP 2 3

Global 3 1

Dial Peer 4 2

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-25


Voice Translation Profile Search-and-
Replace Example
PSTN-IN

Called Rule 1 1 /^4085552/ /2/

1 /^.*/ /9&/ type subscriber subscriber


Calling Rule 2 2 /^.*/ /91&/ type national national
3 /^.*/ /9011&/ type international international

Redirected
Called voice translation-rule 1
rule 1 /^4085552/ /2/
voice translation-rule 2
rule 1 /^.*/ /9&/ type subscriber subscriber
rule 2 /^.*/ /91&/ type national national
rule 3 /^.*/ /9011&/ type international international
voice translation-profile pstn-in
translate called 1
translate calling 2

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-26


Voice Translation Profile Call Blocking
Example
BLOCK

Called

Calling Rule 1 1 reject /^408555/

Redirected
Called

voice translation-rule 1
rule 1 reject /^408555/
voice translation profile block
translate calling 1
dial-peer voice 111 pots
call-block translation-profile incoming block
call-block disconnect-cause incoming invalid_number

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-27


Voice Translation Profiles vs.
dialplan-pattern
dialplan-pattern for Cisco Unified Communications
Manager 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

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-28


Cisco Unified Communications Manager
Express with dialplan-pattern

telephony-service
dialplan-pattern 1 4085552... extension-length 4 Easy to deploy, with
dial-peer voice 2001 pots some caveats on
destination-pattern 2001 dial peers that are
port 1/0/0 not ephone-dn.

X
PSTN
1/0/0
Cisco Unified CME
Analog Phone1-1 DID: 4085552XXX 13125550123
2001
2 1
3
Analog phone will No match on User dials
not ring. 4085552001 14085552001.

*Cisco Unified CME = Cisco Unified


Communications Manager Express
© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-29
Cisco Unified Communications Manager
Express with Voice Translation Profiles
Replaces the dial plan
pattern and covers
inbound and outbound
voice translation-rule 1 routing of any dial
peers
rule 1 /^4085552/ /2/
voice translation-profile pstn-in
translate called 1
voice-port 0/0/0:23
translation-profile incoming pstn-in
dial-peer voice 2001 pots
destination-pattern 2001
port 1/0/0

PSTN
FXS Phone1-1 Cisco Unified CME 13125550123
2001 DID: 4085552XXX

3 2 1
Profile modifies DNIS User dials
Phone rings.
to 2001 14085552001.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-30


Verifying Translation Rules and Profiles

router# test voice translation-rule 5 2015550101

Matched with rule 5


Original number:2015550101 Translated number:1025550101
Original number type: none Translated number type: none
Original 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

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-31


Verifying Translation Rules and Profiles
(Cont.)
router# show voice translation-rule 1
Translation-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:

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-32


Configuring Basic Digit Manipulation
dial-peer voice 3000 pots
destination-pattern 3…
San Jose WAN forward-digits 4
port 0/0:23

1XXX 408555XXXX 281555XXXX

0/0 0/0
10.10.0.1
0/1
3XXX
num-exp 4… 7135554…
dial-peer voice 4000 pots
destination-pattern 7135554…
forward-digits all
port0/1:23 PSTN 2XXX
dial-peer voice 3000 voip
destination-pattern 3…
session target ipv4:10.10.0.1 713555XXXX 4XXX
dial-peer voice 3001 pots
destination-pattern 3…
prefix 12815553 5125551234 Houston
preference 1
port 0/1:23
dial-peer voice 911 pots
destination-pattern 911
no digit-strip
port 0/1:23
© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-33
Configuring Translation Rules

voice translation-rule 1
rule 1 /^4085552/ /2/
voice translation-profile pstn-in
translate called 1
voice-port 0/1:23
translation-profile incoming pstn-in
dial-peer voice 2001 pots
destination-pattern 2001
port 1/0/0
Dials: 4085552001

PSTN
0/1 1/0/0

DID: 4085552XXX
FXS Phone1-1
2001

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-34


Summary

 Digit manipulation is the task of adding or subtracting digits from


the original dialed number to accommodate user dialing habits or
gateway 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 is
forwarded to the telephony interface.
 Number expansion is applied globally to all calls, not just to calls
matching a single designated dial peer.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-35


Summary (Cont.)

 By default, when the terminating router matches a dial string to an


outbound POTS dial peer, the router strips off the left-justified
digits 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 Unified
Communications Manager Express dialplan-pattern.
 Configuring digit manipulation may require the use of basic
commands as well as voice translation rules and profiles.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-36


© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—4-37

You might also like