VoIP:VTX Teams Connect: Difference between revisions

From VTX Public Wiki

(Update routing rules to match all numbers)
Line 138: Line 138:
Import-PSSession $Session -AllowClobber
Import-PSSession $Session -AllowClobber
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="CsOnlinePstnUsage-$MSTeamsDomain"}
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="CsOnlinePstnUsage-$MSTeamsDomain"}
New-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain" -Priority 0 -NumberPattern '^\+\d+' -OnlinePstnGatewayList "$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
New-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain" -Priority 0 -NumberPattern '.*' -OnlinePstnGatewayList "$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
New-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
New-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
Set-CsCallingLineIdentity -Identity Global -EnableUserOverride $True
Set-CsCallingLineIdentity -Identity Global -EnableUserOverride $True
Line 285: Line 285:
Priority : 0
Priority : 0
Description :
Description :
NumberPattern : ^\+\d+
NumberPattern : .*
OnlinePstnUsages : {CsOnlinePstnUsage-123456.teams.ipvoip.ch}
OnlinePstnUsages : {CsOnlinePstnUsage-123456.teams.ipvoip.ch}
OnlinePstnGatewayList : {123456.teams.ipvoip.ch}
OnlinePstnGatewayList : {123456.teams.ipvoip.ch}

Revision as of 07:14, 7 May 2020

With VTX Teams Connect, use Microsoft Teams as your main Telephony Solution

VTX Teams Connect 01.png

Requirements[edit | edit source]

You will find below all the needed requirements to use VTX Teams Connect Service

  • A VTX Teams Connect service
  • A Microsoft 365 domain and accounts with the needed Microsoft licenses ( Microsoft Teams + Microsoft 365 Phone System )
  • A Microsoft Windows PC/Server with Powershell app and the needed modules to assign numbers to users ( we are working on an integration in the Kiosk too )

VTX Teams Connect[edit | edit source]

VTX Teams Connect service allows a smooth and easy integration between Microsoft 365 Teams services and the telephony world ( PSTN ) allowing you to use Microsoft service to pass and receive calls using Desktop (PC/macOS) or Mobile Teams application (Android/iOS) or dedicated Teams Desktop Phones. We are using redundant Microsoft validated SBC (Session Border Controller) from Audiocodes to integrate Microsoft Cloud with VTX Telephony platform, and we did automatize the integration to allow flexibility for our partners and customers. As a consequence, no telephony trunk setup is needed on your side.

  1. Please order a VTX Teams Connect service contacting your Sales contact or order it from your Kiosk interface ( including the number of channels and numbers you will need )
  2. You will have a VTX Kiosk interface account from which you will be able to manage and setup your service


A Microsoft 365 domain and accounts[edit | edit source]


  • A Microsoft 365 domain and account
    • That will include a Microsoft domain for your enterprise like enterprise.onmicrosoft.com ( or your own enterprise internet name if by example you migrated your emails to Microsoft )
    • A Microsoft 365 Admin account that will be able to buy and affect licenses to your users
  • A Microsoft 365 Domain provided by VTX to you like <servicenumber>.teams.ipvoip.ch ( ex: 123456.teams.ipvoip.ch )
  • A Microsoft 365 user account teamsadmin@<servicenumber>.teams.ipvoip.ch ( First Name: "PowerShell" / Last Name : "VTX Connect Teams Admin" / Login : teamsadmin@servicenumber>.teams.ipvoip.ch ) with the following Admin Right. It will be used to setup phone numbers on the account using Powershell ( unless VTX can do it for you from the Kiosk )
    • A Microsoft 365 Phone System license ( Temporarily license to create the routing rules, you can disable the license or use it for another user afterwards )
    • The Microsoft Teams App ( Temporarily license to create the routing rules, you can disable the license or use it for another user afterwards )
    • Assign the following Admin Right to the admin user (You will need to go in the Advanced Options of the Admin rights Management)
      • Skype For Business Admin Admin right
      • Teams admin Admin right
      • Teams communication Admin Admin right
      • Teams communication support engineer Admin right
      • Teams communication support specialist Admin right
  • For all your users wishing to have a telephone number
    • A "Microsoft Teams" license ( "Microsoft Teams Commercial Cloud" or Microsoft Teams license included in the E1 or E3 or E5 license )
    • A "Microsoft 365 Phone System" License for any users that will get a phone number

