Unassigned numbers in Teams – How to.

In Skype for Business server you have the ability to route unassigned numbers to an announcement, response group or user. This functionality is now available for Microsoft Teams in GA.

If a customer calls a number and they are not made aware that the person has left, it could potentially mean loss of business.

So Heres is how you get this configured in your Tenant – This works both with Direct Routing, Calling Plans and Operator Connect.

First of all we need to make sure that you have the latest Teams powershell module installed.

You can test if you have the new cmdlets available.

  • New-CsTeamsUnassignedNumberTreatment
  • Get-CsTeamsUnassignedNumberTreatment
  • Set-CsTeamsUnassignedNumberTreatment
  • Remove-CsTeamsUnassignedNumberTreatment

If not the install and import the latest module by uisng the -force parameter

Now the latest cmd-lets are available for use, and we can start using them

The way it works is similar to Skype for Business – meaning you can point a number range to either an announcement, a specific user or a Call Queue/ Auto attendant.

How to have unassigned numbers reach ressource account

If your endgoal should be unassigned numbers reaching either an Auto Attendant or a Call Queue this is how you do it.

You can use an existing ressource account or create a new one, in this example i will use my exisitng AA called “AA Juhl”

$RAObjectId = (Get-CsOnlineApplicationInstance -Identity oaa_89558f4d43de4117b48be9861b23efae@juhlconsult.dk).ObjectId

You can check to make sure you got the right one by calling the variable

No you must have your regex ready to create the matching rule – there are seperate blogs on the RegEx subject – BUT i always turn to regex101.com its super helpfull – anyway i want to build a regex that Catches anything in the range +45808010xx – This is achieved with this ^+45808010\d{2}$

So now i create the “treatment” or the flow rather for that specific pattern

New-CsTeamsUnassignedNumberTreatment -Identity AttendantUnassigned -Pattern "^\+45808010\d{2}$" -TargetType ResourceAccount -Target $RAObjectId -TreatmentPriority 1

And verify it with Get-CsTeamsUnassignedNumberTreatment

How to have unassigned numbers reach user account

Basically same approch, but now we need the objectId of the user – in this example i will use the number range +45808020xx so the Regex has changed a bit – The priority must be lower – look below for explanation of priority.

$UserObjectId = (Get-CsOnlineUser -Identity tjo@juhlconsult.dk).ObjectId
New-CsTeamsUnassignedNumberTreatment -Identity TJOUnassigned -Pattern "^\+45808020\d{2}$" -TargetType User -Target $UserObjectId -TreatmentPriority 2

How to have unassigned numbers reach announcement

This is also possible, but obviously also achievable by just using an AA – but here you save the Ressource account.

You must record you Wav file locally and then import the audiofile like this

$Content = Get-Content "C:\TJOtemp\NytAnnoucement.wav" -Encoding byte -ReadCount 0
$AudioFile = Import-CsOnlineAudioFile -FileName "TJOAnnouncement.wav" -Content $Content
$fid = [System.Guid]::Parse($AudioFile.Id)

And then create the treatment – i changed the regex again to catch +45808030xx this time around

New-CsTeamsUnassignedNumberTreatment -Identity WAVUnassigned -Pattern "^\+45808030\d{2}$" -TargetType Announcement -Target $fid.Guid -TreatmentPriority 3

Thats it, you now have 3 different ranges with different targets – from here on only your imagination sets the limit for mix and match between ranges, targets and priorities.

How Priority is treated

-TreatmentPriority

The priority of the treatment is Used to distinguish identical patterns. The lower the priority the higher preference. The priority needs to be unique.

If you need help with Regex go to https://www.reg101.com its really usefull

I hope you found this article usefull – please share it in that case.

Have a great day

Leave a Reply

Your email address will not be published. Required fields are marked *