Configuration Microsoft Teams

From Wiki peoplefone (english)
Jump to: navigation, search


  • A peoplefone Account (Registration)
  • An Office 365 E3 or E5 account

How-to configure direct routing for Microsoft Teams

Set up of the domain, step 1
  • During the onboarding process, peoplefone will assign you a specific domain that must be configured in your O365 account.
    To configure them, go to your O365 portal, select on the left menu Setup → Domain and select Add domain

01 domain add.png

  • Enter the domain that you receive from peoplefone (in this example

02 domain new.png

  • Select “Add a TXT record instead”
    03 domain verify.png

  • Copy-paste this screen and send them back to peoplefone so they can setup the validation

04 domain TXTrecords.png

Set up of the domain, step 2
  • When you receive the confirmation that the TXT verification is ready from peoplefone, you must go back to this domain set up and start the verification process.
    After that you must select "I'll add the DNS records myself"

05 domain DNS.png

  • Disable all services and click Next

06 domain online services.png

  • The domain must now be ready:
    07 domain ready.png

Activation of the domain
  • When domain setup's are completed, the next step is to activate them.
    For this, we will need to add a "dummy" user (with a E3 or E5 license) to this specific domain, not the default one.
    When the setup is completed you can delete this "dummy" user.

08 domain activation.png

Direct Routing Configuration

Please note, that enabling the rules you configure on Microsoft's pages via PowerShell can take up to 48 hours.

This How-To covers the setup for a simple solution where only Teams is enabled as communication solution in your O365 account.
If you have or plan a hybrid solution with Teams and Skype for Business online or Skype on Premise, then you will need to select more parameters.

More information on:

Before starting this setup, verify that you have received the following infos from peoplefone:
sbc_nb_channels (voice channels)

In the following setup, we will use as example: (it is possible that the sbc_port is the same)
sbc_port: 6000

For this setup you will need PowerShell with the Skype Online Connector.
The following link will provide you all infos on how to install them:

  • When the PowerShell is ready, you need to load the Skype for Business Online module with:
 Import-Module LyncOnlineConnector

  • Create the session:
 $sfboSession = New-CsOnlineSession -UserName <user@domain>

  • Example:
 $sfboSession = New-CsOnlineSession -UserName

  • Load the session:
 Import-PSSession  $sfboSession

Verify wheter the user is registered in Skype for Business Online:

Get-CsOnlineUser -Identity "<User name>" | fl RegistrarPool

You must receive a non-empty location.

Assign ddi to each user with the command:

 Set-CsUser -identity <user@domain> -EnterpriseVoiceEnabled $true -HostedVoicemail $true -OnPremlineURI tel:+<ddi>

  • Example:
 Set-CsUser -identity -EnterpriseVoiceEnabled $true -HostedVoicemail $true -OnPremlineURI tel:+41582550840

  • Configure the SBC:
 New-CsOnlinePSTNGateway -Fqdn <sbc_domain> -SipSignallingPort <sbc_port> -ForwardCallHistory $true -Enabled $true -ForwardPai $true -MaxConcurrentSessions <sbc_nb_channels>

  • Example:
 New-CsOnlinePSTNGateway -Fqdn -SipSignallingPort 6000 -ForwardCallHistory $true -Enabled $true -ForwardPai $true -MaxConcurrentSessions 10

  • If you get the following error:
 Can not use the "" domain as it was not configured for this tenant.
   + CategoryInfo          : InvalidArgument : (Fqdn=31857.uctr...diaBypass=False:TrunkConfig) [New-CsOnlinePSTNGateway], ArgumentException
   + FullyQualifiedErrorId : CustomValidationFailed,Microsoft.Rtc.Management.Internal.NewOnlinePSTNGatewayCmdlet
   + PSComputerName        :

  • it can be from different reasons:
    • You activate just one user on this domain and he is still not ready. You must wait - it can take a few minutes
    • You did not activate a user
    • The domain assigned to the user is not the correct one. Double check that the domain of the dummy user is the same as the sbc_domain
    • The dummy user does not have the correct license - double check that he has an E3 or E5 license.

  • Create the PstnUsage
 Set-CsOnlinePstnUsage  -Identity Global -Usage @{Add="Peoplefone"}

  • Create an online route:
 New-CsOnlineVoiceRoute -Identity "Peoplefone" -NumberPattern ".*" -OnlinePstnGatewayList <sbc_domain> -Priority 1 -OnlinePstnUsages "Peoplefone"

  • Example:
 New-CsOnlineVoiceRoute -Identity "Peoplefone" -NumberPattern ".*" -OnlinePstnGatewayList -Priority 1 -OnlinePstnUsages "Peoplefone"

  • Create the VoIP routing policy :
 New-CsOnlineVoiceRoutingPolicy "Peoplefone" -OnlinePstnUsages "Peoplefone"

  • Grant this VoIP routing policy to the user:
 Grant-CsOnlineVoiceRoutingPolicy -Identity "<user>" -PolicyName "Peoplefone”

  • Example:
 Grant-CsOnlineVoiceRoutingPolicy -Identity "" -PolicyName "Peoplefone”

If you get an error, saying that the policy cannot be applied, this user needs to login one time into the team client

Set Teams as preferred calling client: (needed if account was migrated from Skype to Teams)
 Get-CsOnlineUser <user>| Select Teams*
TeamsMeetingPolicy  :
TeamsCallingPolicy : AllowCalling
TeamsInteropPolicy : DisallowOverrideCallingTeamsChatTeams
TeamsMessagingPolicy  :
TeamsUpgradeEffectiveMode  : Islands
TeamsUpgradeNotificationsEnabled  : False
TeamsUpgradePolicyIsReadOnly  : None
TeamsUpgradePolicy  :
TeamsCortanaPolicy  :
TeamsOwnersPolicy  :
TeamsMeetingBroadcastPolicy  :
TeamsUpgradeOverridePolicy  :
TeamsVideoInteropServicePolicy  :
TeamsWorkLoadPolicy  :

Check and fix the Interop Policy & Calling Policy

 Grant-CsTeamsUpgradePolicy -PolicyName DisallowOverrideCallingTeamsChatTeams -Identity <user@domain>

 Grant-CsTeamsCallingPolicy -PolicyName AllowCalling -Identity <user@domain>

Example forf how to set a specific user as Anonymous:
  • Create an anonymous policy:
 New-CsCallingLineIdentity  -Identity Anonymous -Description "Anonymous policy" -CallingIDSubstitute Anonymous -EnableUserOverride $false

  • Assign the policy to the user:
 Grant-CsCallingLineIdentity -Identity "<user>" -PolicyName Anonymous

PowerShell Command for an overview of the configuration of a single user

Get-CsOnlineUser -Identity "<identity>" | Format-List -Property FirstName, LastName, EnterpriseVoiceEnabled, HostedVoiceMail, LineURI, UsageLocation, UserPrincipalName, WindowsEmailAddress, SipAddress, OnPremLineURI, OnlineVoiceRoutingPolicy

Other Informations

How can caller ID be used in your organization?

Set the Caller ID for a user


This How-To is based on the Microsoft documentation version published 27.06.2018 (GA)
You can find more info on the following links: