Microsoft Teams
Adding Domains in Microsoft Admin Centre
Step 1
Login into the Microsoft 365 Admin Centre admin.microsoft.com
Make sure that the account you are using has at least Teams Admin Role or Global Admin Role and is using a license type that supports voice for instance Microsoft Teams Phone Standard (E5, E3+Phone system, E1+Phonesystem)
When the above is complete, on the left pane, select > Show all, then go to > Settings, then go to > Domains.
Step 2
Create the DNS (Domains)
When you are in the Domains section in the admin portal, you will have a button titled
+ Add domain
Click this button and fill in the first out of the two DNS (Domains) provided by your MaxContact Representative.
To make it simple, start off with the one which has sbc1 in its name.
It should look like below;
When this is done click on “Use this domain” in the bottom of the page then proceed to Step 3.
Step 3
Adding a TXT-Record to the DNS (Domain)
Choose “Add a TXT record to the domain’s DNS Records” as shown below
Then press “Continue” at the bottom of the page. When this is done, proceed to Step 4.
Step 4
Saving the TXT Record
You will then be presented with the TXT records (as shown below) copy the TXT Value and save it somewhere locally together with its domain name - this will be needed later.
When this is done press Verify at the bottom of the page.
Selecting Verify will generate an *error message (Error message is expected and more info can be found at the end of part 1 of this guide).
Ignore this error message for now and press close at the bottom of the page.
The error message will look something like the below.
Step 5
The TXT Value (Record) that you saved from Step 4 needs to be aligned with the DNS (Domain) that you have created. It should look like the example below:
tvxteams1337-sbc1.sfbcust.telavox.se MS=ms37437805 |
When this is done we will need to repeat the same process for the DNS (Domain) named sbc2. This is done via repeating the process from Step 1) again, so you end up here again.
The result - which will need to be sent back to The PBX should look like below:
tvxteams123456-sbc1.sfbcust.telavox.se MS=ms37437805
tvxteams123456-sbc2.sfbcust.telavox.se MS=ms69432301 |
When this is has been done - await confirmation from MaxContact and proceed to Step 6
Step 6
Completing Domains when DNS is rolled out from MaxContact UCaaS.
6.1) Now we need to complete Domain setup in the Microsoft admin portal where both sbc1 and sbc2 are currently in the state of incomplete setup. This is done via clicking the first domain sbc1 and you end up in the “How do you want to verify your domain” section.
6.2) Click “Add a TXT record, add an mx record to the domains DNS records” then press continue
6.3) You will now be prompted with the TXT-Record you had outputted from Step 4) which is the same as before. Now press verify.
6.4) You will now be prompted by “How do you want to connect your domain” just press continue.
6.5) On the next page you will have “Add DNS records” unselect “Exchange and Exchange Online protection”
MaxContact UCaaS will not provide and host any email services therefore this box is unselected. To move forward press “Continue” - Now one of your domains is set up.
Repeat the same process for sbc2 so both domains have been verified.
* Error Message explanation:
When we are at this state when the DNS (Domains) is not created in the PBX DNS Servers you will see under Domains “Incomplete setup” on the two created domains with the error message attached in step 4. This is because the PBX needs the TXT-Record to verify domain ownership and thus they cannot be created at the same time and therefore will be in a limbo state until both have completed their setups.
Microsoft Teams
Enable Direct Routing for Voice
Requirements
Before executing the commands further down in this guide, you will need to have the following requirements fulfilled.
- Two accounts that are a Teams admin or Global admin in the Microsoft 365 Admin Centre
- These accounts also need Microsoft licenses that supports voice
- Example on licenses that support voice e.g. - Microsoft Teams Phone Standard, E5 or E1/E3 + Phonesystem
- The two admin accounts need to have the domain as an email for both sbc1 and sbc2.
Full description on how this is done can be found in the steps below
* Note that accounts can be set up as temporary accounts or use of existing accounts. This is needed for the configuration for the domains for the domain urlmap (described here). Existing accounts can be restored to its original username/license and domain. If you decide to use the temporary accounts, they can be removed, and their corresponding licenses cancelled after completing this guide.
Connect the admin accounts to the new domains
1 - Log in to Microsoft 365 Admin Centre with the Admin Account (admin.microsoft.com)
2 - Go to Active users and find one of the two accounts mentioned in requirements
3 - Let’s name these users sbc1@yourdomain.com and sbc2@yourdomain.com in this example.
4 - Click on one the users (e.g. sbc1@yourdomain.com)
5 - Click Manage username and email > Click on the pen to edit > Choose sbc1 from the domain dropdown > Save settings
6 - Make sure the username is saved correctly. You should now have a username like sbc1@tvxteamsxxxxx-sbc1.sfbcust.telavox.se
7 - Repeat the process for the second user - meant for user sbc2. i.e., adding a username like sbc2@tvxteamsxxxxx-sbc2.sfbcust.telavox.se
Once complete, we can start executing the PowerShell commands in this guide.
Setup Direct routing and configure Domains and User(s)
Step 1
Adding a Teams module to PowerShell.
Install the Teams module with the below guide
Guide to download and install the Teams-Module
Step 2
Create session towards Teams-Environment and PBX systems.
This step will create the session needed to update the settings in Microsoft-Teams
Run the following command from PowerShell (as administrator):
Connect-MicrosoftTeams |
Step 3
Make sure the Domains are populated in domain urlmap.
Run the following command:
Get-CsTenant | fl Tenantid,*Domain* |
Your result should contain sbc1 and sbc2 in the DomainUrlMap or as VerifiedDomains (The naming convention is dependent on what PowerShell version is being used)
PowerShell Version 5.1.X
PowerShell Version 7.X
You may not see the domains in the UrlMap, however the next steps should still work as expected.
E.g
When this is confirmed - move on to Step 4.
Step 4
Create direct routing rules for Teams. The original guide from Microsoft can be found here.
When running the below commands - remember to change to the FQDN’s (Domains)
provided by MaxContact. These FQDN’s (Domains) must be changed on both sbc1 and sbc2.
- 4.1 - Create the PSTN Gateways
Make sure this is two complete rows in PowerShell (without quotation marks)
1) “New-CsOnlinePSTNGateway -Fqdn tvxteamsxxxxx-sbc1.sfbcust.telavox.se -Enabled $true -SipSignalingPort 5061”
2) “New-CsOnlinePSTNGateway -Fqdn tvxteamsxxxxx-sbc2.sfbcust.telavox.se -Enabled $true -SipSignalingPort 5061” |
- 4.2 - Create PSTN Usage
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="Telavox"} |
- 4.3 Create Voice Route
Make sure this is two complete rows in PowerShell (without quotation marks)
1) “New-CsOnlineVoiceRoute -id "Telavox" -NumberPattern ".*" -OnlinePstnGatewayList @{add="tvxteamsxxxxx-sbc1.sfbcust.telavox.se"} -OnlinePstnUsages Telavox”
2) “Set-CsOnlineVoiceRoute -id "Telavox" -OnlinePstnGatewayList @{add="tvxteamsxxxxx-sbc2.sfbcust.telavox.se"}” |
- 4.4 -Create a Voice Routing Policy
New-CsOnlineVoiceRoutingPolicy "Telavox" -OnlinePstnUsages "Telavox" |
After this you will need to create the direct routing rules for Teams (to place and receive calls to and from the PBX servers) this is done in the next few steps.
Step 5
Check if a user is present in Microsoft Teams.
To check if a user that is created is present in Teams, run the following command and adjust (username@yourdomain.com) accordingly.
Get-CsOnlineUser -Identity "username@yourdomain.com" | fl RegistrarPool |
The response to that command should contain and look something like below
*.infra.lync.com
If that's the case, we proceed to Step 6.
Everything before Step 6 is a one-time only setup, the following steps marked with * are done on a per user basis.
*Step 6
Associate a number to a Teams-user
First check in Flow Admin what landline number is set to the user. You cannot assign a mobile number to the user.
Next step is to associate a landline number to a Teams user.
- Run the following command for PowerShell 5.X
Set-CsPhoneNumberAssignment -Identity "username@yourdomain.com" -PhoneNumber "+441618149869" -PhoneNumberType DirectRouting |
- Run the following command for PowerShell 7.X
Set-CsPhoneNumberAssignment -Identity "username@yourdomain.com" -PhoneNumber "+441618149869" -PhoneNumberType DirectRouting |
Remember to use the E.164 number format i.e +44 (without the first zero) this example is for a number with the UK country code prefix.
If your user/s do not have the correct license applied, you will see an error like below;
*Step 7
Grant Online Voice Routing Policy to a User
First check in Flow Admin what landline number. To grant usage of the online voice routing policy to a user - Run the following command
Grant-CsOnlineVoiceRoutingPolicy -Identity "username@yourdomain.com" -PolicyName "Telavox" |
To verify that the user has been updated correctly, go to Step 8.
*Step 8
Verify user creation
To verify that the user is created correctly - Run the follow command
Get-CsOnlineUser "username@yourdomain.com" | select OnlineVoiceRoutingPolicy |
*Note - This can be used for troubleshooting to verify users are setup correctly.
Here you should see Telavox as an output, then proceed to Step 9.
Step 9
Activate “Forward call history” in Teams Admin portal (admin.teams.microsoft.com)
Log in to your Teams Admin portal. Go to “Voice” > “Direct Routing” and click on the first of your two configured SBCs. Choose “Settings” and, in the top right corner, click “Edit SBC”.
Find the setting “Forward call history” and turn it on.
Repeat the action for your second SBC.
Step 10
Configure the Teams user(s) in Flow Admin to use teams for incoming/outgoing calls
Login to Flow Admin with an administrator account here.
First the add-on “MS-Teams” needs to be added on the user(s) in Flow Admin. To do this, under “Additional services” add the MS-Teams feature for the user(s) that will be using Microsoft Teams with MaxContact UCaaS. This needs to be done separately for each individual user.
- Navigate to Users.
- In the left bottom pane click on Microsoft Teams under Integrations.
- Select all users you have configured to use Teams.
- Fill in to use both incoming & outgoing calls.
- Click Save
Post setup
Requirements
In the Teams Admin portal (admin.teams.microsoft.com) under Voice > Calling Policies you can edit the “Global (Org-wide default)” policy to apply to all Teams users or you can create a new policy to assign to specific users.
However, the main setting that needs to be changed here is “Busy on busy when in a call” set to “Enabled”.
Teams Presence Sync
To sync your Teams presence with your MaxContact UCaaS user, go to the following link and enter your Microsoft Admin account login and approve the permissions as shown below - https://home.telavox.se/presence.jsp
The Microsoft Admin user you connect with must match the details of the Flow Admin user.
If the Teams presence link is not directing you to the same page (as shown above), please make sure to logout of all Flow browser sessions and open a new session in incognito mode and log back in to verify the permissions.
Note – The MaxContact UCaaS user also needs admin rights within the Flow portal to do the presence sync.