In Part 6 we route our onPrem SIP Trunk to Skype for Business Online and Teams using Hybrid Voice Connectivity and Direct Routing.

To be clear, we can’t and will use both the same time. Hybrid Voice Connectivity is only supported by Skype for Business Online and Teams in contrast only supports Direct routing. For Direct routing you have to use your Teams client, the SFB Client won’t work with Direct routing.

Below I will show how to configure Hybrid Voice Connectivity for Skype for Business Online and how to configure Direct routing for Teams.

Also keep in mind that Skype for Business Online will be retired on July 31, 2021 after which the service will no longer accessible. Therefore you need to use Direct routing afterwards.

  • (1.) Hybrid Voice Connectivity: Option to provide access to PSTN for users with Skype for Business Online account. On-premises Skype for Business Mediation server provides interconnectivity to PSTN.
  • (2). Direct routing: Option to provide access to PSTN for users with online Skype for Business account, Microsoft Teams license, using Microsoft Teams client. The SBC is connected to the SIP Proxy in Microsoft 365 or Office 365 without need for any on-premises software from Microsoft.

This post is split into multiple parts

Part 1 will cover the prerequisites like synchronize your onPrem users to Office 365 with Azure AD Connect.

Part 2 will cover migration from Exchange onPrem to Exchange Online and here especially Exchange Hybrid classic full.

Part 3 will cover moving user mailboxes from onPrem to Exchange Online.

Part 4 … will cover troubleshooting Exchange Hybrid

Part 5 will cover migration from Skype for Business onPrem users to Skype for Business Online and Teams.

Part 6 will cover Skype for Business Hybrid Connectivity and Teams Direct Routing

Part 7 will cover troubleshooting Skype for Business Hybrid

(1.) Configure Hybrid Voice Connectivity with Skype for Business online

As mentioned above, the Hybrid Voice Connectivity provides access to PSTN for users with a Skype for Business online account. The on-premises Skype for Business Mediation Server (Role) provides interconnectivity to PSTN and is aware of where the user account is homed to route the calls either to on-premise or Office 365.

Also keep in mind as with all hybrid environments, you have to create the user object in the on-premise AD and synchronized to the Azure AD in order that Hybrid Voice Connectivity will work.

Enabling a user for Phone System with on-premises PSTN connectivity aka Hybrid Voice Connectivity and then moving them to Skype for Business Online requires the following steps:

I will skip all above steps apart from 2. Assign a Voice Routing Policy and 5. Enable users for Enterprise Voice online and Phone System. All other steps we already finished in the previous parts of this post and in my environment.

Besides that in step 2 is an error stating that you should assign the Voice Routing Policy while the users are homed on-premise. When you want to grant the Voice Routing Policy while the user is still on-premise you will run into an error telling you Grant-CsVoiceRoutingPolicy : Voice Routing policy can only be granted to users homed in a Skype for Business Online deployment.

And in step 5 I only need to update the Line URI. The users already enabled for Enterprise Voice from on-premise, will using by default the on-premise dial plan, the update from the Voice Routing Policy doesn’t make sense as we cannot assign it on-premise and will assign it after moving the user to Skype for Business online.

So first I will create a new Voice Routing Policy with the on-premise Skype for Business Server Management Shell which will include all of my on-premise PSTN Usages. Therefore all Online Users who will have assigned this Policy, will be able for outbound calling to all of the defined routes in it.

New-CSVoiceRoutingPolicy -Identity LeinfeldenVoiceRoutingPolicy -Name LeinfeldenVoiceRoutingPolicy -PSTNUsages “Long Distance”, “Local”, “Internal”, “Allow all Calls”

To assign the new Voice Routing Policy to the Online Users we will execute the following cmdlet. And as mentioned above 🙂 , the users must be still homed in Skype for Business Online in order to assign it successfull.

Get-CsUser -Identity | Grant-CsVoiceRoutingPolicy -PolicyName LeinfeldenVoiceRoutingPolicy

To unassign a per-user voice routing policy, execute the following cmdlet:
Get-CsUser -Identity | Grant-CsVoiceRoutingPolicy -PolicyName $null

Phone System users must have a Voice Routing Policy assigned to them for calls to route successfully. This differs from on-premises business voice users who require a Voice Policy to be assigned to them to allow calls to route successfully. The Voice Routing Policy should contain PSTN usages that define authorized calls and routes for Phone System users. You can copy these PSTN usages from existing Voice Policies to new Voice Routing Policies. For more information, see New-CsVoiceRoutingPolicy.

Once a user is on Skype for Business Online and using Phone System with on-premises PSTN connectivity, two voice policies will apply to them. One is an on-premises voice routing policy that we assigned on premises. This policy can be global or user-specific and defines what PSTN usage records are associated with the user.

The other voice policy defines what calling features are available to the user; this voice policy is defined by Microsoft and is identical for all Phone System with on-premises PSTN connectivity users. It is automatically assigned to Phone System users. You can check this policy when executing the
Get-CsOnlineUser -Identity <user> | fl VoicePolicy cmdlet and is named HybridVoice.

Now we only need one more final step to successfully migrate the user to Hybrid Voice Connectivity, we need to update the Line URI for the online users.

Here you can see the number in the specific on-prem format with the separate extension number.

Change it to a unique, normalized phone number in order to use it in Skype for Business Online. (for example, +14255550200). Then click Commit.

As mentioned above, we do not need to assign a dial plan to the online users.

Skype for Business Online and Teams users will use by default the onPremDialPlan from the on-premise Skype for Business Server.


Using the Skype for Busines Online and Teams cmdlets

After moving the user to Skype for Business Online or Teams you can’t manage all settings from the on-premise Skype for Business Management Shell and have to use instead the online cmdlets.

We first need to install Teams PowerShell module on our Front End Server if not already installed.

Skype for Business Online Connector is currently part of latest Teams PowerShell Module. If you’re using the latest Teams PowerShell public release, you don’t need to install the Skype for Business Online Connector.

PS C:> Install-Module MicrosoftTeams

$cred = Get-Credential
$Session = New-CsOnlineSession -Credential $cred -Verbose
Import-PSSession $Session -AllowClobber

When running PowerShell on a Skype for Business Server, the local Skype for Business cmdlets are already loaded when you open PowerShell. You must specify the -AllowClobber parameter to allow the online cmdlets to overwrite the on-premises cmdlets with the same name.

(2.) Configure Direct Routing with Teams

As mentioned above, Direct Routing only works with the Teams Client, so the users should be still migrated to Teams only as shown in Part 5.

To determine where the user is homed – Skype for Business on-premise, Skype for Business Online or Teams, you can use the following PowerShell Online Cmdlet.

Get-CsOnlineUser -Identity <user> | fl InterpretedUserType

Skype for Business on-premise: HybridOnpremSfBUserWithTeamsLicense

Skype for Business Online: HybridOnlineSfBUserWithTeamsLicense

Teams: HybridOnlineTeamsOnlyUser

Determine Teams Upgrade settings
Get-CsOnlineUser -Identity <user> | fl teamsu*

Determine all types in the tenant
Get-CSOnlineuser | group InterpretedUserType -NoElement | ft -AutoSize

Determine all types with an existing LineURI
Get-CSOnlineuser | ?{$_.OnPremLineURI }| group InterpretedUserType -NoElement | ft -AutoSize

InterpretedUserType table · GitHub

In order to migrate to Direct Routing, there are only a few steps involved to do, except configuration of your preferred Session Border Controller (SBC) for Direct Routing. Below I will show the configuration with two different SBCs, once with AudioCodes Mediant VE SBC and once with Ferrari electronic’s Office Master Gate 5.0.

AudiCodes Mediant VE SBC

Ferrari electronic Office Master Gate 5.0

You can also set up the AudioCodes Mediant VE SBC in Hyper-V on-premise.

AudioCodes Mediant VE SBC Hyper-V VM

Provided that you migrating from Hybrid Voice with Skype for Business online, it is recommended that you remove previously configured voice routing information as follows:

Using the on-premise Skype for Business Management Shell

Get-CsUser -Identity | Grant-CsVoiceRoutingPolicy -PolicyName $null

Migrating from Office 365 Phone System with on-premises PSTN connectivity in Skype for Business Server

If a global CsVoiceRoutingPolicy is configured, it is recommended that you remove any PSTN usages associated with this global policy.

Set-CsVoiceRoutingPolicy -Identity “Global” -PstnUsages @{Remove=”Local”, “Internal”, “Long Distance”}

Now we need to configure the Voice Routing for Teams to tell Teams where to route the calls and if the specific user even is allowed to call to the PSTN.

More about Voice Routing for Microsoft Teams Direct Routing you will find here

Configure voice routing for Direct Routing

First connect to Skype for Business Online in order to configure Voice Routing for Teams.

Import-Module MicrosoftTeams
$credential = Get-Credential
$sfboSession = New-CsOnlineSession -Credential $credential
Import-PSSession $sfboSession

First we will add a new PSTN Usage configuration

Use following PowerShell command for creating an empty PSTN Usage:
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add=”Interop”}

Remove an PSTN Usage as follow:
Set-CsOnlinePstnUsage -Identity Global -Usage @{Remove=”Local”, “Allow all Calls”}

An PSTN Usage record is a policy which defines what calls are allowed for the users like allowing the user for outbound calls to the PSTN.
A Public Switched Telephone Network (PSTN) usage record specifies a class of call (such as internal, local, or long distance) that can be made by various users or groups of users in an organization. For details, see PSTN Usage Records in the Planning documentation.

Then we need to create a new Online Voice Route which we need to associate with the previously created PSTN Usage as follows.

New-CsOnlineVoiceRoute -Identity “audc-interop” -NumberPattern “^+” – OnlinePstnGatewayList -Priority 1 -OnlinePstnUsages “Interop”


Creates a new online voice route. Online voice routes contain instructions that tell Skype for Business Online / Teams how to route calls from Office 365 users to phone numbers on the public switched telephone network (PSTN) or a private branch exchange (PBX).

We also need to create a new Voice Routing Policy which we have to assign to our PSTN Usage as follows.

New-CsOnlineVoiceRoutingPolicy “audc-interop” -OnlinePstnUsages “Interop”


Creates a new online voice routing policy. Online voice routing policies manage online PSTN usages for Phone System users.

If not already done, you also have to enable the online user for Enterprise Voice with his specific line uri as follows.

Using the on-premise Skype for Business Management Shell

Set-CsUser -Identity -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI tel:+12345678901

Finally we have to assign the online user to our previously created Voice Route as follows.

Grant-CsOnlineVoiceRoutingPolicy -PolicyName “audc-interop” -Identity


Assigns a per-user online voice routing policy to one or more users. Online voice routing policies manage online PSTN usages for Phone System users.

From now on the user should be able to make outbound calls to the PSTN and also should be reachable from the PSTN under his LineURI.

Move/Migrate users to Teams

Provided, the SBC for Teams is already configured and working, if a user homed in Skype for Business Online, tries to make a call outbound to the PSTN, and is still not moved to Teams only, and further hasn’t assigned an Online Voice Routing Policy, the following message will appear apart from that in Teams there is no dial number pad seeable.

Before the move you can see, the user is still homed in Skype for Business Online and has no Online Voice Routing Policy assigned.

Provided the SBC is still configured and working, inbound calls from the PSTN to Teams will already work without further configuration, even the user is still homed in Skype for Business Online. The reason therefore is that Direct Routing only works with Teams and as the name implies 🙂 is directly connected with Teams.

In order to be able to also make outbound calls from Teams to the PSTN, we first need to move as mentioned the user to Teams only and assign him an Online Voice Routing Policy.

Therefore the user also needs a Microsoft 365 Phone System licence

Btw. moving to Skype for Business Online without this licence works for on-premises enabled Enterprise Voice users despite of this message when using SFB Hybrid Voice Connectivity.

For the move/migration we have several options.

1. We can use the Microsoft Teams admin center and here editing the Teams upgrade settings for the user and switch to Teams only.

2. You first move the user back to on-premise using the on-premise Skype for Business Server Control Panel and after that directly from on-premise to Teams (Teams only).

3. The same as above with the on-premise Skype for Business Server Control Panel you can perform with the on-premise Skype For Business Server Management Shell as shown in Part 5.

4. We can also use PowerShell with the Online Cmdlets while connected to the Office 365 tenant.

Grant-CsTeamsUpgradePolicy -PolicyName UpgradeToTeams -Identity

Disable hybrid to complete migration to the cloud


Migrate to Direct Routing

Configure Direct Routing

Configure voice routing for Direct Routing

User accounts in a hybrid environment with PSTN connectivity

Here’s what you get with Phone System