MSBA-230 · Lesson 5 of 12 · 18 min
Voice routing policies and dial plans
▶ Video coming soon A video version of this lesson is on the way.
By the fifth workshop the design had three PSTN options, and Ludovica wanted everyone in the room to be able to trace a single call from the moment someone pressed a key to the moment a phone rang somewhere else. She drew it on the whiteboard twice: once for a branch coordinator on Operator Connect dialling a pharmacy, and once for the East Branch fax machine sending a referral through the SBC. The two paths used different parts of Teams, and the difference explains most routing questions on the MS-721 exam.
This lesson covers the two pieces of configuration that shape outbound calls: dial plans, which turn what a user dials into a standard number, and, for Direct Routing only, voice routing, which decides which SBC carries the call.
E.164 and normalization
Teams works internally with phone numbers in E.164 format: a plus sign, the country code and the full national number, with no spaces, such as +15550104410. People do not dial like that. They dial seven or ten digits, a four-digit extension, a long-distance prefix, or 9 for an outside line out of old habit. Normalization converts what people dial into E.164, so that every later step can work with one consistent format.
A dial plan is a named set of normalization rules. Each rule has a pattern, written as a regular expression, and a translation. For example, a rule might match four digits beginning with 4 and translate them to the branch's full number with that extension. Rules are evaluated in order, and the first match wins.
Service and tenant dial plans
Every user has a service country dial plan, which Microsoft maintains and applies automatically based on the user's usage location. It handles the normal national dialling patterns for that country. On top of it, an administrator can create tenant dial plans for local needs such as extensions or short codes. The effective dial plan a user gets is the service plan merged with their tenant plan. A tenant dial plan can be assigned to users directly, to groups, or, for some scenarios, to a network site.
Corvallin already had a HeadOffice tenant dial plan for four-digit extensions. For the branches, Felix and Ludovica designed one dial plan per branch, so that a coordinator at the North Branch who dialled 4410 reached a North Branch colleague, and one shared rule for the five-digit branch codes that staff used to call other branches. They tested every rule with a list of real dialling habits that the branch schedulers wrote down for them, including the old habit of dialling 9 first.
# A tenant dial plan for the North Branch (fictional numbers)
$ext = New-CsVoiceNormalizationRule -Parent Global -Name "North-Ext" `
-Pattern '^(4\d{3})$' -Translation '+1555010$1' -InMemory
$nine = New-CsVoiceNormalizationRule -Parent Global -Name "Strip-9" `
-Pattern '^9(\d{10})$' -Translation '+1$1' -InMemory
New-CsTenantDialPlan -Identity "NorthBranch" -NormalizationRules @{Add=$ext,$nine}
# Test what a user would get
Get-CsEffectiveTenantDialPlan -Identity "o.corrick@corvallincare.example" |
Test-CsEffectiveTenantDialPlan -DialedNumber "4410"Routing depends on the number type
After normalization, Teams decides how to send the call to the PSTN. For a user on Calling Plans, Microsoft routes the call through its own network. For a user on Operator Connect or Teams Phone Mobile, Teams sends the call to the operator. There is nothing more to configure for these users; their number type decides the route. Only Direct Routing users need voice routing configuration, because Teams must be told which SBC to use.
This catches people out. A tenant can be full of voice routing policies, but if a user has a Calling Plan number, those policies do nothing for them. When troubleshooting a failed outbound call, the first question is always: what is this user's number type?
Voice routing for Direct Routing
Voice routing has four linked parts. A PSTN usage is simply a label, such as Satellite-Local or Fax-Outbound. A voice route links a number pattern to one or more online PSTN gateways and to one or more PSTN usages; it says, in effect, numbers that match this pattern can be sent through these SBCs, for anyone allowed this usage. An online voice routing policy is a list of PSTN usages, in order, and it is assigned to users. When a Direct Routing user dials, Teams takes the usages in their policy in order, looks for routes in each usage whose pattern matches the number, and tries those routes' gateways.
Routes have a priority, so when several routes in the same usage match a number, the one with the higher priority is tried first. A route that lists two gateways spreads calls between them and fails over if one is down. A policy that lists two usages allows a second set of routes to be tried if the first set fails. Together these give Direct Routing its flexibility: least-cost routing, regional breakout, failover and restrictions on who can call where are all built from these four parts.
| Part | What it is | Corvallin example |
|---|---|---|
| PSTN usage | A label grouping routes | Satellite-Local, Fax-Outbound |
| Voice route | Number pattern + gateways + usages + priority | All numbers via sba1 then sbc1 (Satellite-Local) |
| Online PSTN gateway | A paired SBC | sbc1, sbc2 (hosted), sba1 (satellite) |
| Online voice routing policy | Ordered list of usages, assigned to users | Satellite-Users; Fax-Devices |
# Direct Routing for the satellite office (fictional names)
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="Satellite-Local"}
New-CsOnlineVoiceRoute -Identity "Satellite-All" -NumberPattern '^\+1(\d{10})$' `
-OnlinePstnGatewayList "sba1.voice.corvallincare.example","sbc1.voice.corvallincare.example" `
-OnlinePstnUsages "Satellite-Local" -Priority 1
New-CsOnlineVoiceRoutingPolicy -Identity "Satellite-Users" -OnlinePstnUsages "Satellite-Local"
Grant-CsOnlineVoiceRoutingPolicy -Identity "r.ashby@corvallincare.example" -PolicyName "Satellite-Users"Trunk translation and caller ID
Carriers often expect numbers in a particular format, which is not always E.164. Direct Routing can apply trunk translation rules to a gateway, changing the called and calling numbers as calls leave or enter Teams through that SBC. They are configured on the online PSTN gateway object. For example, a carrier might want outbound called numbers without the plus sign; a translation rule on the gateway removes it, without changing the dial plans users see.
Caller ID is handled separately. Caller ID policies decide what number outside parties see when a user calls, such as the user's own number, a service number, or the number withheld. These work for every connectivity option. Corvallin already used one for the head office schedulers, who show the scheduling queue's number, and planned one per branch so that clients always saw the branch's main number when a coordinator called.
Outbound calling restrictions
Some restrictions apply to every option. Outbound calling restrictions in the Teams admin center, or the dial-out policies they set, can limit users to domestic calls or block all PSTN calls, and the same controls exist for meetings. Inbound call blocking can reject calls from numbers or patterns, which helps with nuisance callers. For Direct Routing users, routing policies add finer control: a user whose policy contains only a local usage simply cannot reach numbers that need a different route.
Worked problem
The call that ignored the routing policy
During testing, Teodor gives a North Branch test user the Satellite-Users voice routing policy, expecting her calls to go through the satellite SBC. Her test calls connect normally, but the SBC logs show nothing. Why?
Show solution
- Check her number type with Get-CsPhoneNumberAssignment: it is OperatorConnect, a Tidelink number.
- Recall that voice routing policies only apply to Direct Routing numbers.
- Her calls went to Tidelink, which is correct for a branch user.
- To test the satellite routing, use a test account with a Direct Routing number from the satellite range.
Answer: The routing policy had no effect because her number was an Operator Connect number. Number type decides the route; voice routing policies only matter for Direct Routing users.
Location-Based Routing
Some countries restrict how calls may cross between the internet and the PSTN. Location-Based Routing (LBR) is a Direct Routing feature that enforces such rules by deciding, from a user's network site, whether a call may break out to the PSTN through a particular SBC. It is mainly used where regulation requires it, and it needs network sites, subnets and policies configured carefully. Corvallin had no such regulation in Canada or the United States, so LBR was not part of the design, but the MS-721 exam asks when it applies.
Testing routing before go-live
Ludovica's test plan for routing had three columns: what is dialled, what the user should reach, and the number type of the test account. For every branch and the satellite office it covered extensions, local and long-distance numbers, toll-free numbers, cross-border numbers, the old 9 prefix, an emergency test number, and a number that should be blocked. The plan was run once with test accounts before each branch's cutover and again with a real user on the day.
| Dialled | Expected result | Test account type |
|---|---|---|
| 4410 | North Branch extension 4410 | Operator Connect (North) |
| 9 followed by ten digits | Normalized to E.164, then sent to Tidelink | Operator Connect (North) |
| Ten-digit local number | Sent through sba1, then sbc1 if sba1 is down | Direct Routing (Satellite) |
| A premium-rate number | Blocked by outbound restriction | Any |
| The emergency test number | Connected with the correct address | Each type |
Teodor noticed that Test-CsEffectiveTenantDialPlan and Test-CsInboundBlockedNumberPattern let him check dial plans and blocking rules without placing a call, and he added them to his exam notes.
A worked set of normalization rules
Felix's tenant dial plan for the North Branch started with four rules, written and tested in the order shown. Patterns in Teams dial plans are regular expressions: the pattern describes the dialled string and the translation describes the result, with numbered references standing for the groups of digits captured. The table uses that notation because it is what the admin center shows.
| Rule | What staff dial | Pattern | Result |
|---|---|---|---|
| Extension | Four digits starting with 4 | ^(4\d{3})$ | The matching North Branch number in E.164 |
| Local, ten digits | 9025550188 | ^(\d{10})$ | +1 followed by the ten digits |
| Long distance | 19025550188 | ^1(\d{10})$ | +1 followed by the ten digits |
| Outside line prefix | 9 then a number | ^9(\d{10,11})$ | The number without the 9, then the rules above |
The outside line prefix rule existed only because long-serving staff had dialled 9 for thirty years and would keep doing so for months. Ludovica told Felix to keep it for a year and then review the usage reports to see whether anyone still used it.
Service codes and emergency numbers
Some short numbers must not be changed by normalization. Emergency numbers such as 911 are handled by the emergency calling design, and a normalization rule that accidentally changed 911 into something else would be dangerous. Service codes such as 211 for community services, 311 for municipal services and 811 for health advice are handled differently by each connectivity option and carrier, so they need testing for each site. Felix added all of them to the test list and confirmed with Tidelink which ones its network supported.
Rule order and testing
Teams applies the first normalization rule whose pattern matches, so order matters. A broad rule placed early can capture numbers meant for a narrower rule later. The safest approach is to put the most specific rules first, keep the list short, and test every rule with Test-CsEffectiveTenantDialPlan for a real user before go-live. Felix kept a test sheet with a column for every kind of dial string staff used, including mistakes such as an extra 1 before a local number, and ran it again after every change to the dial plan.
Ludovica also warned against copying a dial plan from another organization. Rules reflect local dialling habits and area code boundaries, and a dial plan that works in one city can turn a local call into a long distance one in another.
Common mistakes
MistakeAssigning voice routing policies to Calling Plan or Operator Connect users and expecting them to change routing.
InsteadVoice routing policies affect Direct Routing users only.
MistakeWriting normalization rules that overlap, so the wrong one matches first.
InsteadOrder rules carefully and test with Test-CsEffectiveTenantDialPlan.
MistakeFixing a carrier's number format by changing users' dial plans.
InsteadUse trunk translation rules on the gateway.
MistakeCreating a route with one gateway and no fallback.
InsteadList two gateways or add a second usage for failover.
Summary and key terms
- Teams routes numbers in E.164; dial plans normalize what users dial into E.164.
- The effective dial plan is the service country plan plus any tenant dial plan.
- Calling Plan and Operator Connect calls follow the number type; only Direct Routing uses voice routing.
- Voice routing: policy lists usages, usages group routes, routes point to gateways, with priorities.
- Trunk translation rules adjust number formats per SBC; caller ID policies set what callers see.
- Outbound restrictions and inbound blocking work for every connectivity option.
- E.164
- The international phone number format with a plus sign and country code.
- Normalization rule
- A pattern and translation that converts a dialled string into E.164.
- Tenant dial plan
- A dial plan created by an administrator and assigned to users, groups or sites.
- Effective dial plan
- The combination of service and tenant dial plans that applies to a user.
- PSTN usage
- A label that links voice routes to voice routing policies.
- Voice route
- A number pattern linked to gateways and usages, with a priority.
- Online voice routing policy
- An ordered list of PSTN usages assigned to Direct Routing users.
- Trunk translation rule
- A rule on a gateway that changes number formats for a carrier.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Which users are affected by online voice routing policies?
Show answer
Only users with Direct Routing numbers.
What wins when two normalization rules both match?
Show answer
The first matching rule in order.
Where do you change a number format that one carrier requires?
Show answer
In trunk translation rules on that gateway.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.