VoIP:Teams:Debug
From VTX Public Wiki
We remind you that for the time being, each actions takes several hours to be in production, so you need to be really patient and follow the steps above one by one |
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
- Start a "cmd" ( Start menu and enter "cmd" + Enter to display the Black Window
- 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]
- Verify Voice Routing Rule
- Connect to https://admin.teams.microsoft.com/direct-routing/v2/voice-routes and verify the routing rule (cf screenshot)
- Verify Voice Routing Policy
- Connect to https://admin.teams.microsoft.com/policies/teamsonlinevoicerouting and verify Voice Routing policy (cf screenshot )
- Name should be CsOnlineVoiceRoutingPolicy-<service_nummber>.teams.ipvoip.ch
- PSTN Usage Record should be CsOnlinePstnUsage-<service_nummber>.teams.ipvoip.ch
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]
You can use these powershell commands too verify all your users do have a valid MS Teams license enabled ( that enables EnterpriseVoiceEnabled ) and also have the correct OnlineVoiceRoutingPolicy |
# 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]
- Verify user licenses
- 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
- Verify in https://admin.microsoft.com/AdminPortal/Home#/teamsprovisioning that your user Teams license provisioning is finished ( it can take several hours )
- Verify user number
- Connect to https://admin.teams.microsoft.com/users and verify that "Phone Number" has been correctly setup via powershell
- Verify user routing rules
- Connect to https://admin.teams.microsoft.com/user and select your user
- Go in the Policies tab section and look at the last entry "Voice routing policy", is should be CsOnlineVoiceRoutingPolicy-<service_number>.teams.ipvoip.ch
Verify number provisioning in MS Teams app[edit | edit source]
It might take some hours ( up to 4h in our tests) to be able to see your number in the Teams app even if you see the number in Teams Admin web interface. You can try to restart the app to speed it up |
- Verify the number on the MS Teams app
- Open the MS Teams app
- Go in the Calls section ( if you do not see it, then the "Phone System" license is not correctly set )
- (Mobile) You might get a popup informing that you have a new license and that app needs to be restarted
- (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
- Verify that you can see the phone number in the Call section and that you can pass incoming and outgoing calls
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:
- Verify that you did create the "enableteam" user, cf VoIP:Teams:Debug#Create_a_temporarily_user_in_the_.3Cservicenumber.3E.teams.ipvoip.ch_domain
- Wait up to 4h and try again to use the script again
As you can see after some time, the same command did work
Cannot Import Module SkypeOnlineConnector[edit | edit source]
- Information: By default, it is not allowed to execute powershell scrip on a Windows PC, you need to explicitly allow it
- Problem: If you did not follow the Microsoft documentation while installing the SkypeOnlineConnector module, you will not be able to import it
- Symptoms: You will get the powershell error below
- Solution: Open a powershell prompt as admin and set "Set-ExecutionPolicy RemoteSigned -Force" ( cf below )
- Additional Information: cf https://docs.microsoft.com/en-us/SkypeForBusiness/set-up-your-computer-for-windows-powershell/download-and-install-windows-powershell-5-1
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