Voice Translation Rules v2

21
Voice Translation Voice Translation Rules Rules Digit manipulation using translation rules and voice translation rules in Cisco IOS

description

d

Transcript of Voice Translation Rules v2

Page 1: Voice Translation Rules v2

Voice Translation RulesVoice Translation RulesDigit manipulation using translation rules and

voice translation rules in Cisco IOS

Page 2: Voice Translation Rules v2

Presentation GoalPresentation Goal

The Goal of this presentation is to provide the team with fundamental understanding

of digit manipulation using Translation rules and Voice Translation rules.

Page 3: Voice Translation Rules v2

Learning objectivesLearning objectives

At the end of the presentation you should be able to:

Identify the difference between a translation rule and a voice translation rule.

Implement, test and troubleshoot the different methods of digit manipulation outlined in the presentation.

Page 4: Voice Translation Rules v2

VocabularyVocabulary

Automatic Number Identification (ANI) – This is the “Calling Number”.

Dialed Number Identification Service (DNIS) – This is the “Called Number”.

Translation Rule – A basic method of digit manipulation based on a matched string.

Voice Translation Rule – A more advanced method of digit manipulation using regular expressions.

Page 5: Voice Translation Rules v2

Why we need digit manipulationWhy we need digit manipulation

Digit manipulation is used to help manage our number plans.

Different PSTN providers may provide different quantities of digits to different sites. This could lead to overlaps in DN ranges between sites. So we use the various methods of digit manipulation to standardize them.

In this presentation we will only cover IOS (Voice) translation rules.

Page 6: Voice Translation Rules v2

IOS Translation RulesIOS Translation Rules

How we use translation rulesWe use them to expand 5 digit extensions

to the full 10 digit extension that is on the phone.

We only use them in SRST and H.323 dial peers.

We can only have a max of 10 rules configured for 1 translation rule.

Page 7: Voice Translation Rules v2

IOS Translation Rules cont.IOS Translation Rules cont.

A translation rule consists of 3 partsThe translation rule itself:Translation-rule 1The rules that make up the translation

rule:Rule 0 ^7…. 904987 Where the translation rule is applied:Voice-port 3/0:23Translate called 1

Page 8: Voice Translation Rules v2

IOS Translation Rules cont.IOS Translation Rules cont.

The rule below takes an inbound 5 digit called number and expands it to a full 10 digits

ConfigurationTranslation-rule 1Rule 0 ^7…. 904987Rule 1 ^4…. 904464

Voice-port 3/0:23Translate called 1

Verification –FLJVFB401R1#test translation-rule 1 77486The replaced number: 9049877486

Page 9: Voice Translation Rules v2

IOS Translation Rules cont.IOS Translation Rules cont.

Implementing translation rules on our network

translation-rule 1 - defines the translation rule Rule 0 ^3 561393 - individual rules that are specified for translation-rule 1 Rule 1 ^15 1002015 Rule 9 ^2 561362~config removed~call-manager-fallback -SRST configuration where the translation rule is applied ~config removed~transfer-pattern 3.... transfer-pattern 561393.... transfer-pattern 100201.... transfer-pattern 9T transfer-pattern 561362.... transfer-pattern 2....translate called 1 - applies the translation-rule 1 to the callED number and expands it

according to the translation rule~config removed~

Page 10: Voice Translation Rules v2

Voice Translation RulesVoice Translation Rules

Voice Translation Rules are used in the same manner as Translation Rules but they allow for a more granular manner of digit manipulation for the following reasons:

They use regular expressions.They allow up to 15 rules to be specified

per voice translation rule.Configured in 4 parts similar to translation

rules.

Page 11: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

Using voice translation rules requires an understanding of regular expressions.

Page 12: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

The 4 parts of a voice translation rule are:The voice translation rule.The rules that make up the voice

translation rule.The profile that defines where the rule

manipulates the digits. Lastly where the profile is applied.

Page 13: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

A basic voice translation rule.This will match any 4 digit string that starts with a

2 and then replace it with 9120212012

Voice translation-rule 1 -Defining the Voice Translation Rulerule 1 /^2…/ /912012012/ -The rule that dictates the matches and what to do

Voice-translation-profile OutgoingCalled -Defining the voice translation profile that will be appliedtranslate called 1 -Which voice translation rule to match on and where to apply

Dial-peer voice 100 potsdestination-pattern 2…port 3/0:23translation profile outgoing OutgoingCalled -Which profile to apply and whether to apply to incoming or outgoing

Page 14: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

Using voice translation rules requires an understanding of regular expressions.

(they use this crazy table)

Voice Translatio Rule Operators Description

^ Matches the expression at the start of the line.

$ Matches the expression at the end of the line.

/ Delimiter that the marks the start and end of both the matching and replacment strings.

\ Escapes the meaning of the next character.

-Indicates a range when not in the first or last position. This is typically used with the [and] to indicate a range.

[list] Matches a single character specified in a list.

[^list] Does not match a single character specified in a list.

. Matches any single character.

* Repeats the previous regular expression zero or more times

+ Repeats the previous regular expression one or more time

?Repeats the previous regular expression zero or one occurrence of the previous expression. (Use Ctrl-V ? To enter in IOS)

() Groups digits into sets

& Brings all the matched digits into the replacement string

Page 15: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

Regular expressions can be complex and confusing. Some things to keep in mind are:

Begin and end any match or replacement string with “/”rule 1 /1234/ /5678/

The match string can be made up of an explicitly defined string or wildcards, the replacement string cannot contain any wildcards.

Use the “^” to match from the beginning of a string.rule 3 /^7…./ /9048675309/

Use the “$” to match from the end of a string.rule 2 /^4.\(4….$\)/ /90446\1/

The “(\)” escapes the next character in the string./^3\(…\)/ /345\1/

Page 16: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

If you want to match a wild card and not change them create a set.

rule 4 /^3\(…\) /4\1/ Any digits that are in the match string but are not explicitly

matched by the match string are carried over to the match string unchanged.

The following slide has examples of some regular expressions used in voice translation rules.

Page 17: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

Voice translation-rule 1Rule 1 /^$/ /8776754345/ - matches a null string and replaces it with 8776754345

Rule 2 /^987\(.+\)/ /464\1/ - matches 987 something and prepends the set (.+) with with 464

Rule 3 /^\(770\)\(….\)/ /678\2/ - matches 770 then prepends 678 to the second set (….)

Rule 4 /\(^…\)464\(….\)/ /\1987\2/ - changes the middle of the number from 464 to 987

Rule 5 /\(^.*\)7399/ /\15309/ - matches on the beginning of a number and replaces the end

Page 18: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

How we use Voice Translation rules on our network.Voice translation-rule 1Rule 1/^105110….$/ /9089872345/ - matches the nonDID range and replaces it with the BTN

Rule 2 /\^904\)1.1\(….\)/ /\1987\2/ - matches on the NPA of the site and the first pseudo number range

Rule 3 /^..$/ /9089872345/ - matches on the intercom line if it tries to make an offnet call during SRST

These are applied as outgoing to the voice translation-profile then that profile is associated to the SRST config.

Page 19: Voice Translation Rules v2

Voice Translation Rules cont.Voice Translation Rules cont.

How do we verify the Translation Rules and Voice Translation Rules?

To test a translation rule from the IOS CLI

test translation-rule 1 77486 - the “1” specifies which translation rule to test against; 77486 is the the number used to test the rule

The replaced number: 9049877486

To test a voice translation rule from the IOS CLItest voice translation-rule 3 4642946 - the “3” specifies which translation rule to test against; 4642946 is

Matched with rule 2 the number used to test the rule

Original number: 4642946 Translated number: 9044642946Original number type: none Translated number type: noneOriginal number plan: none Translated number plan: none

Page 20: Voice Translation Rules v2

SummarySummary

(Voice) translation rules can be used in the IOS to manipulate the digits in a call.

Voice translation rules use regular expressions to match digits.

Page 21: Voice Translation Rules v2

For your reading pleasureFor your reading pleasure

Regular-expression tutorial.http://www.regular-expressions.info/

Voice Translation Rules.http://www.cisco.com/en/US/tech/tk652/tk90/technologies_tech_note09186a0080325e8e.shtml

Using IOS Translation Rules - Creating Scalable Dial Plans for VoIP Networks.

http://www.ciscosystems.com/en/US/tech/tk652/tk90/technologies_configuration_example09186a0080094681.shtml