Please follow the instructions below for the initial integration of Microsoft Teams into our telephone system. If you have any questions or comments, you can contact us via support@wwcom.ch or +41 41 541 41 41.
Requirements for the integration of Microsoft Teams
- Microsoft 365 E5 licence or
- Microsoft 365 E3, with "Phone System" licence or
- Microsoft 365 Business Standard, with "Business Voice" licence
- Compatible from wwcommunicator Version KVM302
Step 1
First, you have to define a Teams domain, usually as a subdomain of the main domain (e.g. teams.wwcom.ch).
You then have to activate/verify the domain at Microsoft. This can be done with the following steps:
- Log on to https://admin.microsoft.com/AdminPortal/Home#/Domains and enter the FQDN there. Make a note of the TXT name / TXT value.
- Enter "TXT name" / "TXT value" on the DNS server of the corresponding domain
- Again, log on to https://admin.microsoft.com/AdminPortal/Home#/Domains and click on "Verify"
Step 2
Please enter the following DNS entries for the corresponding domain:
- sip IN CNAME sipdir.online.lync.com.
- lyncdiscover IN CNAME webdir.online.lync.com.
- _sip._tls 3600 IN SRV 100 1 443 sipdir.online.lync.com.
- _sipfederationtls._tcp 3600 IN SRV 100 1 5061 sipfed.online.lync.com.
Step 3
Activate Skype for Business online service:
- At https://admin.microsoft.com/AdminPortal/Home#/Domains select "Skype for Business" and click on "Next"
- Then click on "Update DNS settings" and click on “Verify"
- After that, "Healthy" should appear in the overview for your corresponding subdomain
Step 4
Please assign the correct Microsoft licences to all users.
MS licences
- Enterprise licences require either an E5 license (no additional licence required) or an E3 licence with Phone System add-on (and, if conferencing is required, Audio Conferencing add-on)
- For Microsoft 365 Business licences, the Business Voice licence is also required per use
Step 5
In wwcommunicator under "PBX settings", activate the option "Teams compatibility mode". Also make sure that "Allow TLS" and "Allow SRTP" have been enabled. In addition, the domain must be set the same as the Teams domain. The hostname can be chosen freely (e.g. pbx as hostname and examplecompany.ch as the domain, resulting in the FQDN pbx.examplecompany.ch for the PBX). After that, it is preferable to activate "Use Let's Encrypt certificate".
- Create an A record on the DNS server that points to the IP of the PBX
- Restart the PBX
- It may take a while until the switchboard is reachable under the new FQDN (depending on the TTL settings on the DNS)
- Create all users on the PBX. Important: the username must be identical to the Microsoft 365 username (without @domain). Example: if the Microsoft 365 user is hans.example@examplecompany.ch, the user on the PBX must be named hans.example.
- For each Teams user, the option "Microsoft Teams user" must be activated after creation and the telephone number with which the user will be linked in the Teams environment must be entered under "MS Teams telephone number"
Step 6
Connect PBX and activate users
- Connect to the Skype for Business Server
- Open Powershell as administrator
- Create a Skype for Business session
- Import the Skype for Business module
Import-Module SkypeOnlineConnector
If an error occurs during this step, it could be that the "Skype for Business online connector module" is not pre-installed on your Windows system. You can find information about the installation in the official Microsoft manual.
Create Credentials object (credentials of a Microsoft 365 admin are required)
$userCredential = Get-Credential
Create a session on the Skype for Business server
$sfbSession = New-CsOnlineSession -Credential $userCredential Import-PSSession $sfbSession
- Create PSTN gateway
Create gateway and connect direct routing service
New-CsOnlinePSTNGateway -Fqdn MSTEAMS_URL -MaxConcurrentSessions 100 -Enabled $true -ForwardPai $true -ForwardCallHistory $true
You will now be asked for the SipSignalingPort (PORT_VON_SBC). Enter 5061 here.
The following command can be used to check the configuration:
Get-CsOnlinePSTNGateway
- Set up voice routing and corresponding policy
Create PSTN usage
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="Unrestricted"}
Create route, the value MSTEAMS_URL will be given to you
New-CsOnlineVoiceRoute -Identity "Unrestricted" -OnlinePstnGatewayList MSTEAMS_URL -Priority 1 -OnlinePstnUsages "Unrestricted" -NumberPattern ".*"
check the route
Get-CsOnlineVoiceRoute
Create a user routing policy
New-CsOnlineVoiceRoutingPolicy "Unrestricted" -OnlinePstnUsages "Unrestricted"
Check the user routing policy
Get-CsOnlineVoiceRoutingPolicy
Activate user
Now, in order for a user to be activated and assigned a number, they must have already been created in the Microsoft 365 admin portal. For additional users, only the activation and assignment of the voice routing policy is necessary. The previous steps are no longer necessary.
Activate user, assign telephone number and voicemail box
Set-CsUser -Identity OFFICE365_USER -OnPremLineURI tel:TELEPHONENUMBER -EnterpriseVoiceEnabled $true -HostedVoiceMail $true
OFFICE365_USER = Username of the Microsoft 365 account (e.g max.muster@pbx.wwcom.ch
TELEPHONE NUMBER = telephone number from the MS Teams - SIP trunk in international format (e.g. +41415414141)Assign the user routing policy
Grant-CsOnlineVoiceRoutingPolicy -Identity OFFICE365_USER -PolicyName "Unrestricted"
OFFICE365_USER = username of the Microsoft 365 account (for example max.muster@pbx.wwcom.ch
Step 7
Obtain MS Teams UUID per user
New PowerShell session, connect to Azure Active Directory:
Import-Module AzureAD Connect-AzureAD
Obtain the ObjectId per user:
Get-AzureADUser -ObjectId "user@domain"
Output as follows:
ObjectId DisplayName UserPrincipalName UserType -------- ----------- ----------------- -------- abcabcab-abca-abca-abca-abcabcabcabc Hans Beispiel hans.beispiel@beispiel.ch Member
- Enter the ObjectId in the "MS Teams UUID" field on the PBX
Step 8
Next step: Connect the PBX to Azure so that the Graph API can be accessed:
- Open the URL https://portal.azure.com/, Menu -> Azure Active Directory >App Registrations
- New registration, name: wwcomteamsbridge
- Only accounts in this organisation directory
- Redirect URI https://pbx.examplecompany.ch/oauth/
- Certificates & secrets: Generate client key and save the public key under "PBX Settings"->"Teams App Key", as well as copy the App ID and save it under"Teams App id"
- API permissions: User.Read, Presence.Read, Presence.ReadAll
- Then log the PBX on to the Microsoft environment to enable presence matching:
- Go to https://pbx.examplecompany.ch/oauth/
- Enter access data
- Confirm access rights
Step 9
Define MS Teams status mapping via wwcommunicator:
You can find more settings options for wwcommunicator in this wiki in the section "wwcommunicator".