Dear visitor,
VoIPLine Telecom uses latest technologies in web development. Unfortunately your web browser is not supported and some parts of our we site may not be displayed correctly. Below are links to the latest versions of Google Chrome, Mozilla Firefox and MS Edge browser.

Knowledge base centre

Microsoft 365 Teams

Introduction


At the end of this article, you will be able to integrate your Microsoft Teams users from within your Microsoft 365 account, to your flexible call flow manager. Utilising Microsoft Teams as your main business communication tool, whilst adding the additional functionality of the unified communications of Microsoft Teams, video conferencing, video calling, collaboration and more. This guide will step you through the entire process. Should you need any assistance, feel free to contact our support department.

 

Microsoft 365 licensing requirements

 

The first step is to ensure all your Microsoft Teams users have the Enterprise licensing assigned and the 'Phone System' add-on associated. From your Microsoft 365 admin centre, select the active user option under users and click on each user you would like to enable the calling functionality for. Open the licenses and apps tab to verify the 'Phone System' license is assigned. If you do not see the license in the list continue to the next step.


Please note any users that have the Office 365 E5 or Enterprise E5 plan assigned will be required to uncheck the 'Calling Plan' app.

 

teams1.jpg

 

To order the Microsoft 365 Phone System license, click on the billing button from the toolbox menu on the left, select purchase services, then locate and order the required number of Microsoft 365 Phone System license. Repeat the previous step to add the freshly ordered Microsoft 365 Phone System license to your Microsoft 365 users. 


Please note the Microsoft 365 Phone System will appear under the add-ons section in purchases services only if you have an enterprise-grade license on your Office 365 tenancy.

 

teams2.jpg

 

Custom domain setup

 

Now you have the correct licensing assigned to your Microsoft Teams users, we will start the process of configuring the PSTN gateway, known as direct routing, between your Microsoft 365 tenancy and your PBX. Login to your Microsoft 365 account as a global administrator, select Setup and then View under 'get your custom domain set up'. 

 

teams4.jpg

 

Click on the manage tab to add a new domain.

 

teams5.jpg

 

Click on the add domain button, this will produce a setup wizard which will allow you to enter the FQDN details from your customer portal. Now revert to your customer portal. 

 

teams6.jpg

 

Login to your customer portal, click on the order services tab and then the Microsoft Teams button on the left-hand side.

 

teams7.jpg

 

Copy the Microsoft 365 FQDN address which will be in the following format sbcXXXXX.XX.voipcloud.online. Please double-check the information is correct and then click on the "use this domain" button.

 

teams8.jpg

 

Next, you will be prompted to verify the domain that you have entered. Microsoft 365 will provide you with a value for a TXT record confirmation. Copy the full value of this record. Do not attempt to press the verify button until you have added the TXT record to your customer portal.

 

teams9.jpg

 

Enter the text record into the "Office 365 TXT record" field within your customer portal. Now, you will need to start adding your Microsoft Teams users and selecting a phone number to assign to each. The number assigned may contain no relevance as it will be utilised for communications between your PBX and Microsoft 365 tenancy only. Add at least one user and phone number, read and agree to the service terms and conditions, then submit the order. 


Please note, without a Microsoft Teams user and phone number, you will not be able to verify the domain inside your Microsoft 365 portal. Also, note the phone number assigned to your Microsoft Teams user cannot be configured in your inbound PBX call flow, calls to this number will automatically be sent to the associated Microsoft Teams user. Additionally, you cannot assign a number already configured in your call flow to any of your Microsoft Teams users.

 

teams10.jpg

 

Going back to your Microsoft 365 portal click the verify button.


teams9.jpg


Once the domain verifies, ensure you do not select any additional online services and click continue.

 

teams11.jpg

 

We must now activate the domain. This is an essential step to integrate both systems, make sure you do not skip it. On your Microsoft 365 admin centre, you should select users from the left-hand menu and click on active users. After that, you should add a user and enter the required details, making sure you select the correct domain from the drop-down window. This will be in the format sbcXXXXX.XX.voipcloud.online.


Please note, creating an alias for an existing user will not activate the domain. You must create a new user.

 

teams12.jpg

 

Lastly, you should ensure that a product license is assigned to this user. The license can be any license that contains Microsoft Teams, such as Enterprise E1 and Business Basic and does not need to include the Phone System add-on. The domain will not activate without a license assigned. This license can even be reassigned temporarily from another user if a spare license is not available. Finally, hit the next button and complete the activation.

 

teams13.jpg

 

Allocating a calling plan to your Microsoft Teams users

 

