Creating Workflows Using the Lync Server Management Shell

Creating a Response Group workflow entirely in the Lync Server Management Shell gives some added flexibility to configuration. Specifically, interactive workflows have no limit to the number of questions or responses, unlike the Response Group Configuration Tool, which limits both items.


Tip

Take care to not make interactive workflows with too many menu levels because callers can quickly become frustrated and end the call if they have to navigate through too many levels.



Note

Much of the Response Group configuration done using the Management Shell relies heavily on storing objects as variables. Being descriptive with variable names can reduce the complexity involved when trying to tie all the pieces together.


A basic hunt group workflow can be created easily. All workflows need a default action defined, so the first step in creating a workflow within the Management Shell is to store a default action in a variable. The New-CsRgsCallAction cmdlet creates an action stored in memory that can be used in another command. A simple example that stores the action and sends calls to a specific queue is displayed here:

$TransferToCustomerServiceQueue = New-CsRgsCallAction -Action TransferToQueue -QueueID CustomerService

After an action has been created, a workflow object can be created. The actual workflow setup is flexible and can become extremely complicated. Building off the previous example and stored $TransferToCustomerService variable, a simple hunt group workflow example is presented as follows:

New-CsRgsWorkflow -Name MyWorkflow -Parent service:ApplicationServer:lyncpool.companyabc.com -PrimaryUri [email protected] -DefaultAction $TransferToCustomerServiceQueue -Description "Routes callers dialing customer support" -DisplayNumber " +1 (234) 456-7890" -LineURI "tel:+1234567890"


Note

An interactive workflow requires more upfront preparation and object configuration before creation of the workflow object. Each prompt, question, and answer object must be defined in advance of the Response Group configuration since much of using the Management Shell relies heavily on storing objects as variables. Being descriptive with variable names can reduce the complexity involved when trying to tie all the pieces together.


To get started, a new prompt must be created and saved using the New-CsRgsPrompt cmdlet. The New-CsRgsPrompt cmdlet accepts an audio file as input if one has been stored in a separate variable; the alternative is to enter a text string that reads as text-to-speech. For example, to store the prompt in a variable using an audio file saved earlier as $MyAudioFile, use the following:

$PromptDoYouNeedHelp= New-CsRgsPrompt -AudioFilePrompt $MyAudioFile

After creating a prompt to be played to calls, a question must be posed in an interactive workflow. What might seem a little backward is that an answer list must be formed before a question can be created when the shell is used. For example, to store an answer option if the caller says yes or presses 1 on the keypad, use this:

$AnswerYesMaybe = New-CsRgsAnswer -Action $TransferToCustomerServiceQueue -DtmfResponse 1 -VoiceResponseList "Yes"

Because there is more than one option, assume that another Response Group Answer object exists called $AnswerNo and that it disconnects the call if the user says no or presses 2 on the keypad.

After all the possible answers have been defined, a Response Group Question object can be created. Continuing the previous example, assume that the custom prompt asks the caller if she actually needs help. So far, a response of yes has an action that transfers the caller to the Customer Service queue. If the user says no, the call ends. The following example ties the two responses into a question and stores it in yet another variable:

$DoesCustomerNeedHelpQuestion = New-CsRgsQuestion -Prompt $DoYouNeedHelp –AnswerList $YesMaybe,$No -Name "Do you need help" -NoAnswerPrompt $AreYouStillThere

This example shows creating just one question with only two responses. Be sure to thoroughly plan a workflow before continuing with the setup because it does require quite a bit of scripting. Repeat the previous steps for any additional prompts, questions, and answers that will be part of the workflow.

Before the workflow can be created, the initial prompt must be assigned to a default action object:

$AskIfHelpNeeded = New-CsRgsCallAction -Action TransferToQuestion -Question $DoesCustomerNeedHelpQuestion

Now that a question and call action have been created, an entire interactive workflow can be initiated. To finish the example, the following commands create the workflow that asks the caller whether he needs help:

New-CsRgsWorkflow -Name "Customer Service Workflow" -Parent service:ApplicationServer:lyncpool.companyabc.com –PrimaryUri [email protected] - -DefaultAction $AskIfHelpNeeded -Description "Asks user if they need help and routes to Customer Service if yes" -DisplayNumber "+1 (234) 456-7890" -LineURI "tel:+1234567890"

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset