This guide does not explain how to setup Microsoft Teams. The assumption is that you already have a Teams environment with Microsoft, your own domain(s) and users setup and this guide is focussed purely on how to connect your Account with that environment to provide incoming and outgoing calls to the PSTN along with providing phone numbers to your end users.
If you would like some guides on getting Microsoft Teams setup for your business then follow the useful links below:
https://docs.microsoft.com/en-us/MicrosoftTeams/teams-overview
https://support.office.com/en-us/teams
To enable Phone services for Microsoft Teams you need to have a 'phone system license' for each of your users that wish to have this functionality. Here is a useful guide to licensing:
In the Enterprise space, you can add either an E1, E3, or E5 license for a user and this will give you the functionality you need to enable phone services for that user. You also need to add a phone system license 'Add-on' to give you this functionality if this is available on your current Office 365 licensing.
Microsoft have now updated their licensing so that any user that has Teams included in their license can purchase a Phone System Standard license to enable phone services.
Every customer is different when it comes to Teams Integration so there is no 'one guide suits all' for getting setup with Teams. However, we decided to put together a step by step guide for a 'vanilla' customer who is new to Teams and looking to signup to Teams with 3 users and then map 3 phone lines to those users. The guide below is a record of that process with detailed screenshots and could be useful for system integrators to see the steps involved in a 'new' install.
Domain Verification and Trunk Setup
Assuming you already have your own domain setup with Microsoft you now need to setup our Teams SBC domain and get this verified. If you have not set up any domain yet with Microsoft for your organisation then please see our-by-step guide for this above.
First you need to login to login to the Microsoft Admin Center using your Microsoft Login:
https://admin.microsoft.com/AdminPortal/Home#/Domains Then click on 'Show All' and then 'Settings' and the Domains sub-menu option.
If you want to setup all lines on your account to use Microsoft Teams use the default profile otherwise you can create a new profile at the bottom of the page. In the drop down menu for Connection type select 'Microsoft Teams'.
Fill in the fields against each teams number including the teams user IDs hosted in Office 365 (including the domain name e.g. lex.d@techconnections.nz). You can also decide if you want to twin with a regular SIP phone or have the call failover to SIP or be hosted on Teams only. You can also decide if you want to use the Teams Voicemail system or the voicemail and provide an 'offline forwarding number' for your users in case calls fail to Teams and you need to have a backup number for these users (e.g. their mobile phone number). Press 'Save Changes' when done.
The final stages require a good technical knowledge of Microsoft's Admin Center and Power Shell command line to complete the integration. You will likely need an authorized Microsoft Office 365 Reseller to complete the final steps.
Install-Module MicrosoftTeams Set-ExecutionPolicy RemoteSigned Import-Module MicrosoftTeams Connect-MicrosoftTeams
We now need to map your phone number(s) to your Microsoft Teams users.
Run the following power shell commands for each of your tenants in Microsoft Teams. The example below the example domain is "ms81012345.sbc.msteams.nz" (replace this with your own domain) and we have named the Voice Identity as 'VOIP'. These commands are given to you in the Power Shell page in the customer portal so you should be able to just paste them in.
The first command you need to run is the Set-CsUser command and this adds the first user to the trunk (NOTE: this needs to be done BEFORE creating the Voice Route and Policy) and will look something like:
Set-CsPhoneNumberAssignment -Identity "lex.d@techconnections.nz" -PhoneNumber +6492420001 -PhoneNumberType DirectRouting
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="VOIP"}
New-CsOnlineVoiceRoute -Identity "VOIP" -NumberPattern ".*" -OnlinePstnGatewayList "msxxxxxxxx.sbc.msteams.nz" -Priority 1 -OnlinePstnUsages "VOIP"
New-CsOnlineVoiceRoutingPolicy -Identity "VOIP" -OnlinePstnUsages "VOIP"Once the routing policy and voice route have been created then you can assign these to your user using commands similar to those below:
Grant-CsTeamsCallingPolicy -PolicyName AllowCalling -Identity "lex.d@techconnections.nz"
Grant-CsOnlineVoiceRoutingPolicy -Identity "lex.d@techconnections.nz" -PolicyName "VOIP"
Set-CsOnlineVoicemailUserSettings -Identity "lex.d@techconnections.nz" -VoicemailEnabled $false
If you have more than a single user then you will need to now map a phone number to each of your Teams users using the following commands. The example below assumes that our example user Lex.d@techconnections.nz is going to be assigned the phone number 092420001 (added to Microsoft with the full country code format as +6492420001) and we are still using the Identity of "VOIP". Replace these as required for your own circumstances.
Set-CsPhoneNumberAssignment -Identity "lex.d@techconnections.nz" -PhoneNumber +6492420001 -PhoneNumberType DirectRouting
Grant-CsTeamsCallingPolicy -PolicyName AllowCalling -Identity "lex.d@techconnections.nz"
Grant-CsOnlineVoiceRoutingPolicy -Identity "lex.d@techconnections.nz" -PolicyName "VOIP"
Set-CsOnlineVoicemailUserSettings -Identity "lex.d@techconnections.nz" -VoicemailEnabled $false
If your company is currently using Skype for Business, you have to upgrade to Teams and enable the Phone System feature. This process requires a bit of prior planning, so check out the Microsoft articles for more information.
If you are using Skype for Business, this will help you:

FAQ:
https://docs.microsoft.com/en-us/microsoftteams/faq-journey
Getting started:
https://docs.microsoft.com/en-us/microsoftteams/upgrade-start-here
Deployment and implementation:
https://docs.microsoft.com/en-us/microsoftteams/upgrade-to-teams-execute-skypeforbusinessonline
If you have any questions or technical problems, get in touch with our support team