VoIP:Teams:Debug: Difference between revisions

From VTX Public Wiki

m (Text replacement - "$MSTeamsDomain" to "$TeamsDomain")
Line 126: Line 126:


# Set Variables
# Set Variables
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$TeamsDomain = "123456.teams.ipvoip.ch"
# Connect to Microsoft Teams management and assign number and profile to the user
# Connect to Microsoft Teams management and assign number and profile to the user
$Session = New-CsOnlineSession
$Session = New-CsOnlineSession
Import-PSSession $Session -AllowClobber
Import-PSSession $Session -AllowClobber
# Verify all users with correct setup using CsOnlineVoiceRoutingPolicy-$MSTeamsDomain
# Verify all users with correct setup using CsOnlineVoiceRoutingPolicy-$TeamsDomain
Get-CsOnlineUser ` -Filter {(enterprisevoiceenabled -eq $true) -and(HostingProvider -eq "sipfed.online.lync.com")} ` | Select EnterpriseVoiceEnabled,sipaddress,OnPremLineURI,OnlineVoiceRoutingPolicy,RegistrarPool | Format-List
Get-CsOnlineUser ` -Filter {(enterprisevoiceenabled -eq $true) -and(HostingProvider -eq "sipfed.online.lync.com")} ` | Select EnterpriseVoiceEnabled,sipaddress,OnPremLineURI,OnlineVoiceRoutingPolicy,RegistrarPool | Format-List

Revision as of 13:32, 1 July 2022


Start 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]

To verify Voice Routing, you can either use Powershell command lines or check from Admin Teams Web interface in the following 2 sections

Verify Voice Routing using Powershell[edit | edit source]

PS H:\> Get-CsOnlinePstnUsage
Identity : Global
Usage    : {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 Voice Routing using Teams Admin Web Interface[edit | edit source]

  1. Verify Voice Routing Rule
    1. Connect to https://admin.teams.microsoft.com/direct-routing/v2/voice-routes and verify the routing rule (cf screenshot)
  2. Verify Voice Routing Policy
    1. Connect to https://admin.teams.microsoft.com/policies/teamsonlinevoicerouting and verify Voice Routing policy (cf screenshot )
    2. Name should be CsOnlineVoiceRoutingPolicy-<service_nummber>.teams.ipvoip.ch
    3. PSTN Usage Record should be CsOnlinePstnUsage-<service_nummber>.teams.ipvoip.ch


Microsoft Teams Admin - Verify Routing Rule
Microsoft Teams Admin - Verify Routing Policy
Microsoft Teams Admin - Verify PSTN Usage record

Verify User Setup[edit | edit source]

To verify User setup, you can either use Powershell command lines or check from Admin Teams Web interface in the following 2 sections

Verify User setup using Powershell[edit | edit source]

# Set Variables
$TeamsDomain = "123456.teams.ipvoip.ch"

# Connect to Microsoft Teams management and assign number and profile to the user
$Session = New-CsOnlineSession
Import-PSSession $Session -AllowClobber
# Verify all users with correct setup using CsOnlineVoiceRoutingPolicy-$TeamsDomain
Get-CsOnlineUser ` -Filter {(enterprisevoiceenabled -eq $true) -and(HostingProvider -eq "sipfed.online.lync.com")} ` |  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

Verify User setup using Teams Admin Web Interface[edit | edit source]

  1. Verify user licenses
    1. Connect to https://admin.microsoft.com/AdminPortal/Home#/users and verify that your user does have a "Microsoft Teams" license and a "Microsoft 365 Phone System" license
    2. Verify in https://admin.microsoft.com/AdminPortal/Home#/teamsprovisioning that your user Teams license provisioning is finished ( it can take several hours )
  2. Verify user number
    1. Connect to https://admin.teams.microsoft.com/users and verify that "Phone Number" has been correctly setup via powershell
  3. Verify user routing rules
    1. Connect to https://admin.teams.microsoft.com/user and select your user
    2. Go in the Policies tab section and look at the last entry "Voice routing policy", is should be CsOnlineVoiceRoutingPolicy-<service_number>.teams.ipvoip.ch
Microsoft Admin - Verify User license
Microsoft Admin - Verify Teams provisioning status
Microsoft Teams Admin - Verify user number
Microsoft Teams Admin - Verify user voice routing policy

Verify number provisioning in MS Teams app[edit | edit source]

  1. Verify the number on the MS Teams app
    1. Open the MS Teams app
    2. Go in the Calls section ( if you do not see it, then the "Phone System" license is not correctly set )
      1. (Mobile) You might get a popup informing that you have a new license and that app needs to be restarted
      2. (PC) Restart is not supposed to be needed, if you have waited a long time, please try to exit the app and start it back
    3. Verify that you can see the phone number in the Call section and that you can pass incoming and outgoing calls


Microsoft Teams App - Verify user number