Microsoft Windows PC/Server with Powershell[edit | edit source]

  1. (Powershell) : Install Powershell your PC https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7
  2. (Microsoft Visual Studio C++): Install Microsoft Visual Studio C++ 2019 x64 using https://support.microsoft.com/fr-ch/help/2977003/the-latest-supported-visual-c-downloads
  3. (SkypeOnlineConnector Powershell Module)' Install Windows Powershell Skype for Business Online module
    1. Follow https://docs.microsoft.com/en-us/SkypeForBusiness/set-up-your-computer-for-windows-powershell/set-up-your-computer-for-windows-powershell
    2. Install Windows Powershell module Skype for Business Online module: https://www.microsoft.com/en-us/download/details.aspx?id=39366

Import SkypeOnlineConnector Powershell module

 PS C:\WINDOWS\system32> Import-Module SkypeOnlineConnector
 PS C:\WINDOWS\system32>



VTX Teams Connect Kiosk Management[edit | edit source]

Link your <SERVICE_NUMBER>.teams.ipvoip.ch Domain between Microsoft and VTX Telephony platform[edit | edit source]

  1. Connect to https://kiosk.vtx.ch/VoIP/ManageTeams.aspx and follow the helper. You will declare the domain provided by VTX and link it to your Microsoft account
VTX Teams Connect - Kiosk Management


Microsoft Teams Management[edit | edit source]

Connect to Microsoft 365 Admin Portal[edit | edit source]


Voice Routing : Create Voice Routing to allow your users to use VTX Teams Connect[edit | edit source]

Now you will need to setup a routing plan. You can use one of the following options to do it

  • Using a Powershell Script that will ask you questions
  • Manually in Powershell


Microsoft Admin Center - Up to 24h Latency for each setup



Create Voice Routing using a VTX Powershell Script VTX_Connect_Teams_Create_Routing_Rules.ps1[edit | edit source]

  1. Download https://wiki.vtx.ch/media/VTX_Connect_Teams_Create_Routing_Rules.ps1 on your computer ( Right Click on the link / Download )
  2. Open it with Wordpad and use Ctrl-s to save it again ( to inform the system that it is local script )
  3. Execute it on your PC : It will ask you for these parameters and create the routing
    1. VTX Teams Connect Domain : ex: 123456.teams.ipvoip.ch
    2. Your MS Teams Credentials for : teamsadmin@123456.teams.ipvoip.ch


Or Create Voice Routing manually in Powershell Command Prompt[edit | edit source]

  1. Open a powershell prompt on your PC
  2. Copy paste command below one by one changing the values in bold with your own
# Set Variables
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSTeamsAdminUser = "teamsadmin@123456.teams.ipvoip.ch"
# Connect to Microsoft Teams management and create all Voice Routing
$Session = New-CsOnlineSession -UserName $MSTeamsAdminUser
Import-PSSession $Session -AllowClobber
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="CsOnlinePstnUsage-$MSTeamsDomain"}
New-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain" -Priority 0 -NumberPattern '.*' -OnlinePstnGatewayList "$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
New-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
Set-CsCallingLineIdentity -Identity Global -EnableUserOverride $True

# Verify all setup ( You can compare it with the Debug Section in the wiki ) 
Get-CsOnlinePstnUsage
Get-CsOnlineVoiceRoute
Get-CsOnlineVoiceRoutingPolicy
Get-CsCallingLineIdentity

# Logout
Get-PSSession | Remove-PSSession

Number Mapping : Assign numbers to Microsoft accounts[edit | edit source]

Now you will need to assign a number and a routing plan to each user with a "Microsoft 365 Phone System" license. You can use one of the following options to do it

  • Using a Powershell Script that will ask you questions
  • Manually in Powershell


