Instructions for Integrating the Virtual PBX with Your Microsoft Teams
I. Obtaining Microsoft Teams Voice Licenses
To enable the integration, you need accounts with the Phone System and AudioConferencing licenses (or a license plan no lower than E5). Without them, your Microsoft Teams cannot connect to the public telephone network, including the Virtual PBX.
Request the licenses from your Microsoft licensing provider. If needed, the provider can issue test licenses so you can try the integration features for free.
II. Obtaining a *.teams.phonesystem.ms Domain
Please Note
To perform the integration, you must obtain a domain in the *.teams.phonesystem.ms zone, which will be used to connect your Virtual PBX.Request such a domain from our manager. Usually, instead of *, your company name is used. For example, if your company is “FUTURE LLC,” you will receive the domain future.teams.phonesystem.ms.
1. Go to the Office 365 Domain Administration Center.
2. Open Settings → Domains, then select +Add domain.
3. On the page that opens, enter the domain name in the “Domain name” field and click Use this domain.
4. In the next window, choose Advanced options, then Add a TXT record to the domain’s DNS records, and click Continue.
5. In the opened window, copy the “TXT Value” in the format MS=ms96925485 and send it to your manager.
We will need some time to add this value to DNS. After we inform you that everything is ready, click Verify.
6. In the Add DNS Records window, uncheck Exchange and Exchange Online Protection, then click Continue.
7. Click Done.
III. Creating a User in Microsoft Teams
Once the domain has been added to your Office 365, create the first user under this new domain with a Phone System or E5 license, for example: login@future.phonesystem.ms (where “future” is your unique domain).
IV. Connecting the Virtual PBX SBC to Your Microsoft Teams
1. Create the SBC using the Teams PowerShell console. Run PowerShell as Administrator. To do this, install PowerShell for Microsoft Teams by running: Install-Module MicrosoftTeams
During installation, you will be asked to allow access to the PowerShell Gallery (PSGallery). Answer “Yes.”
2. Log in to the Microsoft Teams PowerShell console: $credential = Get-Credential
3. Enter your authentication credentials in the window that appears.
4. Connect to Microsoft Teams PowerShell using: Connect-MicrosoftTeams -Credential $credential
You can read more about connecting to Microsoft Teams PowerShell in the documentation.
5. Add the SBC for call routing by executing: New-CsOnlinePSTNGateway -Fqdn FUTURE.teams.phonesystem.ms -SipSignalingPort 5067 -ForwardPai $false -ForwardCallHistory $false -MediaBypass $true -Enabled $true
Replace FUTURE with your domain.
Please Note
Below is an example of routing all calls through the PBX. If you require more advanced configuration, refer to the instructions.6. Configure PSTN-Usage: Set-CsOnlinePstnUsage -Identity Global -Usage @{Add=“International”}
7. Add a Voice Route: New-CsOnlineVoiceRoute -Identity “International” -NumberPattern “.*” -OnlinePstnGatewayList customerx.teams.phonesystem.ms -Priority 1 -OnlinePstnUsages “International”
8. Add a Voice Routing Policy: New-CsOnlineVoiceRoutingPolicy “International” -OnlinePstnUsages “International”
9. Assign the Voice Routing Policy to the user. This must be done for all users who will use the integration: Grant-CsOnlineVoiceRoutingPolicy -Identity user@msteams.com -PolicyName “International”
Replace user@msteams.com here and elsewhere with the user to whom you are assigning the routing policy.
10. To verify configuration, run: Get-CsOnlineUser “user@msteams.com” | Select OnlineVoiceRoutingPolicy
V. Assigning a Number to a Teams User
To enable users to make calls, assign them a phone number in the format: +44671234567;ext=701, where:
- +44671234567 – the landline or mobile number the user will use to call the public telephone network;
- 701 – the internal extension that corresponds to the Virtual PBX extension.
To assign a phone number, use: Set-CsUser -Identity user@msteams.com -OnPremLineURI tel:+449011234567;ext=701
This command must be executed for all users who will use the Microsoft Teams telephony integration with the Virtual PBX.
VI. Audio Conferencing Setup
1. Obtain a dedicated phone number in the Microsoft Admin Center.
2. To do this, open the Microsoft Teams Admin Center.
3. Navigate to: Voice → Phone Numbers.
4. On the page that opens, click +Add and select a paid number.
5. In the window that appears, set Country or region to Russia.
6. Provide this selected number to your manager.
7. If no Russian phone number is available in the list, you must contact Microsoft or your licensing provider to obtain one.
Until you receive your dedicated number, a shared conference number will be used for audio meetings. In this case, also inform your manager that the number has not been obtained.
8. Also configure outbound call routing from conferences to the Virtual PBX:
Please Note
Below is the configuration for routing all conference numbers through the operator’s PBX. If you require more detailed routing configuration, refer to the instructions.- Configure the Audio Conferencing Routing Policy:
New-CsOnlineAudioConferencingRoutingPolicy “Policy 1” -OnlinePstnUsages “International”
- Assign this policy to a user:
Grant-CsOnlineAudioConferencingRoutingPolicy -Identity victor@cloud-pbx.com -PolicyName “Policy 1”
- In the PBX settings, create a user with the phone number that will be used to connect to the conference, and assign them the name “Conferencing.”
