One cmdlet stands

Tall, as if walking on stilts:

New RGS prompt.

 

Last night the author of today's haiku caught the last part of Project Runway (which, to be honest, is one more part than he typically catches). He has to admit, however, that last night's edition was definitely an interesting one: for some reason (if only he'd caught the first part of the show!) all the models were walking on stilts.

 

Note. Either that or the new trend in the fashion industry is to have 14-foot-tall models. Although he is ashamed to admit this, the author of today's haiku doesn't keep up with the latest trends in the fashion industry: the truth is, he's nowhere near as knowledgeable about fashion and haute couture as you'd expect a technical writer at Microsoft to be. Just don't tell his manager, OK?

 

After what happened to Mondo in last year's Project Runway finale the author of today's haiku vowed he would never watch the show again. (Although, in all honesty, he probably would have made that vow regardless of what happened to Mondo.) Still, last night's show definitely caught his attention, especially when one of the judges noted that he really liked one outfit and that "I could picture that outfit on a woman who wasn't wearing stilts." Ha! Like any self-respecting woman would be caught dead without her stilts. Even the author of today's haiku knows that much about fashion.

 

Inspired by Project Runway, the author of today's haiku decided to write today's haiku while on stilts! However, in an oversight he'll never forgive himself for, he neglected to pack his stilts for the trip to Park City, UT. As a result, today's haiku is – alas – being written without the use of stilts.

 

However, the author is sitting in a really tall chair, if that helps.

 

Fortunately, the New-CsRgsPrompt cmdlet makes for a pretty good show even without a pair of stilts. As you probably know, one important use of the Response Group application is the ability for Lync Server to answer a phone call when no one else is available to answer that call. For example, Lync Server might answer a call, inform the caller that all the agents are currently unavailable, and then tell the caller that someone will be there to help them as quickly as possible. Alternatively, Lync Server might answer the phone and tell the caller that no agents are available after 5:00 PM, and then transfer the call to voice mail. You get the idea.

 

Anyway, as smart as Lync Server is (and, to be honest, the software is pretty darn smart), the system relies entirely on you to tell it what to say to callers in these situations; you can't just ask Lync Server to answer the phone and then figure out for itself what to say. Instead, you need to create a Response Group prompt, which can be one of two things:

 

·         An audio file that is played when Lync Server answers the phone ("Please hold; your call is very important to us.").

·         A text-to-speech prompt. You supply the words ("Please hold; your call is very important to us."), and then Lync Server uses its text-to-speech capabilities to "read" those words to the caller.

 

Regardless of which prompt style you choose (and you can choose both styles if you want) you need to create that prompt by using the New-CsRgsPrompt cmdlet.

 

Which, fortunately for all of us, we did pack for the trip to Park City.

 

It's also fortunate for us (or at least those of us who have to write about the cmdlet) that New-CsRgsPrompt is also remarkably easy to use. You say you want to create a new text-to-speech prompt? No problem:

 

$prompt = New-CsRgsPrompt -TextToSpeechPrompt "Please hold; your call is very important to us."

 

As you can see, there really isn't much to do here. We simply call the New-CsRgsPrompt cmdlet, making sure to include the TextToSpeechPrompt parameter followed by the text we want Lync Server to read to the caller. It's too bad we didn't bring our stilts, because that's a command we probably could write while walking on stilts.

 

Probably.

 

Oh, yeah: you might have noticed that we saved the resulting Response Group prompt to a variable named $prompt. Is that important to know? You might say that: if we didn't do that then our prompt would disappear immediately after we created it. With the prompt saved in a variable we can then add the prompt to a Response Group call action. You know, like this:

 

$callAction = New-CsRgsCallAction -Prompt $prompt -Action TransferToQueue -QueueID $queue.Identity

 

And no, sorry, but we won't explain how call actions work; for that, see Haiku #63. The point is, a Response Group prompt is pretty much useless unless that prompt gets added to a call action.

 

In fact (and this is probably a good thing for you to know) there's no way to save and re-use prompts. Remember the prompt we just created? Well, suppose a week later you'd like to use that same prompt with another Response Group workflow. Can you retrieve that prompt from somewhere (say, by using a Get-CsRgsPrompt cmdlet), or can you maybe copy that prompt from another workflow? No, not really; after all, there's no such thing as a Get-CsRgsPrompt cmdlet. Instead, you'll need to recreate that prompt using New-CsRgsPrompt. And that also means you'll need to re-import any audio files used for making an audio file prompt.

 

Note. OK, having said that, there actually is a way you can save and then re-use prompts. After you create your prompt, use the Export-Clixml cmdlet to save that prompt to an XML file. For example:

 

$prompt | Export-Clixml C:\Lync\PleaseHold.xml

 

If you later want to reuse that prompt you can retrieve it by using the Import-Clixml cmdlet:

 

$prompt = Import-Clixml C:\Lync\PleaseHold.xml

 

Of course, you do have to do this while walking on stilts. But other than that ….

 

Speaking of audio file prompts, here's how you do that:

 

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:atl-cs-001.litwareinc.com" -FileName "PleaseHold.wav" -Content (Get-Content C:\Media\PleaseHold.wav -Encoding byte -ReadCount 0)
 
$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile 

 

As you can see, this is a two-part process: first you import the audio file by using the Import-CsRgsAudioFile cmdlet, and then you use the New-CsRgsPrompt cmdlet along with the AudioFilePrompt parameter. And what's the value for the AudioFilePrompt parameter? You got it: the audio file object we just created using Import-CsRgsAudioFile.

 

And if you want to be really cool, include both a text-to-speech and an audio file prompt in the same Response Group prompt:

 

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:atl-cs-001.litwareinc.com" -FileName "PleaseHold.wav" -Content (Get-Content C:\Media\PleaseHold.wav -Encoding byte -ReadCount 0)
 
$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Please hold; your call is very important to us."

 

So what happens if a prompt includes both a text-to-speech prompt and an audio file prompt? Well, by default, Lync Server will first try to play the audio file prompt. Only if that fails will the system resort to using the text-to-speech prompt.

 

That's pretty much all there is to say about New-CsRgsPrompt. As for models on stilts, the author of today's haiku did a little research and discovered that the Project Runway models were actually professional stilt walking models. (Coincidentally, several years ago the author of today's haiku had to choose between becoming a technical writer and becoming a professional stilt walking model. For some reason, he decided to become a technical writer.) These models work for an entertainment company that can also supply you with belly dancers, living statues, fire-eaters, psychics, and, of course, lipstick analysts. Yet another career option the author of today's haiku gave serious thought to before becoming a technical writer.

 

See you tomorrow.