We will now add your Microsoft Teams accounts to a user object or SIP trunk inside your PBX. You will utilise a user object if you require the PBX functionality, and a SIP trunk if you would like Microsoft 365's phone system to handle your calls. This is an important requirement that must not be skipped, as all Microsoft Teams accounts will require a call plan for outbound calls to be placed. To start, click the settings icon on your user object. 

 

teams17.JPG

 

Click the add button then the option "Microsoft Teams & Skype for Business integration". 

 

teams18.JPG

 

Select the Microsoft Teams email address from the drop-down list that you would like to assign. Save the configuration and don't forget to apply the new configuration.

 

teams19.JPG

 

Alternatively, if you would like to use Microsoft 365's phone system we will add your Microsoft Teams accounts to your SIP trunking object, click the settings icon of your SIP trunk.

 

teams22.JPG

 

Opt for the 'Office 365 PSTN gateway' mode, and ensure you have a call plan assigned. Click on the add button and select your Microsoft Teams accounts, save the configuration and don't forget to apply the configuration.

 

teams23.JPG


For further information or guidance on the PBX configuration please view our extensive knowledge base which has a range of articles to support your system requirements.  

 

Configuring the direct routing gateway

 

We will now connect your Microsoft 365 tenancy to your PBX using the direct routing functionality. To begin, click on the Windows key located in your bottom left of the toolbar, search for PowerShell, then right-click and select run as an administrator. When launching the application as an administrator, the system might request authorisation to run on your computer, click on yes and the PowerShell screen will appear.

 

teams14.jpg


You will now be presented with the PowerShell window to run the following configuration commands. 


mceclip0.png

 

Next, we will require the Skype for Business PowerShell module. Download and install the module from the link Skype for Business PowerShell provided.


mceclip0.png


Once installed, you must import the module by entering the command below to PowerShell and then pressing enter;

 

Import-Module SkypeOnlineConnector

 

If the command fails you may need to import the module by using the full file path to the PowerShell module. Please note that the path may vary on your system, below is an example of a standard file path. Once run repeat the command to import the module.

 

Import-Module "C:\Program Files\Common Files\Skype for Business Online\Modules\SkypeOnlineConnector\SkypeOnlineConnector.psd1"

 

Should you receive an error saying that running of scripts is disabled, you will need to remove the restriction. Run the following command. Once run repeat the command to import the module.

 

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

 

Close PowerShell and reload a new session making sure you run as an administrator as outlined in the first part of this section.


teams14.jpg


Following this enter the command below to connect to your Microsoft 365 tenancy. 

 

$session = New-CsOnlineSession -Verbose

 

You will be prompted to enter the login details of a global administrator from your Microsoft 365 tenancy. If you receive an error saying the remote name could not be resolved, look for the default onmicrosoft.com domain that exists in your Microsoft 365 tenant. You can find this by clicking setup on the left, and then going into domain management. The domain is usually in the format of companyname.onmicrosoft.com.

 

mceclip0.png

 

Once you have found the domain name, run the following command. Where companyname.onmicrosoft.com is the onmicrosoft.com domain from your Microsoft 365 admin centre.

 

$session = New-CsOnlineSession -Verbose -OverrideAdminDomain "companyname.onmicrosoft.com"

 

After you have established the connection, you should import the session into PowerShell executing the command below;

 

Import-PSSession $session -Verbose -AllowClobber

 

mceclip1.png

 

From your customer portal locate and copy the FQDN used in the custom domain section of this guide.

 

teams15.JPG

 

Now, run the command below replacing sbcX.YY.voipcloud.online with your custom FQDN from your customer portal. This will create the PSTN gateway. 

 

New-CsOnlinePSTNGateway -Fqdn "sbcX.YY.voipcloud.online" -SipSignalingPort 5061 -SendSipOptions $false -Enabled $true -ForwardCallHistory $true -ForwardPai $true

 

Please note that If you receive a 'domain not configured for this tenant' error, check to see if you have activated the sbcx.yy.voipcloud.online domain with a licensed user (see the custom domain section of this guide for further details). If you have activated the domain with a licensed user, please wait as Microsoft 365 domain activation can take some time.

 

Then, create an empty PSTN usage;

 

Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="VC PSTNUsage"}

 

Next, create a voice routing policy;

 

New-CsOnlineVoiceRoutingPolicy -Identity "VC VoiceRoutingPolicy" -OnlinePstnUsages "VC PSTNUsage"

 

And the final command to create the voice route, and associate with the PSTN usage, sbcX.YY.voipcloud.online with your custom FQDN from your customer portal;

 

New-CsOnlineVoiceRoute -Identity "VC VoiceRoute" -NumberPattern ".*" -OnlinePstnGatewayList sbcX.YY.voipcloud.online -Priority 0 -OnlinePstnUsages "VC PSTNUsage"

 

The domain setup is now complete and we will continue to set up the Microsoft Teams users. 

 

