MS Teams Auto-Attendant call forwarding to External PSTN number with Direct Routing

We have a situation where MS Teams auto attendant call need to be get forwarded to external PSTN numbers. As we know Auto-attendant make use of number assigned to resource account. So basically when we are configuring forwarding in Auto Attendant settings. Additionally we need to set the OnlineVoiceRouting policy to the Resource account (Using PowerShell). Below is the code cmdlts you can use to set onlineVoicerouting policy to a resource account.

#MS Teams is using Direct Routing for PSTN calls
#Configure resource account for outbound call in MS Teams Auto Attendants
 
#Connect to Microsoft Teams via PowerShell
Connect-MicrosoftTeams
 
#Get all the Online Voice Routing Policies
Get-CsOnlineVoiceRoutingPolicy
 
#Assign Online Voice Routing Policy to Microsoft Teams Resource Account for Teams Direct Routing

 
Grant-CsOnlineVoiceRoutingPolicy -Identity ResourceAccount@cloudmechanics.in -PolicyName Test_Voice_Routing_policy

 
Get-CsOnlineUser ResourceAccount@cloudmechanics.in | select UserPrincipalName,OnlineVoiceRoutingPolicy
 
# Perfect Job Done, disconnect from MS Teams
 
#Disconnect
Disconnect-MicrosoftTeams

So after running above cmdlts, try calling Auto-Attendant number and it will get routed to the external number set up in Auto Attendant configuration.

This entry was posted in MS Teams, Powershell. Bookmark the permalink.

Leave a Reply

Your email address will not be published.