Enable resource account for outbound call in Microsoft Teams Call Queues and Auto Attendants

In this post I describe how you can configure call forwarding to external PSTN phone numbers for a call queue or auto attendant in a Microsoft Teams Direct Routing configuration. Microsoft released the capability to forward phone calls via a Teams Auto Attendant and via a Teams Call Queue to a phone number. Also, the operator can have a (external/PSTN) phone number.

In the past this was not feasible this way, therefore you had to implement a workaround by configuring a “forwarding user” to reach the goal. This is no longer necessary. I’ll show you some screenshots to depict what you’ve got now with Teams Calling and Microsoft 365 Phone System.

Teams Auto Attendant – Operator – External Phone Number Option

Teams Auto Attendant – Operator – External Phone Number Option

Teams Auto Attendant – Call Flow – External Phone Number Option

Teams Auto Attendant – Call Flow – External Phone Number Option

Teams Call Queue – Call Flow – Externa Phone Number Option/s

Within call queues you have two options to forward a call to a phone number. The first option helps to deal with more as the maximum set amount of concurrent calls in a queue. The second option helps to deal with calls waiting in a queue for a certain amount of time.

Teams Call Queue – Call Flow – Externa Phone Number Option/s

What do I have to do to make this work with Teams Direct Routing?

Easy, you have to do two things:

  1. assign a Virtual Phone System User license (!!!) (if not done yet) to the Teams Resource Account (also note the docs.microsoft.com statement saying, “Phone System licenses aren’t supported”, so assigning a E3 + phone system license might not work)
  2. assign an Online Voice Routing Policy to the resource account which is assigned to the call queue or auto attendant [with PowerShell]
  3. Wait for some time (as I was testing this, I configured this in the late afternoon and the next morning it was working as expected, this might be different and I’m not aware of a default duration till it is applied and will work)

I’ll not explain how to get and assign the license, I’ll explain the assignment of the Online Voice Routing Policy because at the time of writing this post, you have to assign the policy by using PowerShell.

Assign an Online Voice Routing Policy to a resource account

#Teams Direct Routing
#Enable resource account for outbound call in Microsoft Teams Call Queues and Auto Attendants
#Example code

Import-Module SkypeOnlineConnector

#Login
if ($cred -eq $null) {$cred = Get-Credential}
#W/O MFA: 
$sfbosession = New-CsOnlineSession -Credential $cred
#WITH MFA: 
#$SFBOsession= New-CsOnlineSession ADMIN-UPN
#Import module
Import-PSSession -Session $sfbosession -AllowClobber

#List Online Voice Routing Policies
Get-CsOnlineVoiceRoutingPolicy 

#Assign Online Voice Routing Policy to Microsoft Teams Resource Account for Teams Direct Routing
$user = "teams-resource-account@domain.tld"
$userovrp = "teams-direct-routing-online-voice-routing-policy"


Grant-CsOnlineVoiceRoutingPolicy -Identity $user -PolicyName $userovrp
#Get a cup or some more cups of coffee and wait!!!
#Check assignment 
Get-CsOnlineUser $user | select OnlineVoiceRoutingPolicy

<#Please note
although it's set quickly it can take quite some time till it is really applied, you can see this on the SBC SIP traces which still points to Teams phone system which is rejecting the referred call with a "403 Forbidden", it detail it states some like that there is no viable outbound route.
#>

Remove-PsSession $sfbosession

Conclusion, opinion and summary

I’ve been waiting for this for some time by now, and now that the feature is available, without creating a workaround, I like it. Especially, because you can also do some automation by using PowerShell for your cloud hotlines based on Microsoft Teams call queues and auto attendants.

Additional resources

4 comments

  1. Quati

    Hi Erik!

    I was expecting this functionality as well.
    But I configured it as you did 2 days ago, and it still doesn’t work. I still get a “SIP/2.0 403 Forbidden” when auto attendant try to transfer to external number.

    “REASON: Q.850;cause=63;text=”925e1bf9-6eaa-4f5d-a82a-6ba88d91112a;User is not Enterprise Voice enabled. User is not allowed to make user based dial out.”
    I’m using AudioCodes in an Azure VM (POC server).

Comment / Kommentar verfassen

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.