Enable calling on your Microsoft Teams users

 

We now have the custom domain configured and the direct routing gateway connected to your Microsoft 365 gateway, next we must enable PSTN calling functionality for your Microsoft Teams users. Login to your customer portal, locate and copy each of the numbers you have assigned to each of your Microsoft Teams user accounts. 


mceclip0.png


Run the command below in PowerShell, where "Teams email address" is your Microsoft Teams email address and "tel:+PHONE NUMBER" is the phone number associated from your customer portal. Press enter once you have copied and adjusted the command. 

 

Set-CsUser -Identity "Teams email address" -EnterpriseVoiceEnabled $true -HostedVoiceMail $false -OnPremLineURI "tel:+PHONE NUMBER"


Please note that If you receive a 'Cannot modify the parameter: "EnterpriseVoiceEnabled" because it is restricted for the user service plan' error, check that the user has been assigned a phone system license. See the Microsoft 365 licensing requirements section of this guide for further details

 

Following this, enter the command below to PowerShell again replacing the place holder with your Microsoft Teams email address. 

 

Set-CsUserPstnSettings -Identity "Teams email address" -AllowInternationalCalls $true -HybridPSTNSite $null


Assign the default voice policy. Copy to PowerShell and return once the place holder has been updated with your Microsoft Teams email address.   

Grant-CsOnlineVoiceRoutingPolicy -Identity "Teams email address" -PolicyName "VC VoiceRoutingPolicy"

 

Please note in the above command the policy-name refers back to the policy created as part of creating the direct routing gateway. If you receive an error saying the policy 'is not a user policy', run the following command to determine what your voice routing policy has been called:
Get-CsOnlineVoiceRoutingPolicy

 

You have now successfully enabled calling functionality on your Microsoft Teams user. Repeat the process with all your additional Microsoft Teams users. Finally, restart your Microsoft Teams client and you will be presented with the dial-pad functionality under the calls tab. It is now highly recommended to adjust the dial plan and disable the standard voicemail, to improve the usability of Microsoft Teams.   


Please note, on rare occasions the Microsoft 365 platform can take up to 48 hours for the synchronisation to complete and the dial-pad to appear. 

 

teamsdialpad.jpg

 

Adjusting the dial plan

 

By default, Microsoft Teams will add the + symbol before any call made by the users. If the country code is not dialled after that, it might cause an error or you may be unable to make the call. Enter the command below to PowerShell. 

 

New-CsTenantDialPlan -Identity "Voipcloud dial plan" -Description "Pass all numbers to PBX"


We now have a new dial plan. Next, we will add our normalisation rules, enter the following commands to PowerShell;

 

$rule1 = New-CsVoiceNormalizationRule -parent "Voipcloud dial plan" -name "Match all digits without plus" -description "pass everything through" -pattern '^(\d+)$' -translation '$1' -inmemory

 

Set-CsTenantDialPlan -identity "Voipcloud dial plan" -NormalizationRules @{add=$rule1}

 

$rule2 = New-CsVoiceNormalizationRule -parent "Voipcloud dial plan" -name "Match all digits with plus" -description "pass everything through" -pattern '^(\+\d+)$' -translation '$1' -inmemory

 

Set-CsTenantDialPlan -identity "Voipcloud dial plan" -NormalizationRules @{add=$rule2}


At this stage, you will have two normalisation rules which match with any number dialled. We now need to assign this dial plan to each of your Microsoft Teams users. Enter the command below, where "email address" is replaced with your Microsoft Teams email address.

 

Grant-CsTenantDialPlan -Identity "email address" -policyname "Voipcloud dial plan"

 

Repeat the process with all your Microsoft Teams user and finish the process by entering the session closure command below and closing PowerShell.

 

 Remove-PSSession $session

  

 

Disable the standard Microsoft 365 voicemail

 

By default, Microsoft 365 Teams voicemail is enabled, you will not require this functionality as this is handled by your voicemail feature inside your PBX of your customer portal. Login to your Microsoft 365 portal as a global administrator and select the all admin centres tab on the left toolbar, followed by the Teams icon.

 

teams1.jpg

 

Select the voice drop-down and then calling policies. Select the default policy which is Global.

 

teams2.jpg

 

Locate the setting 'Voicemail is available for routing inbound calls', update this value to disabled.

 

teams3.jpg

 

Watch this in action

 teamsguide_v2.gif


[[title=Microsoft Teams Integration | Support Article]]
[[description=At the end of this article, you will be able to add and configure Microsoft Teams integration with cloud-hosted VoIP service. Should you need any assistance, feel free to contact our support department.]]

A quick search will help you find answers, to most of the FAQ's.
If you are unable to a find solution from the knowledge base centre, please contact
your service provider for technical assistance.