Announcing ... Unassigned Numbers

A Snippets from the Shell article

by Christopher Wallick, BT

This week we’ll continue our exciting look at those cmdlets that have to do with the Enterprise Voice workload in general, this time focusing on the “CS Announcement Service” in particular. There are some similarities between the CS Announcement Service and the Exchange Announcement Service and if your organization uses Microsoft Exchange you can actually configure Microsoft Lync Server 2010 to use Exchange’s Announcement Service; but I’m getting ahead of myself. At this point you might ask: “Can’t we use the Lync Server Control Panel to configure the Announcement Service?” and the answer would be yes… Well, sort of. Like many other features in Lync Server 2010 there are some things that can’t be done in the Control Panel. So, we turn to our trusted friend – the Lync Server Management Shell.

Before I go any further down this rabbit hole let’s begin at the beginning, shall we? What exactly is this “Announcement” service anyway? Well, the short answer is that it’s the feature within Enterprise Voice running on Lync Server 2010 that plays audio announcements when users dial a valid but unassigned phone number. With announcements, users who dial one of these numbers can be given a message (such as "This number is temporarily out of service") or can be presented with a busy signal. The Announcement service is installed by default as a feature of the Response Group application, which in turn is an advanced feature of Enterprise Voice.

It’s often the case that many organizations have phone numbers that are not assigned to users or phones, but which are still valid numbers that can be called. By default when someone dials one of these numbers he or she will receive a busy signal and the call may result in an error returned to the SIP client. By applying announcement settings to unassigned numbers, administrators have the option of playing a message, returning a busy signal, or redirecting the call.

The process for deploying the Announcement service is fairly straightforward and, as mentioned earlier, requires the Enterprise Voice workload to be installed on either a Standard or Enterprise edition instance of Lync Server 2010. Configuring the Announcement service involves manipulating the unassigned number table by setting number ranges and then associating these numbers with the appropriate announcements.

The first thing we’ll have to do is to create a new announcement and associate the new announcement with a .wav file.

$af = Import-CsAnnouncementFile $ser -FileName "ChangedNumberMessage.wav" -Content (Get-Content ".\PromptFile.wav" -ReadCount 0 -Encoding Byte)

New-CsAnnouncement $ser -Name "Number Changed Announcement" -AudioFilePrompt $af

In this example we first import a .wav file into the file store and assign this uploaded file to a variable ($af). Once that’s done we create the actual announcement and associate the .wav file with it by using the -AudioFilePrompt switch. As in previous Snippets the $ser variable contains the service identity that we want to work with.

Now that we have the announcement we’ll need to configure the unassigned number table. There are several ways the table can be configured based on different business needs. The table can contain all valid extensions, only unassigned extensions, or a combination of both types of numbers where the announcement will only be played when an unassigned number is called. The table can also be configured with custom actions for specific extensions. As you’ll see in a bit, Microsoft recommends that because Lync Server 2010 parses the unassigned number table from top to bottom using the first matching range, final or “last resort” actions should be specified last.

After creating the announcement you can go back to the Lync Server Control Panel to create and manage unassigned number ranges to use the announcements that you created in PowerShell. However, if you really wanted to use PowerShell to create the unassigned number range the command would look something like this:

New-CsUnassignedNumber -Identity Set1 -NumberRangeStart "+15555551000" -NumberRangeEnd "+15555551100" -AnnouncementService ApplicationServer:fqdn.ofyour.LyncAppServer.com -AnnouncementName "Number Changed Announcement"

Just remember that the announcements must be created before you can reference them in the unassigned number table.

Well, I hope this helps someone somewhere. Until next time as always happy shelling!