Page tree
Skip to end of metadata
Go to start of metadata

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 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.

You then have to activate/verify the domain at Microsoft. This can be done with the following steps:

  1. Log on to and enter the FQDN there. Make a note of the TXT name / TXT value.
  2. Enter "TXT name" / "TXT value" on the DNS server of the corresponding domain
  3. Again, log on to and click on "Verify"

Step 2

Please enter the following DNS entries for the corresponding domain:

Step 3

Activate Skype for Business online service:

  1. At select "Skype for Business" and click on "Next"
  2. Then click on "Update DNS settings" and click on “Verify"
  3. 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 as the domain, resulting in the FQDN for the PBX). After that, it is preferable to activate "Use Let's Encrypt certificate".


  1. Create an A record on the DNS server that points to the IP of the PBX
  2. Restart the PBX
  3. It may take a while until the switchboard is reachable under the new FQDN (depending on the TTL settings on the DNS)
  4. 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, the user on the PBX must be named hans.example.
  5. 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

  1. Connect to the Skype for Business Server
    1. Open Powershell as administrator
    2. Create a Skype for Business session
    3. 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.

    4. Create Credentials object (credentials of a Microsoft 365 admin are required)

      $userCredential = Get-Credential
    5. Create a session on the Skype for Business server

      $sfbSession = New-CsOnlineSession -Credential $userCredential
      Import-PSSession $sfbSession
  2. Create PSTN gateway
    1. 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.

    2. The following command can be used to check the configuration:

  3. Set up voice routing and corresponding policy
    1. Create PSTN usage

      Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="Unrestricted"}
    2. Create route, the value MSTEAMS_URL will be given to you

      New-CsOnlineVoiceRoute -Identity "Unrestricted" -OnlinePstnGatewayList MSTEAMS_URL -Priority 1 -OnlinePstnUsages "Unrestricted" -NumberPattern ".*"
    3. check the route

    4. Create a user routing policy

      New-CsOnlineVoiceRoutingPolicy "Unrestricted" -OnlinePstnUsages "Unrestricted"
    5. Check the user routing policy

  4. 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.

    1. 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
      TELEPHONE NUMBER = telephone number from the MS Teams - SIP trunk in international format (e.g. +41415414141)

    2. Assign the user routing policy

      Grant-CsOnlineVoiceRoutingPolicy -Identity OFFICE365_USER -PolicyName "Unrestricted"

      OFFICE365_USER = username of the Microsoft 365 account (for example

Step 7

Obtain MS Teams UUID per user

  1. New PowerShell session, connect to Azure Active Directory:

    Import-Module AzureAD
  2. Obtain the ObjectId per user:

    Get-AzureADUser -ObjectId "user@domain"

    Output as follows:

    ObjectId DisplayName UserPrincipalName UserType
    -------- ----------- ----------------- --------
    abcabcab-abca-abca-abca-abcabcabcabc Hans Beispiel Member
  3. 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:

  1. Open the URL, Menu -> Azure Active Directory >App Registrations
  2. New registration, name: wwcomteamsbridge
  3. Only accounts in this organisation directory
  4. Redirect URI
  5. 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"
  6. API permissions: User.Read, Presence.Read, Presence.ReadAll
  7. Then log the PBX on to the Microsoft environment to enable presence matching:
  8. Go to
  9. Enter access data
  10. 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".

  • No labels