Response Group – How-to create a Call Action

Many response group objects have action properties that accept
RgsCallAction object. The RgsCallAction is used to determine what the system
does when a call is received. Properties for RgsCallAction are as below:

- Action <Enumerator >: Action to be taken. - Terminate: will terminate the call (hang up). - TransferToQueue: call will be transferred to selected queue. - TransferToQuestion: call will be transferred to selected question. - TransferToUri: call will be transferred to selected SipUri. - TransferToVoiceMailUri: call will be transferred to selected voice mail URI. - TransferToPSTN: call will be transferred to selected PSTN (public switched telephone network).

**Prompt** \<CsRgsPrompt\>:  
The prompt (audio file or Text To Speech) to be played.
  • Question <CsRgsQuestion>:
    The question to transfer the call to.
  • QueueID <CsRgsQueue>:
    Identity of the queue the call should be transferred to.
  • Uri <String>:
    SIP address, voice mail URI or PSTN number the call should be transferred to.

At this point you might have noticed that I introduced a few
new Rgs related cmdlets: CsRgsPrompt, CsRgsQuestion and CsRgsQueue. I will not
go deep in this post about these objects but let me at least define for you
what the goal of this objects is:

Either an audio file played or a text that is read aloud by the TTS engine in
order to supply caller with additional information.

Provide the caller with choices (ex: press 1 for English, press 2 for French)
and take action based on the callers' answer.

Hold the caller on hold until an agent is eligible to receive the call.

To create a call action you can either use the Lync Server
Control Panel or the Lync Server Management Shell. However to add a prompt to a
call action you have to use the Lync Server Management Shell.

Figure 1: Configuring a call action via Lync Server
Control Panel

Let's create a call action via PowerShell:

Open the Shell or Import the Lync module to your
PowerShell console.
PS C:\> Import-Module Lync

If you want a prompt in you call action, create
          PS C:\>  $prompt = New-CsRgsPrompt -TextToSpeechPrompt
"Please hold the line, you are being transferred to our sales group".

Create your call action object and define an
action to your object
PS C:\>  $ca = New-CsRgsCallAction -Action

Now depending on the action you selected above
enter a value in the correct property, not doing so will throw an exception
when trying to use this call action with another object.
PS C:\> $ca.Uri = ""

Attach the prompt to your object
          PS C:\> $ca.Prompt = $prompt

Keep in mind that call actions can have only certain type of
action depending on the parent object consuming them, below is a summary of the
valid choices:

Workflow (NextTarget): TransferToQueue,

Workflow (BusinessHours, Holiday): Terminate,
TransferToUri, TransferToVoiceMailUri

Answer: TransferToQueue, TransferToQuestion

Queue: Terminate, TransferToQueue,
TransferToUri, TransferToVoicemailUri

We now have a call action object in memory ready to be used
with either a RgsWorkflow, a RgsAnswer or a RgsQueue.