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 email@example.com 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
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"
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.
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
Please assign the correct Microsoft licences to all users.
- 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
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 firstname.lastname@example.org, 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"
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
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)
Create a session on the Skype for Business server
- Create PSTN gateway
Create gateway and connect direct routing service
You will now be asked for the SipSignalingPort (PORT_VON_SBC). Enter 5061 here.
The following command can be used to check the configuration:
- Set up voice routing and corresponding policy
Create PSTN usage
Create route, the value MSTEAMS_URL will be given to you
check the route
Create a user routing policy
Check the user routing policy
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
OFFICE365_USER = Username of the Microsoft 365 account (e.g email@example.com
TELEPHONE NUMBER = telephone number from the MS Teams - SIP trunk in international format (e.g. +41415414141)
Assign the user routing policy
OFFICE365_USER = username of the Microsoft 365 account (for example firstname.lastname@example.org
Obtain MS Teams UUID per user
New PowerShell session, connect to Azure Active Directory:
Obtain the ObjectId per user:
Output as follows:
- Enter the ObjectId in the "MS Teams UUID" field on the PBX
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
Define MS Teams status mapping via wwcommunicator:
You can find more settings options for wwcommunicator in this wiki in the section "wwcommunicator".