As per this week’s announcement, Microsoft Phone System Direct Routing is now in public preview!
What does this mean?
In essence, this means that it is now possible to configure a SIP Trunk directly from a supported on-premises Session Border Controller (SBC) to Microsoft Teams via the internet.
To understand how this fits into the overall picture, the diagram below outlines the main components that come together to enable PSTN connectivity for Office 365 in Australia. This diagram assumes I do not have an on-premises Skype for Business server deployed, and simply want to enable voice services for users homed within Office 365 with minimal on-premises infrastructure:
To summarise what options are available today:
Microsoft Cloud Connector edition was a great way to enable PSTN connectivity for Skype for Business Online users, particularly as native cloud calling plans are only now available in Australia. However, CCE will support PSTN connectivity for Skype for Business Online only, not Microsoft Teams. The other key differentiator with Direct Routing is that I no longer need to deploy the Cloud Connector Edition virtual machines as well as an SBC to provide connectivity to the Office 365 cloud: a certified SBC is all that is required.
Another major difference with Direct Routing is that it can be deployed side by side with Telstra Calling for Office 365 Calling Plans. This means we now have greater flexibility in deployment options: I can choose to have some calls route via on-premises infrastructure, and other calls to route to the PSTN network direct from the cloud via Telstra Calling. This is useful in environments where I may want to route some calls to existing on-premises infrastructure (call centres, analogue endpoints, other 3rd party telephony infrastructure), but have the bulk of my organisation’s PSTN calls route via a Telstra Calling Plan (ignore “Microsoft Calling Plan” in the diagram below, in Australia it’s known as a Telstra Calling Plan):
Now that there are two ways I can route calls to the PSTN from Microsoft Teams at the same time, how do I control what routes where?
Using this approach, users are configured to route all their calls via Direct Routing or via a Telstra Calling Plan. In this example, one user is assigned a Calling Plan (pure cloud), the other a Direct Routing policy (via on-premises SBC):
Using this approach, calls are routed via Telstra Calling plan or Direct Routing based on the number dialled. For example, if I dial extensions associated with an on-premises call centre, these route via Direct Routing, all other calls via a Telstra Calling Plan:
In the above example, calls route one of two ways depending on the number dialled. But what’s the logic? How does it “know” to route via a calling plan if Direct Routing fails to mind a match? The following diagram outlines the decision tree when a user makes a phone call. As long as the user is licensed for Telstra Calling from within the Office 365 portal, the call will automatically route if no matching Direct Routes are found:
In this section, I will walk through end to end configuration that enables Direct Routing with Microsoft Teams from an on-premises SIP Trunk, via a Ribbon SBC Edge 1000. This section assumes you have an intimate knowledge of Ribbon SBC configuration!
The following diagram gives a good overview of all the requirements needed to enable Direct Routing:
For more details on planning and configuring direct routing, check out the following Microsoft Docs:
$acctName=admin@domain.onmicrosoft.com
$sfboSession = New-CsOnlineSession -UserName $acctName
Import-PSSession $sfboSession
New-CsOnlinePSTNGateway -Fqdn teamstrunk.insynctechnology.com.au -SipSignallingPort 5061 -MaxConcurrentSessions 10 -ForwardCallHistory $true -Enabled $true
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="Australia"}
New-CsOnlineVoiceRoute -Identity "AU-Emergency" -NumberPattern "^+000$" -OnlinePstnGatewayList teamstrunk.insynctechnology.com.au -Priority 1 -OnlinePstnUsages "Australia"
New-CsOnlineVoiceRoute -Identity "AU-Service" -NumberPattern "^\+61(1\d{2,8})$" -OnlinePstnGatewayList teamstrunk.insynctechnology.com.au -Priority 1 -OnlinePstnUsages "Australia"
New-CsOnlineVoiceRoute -Identity "AU-National" -NumberPattern "^\+61\d{9}$" -OnlinePstnGatewayList teamstrunk.insynctechnology.com.au -Priority 1 -OnlinePstnUsages "Australia"
New-CsOnlineVoiceRoute -Identity "AU-International" -NumberPattern "^\+(?!(61190))([1-9]\d{9,})$" -OnlinePstnGatewayList teamstrunk.insynctechnology.com.au -Priority 1 -OnlinePstnUsages "Australia"
New-CsOnlineVoiceRoutingPolicy "Australia" -OnlinePstnUsages "Australia"
Ensure the following general node level setting have been configured:
Note: Don't expect a valid ICMP response, all we care about is a valid DNS resolution (the above example shows a successful resolution).
The SIP Trunk I’ll be configuring between the SBC and Microsoft Teams must be a secure TLS trunk. To support this, a public certificate is required.
After receiving the certificates from the certification authority, install the SBC certificate and the Root/Intermediate certificates:
The Microsoft Phone System Hybrid Voice Connectivity Interface has DNS name sip.pstnhub.microsoft.com. This interface uses a public certificate provided by Cyber Baltimore CyberTrust Root, which will also need to be trusted by your SBC:
The TLS profile defines the crypto parameters for the SIP protocol. To create a new TLS profile:
|
Parameter |
Value |
|
Description |
MS Phone System TLS Profile |
|
TLS Protocol |
TLS 1.2 Only |
|
Validate Client FQDN |
Disabled |
SIP profiles allows configuring such parameters as SIP Headers customizations, options tags etc.
|
Parameter |
Value |
|
Description |
MS Phone System SIP Profile |
|
FQDN in From Header |
Sonus SBC FQDN |
|
FQDN In Contact Header |
Sonus SBC FQDN |
|
Origin Field name |
Ribbon SBC FQDN |
The Media Crypto Profile defines the encryption mechanism to use between the SBC and Microsoft Phone System Interface. To add a Media Crypto Profile:
|
Parameter |
Value |
|
Description |
MS Phone System Media Crypto Profile |
|
Operation Option |
Supported |
|
Crypto Suite |
AES_CM_128_HMAC_SHA1_80 |
The Media List defines the codecs and if the crypto mechanism will be used. To create a media Profile:
|
Parameter |
Value |
|
Description |
MS Phone System Media List |
|
Media Profiles List |
Default G711a Default G711u |
|
Crypto Profile ID |
MS Phone System Media Crypto Profile |
The SIP server table defines the information about the SIP interfaces connected to the Sonus SBC. To add a new SIP Server Table:
|
Parameter |
SBC 1 |
SBC 2 |
SBC 3 |
|
Priority |
1 |
2 |
3 |
|
Host |
sip.pstnhub.microsoft.com |
sip2.pstnhub.microsoft.com |
sip3.pstnhub.microsoft.com |
|
Port |
5061 |
5061 |
5061 |
|
Protocol |
TLS |
TLS |
TLS |
|
TLS Profile |
Microsoft Phone System |
Microsoft Phone System |
Microsoft Phone System |
|
Monitor |
SIP Options |
SIP Options |
SIP Options |
If you’ve made it this far, I would assume you are already familiar with transformation and routing table configuration. For completeness sake, here’s the ones I created for my test Direct Routing number:
You will need to route calls both to and from your Microsoft Teams Direct Routing trunk:
To create a new signalling group:
|
Parameter |
Value |
|
Description |
MS Phone System |
|
Call Routing Table |
From MS Phone System |
|
No. of Channels |
10 |
|
SIP Profile |
MS Phone System SIP Profile |
|
SIP Server Table |
MS Phone System Sip Server Table |
|
Load Balancing |
Priority |
|
Media List ID |
MS Phone System Media List |
|
Signalling Media/Private IP |
Ethernet 1 (whichever port you’re using to route to/from Office 365) |
|
Outbound NAT Traversal |
Static NAT |
|
NAT Public IP (Signalling/Media) |
121.50.209.233 |
|
Listen Port |
Port: 5061 Protocol: TLS TLS Profile ID: MS Phone System TLS Profile |
|
Federated IP/FQDN |
sip.pstnhub.microsoft.com sip2.pstnhub.microsoft.com sip3.pstnhub.microsoft.com sip-all.pstnhub.microsoft.com |
Note: Make sure to add sip-all.pstnhub.microsoft.com to the Federated IP/FQDN list. In testing, I was receiving SIP invites from IP addresses that were not resolvable via the three Microsoft documented “pstnhub” FQDNs. This meant that every third inbound call to Microsoft Teams would fail as the source IP was unknown. adding this additional record was the solution.
Once this has been created, confirm you are sending and receiving SIP Options and 200 OK responses in both directions:
Now that the SBC configuration has been completed, we can now enable our Microsoft Teams users for calls via Direct Routing.
If you are still sporting a hybrid Skype for Business environment, it’s only supported to enable users for Direct Routing with Teams if they are homed in Office 365. To check this, run the following cmdlet and ensure the Registrar Pool fqdn ends in “infra.lync.com:
Get-CsOnlineUser -Identity "Patrick Bateman" | fl RegistrarPool
Your users will need to be licensed for Microsoft Phone System in order to enable calls within Microsoft Teams. To check:
Connect-MsolService
(Get-MsolUser -UserPrincipalName patrick.bateman@insynctechnology.com.au).Licenses.ServiceStatus
The following cmdlet will enable the user for Phone System calling, enable Azure Voicemail, and configure their phone number:
Set-CsUser -Identity patrick.bateman@insynctechnology.com.au -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI tel:+61799999999
The final step is to assign the Online Voice Routing Policy we created earlier to the user. To do this:
Grant-CsOnlineVoiceRoutingPolicy -Identity "patrick.bateman@insynctechnology.com.au" -PolicyName Australia
To Check everything has been configured correctly, run the following:
Get-CsOnlineUser -Identity "patrick.bateman@insynctechnology.com.au" | Format-List -Property FirstName, LastName, EnterpriseVoiceEnabled, HostedVoiceMail, LineURI, UsageLocation, UserPrincipalName, WindowsEmailAddress, SipAddress, OnPremLineURI, OnlineVoiceRoutingPolicy
A lot of the diagrams for this post came from a great video available on YouTube. Check it out here: Office 365 Microsoft Teams Direct Routing Deep Dive.
I hope you find this post useful. As usual, ping me with any questions or queries, always happy to help.