Assign numbers using a VTX Powershell Script VTX_Connect_Teams_Assign_Numbers.ps1[edit | edit source]

  1. Download https://wiki.vtx.ch/media/VTX_Connect_Teams_Assign_Numbers.ps1 on your computer ( Right Click on the link / Download )
  2. Open it with Wordpad and use Ctrl-s to save it again ( to inform the system that it is local script )
  3. Execute it on your PC : It will ask you for these parameters and create the routing
    1. VTX Teams Connect Domain : ex: 123456.teams.ipvoip.ch
    2. Your MS Teams Credentials for : ex: teamsadmin@123456.teams.ipvoip.ch
    3. The MS Team user email : ex: first.last@company.onmmicrosoft.com
    4. The Telephone number you wish to set : ex: +41225661234


Or Assign numbers manually in Powershell Command Prompt[edit | edit source]

  1. Open a powershell prompt on your PC
  2. Copy paste command below one by one changing the values in bold with your own
# Set Variables
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSTeamsAdminUser = "teamsadmin@123456.teams.ipvoip.ch"
$MSTeamsUserEmail = "first.last@MSDOMAIN.onmicrosoft.com"
$MSTeamsUserNumber = "+41215661234"
# Connect to Microsoft Teams management
# Connect to Microsoft Teams management and assign number and profile to the user
$Session = New-CsOnlineSession -UserName $MSTeamsAdminUser
Import-PSSession $Session -AllowClobber
# Assign a number to your user and the Call Routing
Get-CsOnlineUser -Identity $MSTeamsUserEmail | Set-CsUser -EnterpriseVoiceEnabled $true -OnPremLineURI "tel:$MSTeamsUserNumber"
Get-CsOnlineUser -Identity $MSTeamsUserEmail | Grant-CsOnlineVoiceRoutingPolicy -PolicyName "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain"
# Verify your setup 
Get-CsOnlineUser -Identity $MSTeamsUserEmail | Select EnterpriseVoiceEnabled,OnPremLineURI,OnlineVoiceRoutingPolicy,RegistrarPool | Format-List
# List all users with EnterPrise Voice Enabled
Get-CsOnlineUser ` -Filter {(enterprisevoiceenabled -eq $true) -and(HostingProvider -eq "sipfed.online.lync.com")} ` | Select sipaddress,HostedVoicemailPolicy,OnlineVoiceRoutingPolicy,lineuri,OnPremLineURI,RegistrarPool | Format-List
# Logout
Get-PSSession | Remove-PSSession


Dismantle the Service[edit | edit source]

Delete Voice Routing[edit | edit source]

Here are the commands you can use to delete the Voice Routing if you wish to migrate service somewhere else


  1. Open a powershell prompt on your PC
  2. Copy paste command below one by one changing the values in bold with your own
# Set Variables
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSTeamsAdminUser = "teamsadmin@123456.teams.ipvoip.ch"
# Connect to Microsoft Teams management and create all Voice Routing
$Session = New-CsOnlineSession -UserName $MSTeamsAdminUser
Import-PSSession $Session -AllowClobber

# Delete the Voice Routing
Remove-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain"
Remove-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain"
Set-CsOnlinePstnUsage -Identity Global -Usage @{Remove="CsOnlinePstnUsage-$MSTeamsDomain"}

# Logout
Get-PSSession | Remove-PSSession

Debug[edit | edit source]


Start the powershell script in Command Line to be able to see the errors[edit | edit source]

  • Problem: If you enter wrong credentials, or wrong domain, or if the domain or user is not yet ready on Microsoft side, you might get an error that disappears too quickly
  • Solution: use the powershell -File file.ps1 command to be able to see the errors


  1. Start a "cmd" ( Start menu and enter "cmd" + Enter to display the Black Window
  2. Use the command powershell -File file.ps1 ( replacing file.ps1 with the correct path of the ps1 file )
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

H:\>c:

C:\>powershell -File "C:Users\bob\Desktop\VTX_Connect_Teams_Create_Routing_Rules
.ps1"
VTX Teams Connect domain name is XXXX.teams.ipvoip.ch
VTX Teams Admin Username is vtxadmin@XXXX.teams.ipvoip.ch
Connecting to Microsoft Online Management with the credentials you provided
Get-CsOnlinePowerShellEndpoint : The remote name could not be resolved:
'lyncdiscover.xxxx.teams.ipvoip.ch'
At C:\Program Files\Common Files\Skype for Business
Online\Modules\SkypeOnlineConnector\SkypeOnlineConnectorStartup.psm1:149
char:26
+ ... targetUri = Get-CsOnlinePowerShellEndpoint -TargetDomain $adminDomain ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-CsOnlinePowerShellEndpoin
   t], WebException
    + FullyQualifiedErrorId : System.Net.WebException,Microsoft.Rtc.Management
   .OnlineConnector.GetPowerShellEndpointCmdlet


