Error when trying to execute PowerShell script dial plan

Jordan351

SOHO User
Joined
May 22, 2025
Messages
3
Reaction score
0
Hi there,

We're trying to activate TeamsDirect Routing with the PS script teams_dial_plan.ps1.

After connecting to the tenant and executing the script, here is the error code:
Set-CsOnlinePstnUsage : Cannot add these items to the collection as they conflict or have duplicate key/identity:
Usage: 3CX PSTN Usage

I don't understand if the issue is from 3CX, Microsoft, or maybe the certificate.

Has someone already encountered this problem?

I have a 4SC license. Is it compulsory to have a 16SC to use Teams Direct Routing? That seems weird to me...

I appreciate your help.

Best regards,
Jordan
 
Make sure you don't have any remnants of previous config in Teams. Go in Teams Admin and delete any voice routes, PSTN usages, SBCs, etc.
 
Thank you for your answer.

I already tried to remove everything in Teams admin panel
I also checked the Teams Integration FAQs and used these PS commands and deleted everything but Global:
Get-CsTenantDialPlan
get-CsOnlineVoiceRoutingPolicy
Get-CsOnlineVoiceRoute
Get-CsOnlinePstnUsage
get-CsOnlinePSTNGateway

All clear, only Global is still there.

I executed the script again and I got this:

Set-CsOnlinePstnUsage : Cannot remove these items from the collection because they cannot be found: Usage: All
Au caractère C:\teams_dial_plan.ps1:6 : 1
+ Set-CsOnlinePstnUsage -Identity Global -Usage @{remove="All"}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation : ({ ConfigType = ...Configuration }:<>f__AnonymousType106`5) [Set-CsOn
linePstnUsage], Exception
+ FullyQualifiedErrorId : ClientError,Microsoft.Teams.ConfigApi.Cmdlets.SetCsOnlinePstnUsage



SBCs with issues: 1
Status: Inactive

Thanks for your help,
Jordan
 
Do you think this could be because the subscription is 4SC instead of 16?
I'm really having trouble solving the problem.
 

Members Online Now

Forum statistics

Threads
111,831
Messages
589,277
Members
164,660
Latest member
RJenkinsROCK