Freigeben über


Haiku #43

Please hold: your call is

Very important to us.

Music on hold file.

If you're like most people, you're probably sitting in your office right now thinking, "I wonder why those guys who do the Lync Server PowerShell blog never call me. Do they just not like me?"

To begin with, you shouldn't worry about whether we like you or not; we like everybody. (Well, except for you, over there. Sorry, but it's just not working out.) No, the real reason we never call you is because we're afraid we might get put on hold and then we'd have to sit there in silence for a minute or two before you were able to talk to us. In this day and age, what with cable TV, satellite radio, cell phones, and MP3 players, the thought of sitting in silence is just too frightening to contemplate.

Of course, we might be willing to call if we had some assurance that we'd be able to listen to something in case we get put on hold; for example, maybe you could play some music, or maybe you could have some soothing voice remind us how important our call really is to you and assure us that all calls will be answered in the order in which they were received. That would definitely help.

Note. Two suggestions: First, if you are going to play music when people get put on hold then we recommend that you not play 4'33" by John Cage. (Hey, just a suggestion.) Second, we recommend that you don't give people an estimate of when they can expect their call to be answered. The author of today's haiku once called a customer support line and was told that the average wait time was 67 hours. And then, of course, 15 seconds later his call was answered. But maybe the customer support people were traveling on a high-speed rocket or something.

Admittedly, that sounds great; in fact, you're probably thinking how nice it would be to be able to play music any time you need to park a call using Microsoft Lync Server 2010.

Note. What do you mean, "What's call parking?" Haven't you ever read The Good Book (also known as the Lync Server 2010 PowerShell help)? Here's a definition copied from the help topic for Get-CsCpsConfiguration:

Call parking is a service that allows a user to "park" an incoming phone call. Parking a call transfers it to a number in a specified range, or orbit, and then immediately places the call on hold. Anyone (not just the person who originally answered the call) can resume the conversation from any telephone in the system by entering the correct number.

There's just one problem: how do you go about importing an audio file to be played any time you park a call, and then how do you go about telling Lync Server to play that particular file any time you park a call? Sounds impossible, doesn't it?

And, to be perfectly honest, it is impossible.

Well, unless you use Set-CsCallParkServiceMusicOnHoldFile.

Note. Yes, Set-CsCallParkServiceMusicOnHoldFile is a mouthful, isn't it? However, it's not the biggest cmdlet name found in Lync Server; at 36 characters, it pales before the 44-character behemoths Remove-CsBandwidthPolicyServiceConfiguration and Remove-CsDialInConferencingDtmfConfiguration.

Incidentally, while there is considerable disagreement on this issue many people insist that the longest actual word in the English language is floccinaucinihilipilification (29 characters). Floccinaucinihilipilification means "the act of estimating something as being totally worthless."

Looks like the author of today's haiku will be getting a one-word performance review this year.

As you're about to see, while Set-CsCallParkServiceMusicOnHoldFile might be difficult to spell (or at least to type), it's pretty easy to use. The one tricky thing is this: before you can set an audio file as the music on hold file, it needs to be imported to the Application Server that hosts the Call Park application. Oh, and this: you can only have a single audio file per Application Server. That means that the same audio file will be played any time anyone gets put on hold (or at least anyone who gets put on hold via a Call Park orbit assigned to that Application Server).

Here's how you import an audio file and assign it to an Application Server:

$audioFile = Get-Content -ReadCount 0 -Encoding byte "C:\MoHFiles\MusicOnHold.wma"

Set-CsCallParkServiceMusicOnHoldFile -Service ApplicationServer:atl-cs-001.litwareinc.com -Content $audioFile

So what's going on here? Well, in the first line we're using the Get-Content cmdlet to read in the file MusicOnHold.wma and store it in a variable named $audioFile. (By the way, the .WMA format is the only audio format you can use with the Call Park application.) We set the ReadCount parameter to 0 to ensure that the file is read in all at once (otherwise PowerShell would try to read the file line-by-line, which isn't going to work with an audio file) and set the encoding parameter to byte (which lets Get-Content know that we aren't working with, say, a text file). Like we said, all that information gets stashed in the variable $audioFile.

In line 2 we then call Set-CsCallParkServiceMusicOnHoldFile to assign our audio file to the Application Server atl-cs-001.litwareinc.com. And that's all we have to do.

Oh, wait: not quite. We also have to enable music on hold for all the Call Park configurations where we want to use that feature. Fortunately, that can be done using the Set-CsCpsConfiguration cmdlet. For example, to enable music on hold throughout your organization you can use a command like this:

Get-CsCpsConfiguration | Set-CsCpsConfiguration –EnableMusicOnHold $True

Incidentally, Lync Server does ship with a default music on hold file: Cpsmoh.wma. It's unlikely that the Rolling Stones are going to do a cover version of Cpsmoh.wma, but it will work, and – best of all – you don't have to import or configure the thing: just enable music on hold, without specifying a different audio file, and you'll be in business.

Oh, and remember, this just has to be an audio file; it doesn't have to be music that gets played. If you'd like to record a message of some kind and play that instead of music, hey, that's up to you. And if you do decide to play music, well, keep in mind that there could be copyright issues involved here. But we're not lawyers, so we won't get into that.

Note. Good point: we're not really technical writers, either, but that never seems to stop us, does it?

And so if you configure music on hold for the Call Park application then will we call you? We'll see. We're really busy right now (it's like a fire drill around here), but maybe later, when things start to slow down ….