VoIP:Teams:Debug: Difference between revisions

From VTX Public Wiki

(Move Content of Debug Section in a subpage)
 
Line 205: Line 205:
* '''Problem''': When we run the script to create the call routing, you might get a red error that New-CsOnlineVoiceRoutingPolicy is not working
* '''Problem''': When we run the script to create the call routing, you might get a red error that New-CsOnlineVoiceRoutingPolicy is not working
* '''Symptoms''': When running the script to create the call routing, you might get an error "Cannot find specified Online PSTN usage"
* '''Symptoms''': When running the script to create the call routing, you might get an error "Cannot find specified Online PSTN usage"
* '''Possible Explanation''':
* '''Possible Explanation''': MS Teams platform is getting some delay and between the time we create the Online PSTN usage and the time we use it in Online Voice Routing Policy, we need to wait for Teams platform to get up to date
** You forgot to create the temporary User "enableteams"
* '''Solution''': Wait up to 4h and try again to use the script again
** MS Teams platform is getting some delay and between the time we create the Online PSTN usage and the time we use it in Online Voice Routing Policy, we need to wait for Teams platform to get up to date
* '''Solution''':
# Verify that you did create the "enableteam" user, cf [[{{FULLPAGENAME}}#Create_a_temporarily_user_in_the_.3Cservicenumber.3E.teams.ipvoip.ch_domain]]
# Wait up to 4h and try again to use the script again





Revision as of 11:47, 7 September 2020


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
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSteamsAdminUser = "admin@COMPANY.onmicrosoft.com"

# 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
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

Frequent Errors[edit | edit source]

New-CsOnlineVoiceRoutingPolicy - Cannot find specified Online PSTN usage[edit | edit source]

  • Problem: When we run the script to create the call routing, you might get a red error that New-CsOnlineVoiceRoutingPolicy is not working
  • Symptoms: When running the script to create the call routing, you might get an error "Cannot find specified Online PSTN usage"
  • Possible Explanation:
    • You forgot to create the temporary User "enableteams"
    • MS Teams platform is getting some delay and between the time we create the Online PSTN usage and the time we use it in Online Voice Routing Policy, we need to wait for Teams platform to get up to date
  • Solution:
  1. Verify that you did create the "enableteam" user, cf VoIP:Teams:Debug#Create_a_temporarily_user_in_the_.3Cservicenumber.3E.teams.ipvoip.ch_domain
  2. Wait up to 4h and try again to use the script again


As you can see after some time, the same command did work

Teams Error - Cannot Find Online PSTN Usage - Wait a few hours and try again

Cannot Import Module SkypeOnlineConnector[edit | edit source]


Confirmation of the problem, here Execution Policy is Restricted, i.e disabled

Get-ExecutionPolicy
Restricted

Solution

Set-ExecutionPolicy RemoteSigned -Force

Get-ExecutionPolicy
RemoteSigned


Error that you are getting

Modules d'importation : Le fichier "C:\Program Files\Common Files\Skype for Business
Online\Modules\SkypeOnlineConnectorSkypeOnlineConnectorStartup.psm1" ne peut pas être chargé, car l'exécution de
Les scripts sont désactivés sur ce système. Pour plus d'informations, voir "about_Execution_Policies".
(https:/go.microsoft.com/fwlink/?LinkID=135170).
En ligne:1 Caractère:1
+ modules d'importation "C:\Program Files\Common Files\Skype for Business Onlin ...


+ CategoryInfo : Erreur de sécurité : ( 🙂 [Modules d'importation], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand


Get-CsOnlinePowerShellEndpoint : The remote name could not be resolved: 'lyncdiscover.xxx'[edit | edit source]

  • Problem : You get an red colored error when using the scripts
  • Symptoms: When starting to use a powershell script or command, you get an error like Get-CsOnlinePowerShellEndpoint : The remote name could not be resolved: 'lyncdiscover.xxx'
  • Possible Explanation: You are using an admin account where needed lyncdiscover.$DOMAIN DNS entry is not set correctly
  • Solution: Please verify and dix your Admin account DNS setup
  • Workaround : Add the suffix "-OverrideAdminDomain $MSTeamsDomain" to the New-CsOnlineSession command