C:\>powershell -File "C:Users\bob\Desktop\VTX_Connect_Teams_Create_Routing_Rules
.ps1"


Verify Voice Routing[edit | edit source]

PS H:\> Get-CsOnlinePstnUsage
Identity : Global
Usage    : {Default, CsOnlinePstnUsage-123456.teams.ipvoip.ch}


PS H:\> Get-CsOnlineVoiceRoute

Identity              : CsOnlineVoiceRoute-123456.teams.ipvoip.ch
Priority              : 0
Description           :
NumberPattern         : .*
OnlinePstnUsages      : {CsOnlinePstnUsage-123456.teams.ipvoip.ch}
OnlinePstnGatewayList : {123456.teams.ipvoip.ch}
Name                  : CsOnlineVoiceRoute-123456.teams.ipvoip.ch


PS H:\> Get-CsOnlineVoiceRoutingPolicy

Identity         : Global
OnlinePstnUsages : {}
Description      :
RouteType        : BYOT

Identity         : Tag:CsOnlineVoiceRoutingPolicy-123456.teams.ipvoip.ch
OnlinePstnUsages : {CsOnlinePstnUsage-123456.teams.ipvoip.ch}
Description      :
RouteType        : BYOT


PS H:\> Get-CsCallingLineIdentity

Identity                  : Global
Description               :
EnableUserOverride        : True
ServiceNumber             :
CallingIDSubstitute       : LineUri
BlockIncomingPstnCallerID : False


Verify Users Setup[edit | edit source]

# Set Variables
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSTeamsAdminUser = "teamsadmin@123456.teams.ipvoip.ch"

# Connect to Microsoft Teams management and assign number and profile to the user
$Session = New-CsOnlineSession -UserName $MSTeamsAdminUser
Import-PSSession $Session -AllowClobber
# Verify all users with correct setup using CsOnlineVoiceRoutingPolicy-$MSTeamsDomain
PS H:\> Get-CsOnlineUser -Filter {(enterprisevoiceenabled -eq $true) -and(OnlineVoiceRoutingPolicy-eq "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain") } | Select EnterpriseVoiceEnabled,sipaddress,OnPremLineURI,OnlineVoiceRoutingPolicy,RegistrarPool | Format-List

EnterpriseVoiceEnabled   : True
SipAddress               : sip:user1@myoffice.onmicrosoft.com
OnPremLineURI            : tel:+41215660011
OnlineVoiceRoutingPolicy : CsOnlineVoiceRoutingPolicy-123456.teams.ipvoip.ch
RegistrarPool            : sippoolAM42E08.infra.lync.com

EnterpriseVoiceEnabled   : True
SipAddress               : sip:user2@myoffice.onmicrosoft.com
OnPremLineURI            : tel:+41215660012
OnlineVoiceRoutingPolicy : CsOnlineVoiceRoutingPolicy-123456.teams.ipvoip.ch
RegistrarPool            : sippoolAM42E08.infra.lync.com

EnterpriseVoiceEnabled   : True
SipAddress               : sip:user3@myoffice.onmicrosoft.com
OnPremLineURI            : tel:+41215660013
OnlineVoiceRoutingPolicy : CsOnlineVoiceRoutingPolicy-123456.teams.ipvoip.ch
RegistrarPool            : sippoolAM42E08.infra.lync.com

# Logout
Get-PSSession | Remove-PSSession