Agent Interaction SDK Application Blocks Guide

Open Media Interaction Handling Application Blocks

Summary: This section presents the design and use of the two Open Media Interaction Handling Application Blocks.

Sections Overview

Simple Open Media Interaction Handling
Complex Open Media Interaction Handling

Simple Open Media Interaction Handling

The Simple Open Media Interaction Handling Application Block shows how to perform simple agent actions on open media interactions, for instance, create, accept, decline.

Design of the Simple Open Media Interaction Handling Application Block.

Figure 5.1. Class Diagram of the Simple Open Media Interaction Handling Application Block

Table 5.1 describes each of the components in Figure 5.1.

Table 5.1. Simple Open Media Interaction Handling Application Block Component Description

Class Name

Description

SimpleOpenMediaHandler

Manages agent actions on open media interactions.

InteractionListenerAdapter

Monitors interaction events.

AgentHandler

Manages agent actions. See the Agent Application Block section.

As shown in figure 5.1, the design of the Simple Open Media Interaction Handling Application Block makes it possible to use this application block with the Agent Application Block.

Using the Simple Open Media Interaction Handling Application Block

To create a Simple Open Media Interaction Handling Application Block, you can either use or not an Agent Application Block. The following code example uses an Agent instance to create the application block.

Agent anAg = mAgentHdl.getAgent();
SimpleOpenMediaHandler mIxnHdl = new SimpleOpenMediaHandler(anAg);

Then you can use the SimpleOpenMediaHandler instance to perform actions on open media interactions. For instance, you can create a new open media interaction. The application block adds an InteractionListenerAdapter instance to the returned interaction.

Interaction parentIxn = ... ;

Interaction anIxn = mIxnHdl.createOpenMediaInteraction("MediaType", "InteractionType", "InteractionSubtype", "customer ID", "queue","interaction subject", parentIxn, null);

Complex Open Media Interaction Handling

The Complex Open Media Interaction Handling shows how to perform complex agent actions on open media interactions, for instance, stop processing an interaction in Universal Contact Server, stop processing an interaction in the Interaction Server, and thread interactions.

Design of the Complex Open Media Interaction Handling Application Block.

Figure 5.2. Class Diagram of the Complex Open Media Interaction Handling Application Block

Table 5.2 describes each of the components in Figure 5.2.

Table 5.2. Complex Open Media Interaction Handling Application Block Component Description

Class Name

Description

SimpleOpenMediaHandler

Manages simple agent actions on open media interactions.

ComplexOpenMediaHandler

Manages complex agent actions on open media interactions.

AgentHandler

Manages agent actions. See the Agent Application Block section.

As shown in figure 5.2, the design of the Complex Open Media Interaction Handling Application Block makes it possible to use this application block with the Agent Application Block.

Using the Complex Open Media Interaction Handling Application Block

To create a Complex Open Media Interaction Handling Application Block, you can either use or not an Agent Application Block. The following code example creates an AgentHandler instance and uses it to create the application block.

Agent anAg = (Agent) myAilFactory.getPerson("my_Agent_ID");
mIxnHdl = new ComplexOpenMediaHandler(anAg);

As the ComplexOpenMediaHandler class inherits the SimpleOpenMediaHandler class, you can use it to perform simple agent actions. For instance, you can create a new interaction, as shown in the following code snippet.

Interaction anIxn = mIxnHdl.createOpenMediaInteraction("MediaType", "InteractionType", "InteractionSubtype", "customer ID", "queue","interaction subject", parentIxn, null);

The following code snippet stops the Universal Contact Server from processing the interaction created above:

mIxnHdl.stopProcessingUCS((InteractionOpenMedia)anIxn, false);

Top of the page

Back to the main page