This chapter discusses the JavaScript MultiChannel Application Programming Interface (JSMCAPI) classes.
Understanding JSMCAPIThis section discusses JSMCAPI, a JavaScript-based application programming interface (API) used to build custom applications, such as MultiChannel consoles, or to enable MultiChannel functionality on the PeopleSoft Pure Internet Architecture page. The API is built on the REN server JavaScript client and is a pure JavaScript API.
JSMCAPI is the interface through which the application developer accesses the JSMCAPI functionality. JSMCAPI provides a set of objects, such as User, Address, Group, and so on. The PSMC, a global object, provides all those methods called to send agent requests to the server; it also provides an event handler callback method for the PeopleSoft MultiChannel Application Programming Interface (PSMCAPI) call backs for events coming from the CTI server.
The JSMCAPI communicates with the PSMCAPI through the REN server using MCP (Multi-Channel Protocol). MCP includes topic and event definition. In general, JSMCAPI:
Sends agent requests to the MultiChannel Server.
The requests can be agent state requests such as login, logout, set ready, and so on. Requests can also be call requests, such as dial-out, answer the call, transfer/conference, and so on.
Receives PBX/Switch events from the CTI server.
Events can be the agent state change, such as event ready, not ready, and so on. Events can also be call events, such as incoming call, call released, call transferred, and so on.
Understanding JSMCAPI ClassesThis sections gives an overview of all the JSMCAPI classes.
The following class diagrams explain all the classes, fields, and the methods.

Class diagram part 1

Class diagram part 2

Class diagram part 3

Class diagram part 4

PSMCPSMC is the base class that an application accesses to start an instance of JSMCAPI. The application can access all JSMCAPI functionality through this object. A session object is created from this class.
The following diagram explains the relationship of PSMC with all other classes:

PSMC base class part 1

PSMC base class part 2
See Also

ServerThe Server class refers to the routing server and can execute events for specific server states. Three types of servers are available: CTI, queue server, and MultiChannel server. The constants are CTI, UQ and MCS, respectively.
See Also

RENServerThe RENServer cluster is represented in the RENServer class. It provides the URL and the server status (active or shutdown).
See Also

SessionSessions are set for users registering with the server. Addresses, buddies, and groups are registered for the user with the session. The connection between the server and JSMCAPI is a session. There is only one session object per PSMC object.
See Also

_AddressThe _Address class identifies the user with a unique ID. The ID identifies the user to the routing system and is unique for each channel or media type.
The subclasses of _Address class are:
Extension
_UQAddress
A2AchatAddress
Further delineation of address by media type is provided by:
ChatAddress
EmailAddress
GenericAddress
ChatAddress, EmailAddress, and GenericAddress classes extend _UQAddress.
See Also
A2AChatAddress Class Constructor
EmailAddress Class Constructor
GenericAddress Class Constructor

LineLine class describes the line of the extension for a call task. This version supports one extension with two lines and two extensions with one line in each.
See Also

ConnectionTasks are routed to agents through a connection. Email, chat and generic have a dedicated connection class, like EmailConnection, ChatConnection, and GenericConnection. These connections provide task-specific manipulation functions.
See Also
ChatConnection Class Constructor
EmailConnection Class Constructor

GroupThe group class defines the group or queue information. Each session can have one or more group objects.
See Also

TaskThis abstract base class defines a unit of work. The classes that extend task per media type are:
Call
Chat
A2AChat
GenericTask
See Also

_User_User is a base class. The subclasses are User and Buddy. These classes define the properties that pertain to the user such as the addresses, languages, or presence. _User is a virtual class and should not be instantiated.
See Also

MediaTypeThis class defines the media that an agent can handle.
See Also

ReasonThe Reason class defines the message or error message that accompanies an event or request. Globalization of the messages is implemented. Furthermore, extra data can be passed in this object for providing a detailed message.
See Also

StatisticsStatistics are provided by the routing server for agent, call, task, group, and user. The following classes describe the statistics for each component:
AgentStatistics
CallStatistics
TaskStatistics
GroupStatistics
GroupStatistics1
GroupStatistics2
UserStatistics1
UserStatistics2
See Also
AgentStatistics Class Constructor
CallStatistics Class Constructor
TaskStatistics Class Constructor
GroupStatistics1 Class Constructor
GroupStatistics2 Class Constructor
UserStatistics1 Class Constructor
UserStatistics2 Class Constructor

DataWhen a task is introduced to the system, data pertaining to the task is defined in the following classes:
CallData
EmailData
ChatData
GenericData
Application-specific data is provided for tasks via the AppData class. Similarly, user data is defined in UserData.
See Also

GlobalsThis class defines functions that are used universally.
See Also

MCEventEvents passed to the application handler are defined by MCEvent.
See Also

CapsCapabilities (Caps) define the ability or allowed actions for a component. The following classes define specific capabilities:
ChatConnectionCaps
EmailConnectionCaps
GenericConnectionCaps
ExtensionCaps
LineCaps
ChatConnectionCaps
EmaiConnectionCaps
GenericConnectionCaps
UserCaps
See Also
ChatConnectionCaps Class Constructor
EmailConnectionCaps Class Constructor
GenericConnectionCaps Class Constructor
ExtensionCaps Class Constructor

ForwardModeForwardMode describes various forward modes that can be used while setting the forwarding mode for an Address.
See Also
_Address Class HierarchyThe _Address class can be extended by other subclasses. The following flow chart shows the different subclasses and how they interrelate.
Do not instantiate _Address or _UQAddress class objects. Instead, use the child classes.

_Address class hierarchy
See Also
A2AChatAddress Class Constructor
EmailAddress Class Constructor
GenericAddress Class Constructor
_Address Class Constructor  
The following is the _Address class constructor.

_Address 
Syntax
_Address()
Description
Creates an _Address object that describes the address.
Parameters
None.
Returns
An _Address object.
_Address Class Fields  
This section discusses the JSMCAPI _Address class fields, which are described in alphabetical order.

caps  
Description
The capacities of the address.
Type: object.

id  
Description
The ID of the address.
Type: string.
_Address Class Callback Event Method    
The following is the callback event method used with a JSMCAPI _Address object.

onError 
Syntax
onError(event)
Description
Fires on the event of an address error.
_UQAddress Class Constructor   
The following is the UQAddress class constructor.

_UQAddress 
Syntax
_UQAddress()
Description
Creates a _UQAddress object, which is the base for the various addresses associated with the universal queue server.
Parameters
None.
Returns
A universal queue address object.
_UQAddress Class Fields   
The _UQAddress class inherits the following fields from the _Address class:
caps
id
The following are the _UQAddress class fields.

Tasks 
Description
The associative array of the tasks on the queue managed by the address.
_UQAddress Methods  
The following are the _UQAddress methods.

acceptTask  
Syntax
acceptTask(task, reason)
Description
Sends a request to the universal queue server to signal that the client has accepted the task.
Parameters
| 
 task  | 
 The task ID.  | 
| 
 reason  | 
 The associated reason code.  | 
Returns
Request number.

dequeueTask  
Syntax
dequeueTask(task)
Description
Sends a request to the universal queue server to remove the task from its queue.
Parameters
| 
 task  | 
 The task ID.  | 
Returns
Request number.
_UQAddress Class Callback Event Methods    
The _UQAddress class inherits the onError callback event method from the _Address class.
See _Address Class Callback Event Method.
The following are the callback event methods used with a JSMCAPI universal queue address object. The callback event methods are described in alphabetical order.

onAccepted  
Syntax
onAccepted(event)
Description
Fires when the task is accepted.

onAcceptingTask  
Syntax
onAcceptingTask(event)
Description
Fires as the task is being accepted.

onDequeueingTask  
Syntax
onDequeueingTask(event)
Description
Fires as the task is being dequeued.

onNotify  
Syntax
onNotify(event)
Description
Fires on task notification.

onTaskAdded  
Syntax
onTaskAdded(event)
Description
Fires when the task is added to the addressed queue.

onTaskRemoved  
Syntax
onTaskRemoved(event)
Description
Fired when the task is removed

onUnassigned  
Syntax
onUnassigned(event)
Description
Fired when the task is unassigned.
_User Class HierarchyThe _User class can be extended by other subclasses. The following flow chart shows the different subclasses and how they interrelate:

_User class hierarchy
See Also
_User Class Constructor  
The following is the _User class constructor.

_User 
Syntax
_User()
Description
Describes the base class of user/agent.
Parameters
None.
Returns
A _User object.
_User Class Fields  
The following are the fields associated with the JSMCAPI _User class. These fields are discussed in alphabetical order.

agentID  
Description
The agent's agent ID.
Type: string.

caps  
Description
The agent capabilities on each group.
Type: associative array.

id   
Description
The agent's PeopleSoft user ID.
Type: string.

name  
Description
The agent's user name.
Type: string.

presences  
Description
The agent's presence on each group.
Type: associative array.

states  
Description
Agent state on each group.
Type: associative array, including the constants beginning with ST_*.
These constants must be accessed from an instantiated object.

ST_LOGGEDIN  
Description
The agent is logged in.

ST_LOGGEDOUT  
Description
The agent is logged out.

ST_NOTREADY  
Description
The agent is not ready.

ST_READY  
Description
The agent is ready.

ST_UNKNOWN  
Description
The agent's state is unknown.

ST_WORKNOTREADY  
Description
The agent is in the work not ready state.

ST_WORKREADY  
Description
The agent is in the work ready state.

statistics  
Description
Agent statistics for CTI.
Type: AgentStatistics object.
See Also
AgentStatistics Class Constructor.

statistics1  
Description
Agent statistics for the universal queue server.
Type: UserStatistics1 object.
See Also
UserStatistics1 Class Constructor.

statistics2  
Description
Agent statistics for the universal queue server.
Type: UserStatistcs2 object.
See Also
UserStatistics2 Class Constructor.
A2AChat Class Constructor  
The following is the A2AChat class constructor.

A2AChat 
Syntax
A2AChat(event,address,chatType)
Description
Creates an agent-to-agent chat object.
The chat is related to the A2AChatAddress. It does not extend Task as it is not generated or tracked by the universal queue server. Construction occurs inside the A2AChatAddress.
Parameters
| 
 event  | 
 Enter the event associated with the agent-to-agent chat.  | 
| 
 address  | 
 Enter the address from A2AChatAddress.  | 
| 
 chatType  | 
 Enter the chat type, for example consult or answer.  | 
Returns
An agent-to-agent chat object.
A2AChat Class Fields  
The following are the A2AChat fields.

address  
Description
The address containing the agent-to-agent chat.
Type: A2AChatAddress object.
See Also
A2AChatAddress Class Constructor

agentID  
Description
The associated agent's ID.
Type: string.

agentName  
Description
The associated agent's name.
Type: string.

appData  
Description
The application data that is provided to the client with the notification event.
Type: AppData object.
See Also

chatType  
Description
The type of chat, either A2AChat.TYPE_CONSULT or A2AChat.TYPE_ANSWER.
Type: string, with one of the following constants:
| 
 Value  | 
 Description  | 
| 
 TYPE_ANSWER  | 
 The A2AChat type answer. This type is generated when another agent wants this agent to answer an A2AChat.  | 
| 
 TYPE_CONSULT  | 
 The A2AChat type consult. This type is generated when this agent wants to consult another agent.  | 
Example
The A2AChat.TYPE_* can only be accessed as in the following example:
var value = A2AChat.TYPE_CONSULT;
See Also

customerName  
Description
The name of the customer in the ongoing chat.
Type: object.

id  
Description
The ID of this chat.
Type: string.

isConference  
Description
A flag to check whether it is conference or not.
Type: object.

jr  
Description
JournalRoute
Type: string.

question  
Description
Question that is asked when customer initiates chat.
Type: object.

subject  
Description
Subject of the chat. Customer will provide this subject when he initiates chat.
Type: object.

type  
Description
The task type, chat.
Type: string.

uniqueueId  
Description
The unique ID.
Type: string.
A2AChat Class Method   
The following is the A2AChat class method.

getURL 
Syntax
getURL(defaultURL)
Description
Returns the URL for the given task.
Parameters
| 
 defaultURL  | 
 If not null, this value will override the generated base URL.  | 
Returns
The URL associated with this task.
A2AChatAddress Class Constructor  
The following is the A2AChatAddress constructor.

A2AChatAddress 
Syntax
A2AChatAddress()
Description
Agent-to-agent chat address. Handles the creation of agent-to-agent chats for incoming and outgoing chat communication.
Parameters
None.
Returns
An A2AChatAddress object.
A2AChatAddress Class Fields  
The A2AChatAddress class inherits the following fields from the _Address class:
id
caps
The following are the fields associated with the A2AChatAddress class.

id  
Description
The address ID.
Type: string.

tasks  
Description
The array of A2AChats associated with this address.
Type: associative array.
See Also
A2AChatAddress Class Method  
The following is the A2AChatAddress class method.

initiateChat 
Syntax
initiateChat(agentId)
Description
Initializes the A2AChatAddress by creating an A2AChat task.
Parameters
| 
 agentId  | 
 The ID of the agent with whom you want to chat.  | 
Returns
Request number.
A2AChatAddress Class Callback Event Methods    
The A2AChatAddress class inherits the onError callback event method from the _Address class.
See _Address Class Callback Event Method.
The following are the A2AChatAddress class callback methods:

onChatEnded  
Syntax
onChatEnded(event)
Description
This event gets called when an agent to agent chat is closed.

onInitiatingChat  
Syntax
onInitiatingChat(event)
Description
This event gets called when chat is getting initiated.

onNotify  
Syntax
onNotify(event)
Description
This event gets called when there is a new A2Achat notification.
AgentStatistics Class Constructor  
The following is the AgentStatistics class constructor.

AgentStatistics 
Syntax
AgentStatistics()
Description
The agent statistics information.
Parameters
None.
Returns
An AgentStatistics object.
AgentStatistics Class Fields  
The following are the AgentStatistics class fields.

averageCallDuration  
Description
The average call duration, in seconds, for an agent.
Type: number

averageHoldDuration  
Description
The average hold duration, in seconds, for an agent.
Type: number.

callsHandled  
Description
The total number of calls handled by an agent.
Type: number.

data  
Description
An associative array of key-value pairs that includes all agent statistics.
Type: associative array.

percentIdleTime  
Description
The percentage of time for which the agent is idle.
Type: number

percentTimeAvailable  
Description
The percentage of time for which the agent is in ready state.
Type: number

percentTimeInCurrentState  
Description
The percentage of time in current state.
Type: number

percentTimeUnavailable  
Description
The percentage of time for which the agent is in not ready state.
Type: number

timeCurrentLogin  
Description
The time since login for the agent.
Type: number.

timeWorking  
Description
The time spent working on tasks.
Type: number.

totalTaskAcceptedLogin  
Description
The number of tasks accepted since login time
Type: number

totalTaskDoneLogin  
Description
Number of tasks done by the agent since login time i.e. current login.
Type: number.

totalTaskUnassignedLogin  
Description
Number of tasks unassigned since login time
Type: number.

unavailableDuration  
Description
The total time for which an agent is unavailable.
Type: string.

waitDuration  
Description
The total time an agent has to wait for a call.
Type: string.
AppData Class Constructor  
The following is the AppData class constructor.

AppData 
Syntax
AppData()
Description
The AppData object describes the key-value pairs of the data received on the agent-to-agent chat event.
Parameters
None.
Returns
Type: AppData object.
AppData Class Fields  
The following are the AppData class fields.

data  
Description
An associative array of the data in name value pairs.
Type: associative array.

groupId  
Description
The group ID passed in by the notify event.
Type: string.

jr   
Description
The JournalRoute.
Type: string.

question  
Description
The initial question of the task.
Type: string.

strData  
Description
The raw application data as a string.
Type: string.

subject  
Description
The subject of the task.
Type: string.

uniqueId  
Description
The unique ID.
Type: string.

url  
Description
The URL passed in by the AppData.
Type: string with the following constant:
| 
 Value  | 
 Description  | 
| 
 URL  | 
 The associated URL.  | 

userId  
Description
The agent's user ID.
Type: string.

username  
Description
The agent's user name.
Type: string.

wizUrl  
Description
The wizard URL that is used for popping up new task window.
Type: string.
AppData Class Method  
The following is the AppData class method.

addKeyValue 
Syntax
addKeyValue(key, value)
Description
Add the key-value pair to the AppData object.
Parameters
| 
 key  | 
 The key.  | 
| 
 value  | 
 The value.  | 
Returns
None.
Buddy Class Constructor  
The Buddy class extends the _User class.
The following is the Buddy class constructor.

Buddy 
Syntax
Buddy()
Description
Describes the buddy. An agent can register buddies and is notified of state changes.
Parameters
None.
Returns
A Buddy object.
Buddy Class FieldsThe Buddy class inherits the following fields from the _User class:
agentID
caps
id
name
presences
states
statistics
statistics1
statistics2
Buddy Class Callback Event Methods    
The following are the Buddy class callback event methods.

onStat1  
Syntax
onStat1(event)
Description
Fires when statistics1 is received.

onStat2  
Syntax
onStat2(event)
Description
Fires when statistics2 is received.

onState  
Syntax
onState(event)
Description
Fires when the state event is received.
Call Class Constructor  
The Call class extends the Task class.
The following is the Call class constructor.

Call 
Syntax
Call(strCall)
Description
The Call object describes the call task information associated with the line.
Parameters
| 
 strCall  | 
 Enter the call to use with this object.  | 
Returns
A Call object.
Call Class Fields  
The Call class inherits the following fields from the Task class:
caseid
cost
customerid
group
id
onStat
priority
type
urlAbs
urlRel
See Task Class Fields.
The following are additional Call class fields.

line  
Description
The line object that is associated with this call.
Type: line object.
See Also

statistics  
Description
Call statistics object associated with the call.
Type: CallStatistics object.
See Also
CallStatistics Class Constructor.
CallData Class Constructor  
The following is the CallData class constructor.

CallData 
Syntax
CallData()
Description
The CallData object describes the key-value pairs of the call data with the call object.
Parameters
None.
Returns
A CallData object.
CallData Class Fields  
The following are the CallData class fields:

ani  
Description
The ANI caller id.
Type: string.

callId  
Description
The call ID.
Type: string.

callType  
Description
The call type.
Type: string.

data  
Description
The key-value pairs of the call data.
Type: string.

dnis  
Description
The DNIS callee ID.
Type: string.
CallData Class Method  
The following is the CallData class method.

addKeyValue 
Syntax
addKeyValue(key), value
Description
Add key value to the CallData object.
Parameters
| 
 key  | 
 The key.  | 
| 
 value  | 
 The value.  | 
Returns
None.
CallStatistics Class Constructor  
The following is the CallStatistics class constructor.

CallStatistics 
Syntax
CallStatistics()
Description
The call statistics information.
Parameters
None.
Returns
A CallStatistics object.
CallStatistics Class Fields  
The following are the CallStatistics class fields.

data  
Description
An associative array of key-value pairs that includes all statistics.
Type: associative array.

holdTime  
Description
Duration that the call is on hold.
Type: string.

queueTime  
Description
Duration that this call has been in the queue.
Type: string.

talkTime  
Description
Duration that the call is established.
Type: string.
Chat Class Constructor  
The Chat class extends the Task class.
The following is the Chat class constructor.

Chat 
Syntax
Chat(event, address)
Description
The Chat object describes the task information for tasks associated with the ChatAddress.
Parameters
| 
 event  | 
 The onNotify event.  | 
| 
 address  | 
 The chat address.  | 
Returns
A Chat object.
Chat Class Fields  
The Chat class inherits the following fields from the Task class:
caseid
cost
customerid
group
id
onStat
priority
type
The task type for chat that is Task.TYPE_CHAT.
urlAbs
urlRel
See Task Class Fields.
The following are the additional Chat class fields.

address  
Description
The address containing the agent-to-agent chat.
Type: A2AChatAddress object.
See Also
A2AChatAddress Class Constructor

agentId  
Description
The agent's ID.
Type: string.

appData  
Description
The application data that is provided to the client with the notification event.
Type: AppData object.
See Also

chatconnection  
Description
The chat connection object associated with this call.
Type: line object

chatType  
Description
Type of chat, for example consulting chat or answering chat
Type: string

customerName  
Description
The customer username.
Type: string.

groupId  
Description
The group ID.
Type: string.

question  
Description
The question for this chat.
Type: string.

subject  
Description
The subject of the chat.
Type: string.

statistics  
Description
The chat statistics object that associated with this chat.
Type: string.

userData  
Description
The user data associated with the chat.
Type: object.
Chat Class Method  
The Chat class extends the Task class.
The following is the Chat class method.

gettpUrl  
Syntax
gettpUrl(defaultUrl)
Description
Returns the URL for the given task for a third-party routing server.
Parameters
| 
 defaultUrl  | 
 If not null, this value will override the generated base URL.  | 
Returns
Returns the URL associated with this task.

getUrl  
Syntax
getUrl(defaultUrl)
Description
Returns the URL for the given task.
Parameters
| 
 defaultUrl  | 
 The default URL for this chat. If not null this value will override the generated base URL.  | 
Returns
Returns the URL for the chat.
ChatAddress Class Constructor  
The ChatAddress class extends the _UQAddress class.
See _UQAddress Class Constructor.
The following is the ChatAddress class constructor.

ChatAddress 
Syntax
ChatAddress()
Description
Handles the creation of customer chat tasks.
Parameters
None.
Returns
A ChatAddress object.
ChatAddress Class Fields  
The ChatAddress class inherits the following fields from the _Address class:
id
The address's ID is equal to Task.TYPE_CHAT.
caps
The ChatAddress class inherits the following field from the _UQAddress class:
tasks
The following are ChatAddress class fields.

chatconnections  
Description
List of ChatConnection objects that are associated with chat address.
Type: chatconnection object.
ChatAddress Class Methods  
The ChatAddress class inherits the following methods from the _UQAddress class:
acceptTask
dequeueTask
See _UQAddress Methods.
The following are ChatAddress class methods.

chat  
Syntax
chat(agentId,buddyId,reason )
Description
Sends a request to initiate a new chat.
Parameters
| 
 agentId  | 
 The source agent Id.  | 
| 
 buddyId  | 
 The Id of the buddy.  | 
| 
 reason  | 
 The reason code for chat request.  | 
Returns
Request number.

getChatconnectionByConnectionId  
Syntax
getChatconnectionByConnectionId(connectionId)
Description
Get the chatconnection object with the chatconnection Id.
Parameters
| 
 connectionId  | 
 The connection id associated with a chat.  | 
Returns
Line object, null if there is no connection with that chatconnection id.

getChatconnectionindexByConnectionId  
Syntax
getChatconnectionindexByConnectionId (connectionId)
Description
Get the chatconnection index with the chatconnection Id.
Parameters
| 
 connectionId  | 
 The connection id associated with a chat.  | 
Returns
index, −1 if there is no connection with that chatconnection id.

getFreeChatconnection  
Syntax
getFreeChatconnection()
Description
Get the free chatconnection object. A connection is free if there is no activity on this line.
Returns
Returns chatconnection object, null if there is no free line.

getFreeChatconnectionIndex  
Syntax
getFreeChatconnectionIndex()
Description
Get the free chatconnection index. A connection is free if there is no activity on this line.
Returns
Returns chatconnection index, null if there is no free line.
ChatAddress Callback Event Methods    
The ChatAddress class inherits the onError callback event method from the _Address class.
See _Address Class Callback Event Method.
The ChatAddress class inherits the following callback event methods from the _UQAddress class:
onAccepted
onAcceptingTask
onDequeueingTask
onNotify
onTaskAdded
onTaskRemoved
onUnassigned
The following are ChatAddress callback event methods:

onCapabilitiesChanged  
Syntax
onCapabilitiesChangedevent
Description
Fires when ChatAddress capabilities change
ChatConnection Class Constructor  
The following is the chatconnection class constructor.

ChatConnectionSyntax
ChatConnection()
Description
Chat connection object.
Parameters
None
Returns
Returns a chatconnection object.
ChatConnection Class Fields  
The following are chatconnection class fields:

caps  
Description
The capabilities of the ChatConnection.

chat  
Description
Chat task associated with the connection.
Type: string

connectionId  
Description
The connection Id.
Type: string

id  
Description
The constant representing ChatConnection Id.
Type: string

state  
Description
The connection state.
Type: string
| 
 Value  | 
 Description  | 
| 
 ST_DIALING  | 
 Dialing state.  | 
| 
 ST_DROPPED  | 
 Dropped state.  | 
| 
 ST_IDLE  | 
 Idle state.  | 
| 
 ST_INCOMING  | 
 Incoming state.  | 
| 
 ST_TALKING  | 
 Talking state.  | 
| 
 ST_WRAPUP  | 
 Wrap up state.  | 
ChatConnection Class Methods  
The following are chatconnection class methods:

answer  
Syntax
answer(agentId,reason )
Description
Answer a chat request.
Parameters
| 
 agent Id  | 
 The Id of the agent answering the call.  | 
| 
 reason  | 
 The reason code for the answer request.  | 
Returns
Request number.

attachUserData
Syntax
attachUserData(userData,reason )
Description
Attach user data for the chat connection.
Parameters
| 
 userData  | 
 User data of the chat connection.  | 
| 
 reason  | 
 The reason code for the answer request.  | 
Returns
Request number.

conference  
Syntax
conference(agentId,reason )
Description
Conference a chat with another agent.
Parameters
| 
 agent Id  | 
 The Id of the agent invited to the conference.  | 
| 
 reason  | 
 The reason code for the conference request.  | 
Returns
Request number.

forward  
Syntax
forward(fromagentId,toagentId, qid, userdata, chatdata, reason)
Description
Forward chat to another agent or another queue.
Parameters
| 
 fromagentid  | 
 The agent id from whom task is forwarded.  | 
| 
 toagentid  | 
 The target agentid to whom task is forwarded.  | 
| 
 qid  | 
 The target queue to forward the task.  | 
| 
 userdata  | 
 The user data.  | 
| 
 chatdata  | 
 The chat data.  | 
| 
 Reason  | 
 The reason code to forward the task.  | 
Returns
Request number.

gethistory  
Syntax
gethistory(agentId,noofLines, reason )
Description
Request chat history by specifying number of lines of chat history needed.
Parameters
| 
 agent Id  | 
 The source agent id.  | 
| 
 noofLines  | 
 Number of lines of history required.  | 
| 
 reason  | 
 The reason code for the history request.  | 
Returns
Request number.

getUrl  
Syntax
getUrl(defaultURL)
Description
Get the URL for screen popup.
Parameters
| 
 defaultUrl  | 
 The default popup URL.  | 
Returns
Returns a URL string.

message  
Syntax
message(agentId,message, reason )
Description
Send a chat message while chatting.
Parameters
| 
 agent Id  | 
 The source agent id.  | 
| 
 message  | 
 The message to send to other party.  | 
| 
 reason  | 
 The reason code for the message request.  | 
Returns
Request number.

pushURL  
Syntax
pushURL(URL)
Description
Request to push a URL to the customer.
Parameters
| 
 URL  | 
 URL to push.  | 
Returns
Request number.

reject  
Syntax
reject(agentId,reason )
Description
Reject a chat.
Parameters
| 
 agent Id  | 
 The source agent id.  | 
| 
 reason  | 
 The reason code for reject.  | 
Returns
Request number.

release  
Syntax
release(agentId,reason )
Description
Release a chat.
Parameters
| 
 agent Id  | 
 The source agent id.  | 
| 
 reason  | 
 The reason code for release request.  | 
Returns
Request number.

typing  
Syntax
typing(agentId,reason )
Description
Indicates typing in a chat conversation by one party.
Parameters
| 
 agent Id  | 
 The source agent id.  | 
| 
 reason  | 
 The reason code for typing.  | 
Returns
Request number.

wrapup
Syntax
wrapup(agentid,message,tasknum,reason)
Description
Stores chat wrap up comments.
Parameters
| 
 agentid  | 
 The agent id who enters wrap up comments.  | 
| 
 message  | 
 Chat message.  | 
| 
 tasknum  | 
 Task number.  | 
| 
 reason  | 
 The reason code.  | 
Returns
Request number.
ChatConnection Class Callback Event Methods  
The following are ChatConnection class callback event methods.

onAccepted  
Syntax
onAccepted(event)
Description
Fires when chat is accepted by a agent.

onAnswering  
Syntax
onAnswering(event)
Description
Fires when answering the chat.

onCapabilitiesChanged  
Syntax
onCapabilitiesChanged(event)
Description
Fires when chat capabilities change.

onChatdataChanged  
Syntax
onChatdataChanged(event)
Description
Fires when there is a change in chat data.

onConferencing  
Syntax
onConferencing(event)
Description
Fires when conferencing the chat.

onDialing  
Syntax
onDialing(event)
Description
Fires when chat is in the process of connecting.

onDropped  
Syntax
onDropped(event)
Description
Fires when chat is dropped.

onError  
Syntax
onError(event)
Description
Fires when a there is a chat connection error.

onForwarded  
Syntax
onForwarded(event)
Description
Fires when chat is forwarded.

onForwardError  
Syntax
onForwardError(event)
Description
Fires when there is error in forwarding the task.

onForwarding  
Syntax
onForwarding(event)
Description
Fires when forwarding the chat.

onHistory  
Syntax
onHistory(event)
Description
Fires when agent receives chat history.

onIncomingChat  
Syntax
onIncomingChat(event)
Description
Fires when ChatConnection state is changed to INCOMING.

onMessage  
Syntax
onMessage(event)
Description
Fires when there is incoming message.

onPartyAdded  
Syntax
onPartyAdded(event)
Description
Fires when a new chat party is added.

onPartyChanged  
Syntax
onPartyChanged(event)
Description
Fires when the chat party changes.

onPartyRemoved  
Syntax
onPartyRemoved(event)
Description
Fires when a chat party is removed.

onProperties  
Syntax
onProperties(event)
Description
Fires when a agent receives chat properties.

onPushURL  
Syntax
onPushURL(event)
Description
Fires when a routing system push URL.

onRejected  
Syntax
onRejected(event)
Description
Fires when a chat is rejected.

onReleased  
Syntax
onReleased(event)
Description
Fires when a chat is released.

onReleasing  
Syntax
onReleasing(event)
Description
Fires when conferencing the chat.

onRevoked  
Syntax
onRevoked(event)
Description
Fires when a chat is revoked.

onTalking  
Syntax
onTalking(event)
Description
Fires when an agent/customer is in the state of talking.

onTyping  
Syntax
onTyping(event)
Description
Fires when typing in a chat conversation.

onUserdataChanged  
Syntax
onUserdataChanged(event)
Description
Fires when there is a change in user data.
ChatConnectionCaps Class Constructor  
The following is the chatconnectioncaps class constructor.

ChatConnectionCapsSyntax
ChatConnectionCaps(strCaps)
Description
Describes the ChatConnection capabilities.
Parameters
| 
 strCaps  | 
 Chat connection capability.  | 
Returns
Returns a chatconnection object.
ChatConnectionCaps Class Fields  
The following are the ChatConnectionCaps class fields.

canAnswer  
Description
Answer capability.
Type: boolean

canConference  
Description
Conference capability.
Type: boolean

canConferenceSingle  
Description
Conference single capability.
Type: boolean

canForward  
Description
Forward capability.
Type: boolean

canIndicateTyping  
Description
Indicate Typing capability.
Type: boolean

canPushURL  
Description
PushURL capability.
Type: boolean

canReject  
Description
Reject capability.
Type: boolean

canSendMessage  
Description
SendMessage capability.
Type: boolean
ChatData Class Constructor  
The following is ChatData class constructor.

ChatDataSyntax
ChatData()
Description
The ChatData object describes the key-value pairs of the chat data with the chat object.
ChatData Class Fields  
The following is ChatData class field.

data  
Description
Key value pairs that includes data.
Type: object.
ChatData Class Methods  
The following is ChatData class method.

addKeyValue  
Syntax
addKeyValue(key, value )
Description
Add key value to the chatdata object.
Parameters
| 
 key  | 
 The variable name.  | 
| 
 value  | 
 The value of the variable.  | 
Email Class Constructor  
The Email class extends the Task class.
The following is the email class constructor.

Email 
Syntax
Email(event)
Description
The Email object describes the task information for tasks associated with the EmailAddress.
Parameters
| 
 event  | 
 The notification event.  | 
Returns
Returns an Email object.
Email Class Fields  
The Chat class inherits the following fields from Task class:
caseid
cost
customerid
group
id
onStat
priority
type
The task type is equal to Task.TYPE_EMAIL.
urlAbs
urlRel
See Task Class Fields.
The following are the additional Email class fields.

address  
Description
The address containing the A2AChat.

agentId  
Description
The agent's ID.

appData  
Description
The application data that is provided to the client with the notification event.
Type: AppData object.
See Also

customerName  
Description
The customer username.
Type: string.

emailconnection  
Description
The emailconnection object that associated with this email.
Type: line object.

emailId  
Description
The unique email id generated from an Enqueue. It identifies the email stored in the database ie. it serves as a key to the data stored in the database.
Type: string.

groupId  
Description
The group id.
Type: string.

question  
Description
The question for this email.
Type: string.

statistics  
Description
The statistics object that is associated with this email.
Type: object.

subject  
Description
The subject of this email.
Type: string.

userData  
Description
The user data that is associated with this email.
Type: object.
Email Class Method  
The following are the Email class methods:

gettpUrl  
Syntax
gettpUrl(defaultUrl)
Description
Returns the URL for the given task for third-party routing.
Parameters
| 
 defaultUrl  | 
 If not null, this value will override the generated base URL.  | 
Returns
The URL associated with this task.

getUrl  
Syntax
getURL(defaultUrl)
Description
Returns the URL for the given task.
Parameters
| 
 defaultUrl  | 
 If not null, this value will override the generated base URL.  | 
Returns
The URL associated with this task.
EmailAddress Class Constructor  
The EmailAddress class extends the _UQAddress class.
See _UQAddress Class Constructor.
The following is the EmailAddress class constructor.

EmailAddress 
Syntax
EmailAddress()
Description
Handles the creation of email tasks.
Parameters
None.
Returns
An EmailAddress object.
EmailAddress Class Fields  
The EmailAddress class inherits the following fields from the _Address class:
id
The address's ID is equal to Task.TYPE_EMAIL.
caps
The EmailAddress class inherits the tasks field from the _UQAddress class.
The following are EmailAddress class fields.

agent  
Description
The agent id of this email address.

emailconnections  
Description
Describes the EmailConnection object.
EmailAddress Class Methods  
The EmailAddress class inherits the following fields from the _UQAddress class:
acceptTask
dequeueTask
See _UQAddress Methods.

getEmailconnectionByConnectionId  
Syntax
getEmailconnectionByConnectionId(connectionId)
Description
Get the emailconnection object with the emailconnection id.
Parameters
| 
 connectionId  | 
 The connection id associated with a email.  | 
Returns
Returns line object, null if there is no connection with that emailconnection id.

getEmailconnectionindexByConnectionId  
Syntax
getEmailconnectionindexByConnectionId(connectionId)
Description
Get the emailconnection index with the emailconnection id.
Parameters
| 
 connectionId  | 
 The connection id associated with a email.  | 
Returns
Returns index, -1 if there is no connection with that emailconnection id.

getFreeEmailconnection  
Syntax
getFreeEmailconnection()
Description
Get the free email connection object. A connection is free if there is no activity on this line.
Returns
Returns emailconnection object, null if there is no free line.
EmailAddress Callback Event Methods  
The EmailAddress class inherits the onError callback event method from the _Address class.
See _Address Class Callback Event Method.
The EmailAddress class inherits the following callback event methods from the _UQAddress class:
onAccepted
onAcceptingTask
onDequeueingTask
onNotify
onTaskAdded
onTaskRemoved
onUnassigned
See _UQAddress Class Callback Event Methods.
EmailConnection Class Constructor  
The following is EmailConnection class constructor.

EmailConnectionSyntax
EmailConnection()
Description
Handles email connection.
EmailConnection Class Fields  
The following are EmailConnection class fields.

caps  
Description
The capabilities of the EmailConnection.

connectionId  
Description
The email connection Id.
Type: string

email  
Description
Email task id associated with this email connection.
Type: string with following constants:

id  
Description
The id of the EmailConnection.
Type: string

state  
Description
The connection state.
Type: string
| 
 Value  | 
 Description  | 
| 
 ST_DIALING  | 
 Dialing state.  | 
| 
 ST_DROPPED  | 
 Dropped state.  | 
| 
 ST_IDLE  | 
 Idle state.  | 
| 
 ST_INCOMING  | 
 Incoming state.  | 
| 
 ST_TALKING  | 
 Talking state.  | 
EmailConnection Class Methods  
The following are the EmailConnection class methods:

abandon  
Syntax
abandon(reason)
Description
Abandon email task without completing the task .
Parameters
| 
 Reason  | 
 The reason code to abandon.  | 
Returns
Request number.

answer  
Syntax
answer(reason)
Description
Answer/Accept the email assignment.
Parameters
| 
 Reason  | 
 The reason code to answer.  | 
Returns
Request number.

attachUserData
Syntax
attachUserData(userData,reason )
Description
Attach user data for the email connection.
Parameters
| 
 userData  | 
 User data of the email connection.  | 
| 
 reason  | 
 The reason code for the answer request.  | 
Returns
Request number.

complete  
Syntax
complete(reason)
Description
Send task completion notification.
Parameters
| 
 Reason  | 
 The reason code to complete.  | 
Returns
Request number.

forward  
Syntax
forward(fromagentId,toagentId, qid, userdata, emaildata, reason)
Description
Forward email to another agent or to another queue.
Parameters
| 
 fromagentid  | 
 The agent id from whom task is forwarded.  | 
| 
 toagentid  | 
 The target agent id to whom task is forwarded.  | 
| 
 qid  | 
 The target queue to forward the task.  | 
| 
 userdata  | 
 The user data.  | 
| 
 emaildata  | 
 The email data.  | 
| 
 Reason  | 
 The reason code to forward the task.  | 
Returns
Request number.

reject  
Syntax
reject(reason)
Description
Reject email assignment.
Parameters
| 
 Reason  | 
 The reason code to reject.  | 
Returns
Request number.

withdraw_RES  
Syntax
withdraw_RES (reason)
Description
Send response for the request of (Withdraw of Email) by routing server. This is the response from the agent to the routing system.
Parameters
| 
 Reason  | 
 The reason code to withdraw.  | 
Returns
Request number.
EmailConnection Class Callback Event Methods  
The following are EmailConnection class callback event methods:

onAnswering  
Syntax
onAnswering(event)
Description
Fires when email task is getting answered.

onCapabilitiesChanged  
Syntax
onCapabilitiesChanged(event)
Description
Fires when there is a change in connection capabilities.

onCompleted  
Syntax
onCompleted(event)
Description
Fires when EmailConnection state is changed to COMPLETED.

onDropped  
Syntax
onDropped(event)
Description
Fires when EmailConnection state is changed to DROPPED.

onEmaildataChanged  
Syntax
onEmaildataChanged(event)
Description
Fires when there is a change in email data.

onError  
Syntax
onError(event)
Description
Fires when a there is a email connection error.

onForwarded  
Syntax
onForwarded(event)
Description
Fires when email is forwarded to another queue or to another agent.

onForwardError  
Syntax
onForwardError(event)
Description
Fires when there is error in forwarding the task.

onForwarding  
Syntax
onForwarding(event)
Description
Fires when forwarding the email.

onIncoming  
Syntax
onIncoming(event)
Description
Fires when EmailConnection state is changed to INCOMING.

onProcessing  
Syntax
onProcessing(event)
Description
Fires when EmailConnection state is changed to PROCESSING.

onRejected  
Syntax
onRejected(event)
Description
Fires when email task is rejected by agent and the routing system acknowledges the same.

onRevoked  
Syntax
onRevoked(event)
Description
Fires when email is revoked by routing system before agent accepts that.

onUserdataChanged  
Syntax
onUserdataChanged(event)
Description
Fires when there is a change in user data.

onWithdraw_REQ  
Syntax
onWithdraw_REQ(event)
Description
Fires when there is a request for email withdraw from routing server. This is a request from routing server to the agent.
EmailConnectionCaps Class Constructor  
The following is EmailConnectionCaps class constructor:

EmailConnectionCapsSyntax
EmailConnectionCaps(strCaps)
Description
Describes the EmailConnection capabilities.
Parameters
| 
 strCaps  | 
 The capability of the connection  | 
Returns
Returns EmailConnection object.
EmailConnectionCaps Class Fields  
The following are the EmailConnectionCaps class fields.

canAnswer  
Description
Answer/Accept an email capability.
Type: boolean

canComplete  
Description
Capability to complete an assigned email.
Type: boolean

canForward  
Description
Capability to forward an email.
Type: boolean

canReject  
Description
Capability to reject an email.
Type: boolean
EmailData Class Constructor  
The following is EmailConnectionCaps class constructor.

EmailDataSyntax
EmailData()
Description
The EmailData object describes the key-value pairs of the email data with the Email object.
Returns
Returns EmailData object.
EmailData Class Fields  
The following is EmailData class field.

data  
Description
Key value pairs that includes email data.
Type: object.
EmailData Class Methods  
The following is EmailData class method.

addKeyValue  
Syntax
addKeyValue(key, value )
Description
Add key value to the emaildata object.
Parameters
| 
 key  | 
 The variable name.  | 
| 
 value  | 
 The value of the variable.  | 
Extension Class Constructor  
The Extension class extends the _Address class.
See _Address Class Constructor.
The following is the Extension class constructor.

Extension 
Syntax
Extension(numOfLines)
Description
The Extension object describes the CTI address.
Parameters
| 
 numOfLines  | 
 Enter the number of lines for this extension.  | 
Returns
An Extension object.
Extension Class Fields  
The Extension class inherits the following fields from the _Address class:
caps
id
The following are the Extension class fields.

forwardMode  
Description
The forward mode of the extension.
Type: forwardMode object.
See Also

isDnd  
Description
Flag for Do Not Disturb.
Type: boolean.

lines  
Description
List of line objects associated with this extension.
Type: list.

numOfLines  
Description
The number of lines for this extension.
Type: number.
Extension Class Methods  
The Extension class inherits the onError method from the Address class.
The following are the Extension class methods.

cancelDnd  
Syntax
cancelDnd(reason)
Description
Cancel the DND (do not disturb).
Parameters
| 
 reason  | 
 The reason for DND cancellation.  | 
Returns
Request number.

cancelForwardSet  
Syntax
cancelForwardSet(reason)
Description
Cancel the forward.
Parameters
| 
 reason  | 
 The reason for cancelling the forward.  | 
Returns
Request number.

forwardSet  
Syntax
forwardSet(number, mode, reason)
Description
Forward the call to another number/extension.
Parameters
| 
 mode  | 
 The forward mode.  | 
| 
 number  | 
 The number to which all calls will be forwarded.  | 
| 
 reason  | 
 The reason to forward.  | 
Returns
Request number.

getDialingLine  
Syntax
getDialingLine()
Description
Get the dialing line object.
Parameters
None
Returns
Returns a line object. Null if there is no dialing line.
See Also

getFreeLine  
Syntax
getFreeLine()
Description
Get the free line object. A line is free if there is no activity on this line.
Parameters
None
Returns
Returns a line object. It returns null if there is no free line.

getLineByConnectionId  
Syntax
getLineByConnectionId(connectionID)
Description
Get the line object with the call.
Parameters
| 
 connectionId  | 
 The connection ID associated with a call.  | 
Returns
Returns a Line object. Returns null if there is no line with that call.
See Also

getOffHookLine  
Syntax
getOffHookLine()
Description
Get the offhook line object.
Parameters
None.
Returns
Returns a Line object. Returns null if there is no offhook line.
See Also

setDnd  
Syntax
setDnd(reason)
Description
Fires when setting DND (do not disturb).
Parameters
| 
 reason  | 
 The reason to set the DND.  | 
Returns
Request number.
Extension Class Callback Event Methods    
The following are the Extension class callback event methods.

onCancelingDnd  
Syntax
onCancelingDnd(event)
Description
Fires when canceling DND (do not disturb).

onCancelingForward  
Syntax
onCancelingForward(event)
Description
Fires when canceling forward.

onDnd  
Syntax
onDnd(event)
Description
Fires when DND (Do Not Disturb) is requested and processed.

onDndCanceled  
Syntax
onDndCanceled(event)
Description
Fires when DND is cancelled.
Parameters
| 
 event  | 
 The event object.  | 
Returns
None.

onForwardCanceled  
Syntax
onForwardCanceled(event)
Description
Fires when forward is canceled.

onForwarded  
Syntax
onForwarded(event)
Description
Fires when call is forwarded.

onForwarding  
Syntax
onForwarding(event)
Description
Fires when forwarding the call.

onSettingDnd  
Syntax
onSettingDnd(event)
Description
Fires when setting DND (do not disturb).
ExtensionCaps Class Constructor 
The following is the Extension class constructor.

ExtensionCaps 
Syntax
ExtensionCaps(strCaps)
Description
Describes the extension's capabilities.
Parameters
| 
 strCaps  | 
 A string comprising the extension's capabilities.  | 
Returns
An ExtensionCaps object.
ExtensionCaps Class Fields  
The following are the Extension class fields.

canCancelDnd  
Description
This extension can cancel DND (do not disturb).
Type: boolean.

canDial  
Description
This extension can dial out.
Type: boolean.

canFwdBusy  
Description
This extension can forward calls if busy.
Type: boolean.

canFwdBusyNoAnswer  
Description
This extension can forward calls if busy/no answer.
Type: boolean.

canFwdCancelForward  
Description
This extension can cancel forward.
Type: boolean.

canFwdDefault  
Description
This extension can forward.
Type: boolean.

canFwdNoAnswer  
Description
This extension can forward if no answer.
Type: boolean.

canFwdUnconditional  
Description
This extension can forward unconditionally.
Type: boolean.

canRefreshState  
Description
This extension can refresh state.
Type: boolean.

canSetDnd  
Description
This extension can set DND (do not disturb).
Type: boolean.
ForwardMode Class Constructor  
The following is the ForwardMode class constructor.

ForwardMode 
Syntax
ForwardMode()
Description
Describes various forward modes that can be used while setting the forwarding mode for an Address.
Parameters
None.
Returns
A ForwardMode object.
ForwardMode Class Field  
The following is the ForwardMode class field.

mode 
Description
The current forwarding mode.
Type: string of the following constants.
| 
 Value  | 
 Description  | 
| 
 BUSY  | 
 The BUSY forwarding mode.  | 
| 
 BUSYNOANSWER  | 
 The BUSYNOANSWER forwarding mode.  | 
| 
 DEFAULT  | 
 The DEFAULT forwarding mode.  | 
| 
 NOANSWER  | 
 The NOANSWER forwarding mode.  | 
| 
 NONE  | 
 No forwarding mode.  | 
| 
 UNCONDITIONAL  | 
 The UNCONDITIONAL forwarding mode.  | 
GenericAddress Class Constructor  
The GenericAddress class extends the _UQAddress class.
The following is the GenericAddress class constructor.

GenericAddress 
Syntax
GenericAddress()
Description
Handles the creation of generic tasks.
Parameters
None.
Returns
A GenericAddress object.
GenericAddress Class Fields  
The GenericAddress class inherits the following fields from the _Address class.
caps
id
The address's ID is equal to Task.TYPE_GENERIC.
The GenericAddress class inherits the tasks field from the _UQAddress class.
The following are GenericAddress class fields:

agent  
Description
The agent id of this generic address owner.
Type: object

genericconnections  
Description
List of GenericConnections.
Type: genericconnectionobject
GenericAddress Class Methods  
The GenericAddress class inherits the following methods from the _UQAddress class:
acceptTask
dequeueTask
See _UQAddress Methods.
The following are GenericAddress own class methods.

getFreeGenericconnection  
Syntax
getFreeGenericconnectio()
Description
Get the free generic connection object. A connection is free if there is no activity on this line.
Parameters
None.
Returns
Returns genericconnection object, null if there is no free line.

getGenericconnectionByConnectionId  
Syntax
getFreeGenericconnectio(connectionId)
Description
Get the genericconnection object with the genericconnection id.
Parameters
| 
 connectionId  | 
 The connection id associated with a generic.  | 
Returns
Returns line object, null if there is no connection with that genericconnection id.

getGenericconnectionindexByConnectionId  
Syntax
getGenericconnectionindexByConnectionId(connectionId)
Description
Get the genericconnection index with the genericconnection id.
Parameters
| 
 connectionId  | 
 The connection id associated with a generic.  | 
Returns
Returns index, -1 if there is no connection with that genericconnection id.
GenericAddress Class Callback Event Methods 
The GenericAddress class inherits the onError callback event method from the _Address class.
See _Address Class Callback Event Method.
The GenericAddress class inherits the following callback event methods from the _UQAddress class:
onAcceptingTask
onDequeueingTask
onTaskAdded
onTaskRemoved
onNotify
onAccepted
onUnassigned
See _UQAddress Class Callback Event Methods.
GenericConnection Class Constructor  
The following is the GenericConnection class constructor.

GenericConnectionSyntax
GenericConnection()
Description
Handles Generic connection.
Parameters
None.
Returns
A genericconnection object.
GenericConnection Class Fields  
The following are GenericConnection class fields:

caps  
Description
The capabilities of the GenericConnection.

connectionId  
Description
The generic connection Id.
Type: string

generic  
Description
The generic task id associated with this generic connection.
Type: string

id  
Description
The id of the GenericConnection.
Type: string

state  
Description
The connection state.
Type: string with following constants:
| 
 Value  | 
 Description  | 
| 
 ST_DIALING  | 
 Dialing state.  | 
| 
 ST_DROPPED  | 
 Dropped state.  | 
| 
 ST_IDLE  | 
 Idle state.  | 
| 
 ST_INCOMING  | 
 Incoming state.  | 
| 
 ST_TALKING  | 
 Talking state.  | 
GenericConnection Class Methods  
The following are the GenericConnection class methods:

abandon  
Syntax
abandon(reason)
Description
Abandon generic task.
Parameters
| 
 Reason  | 
 The reason code to abandon.  | 
Returns
Request number.

answer  
Syntax
answer(reason)
Description
Answer/Accept the generic task assignment.
Parameters
| 
 Reason  | 
 The reason code to answer.  | 
Returns
Request number.

attachUserData
Syntax
attachUserData(userData,reason )
Description
Attach user data for the generic connection.
Parameters
| 
 userData  | 
 User data of the generic connection.  | 
| 
 reason  | 
 The reason code for the answer request.  | 
Returns
Request number.

complete  
Syntax
complete(reason)
Description
Send task completion notification.
Parameters
| 
 Reason  | 
 The reason code to complete.  | 
Returns
Request number.

forward  
Syntax
forward(fromagentId,toagentId, qid, userdata, genericdata, reason)
Description
Forward generic task to another Agent or to another queue.
Parameters
| 
 fromagentid  | 
 The agent id from whom task is forwarded.  | 
| 
 toagentid  | 
 The target agent id to whom task is forwarded.  | 
| 
 qid  | 
 The target queue to forward the task.  | 
| 
 userdata  | 
 The user data.  | 
| 
 emaildata  | 
 The email data.  | 
| 
 Reason  | 
 The reason code to forward the task.  | 
Returns
Request number.

reject  
Syntax
reject(reason)
Description
Reject generic task assignment.
Parameters
| 
 Reason  | 
 The reason code to reject.  | 
Returns
Request number.

withdraw_RES  
Syntax
withdraw_RES (reason)
Description
Send response for the request of (Withdraw of Generic task) by routing server. This is the response from the agent to the routing system.
Parameters
| 
 Reason  | 
 The reason code to withdraw.  | 
Returns
Request number.
GenericConnection Class Callback Event Methods  
The following are ChatConnection class callback event methods:

onCapabilitiesChanged  
Syntax
onCapabilitiesChanged(event)
Description
Fires when there is a change in GenericData.

onCompleted  
Syntax
onCompleted(event)
Description
Fires when GenericConnection state is changed to COMPLETED.

onDropped  
Syntax
onDropped(event)
Description
Fires when GenericConnection state is changed to DROPPED.

onError  
Syntax
onError(event)
Description
Fires when a there is a generic connection error.

onForwarded  
Syntax
onForwarded(event)
Description
Fires when generic task is forwarded.

onForwardError  
Syntax
onForwardError(event)
Description
Fires when there is error in forwarding the generic task.

onForwarding  
Syntax
onForwarding(event)
Description
Fires when forwarding the generic task.

onGenericdataChanged  
Syntax
onGenericdataChanged(event)
Description
Fires when there is a change in GenericData.

onIncoming  
Syntax
onIncoming(event)
Description
Fires when GenericConnection state is changed to INCOMING.

onProcessing  
Syntax
onProcessing(event)
Description
Fires when GenericConnection state is changed to PROCESSING.

onRejected  
Syntax
onRejected(event)
Description
Fires when generic task is rejected by agent and the routing system acknowledges the same.

onRevoked  
Syntax
onRevoked(event)
Description
Fires when generic task is revoked by routing system before agent accepts that.

onUserdataChanged  
Syntax
onUserdataChanged(event)
Description
Fires when there is a change in user data.

onWithdraw_REQ  
Syntax
onWithdraw_REQ(event)
Description
Fires when there is a request for generic task withdraw from routing server. This is a request from routing server to the agent.
GenericConnectionCaps Class Constructor  
The following is GenericConnectionCaps class constructor.

GenericConnectionCapsSyntax
GenericConnectionCaps(strCaps)
Description
Describes the GenericConnection capabilities.
Parameters
| 
 strCaps  | 
 The capability of the connection.  | 
Returns
Returns GenericConnection object.
GenericConnectionCaps Class Fields  
The following are the GenericConnectionCaps class fields

canAnswer  
Description
Answer/Accept a generic task capability.
Type: boolean

canComplete  
Description
Complete an assigned generic task capability.
Type: boolean

canForward  
Description
Forward a generic task capability.
Type: boolean

canReject  
Description
Reject a generic task capability.
Type: boolean
GenericData Class Constructor  
The following is GenericConnectionCaps class constructor:

GenericDataSyntax
GenericData()
Description
The GenericData object describes the key-value pairs of the generic data with the generic object
Returns
Returns GenericData object.
GenericData Class Fields  
The following is GenericData class field:

data  
Description
Key value pairs that includes data.
Type: object.
GenericData Class Methods  
The following is GenericData class method:

addKeyValue  
Syntax
addKeyValue(key, value )
Description
Add key value to the genericdata object.
Parameters
| 
 key  | 
 The variable name.  | 
| 
 value  | 
 The value of the variable.  | 
GenericTask Class Constructor  
The GenericTask class extends the Task class.
The following is the GenericTask class constructor

GenericTask 
Syntax
GenericTask(event)
Description
The GenericTask object describes the generic task information for tasks associated with the GenericAddress object.
Parameters
| 
 event  | 
 The triggering event.  | 
Returns
A GenericTask object.
GenericTask Class Fields  
The GenericTask class inherits the following fields from the Task class:
caseid
cost
customerid
group
id
onStat
priority
type
The task type for generic task that is Task.TYPE_GENERIC.
urlAbs
urlRel
See Task Class Fields.
The following are the additional GenericTask class fields.

address  
Description
The address containing the A2AChat.

agentId  
Description
The agent id to whom this task is assigned.
Returns a string.

appData  
Description
The application data that is provided to the client with the notification event.
Type: AppData object.
See Also

customerName  
Description
The customer username.
Type: string.

genericconnection  
Description
The generic connection object that associated with this Generic task.
Type: line

genericId  
Description
The unique generic id generated from an Enqueue. It identifies the data in the database associated with the generic task.
Type: string.

groupId  
Description
The group id for which task is initiated.
Type: string.

question  
Description
The question of this generic task which is raised by customer.
Type: string.

statistics  
Description
Task statistics of the generic task.
Type: object.

subject  
Description
The subject of the generic task.
Type: string.

userdata  
Description
User data object that is associated with this generic task.
Type: object.
GenericTask Class Method  
The following is the GenericTask class method.

gettpUrl  
Syntax
gettpUrl(defaultUrl)
Description
Returns the URL for the given task for the third-party routing.
Parameters
| 
 defaultUrl  | 
 If not null, this value will override the generated base URL.  | 
Returns
Returns the URL for the given task.

getUrl  
Syntax
getUrl(defaultUrl)
Description
Returns the URL for the given task.
Parameters
| 
 defaultUrl  | 
 If not null, this value will override the generated base URL.  | 
Returns
Returns the URL for the given task.
GLOBALS Class Fields  
The following are global fields, which may be accessed without instantiating an object. They are accessed as shown.

A2AChat.PS_JR  
Description
The Journal Routing constant.
Example
A2AChat.PS_JR = "ps_jr";

A2AChat.TYPE_ANSWER  
Description
The constant representing an A2AChat type of answer.
This type is generated when a different user wants this user to answer an A2AChat.
Example
A2AChat.TYPE_ANSWER = "answer";

A2AChat.TYPE_CONSULT  
Description
The constant representing an A2AChat type of consult.
This type is generated when this user wants to consult a different user.
Example
A2AChat.TYPE_CONSULT = "consult";

Server.TYPE_CTI  
Description
The constant representing a CTI server.
Example
Server.TYPE_CTI = "CTI";

Server.TYPE_UQ  
Description
The UQ server type.
Example
Server.TYPE_UQ = "UQ";

Task.TYPE_A2ACHAT  
Description
The constant representing an A2AChat.
Example
Task.TYPE_A2ACHAT = "A2ACHAT";

Task.TYPE_CHAT  
Description
The constant representing a chat task.
Example
Task.TYPE_CHAT = "CHAT";

Task.TYPE_CTI  
Description
The constant representing a CTI task.
Example
Task.TYPE_CTI = "CTI";

Task.TYPE_EMAIL  
Description
The constant representing an email task.
Example
Task.TYPE_EMAIL = "EMAIL";

Task.TYPE_GENERIC  
Description
The constant representing a generic task.
Example
Task.TYPE_GENERIC = "GENERIC";
GLOBALS Class Methods  
The following are the GLOBALS class methods.

initJSMCAPI  
Syntax
initJSMCAPI()
Description
The initialization function of the JSMCAPI. This is the first function should be called by application.
Parameters
None.
Returns
None. Initializes JSMCAPI.

isValid  
Syntax
isValid(obj)
Description
Returns true if an object is not undefined and not null. Obj can be any JavaScript object or literal. This method is a convenience method to check that an object is both not null and not undefined.
Parameters
| 
 obj  | 
 Obj can be any JavaScript object or literal.  | 
Returns
Returns a boolean.
Returns true if an object is not undefined and not null.

MCFBroadcast  
Syntax
MCFBroadcast(cluster, queue, task, state, presence, message, securitylevel, importancelevel, senderid, NameValuePairString )
Description
Broadcast a message to any queue, cluster, or only agents.
Parameters
| 
 cluster  | 
 Cluster Id to which we need to send broadcast message.  | 
| 
 queue  | 
 Denotes the queue Id in the cluster.  | 
| 
 task  | 
 Denotes the task, such as email, chat, voice, or generic.  | 
| 
 state  | 
 Denotes the state, such as LoggedIn and NotLoggedIn.  | 
| 
 presence  | 
 Denotes whether the agent is ready or not ready.  | 
| 
 Message  | 
 Enter the message to broadcast.  | 
| 
 security level  | 
 Security level defined by application developers.  | 
| 
 importance level  | 
 Importance level defined by application developers.  | 
| 
 sender Id  | 
 The sender's user id  | 
| 
 namevaluepairs  | 
 Any extra data formed as name-value pair string.  | 
Returns
None
Group Class Constructor  
The following is the Group class constructor.

Group 
Syntax
Group()
Description
The Group object describes the group information.
Parameters
None.
Returns
A Group object.
Group Class Fields  
The following are the Group class fields.

id   
Description
The group ID.
Type: string.

name  
Description
The group name.
Type: string.

registered  
Description
True if the Group is registered on the server.
Type: boolean.

statistics  
Description
The group statistics for CTI.
Type: GroupStatistics object
See Also
GroupStatistics1 Class Constructor

statistics1  
Description
The group statistics for the queue server.
Type: GroupStatistics1 object.
See Also
GroupStatistics1 Class Constructor

statistics2  
Description
The group statistics for the queue server.
Type: GroupStatistics2 object.
See Also
GroupStatistics2 Class Constructor
Group Class Callback Event Methods    
The following are the Group class callback event methods.

onStat  
Syntax
onStat(event)
Description
Fires when there is new statistics going to this group.

onStat1  
Syntax
onStat1(event)
Description
Fires when statistics1 is received.

onStat2  
Syntax
onStat2(event)
Description
Fires when statistics2 is received.

onTaskAdded  
Syntax
onTaskAdded(event)
Description
Fires when a task added to this group.

onTaskRemoved  
Syntax
onTaskRemoved(event)
Description
Fires when a task is removed from this group.
GroupStatistics Constructor  
The following is the GroupStatistics class constructor.

GroupStatistics 
Syntax
GroupStatistics()
Description
The group statistics information.
Parameters
None.
Returns
A GroupStatistics object.
GroupStatistics Fields  
The following are the GroupStatistics class fields.

data  
Description
Key value pairs that include all statistics.

listOfTasksInTheQueueByTaskType  
Description
Denotes the task type, task state and the time for which the task is in the system.

maxTaskCompletionTime  
Description
Longest wait time for a task in the queue.

newestTask  
Description
Time elapsed for the most recent task.

newestTaskCompletionTime  
Description
Difference between queue time and the time when task is done.

numberOfAbandoned  
Description
Number of tasks that are abandoned.

numberOfLoggedIn  
Description
Number of agents that are logged in the queue.

numberOfQueued  
Description
Number of tasks that are queued.

numUnassignedTasks  
Description
Number of unassigned tasks.

queuedWaitTime  
Description
The average wait time, in seconds, of a queued task.

queueUpTime  
Description
Time since the queue is available on the system (startup/boot time).

relativeQueueLoad  
Description
Relative queue load.

timeElapsedOldestTask  
Description
Time elapsed for the oldest task (difference between current time and en-queue time).
GroupStatistics1 Class Constructor  
The following is the GroupStatistics1 class constructor.

GroupStatistics1 
Syntax
GroupStatistics1(data)
Description
UQ Group statistics sent on group refresh 1.
Parameters
| 
 data  | 
 Statistical data from the UQ server.  | 
Returns
A GroupStatistics1 object.
GroupStatistics1 Class Fields  
The following are the GroupStatistics1 class fields.

mostRecentTaskDone  
Description
The most recently done task in the group.
Type: string.

mostRecentTaskDoneData  
Description
The data for the most recent task done.
Type: string.

mostRecentTaskEnqueued  
Description
The most recently enqueued task in the group.
Type: string.

mostRecentTaskEnqueuedData  
Description
The data for the most recently enqueued task.
Type: string.

numAgentsAvailable  
Description
Number of agents available in the group.
Type: string.

numAgentsLoggedIn  
Description
Number of agents logged in on the group.
Type: string.

numEscalation  
Description
Number of escalated tasks in the group.
Type: string.

numOverflow  
Description
Number of overflowed tasks in the group.
Type: string.

numTaskAccepted  
Description
Number of tasks accepted in the group.
Type: string.

numTaskDone  
Description
Number of tasks done in the group.
Type: string.

numTaskQueued  
Description
Number of tasks queued in the group.
Type: string.

reasonFlag  
Description
The reason flag for this GroupStatistics event.
Type: string.

taskTotalTimeInSystem  
Description
The total time in the system.
Type: string.

timeSinceStart  
Description
The time since start.
Type: string.
GroupStatistics2 Class Constructor  
The following is the GroupStatistics2 class constructor.

GroupStatistics2 
Syntax
GroupStatistics2(data)
Description
UQ Group statistics sent on group refresh 2.
Parameters
| 
 data  | 
 UQ server statistical data.  | 
Returns
A GroupStatistics2 object.
GroupStatistics2 Class Fields  
The following are the GroupStatistics2 class fields.

averageTaskDuration  
Description
The average task duration in the group.
Type: string.

averageWaitTime  
Description
The average wait time in the group.
Type: string.

oldestTask  
Description
The oldest task in the group.
Type: string.

recentTask  
Description
The most recent task in the group.
Type: string.

timeElapsedOldestTask  
Description
The time elapsed for the oldest task in the group.
Type: string.

timeElapsedRecentTask  
Description
The time elapsed for the most recent task in the group.
Line Class Constructor  
The following is the Line class constructor.

Line 
Syntax
Line()
Description
The Line object describes the line of the extension. JSMCAPI only supports one extension with two lines and two extensions with one line in each.
Parameters
None.
Returns
A Line object.
Line Class Fields  
The following are the Line class fields.

call  
Description
The Call object on the line.
Type: Call object.
See Also

caps  
Description
The capabilities of the line.
Type: LineCaps object.
See Also

connectionid  
Description
The call connection ID on the line.
Type: string.

id  
Description
The line ID.
Type: string.

isMuted  
Description
Flag to see whether extension is muted or not.
Type: string.

state  
Description
The line state.
Type: string with the following constants:
| 
 Value  | 
 Description  | 
| 
 ST_DIALING  | 
 The dialing state.  | 
| 
 ST_DROPPED  | 
 The dropped state.  | 
| 
 ST_HELD  | 
 The held state.  | 
| 
 ST_IDLE  | 
 The idle state.  | 
| 
 ST_OFFHOOK  | 
 The offhook state.  | 
| 
 ST_RINGING  | 
 The ringing state.  | 
| 
 ST_TALKING  | 
 The talking state.  | 
Line Class Methods  
The following are the Line class methods.

alternate  
Syntax
alternate(reason)
Description
Alternate a call.
Parameters
| 
 reason  | 
 The reason to alternate a call.  | 
Returns
Request number.

answer  
Syntax
answer(reason)
Description
Answer a call.
Parameters
| 
 reason  | 
 The reason to answer a call.  | 
Returns
Request number.

attachUserData  
Syntax
attachUserDate(userdata, reason)
Description
Attach user data to a call.
Parameters
| 
 userdata  | 
 The user data to attach to the call.  | 
| 
 reason  | 
 The reason to attach the user data.  | 
Returns
Request number.

clear  
Syntax
clear(reason)
Description
Clear a conference call.
Parameters
| 
 reason  | 
 The reason to clear the conference.  | 
Returns
Request number.

complete  
Syntax
complete(reason)
Description
Complete the two-step transfer/conference.
Parameters
| 
 reason  | 
 The reason to complete the two-step transfer/conference.  | 
Returns
Request number.

conference  
Syntax
conference(destination, reason, userdata, calldata)
Description
Conference a call.
Parameters
| 
 destination  | 
 The destination being invited into the conference.  | 
| 
 reason  | 
 The reason to conference.  | 
| 
 userdata  | 
 The user data to be attached.  | 
| 
 calldata  | 
 The call data to be modified.  | 
Returns
Request number.

conferenceSingle  
Syntax
conferenceSingle(destination, reason, userdata, calldata)
Description
Single-step conference a call.
Parameters
| 
 destination  | 
 The destination being invited into the conference.  | 
| 
 reason  | 
 The reason to conference.  | 
| 
 userdata  | 
 The user data to be attached.  | 
| 
 calldata  | 
 The call data to be modified.  | 
Returns
Request number.

dial  
Syntax
dial(number, reason, userdata)
Description
Dial out.
Parameters
| 
 destination  | 
 The destination being invited into the conference.  | 
| 
 reason  | 
 The reason to conference.  | 
| 
 userdata  | 
 The user data to be attached.  | 
Returns
Request number.

dropParty  
Syntax
dropParty(destination, reason)
Description
Drop a party in conference.
Parameters
| 
 destination  | 
 The destination being dropped from the conference.  | 
| 
 reason  | 
 The reason to drop the party.  | 
Returns
Request number.

getAni  
Syntax
getAni()
Description
Get the ANI.
Parameters
None.
Returns
Returns a string representing the ANI.

getDescr  
Syntax
getDescr()
Description
Get the description attached to the call on the line.
Parameters
None.
Returns
Returns a string.

getDnis  
Syntax
getDnis()
Description
Get the DNIS.
Parameters
None.
Returns
Returns a string.

getPadvalue  
Syntax
getPadvalue(key)
Description
Get the PAD value.
Returns
A string representing PAD value.

getReferenceId  
Syntax
getReferenceId()
Description
Get the reference ID attached to the call on the line.
Parameters
None.
Returns
Returns a string.

getUrl  
Syntax
getUrl(defaultUrl)
Description
Get the URL for screen pop-up.
Parameters
| 
 defaultUrl  | 
 The default pop-up URL.  | 
Returns
Returns a string.

grabCall  
Syntax
grabCall(destination, reason)
Description
Grab a call from the queue.
Parameters
| 
 destination  | 
 The destination to be grabbed.  | 
| 
 reason  | 
 The reason for the grab.  | 
Returns
Request number.

hold  
Syntax
hold(reason)
Description
Hold a call.
Parameters
| 
 reason  | 
 The reason to hold the call.  | 
Returns
Request number.

join  
Syntax
join(reason, conferenceId)
Description
Join an existing call/conference.
Parameters
| 
 reason  | 
 The reason to join the call.  | 
| 
 conferenceId  | 
 Call id.  | 
Returns
Request number.

mute  
Syntax
mute(reason)
Description
Mute an extension.
Parameters
| 
 reason  | 
 The reason to mute the call.  | 
Returns
Request number.

park  
Syntax
park(destination, reason)
Description
Park a call.
Parameters
| 
 destination  | 
 The destination on which the call will be parked.  | 
| 
 reason  | 
 The reason to park the call.  | 
Returns
Request number.

reconnect  
Syntax
reconnect(reason)
Description
Reconnect to the original party during two-step transfer/conference.
Parameters
| 
 reason  | 
 The reason to reconnect.  | 
Returns
Request number.

reject  
Syntax
reject(reason)
Description
Reject an incoming call.
Parameters
| 
 reason  | 
 The reason to reject.  | 
Returns
Request number.

release  
Syntax
release(reason)
Description
Release a call.
Parameters
| 
 reason  | 
 The reason to release the call.  | 
Returns
Request number.

retrieve  
Syntax
retrieve(reason)
Description
Retrieve a held call.
Parameters
| 
 reason  | 
 The reason to retrieve the call.  | 
Returns
Request number.

sendDTMF  
Syntax
Syntax
sendDTMF(reason,stringDTMF )
Description
Send DTMF tones to the switch.
Parameters
| 
 reason  | 
 The reason for requesting DTMF.  | 
| 
 stringDTMF  | 
 DTMF tones string (0-9,*,#).  | 
Returns
Request number.

setcallresult  
Syntax
setcallresult(result)
Description
Set call result.
Parameters
| 
 result  | 
 Result of the call.  | 
Returns
Request number.

setcallresultDNC  
Syntax
setcallresultDNC(number, reason)
Description
Do not call.
Parameters
| 
 number  | 
 The number not to be disturbed.  | 
| 
 reason  | 
 The reason not to disturb.  | 
Returns
Request number.

setcallresultReschedule  
Syntax
setcallresultReschedule(hour, minutes, day, month,year)
Description
Reschedule a call.
Parameters
| 
 hour  | 
 Hours  | 
| 
 Minutes  | 
 Minutes  | 
| 
 Day  | 
 Day  | 
| 
 Month  | 
 Month  | 
| 
 Year  | 
 Year  | 
Returns
Request number.

transfer  
Syntax
transfer(destination, reason, userdata, calldata)
Description
Transfer a call.
Parameters
| 
 destination  | 
 The destination to which the call will be transferred.  | 
| 
 reason  | 
 The reason to transfer.  | 
| 
 userdata  | 
 The user data to be attached.  | 
| 
 calldata  | 
 The call data to be modified.  | 
Returns
Request number.

transferMute  
Syntax
transferMute(destination, reason, userdata, calldata)
Description
Transfer mute a call.
Parameters
| 
 destination  | 
 The destination to which the call will be transferred.  | 
| 
 reason  | 
 The reason to transfer.  | 
| 
 userdata  | 
 The user data to be attached.  | 
| 
 calldata  | 
 The call data to be modified.  | 
Returns
Request number.

unmute  
Syntax
unmute(reason)
Description
Unmute a call.
Parameters
| 
 reason  | 
 The reason to unmute a call.  | 
Returns
Request number.

updateCallData  
Syntax
updateCallData(calldata, reason)
Description
Update call data to a call.
Parameters
| 
 calldata  | 
 The call data to update.  | 
| 
 reason  | 
 The reason to update.  | 
Returns
Request number.
Line Class Callback Event Methods    
The following are the Line class callback event methods.

onAlternating  
Syntax
onAlternating(event)
Description
Fires when alternating the call.

onAnswering  
Syntax
onAnswering(event)
Description
Fires when answering the call.

onAttachingUD  
Syntax
onAttachingUD(event)
Description
Fires when attaching user data.

onCallDataChanged  
Syntax
onCallDataChanged(event)
Description
Fires when the call data on the call is changed.

onCapabilitiesChanged  
Syntax
onCapabilitiesChanged(event)
Description
Fires when the capabilities changed.

onClearing  
Syntax
onClearing(event)
Description
Fires when clearing the conference.

onCompleting  
Syntax
onCompleting(event)
Description
Fires when completing the two-step transfer/conference.

onConferencing  
Syntax
onConferencing(event)
Description
Fires when conferencing the call.

onDialing  
Syntax
onDialing(event)
Description
Fires when there is an outgoing call.

onDropped  
Syntax
onDropped(event)
Description
Fires when the call is released.

onError  
Syntax
onError(event)
Description
Fires when there is error.

onGrabbing  
Syntax
onGrabbing(event)
Description
Fires when grabbing a call from a queue.

onHeld  
Syntax
onHeld(event)
Description
Fires when the call is on hold.

onHolding  
Syntax
onHolding(event)
Description
Fires when holding the call.

onJoining  
Syntax
onJoining(event)
Description
Fires when joining a call or a conference.

onMuted  
Syntax
onMuted(event)
Description
Fires when a call is muted.

onOffHook  
Syntax
onOffHook(event)
Description
Fires when the line is off hook.

onOnHook  
Syntax
onOnHook(event)
Description
Fires when the line is on hook.

onParking  
Syntax
onParking(event)
Description
Fires when parking the call.

onPartyAdded  
Syntax
onPartyAdded(event)
Description
Fires when a new call party coming.

onPartyChanged  
Syntax
onPartyChanged(event)
Description
Fires when the call party has changed.

onPartyRemoved  
Syntax
onPartyRemoved(event)
Description
Fires when a call party is removed.

onReconnecting  
Syntax
onReconnecting(event)
Description
Fires when reconnecting the call.

onRejected  
Syntax
onRejected(event)
Description
Fires when call is rejected.

onRejecting  
Syntax
onRejecting(event)
Description
Fires agent rejects an incoming call.

onReleasing  
Syntax
onReleasing(event)
Description
Fires when releasing the call.

onRetrieving  
Syntax
onRetrieving(event)
Description
Fires when retrieving the call.

onRinging  
Syntax
onRinging(event)
Description
Fires when there is an incoming call.

onSetcallresult  
Syntax
onSetcallresult(event)
Description
Fires when there is a request for setting call result.

onSetcallresultDNC  
Syntax
onSetcallresultDNC(event)
Description
Fires when there is a request for do not call.

onSetcallresultReschedule  
Syntax
onSetcallresultReschedule(event)
Description
Fires when there is a request to reschedule a call.

onTalking  
Syntax
onTalking(event)
Description
Fires when the call is established.

onTransfering  
Syntax
onTransfering(event)
Description
Fires when transferring the call.

onUnmuted  
Syntax
onUnmuted(event)
Description
Fires when call is unmuted.

onUpdatingCD  
Syntax
onUpdatingCD(event)
Description
Fires when updating the call data.

onUserDataChanged  
Syntax
onUserDataChanged(event)
Description
Fires when the user data attached on the call is changed.
LineCaps Class Constructor  
The following is the LineCaps class constructor.

LineCaps 
Syntax
LineCaps(strCaps)
Description
Describes the line's capabilities.
Parameters
| 
 strCaps  | 
 The line's capabilities.  | 
Returns
A LineCaps object.
LineCaps Class Fields  
The following are the LineCaps class fields.

canAlternate  
Description
The line has alternate capability.
Type: boolean.

canAnswer  
Description
The line has answer capability.
Type: boolean.

canAttachUserDate  
Description
The line has attach user data capability.
Type: boolean.

canClear  
Description
The line has clear capability.
Type: boolean.

canComplete  
Description
The line has complete capability.
Type: boolean.

canConference  
Description
The line has conference capability.
Type: boolean.

canConferenceSingle  
Description
The line has conference single capability.
Type: boolean.

canDropParty  
Description
The line has drop party capability.
Type: boolean.

canHold  
Description
The line has hold capability.
Type: boolean.

canMute  
Description
The line has mute capability.
Type: boolean.

canPark  
Description
The line has park capability.
Type: boolean.

canReconnect  
Description
The line has reconnect capability.
Type: boolean.

canReject  
Description
The line has reject capability.
Type: boolean.

canRelease  
Description
The line has release capability.
Type: boolean.

canRetrieve  
Description
The line has retrieve capability.
Type: boolean.

canSendDTMF  
Description
The line has DTMF capability.
Type: boolean.

canSetcallresult  
Description
The line has set call result capability.
Type: boolean.

canSetcallresultDNC  
Description
The line has do not call capability.
Type: boolean.

canSetcallresultReschedule  
Description
The line has reschedule capability.
Type: boolean.

canTransfer  
Description
The line has transfer capability.
Type: boolean.

canTransferMute  
Description
The line has transfer mute capability.
Type: boolean.

canUnmute  
Description
The line has unmute capability.
Type: boolean.

canUpdateCallData  
Description
The line has update call data capability.
Type: boolean.
MCEvent Class Constructor  
The following is the MCEvent class constructor.

MCEvent 
Syntax
MCEvent()
Description
The MCEvent will be passed to the application event handler.
Parameters
None.
Returns
An MCEvent object.
MCEvent Class Fields  
The following are the MCEvent class fields.

extension  
Description
The extension associated with the event.
Type: Extension object.
See Also

group  
Description
The group associated with the event.
Type: Group object.
See Also

reason  
Description
The reason associated with the event.
Type: Reason object.
See Also

user  
Description
The user associated with the event.
Type: User object.
See Also
MediaType Class Constructor  
The following is the MediaType class constructor.

MediaType 
Syntax
MediaType()
Description
Distinguishes between email and CTI media types.
Parameters
None.
Returns
A MediaType object.
MediaType Class Field  
The following is the MediaType field.

type 
Description
The media type.
Type: string with the following constants:
| 
 Value  | 
 Description  | 
| 
 MT_CHAT  | 
 The chat media type.  | 
| 
 MT_EMAIL  | 
 The email media type.  | 
| 
 MT_GENERIC  | 
 The generic media type.  | 
| 
 MT_VOICE  | 
 The voice media type (CTI).  | 
PSMC Class Constructor  
The following is the PSMC class constructor.

PSMC 
Syntax
PSMC()
Description
The global object that the application can access.
Parameters
None.
Returns
A PSMC object.
PSMC Class Fields  
The following are the PSMC class fields.

renserver  
Description
The PSMC instance of the RenServer object.
Type: RenServer object.
See Also

servers  
Description
An associative array the different server objects, indexed by server ID.
Type: associative array.
See Also

sessions  
Description
An associative array that holds the different session objects, indexed by server ID.
Type: associative array.
See Also
PSMC Class Methods  
The following are the PSMC class methods.

closeSession  
Syntax
closeSession(serverId)
Description
Closes the specified session and server object and deletes them.
Parameters
| 
 serverId  | 
 The ID of the REN server cluster for a UQ server, or the server ID for a CTI server.  | 
Returns
None.

getCallById  
Syntax
getCallById(id)
Description
Retrieve the call object by the call ID.
Parameters
| 
 id  | 
 The call ID.  | 
Returns
Type: Call object.
See Also

getChatById  
Syntax
getChatById(id)
Description
Retrieve the chat object by the task id.
Parameters
| 
 id  | 
 The task ID.  | 
Returns
Type: chat object.

getEmailById  
Syntax
getEmailById(id)
Description
Retrieve the email object by the task id.
Parameters
| 
 id  | 
 The task ID.  | 
Returns
Type: email object.

getGenericTaskById  
Syntax
getGenericTaskById(id)
Description
Retrieve the Generic object by the task id.
Parameters
| 
 id  | 
 The task ID.  | 
Returns
Type: generic object.

getLineById  
Syntax
getLineById(id)
Description
Retrieve the line object by the line ID.
Parameters
| 
 id  | 
 The line ID.  | 
Returns
Type: Line object.
See Also

openSession  
Syntax
openSession(id)
Description
Creates the session and server objects for the PSMC.
Parameters
| 
 id  | 
 The ID of the REN server cluster for a UQ server, or the server ID for a CTI server.  | 
Returns
None.

start  
Syntax
start()
Description
Start the JSMCAPI.
Parameters
None.
Returns
None.

stop  
Syntax
stop()
Description
Stop the JSMCAPI.
Parameters
None.
Returns
None.
Reason Class Constructor  
The following is the Reason class constructor.

Reason 
Syntax
reason(code, desc, reasondata1, reasondata2, reasondata3)
Description
The Reason object carries the reason code and reason description.
Parameters
| 
 code  | 
 The reason code.  | 
| 
 desc  | 
 The reason description.  | 
| 
 reasondata1  | 
 The reason data1.  | 
| 
 reasondata2  | 
 The reason data2.  | 
| 
 reasondata3  | 
 The reason data3  | 
Returns
Type: Reason object.
Reason Class Fields  
The following are the Reason class fields.

code  
Description
The reason code.
Type: string.

desc  
Description
The reason description.
Type: string.

reasonData1  
Description
Place holder for extra data.
Type: string.

reasonData2  
Description
Place holder for extra data.
Type: string.

reasonData3  
Description
Place holder for extra data.
Type: string.
RenServer Class Constructor  
The following is the RenServer class constructor.

RenServer 
Syntax
RenServer()
Description
The RenServer object describes the REN server cluster information.
Parameters
None.
Returns
A RenServer object.
RenServer Class Fields  
The following are the RenServer class fields.

isRunning  
Description
Flag containing the state of the REN server connection.
Type: boolean.

url  
Description
The REN server URL.
Type: string.
RenServer Class Callback Event Methods    
The following are the RenServer class callback event methods.

onDown  
Syntax
onDown(event)
Description
Fires when the REN server is down.

onUp  
Syntax
onUp(event)
Description
Fires when the REN server is up.
Server Class Constructor  
The following is the Server class constructor.

Server 
Syntax
Server(serverId)
Description
The Server object describes the server information.
Parameters
| 
 serverId  | 
 The ID of the REN server cluster for a UQ server, or the server ID for a CTI server.  | 
Returns
A Server object.
Server Class Fields  
The following are the Server class fields.

id  
Description
The server ID.
Type: string.

info  
Description
The server information string.
Type: string.

state  
Description
The server state.
Type: string with the following constants.
| 
 Value  | 
 Description  | 
| 
 ST_INSERVICE  | 
 The server is in service.  | 
| 
 ST_OUTOFSERVICE  | 
 The server is out of service.  | 

type  
Description
The type of server, either CTI or UQ.
Type: string with the following constants.
| 
 Value  | 
 Description  | 
| 
 TYPE_CTI  | 
 The server is a CTI server.  | 
| 
 TYPE_MCS  | 
 The server is a third-party MultiChannel server.  | 
| 
 TYPE_UQ  | 
 The server is a queue server.  | 
Example
The TYPE_* fields are global fields, which may be accessed without instantiating an object. They are accessed as shown in this example:
Server.TYPE_UQ = "UQ";
See Also
Server Class Callback Event Methods    
The following are the Server class callback event methods.

onBroadcast  
Syntax
onBroadcast(event)
Description
Fires when there is broadcast message.

onHbLost  
Syntax
onHbLost(event)
Description
Fires when the server's heartbeat is lost.

onHbRecovered  
Syntax
onHbRecovered(event)
Description
Fires when the server's heartbeat is recovered.

onInService  
Syntax
onInService(event)
Description
Fires when the server changes state to in service.

onOutOfService  
Syntax
onOutOfService(event)
Description
Fires when the server changes state to out of service.

onRestart  
Syntax
onRestart(event)
Description
Fires when server restarts.
Session Class Constructor  
The following is the Session class constructor.

Session 
Syntax
Session(serverId)
Description
The Session object describes the session with the server.
Parameters
| 
 serverId  | 
 The ID of the REN server cluster for a UQ server, or the server ID for a CTI server.  | 
Returns
Returns a Session object.
Session Class Fields  
The following are the Session class fields.

addresses  
Description
The associative array of addresses that the session register.
Type: associative array.

buddies  
Description
The buddy hash table in this session.
Type: associative array.

groups  
Description
The group hash table in this session.
Type: associative array.

id  
Description
The session ID generated by the server.
Type: string.

intervalBetweenReqs
Description
Interval in milliseconds between requests.
Type: number

numberRegsPerBulkReqDescription
Number of users or groups to register for one bulk register request.
Type: number

serverId  
Description
The serverId will be unique for every session. It is used to lookup the protocol objects.
Type: string.

state  
Description
The session state.
Type: string with the following constants.
| 
 Value  | 
 Description  | 
| 
 ST_ACTIVE  | 
 The session is in the active state.  | 
| 
 ST_CLOSED  | 
 The session is in the closed state.  | 
| 
 ST_CLOSING  | 
 The session is in the closing state.  | 
| 
 ST_IDLE  | 
 The session is in the idle state.  | 

user  
Description
The current user for the session.
Type: User object.
See Also
Session Class Methods  
The following are the Session class methods.

broadcastSubscribe  
Syntax
broadcastSubscribe(cluster, queue, task, state, presence, method)
Description
Subscribe to broadcast messages.
Returns
Object.

broadcastUnsubscribe  
Syntax
broadcastunsubscribe(type)
Description
Unsubscribe to broadcast messages.
Returns
None.

close  
Syntax
close()
Description
Close the session with the server.
Parameters
None.
Returns
Request number.

open  
Syntax
open()
Description
Open the session with the server.
Parameters
None.
Returns
Request number.

registerAddress  
Syntax
registerAddress(address)
Description
Register the address to the server so that the server will report all events that occur on this address.
Parameters
| 
 address  | 
 The address to be registered.  | 
Returns
Request number.

registerBuddy  
Syntax
registerBuddy(buddy)
Description
Register the buddy to the JSMCAPI so that the JSMCAPI will report all state events that occur on this buddy.
Parameters
| 
 buddy  | 
 The buddy to be registered.  | 
Returns
Request number.

registerBuddiesBulk
Syntax
registerBuddiesBulk(buddies, numRegsPerBulkReq, intervalBetweenReqs)
Description
Register multiple buddies to the JSMCAPI so that the JSMCAPI will report state events that occur for the buddies.
Parameters
| 
 buddies  | 
 An array of buddies  | 
| 
 numRegPerBulkReq  | 
 Number of buddies to register in one bulk registration request.  | 
| 
 intervalBetweenReqs  | 
 Interval in milliseconds between requests.  | 
Returns
Request number.

registerGroup  
Syntax
registerGroup(group)
Description
Register the group to the server so that the server will report all events that occur on this group.
Parameters
| 
 group  | 
 The group to be registered.  | 
Returns
Request number.

registerGroupsBulk
Syntax
registerGroupsBulk(groups, numRegsPerBulkReq, intervalBetweenReqs)
Description
Register multiple groups to the server so that the server will report all events that occur on the groups.
Parameters
| 
 groups  | 
 An array of groups.  | 
| 
 numRegPerBulkReq  | 
 Number of groups to register in one bulk registration request.  | 
| 
 intervalBetweenReqs  | 
 Interval in milliseconds between requests.  | 
Returns
Request number.

registerUser  
Syntax
registerUser(user)
Description
Register the user to the server so that the server will report all those events that happen on this user.
Parameters
| 
 user  | 
 The user to be registered.  | 
Returns
Request number.

setAutoRecovery  
Syntax
setAutoRecovery(autorecover)
Description
Sets the auto recovery feature of the queue server connection to off.
Parameters
| 
 autoRecover  | 
 Recover.  | 

statPublish  
Syntax
statPublish(userStat, groupStat)
Description
Sets the statistics publishing levels for the queue server.
Parameters
| 
 userStat  | 
 Either 0, 1, or 2 for UserStatistics publishing. Enter 0 for no statistics publishing, 1 for Statistics1 publishing, and 2 for Statistics2 and Statistic1 publishing.  | 
| 
 groupStat  | 
 Either 0, 1, or 2 for GroupStatistics publishing. Enter 0 for no statistics publishing, 1 for Statistics1 publishing, and 2 for Statistics2 and Statistic1 publishing.  | 
Returns
Request number.

unregisterAddress  
Syntax
unRegisterAddress(address)
Description
Unregister the address from the server so that the server will not report any events about this address.
Parameters
| 
 address  | 
 The address to be unregistered.  | 
Returns
Request number.

unregisterBuddy  
Syntax
unregisterBuddy(buddy)
Description
Unregister the buddy from the JSMCAPI so that the JSMCAPI will not report any events about the buddy state change.
Parameters
| 
 buddy  | 
 The buddy to be unregistered.  | 
Returns
Request number.

unregisterGroup  
Syntax
unregisterGroup(group)
Description
Unregister the group from the server so that the server will not report any events about this group.
Parameters
| 
 group  | 
 The group to be unregistered.  | 
Returns
Request number.

unregisterUser  
Syntax
unregisterUser(user)
Description
Unregister the user from the server so that the server will not report any events to this user.
Parameters
| 
 user  | 
 The user to be unregistered.  | 
Returns
Request number.
Session Class Callback Event Methods    
The following are the Session class callback event methods.

onAddressRegistered  
Syntax
onAddressRegistered(event)
Description
Fires when the address is registered by the session.

onAddressUnregistered  
Syntax
onAddressUnregistered(event)
Description
Fires when the address is unregistered by the session.

onBuddyRegistered  
Syntax
onBuddyRegistered(event)
Description
Fires when the buddy is registered by the session.

onBuddyUnregistered  
Syntax
onBuddyUnregistered(event)
Description
Fires when the buddy is unregistered by the session.

onClosed  
Syntax
onClosed(event)
Description
Fires when the session is closed.

onError  
Syntax
onError(event)
Description
Fires when there is a session error.

onGroupRegistered  
Syntax
onGroupRegistered(event)
Description
Fires when a group is registered by the session.

onGroupUnregistered  
Syntax
onGroupUnregistered(event)
Description
Fires when a group is unregistered by the session.

onInfo  
Syntax
onInfo(event)
Description
Fires when there is a session information event, such as the user is already logged in.

onOpened  
Syntax
onOpened(event)
Description
Fires when the session is opened.

onUserRegistered  
Syntax
onUserRegistered(event)
Description
Fires when the user is registered by the session.

onUserUnregistered  
Syntax
onUserUnregistered(event)
Description
Fires when the user gets unregistered by the session.
Task Class Hierarchy 
The Task class can be extended by other subclasses. The following flow chart shows the different subclasses and how they interrelate.

Task class hierarchy
See Also
GenericAddress Class Constructor
Task Class Constructor  
The following is the Task class constructor.

Task 
Syntax
Task()
Description
Task is an abstract base class.
Parameters
None.
Returns
Type: Task object.
Task Class Fields  
The following are the Task class fields.

caseid  
Description
The associated case ID.
Type: string.

cost  
Description
The associated cost.
Type: string.

customerid  
Description
The associated customer ID.
Type: string.

group  
Description
The group for which task is assigned.
Type: string.

id  
Description
The task ID.
Type: string.

onStat  
Description
Method that will be triggered when there is statistics published regarding this task.
Type: string.

priority  
Description
The priority of the task.
Type: string.

type  
Description
The type of the task.
Type: string, one of the following:
| 
 Value  | 
 Description  | 
| 
 TYPE_A2ACHAT  | 
 The A2AChat type.  | 
| 
 TYPE_CHAT  | 
 The chat type.  | 
| 
 TYPE_CTI  | 
 The CTI type.  | 
| 
 TYPE_EMAIL  | 
 The email type.  | 
| 
 TYPE_GENERIC  | 
 The generic type.  | 
Example
The TYPE_* fields are global fields, which may be accessed without instantiating an object. They are accessed as shown in this example:
Task.TYPE_GENERIC = "GENERIC";
See Also

urlAbs  
Description
The absolute URL that is useful in constructing URL for new window.
Type: urlAbs object.

urlRel  
Description
The relative URL that is useful in constructing URL for new window.
Type: urlRel object.
TaskStatistics Class Constructor  
The following is the TaskStatistics class constructor.

TaskStatisticsSyntax
TaskStatistics()
Description
Describes the task statistics information.
Returns
Task statistics object.
TaskStatistics Class Fields  
The following are the TaskStatistics class fields.

data  
Description
Key value pairs that includes all statistics.
Type: collection.

holdTime  
Description
Time duration that the task is on hold.
Type: number

queueTime  
Description
Time duration in the queue for this task.
Type: number

talkTime  
Description
Time duration that the task is established.
Type: number
User Class Constructor  
The User class extends the _User class.
The following is the User class constructor.

User 
Syntax
User(id, name, agentId, agentPassword)
Description
Describes the user/agent.
Parameters
| 
 id  | 
 The user ID.  | 
| 
 name  | 
 The user name.  | 
| 
 agentId  | 
 The agent ID.  | 
| 
 agentPassword  | 
 The agent's password.  | 
Returns
A User object.
User Class Fields  
The User class inherits the following fields from the _User class:
agentId
caps
id
name
presences
ST_LOGGEDIN
ST_LOGGEDOUT
ST_NOTREADY
ST_READY
ST_UNKNOWN
ST_WORKNOTREADY
ST_WORKREADY
states
statistics
statistics1
statistics2
The following are the User class fields.

addresses  
Description
The addresses associated with this agent.
Type: associative array.

agentPassword  
Description
The password for this agent.
Type: string.

language  
Description
The language for this agent.
Type: string.

registeredAddresses  
Description
The registered addresses for this user.
Type: associative array.

statesUq  
Description
States of the user for the queue server indexed by group number
Type: object.
User Class Methods  
The following are the User class methods.

ctiBusyUq  
Syntax
ctiBusyUq(busy, subtractcost, task)
Description
Flip ctiBusy flag, reduce cost of a CTI task from an agent's workload, or both. If the task is the same as the agent's assigned task, then the task's cost will be used. In case they do not match, the task type is checked and the default cost of the task is used to recalculate the workload.
Parameters
| 
 busy  | 
 The ctibusy flag that can have a value of 0 or 1.  | 
| 
 subtractcost  | 
 Flag to reduce cost of the cti task from the agent's workload. It can be set to 0 or 1.  | 
| 
 task  | 
 The task object.  | 
Returns
Request number.

disableMedia  
Syntax
disableMedia(group, mediaType, extension, reason)
Description
Disable a media channel for an agent on a group/queue.
Parameters
| 
 group  | 
 The group (queue) on which to disable the specified media type.  | 
| 
 mediaType  | 
 The media type to disable.  | 
| 
 extension  | 
 The extension on which to disable the specified media type.  | 
| 
 reason  | 
 The reason for disabling this media type.  | 
Returns
Request number.

enableMedia  
Syntax
enableMedia(group, mediaType, extension, reason)
Description
Enable a media channel for an agent on a group/queue.
Parameters
| 
 group  | 
 The group (queue) on which to enable the specified media type.  | 
| 
 mediaType  | 
 The media type to enable.  | 
| 
 extension  | 
 The extension on which to enable the specified media type.  | 
| 
 reason  | 
 The reason for enabling this media type.  | 
Returns
Request number.

isMediaEnabled  
Syntax
isMediaEnabled(mediaType, group)
Description
Determines if the specified media type is enabled.
Parameters
| 
 mediaType  | 
 Enter the media type.  | 
| 
 group  | 
 Enter the group.  | 
Returns
Returns true if the media type is enabled.

login  
Syntax
login(group, extension, reason)
Description
Log the user in to a queue.
Parameters
| 
 group  | 
 The group to which the user will log in.  | 
| 
 extension  | 
 The extension.  | 
| 
 reason  | 
 The reason for the login.  | 
Returns
Request number.

loginUq  
Syntax
loginUq(group)
Description
Log a user in to a UQ server queue.
Parameters
| 
 group  | 
 The group (queue) to which the user will login.  | 
Returns
Request number.

logout  
Syntax
logout(group, extension, reason)
Description
Log the user out of the specified group (queue).
Parameters
| 
 group  | 
 The group from which the user will log out.  | 
| 
 extension  | 
 The extension.  | 
| 
 reason  | 
 The reason for the log out.  | 
Returns
Request number.

logoutUq  
Syntax
logoutUq(group)
Description
Log the user out from the UQ server queue.
Parameters
| 
 group  | 
 The group (queue) from which to log the user out.  | 
Returns
Request number.

register  
Syntax
register(extension, reason)
Description
Register an extension for the user.
Parameters
| 
 extension  | 
 The extension to be registered.  | 
| 
 reason  | 
 The reason to register the extension.  | 
Returns
Request number.

setNotReady  
Syntax
setNotReady(group, presence, extension, reason)
Description
Set the user state as not ready.
Parameters
| 
 group  | 
 The group on which the user is changing state.  | 
| 
 presence  | 
 The presence in the new state.  | 
| 
 extension  | 
 The extension with which the user is changing state.  | 
| 
 reason  | 
 The reason to set not ready.  | 
Returns
Request number.

setPresence  
Syntax
setPresence(group, presence, extension, reason)
Description
Set the presence for the current state.
Parameters
| 
 group  | 
 The group on which the user is changing presence.  | 
| 
 presence  | 
 The presence for the state.  | 
| 
 extension  | 
 The extension with which the user is changing presence.  | 
| 
 reason  | 
 The reason to set the presence.  | 
Returns
Request number.

setPresenceUq  
Syntax
setPresenceUq(group, presenceText, reason)
Description
Set the Presence for UQ servers.
Parameters
| 
 group  | 
 The group (queue) on which the user is changing his or her presence.  | 
| 
 presenceText  | 
 The new presence.  | 
| 
 reason  | 
 The reason to set the new presence.  | 
Returns
Request number.

setReady  
Syntax
setReady(group, presence, extension, reason)
Description
Set the user state as ready.
Parameters
| 
 group  | 
 The group on which the user is changing state.  | 
| 
 presence  | 
 The presence for the state.  | 
| 
 extension  | 
 The extension with which the user is changing state.  | 
| 
 reason  | 
 The reason to set the state.  | 
Returns
Request number.

setWorkNotReady  
Syntax
setWorkNotReady(group, presence, extension, reason)
Description
Set the user state as work not ready.
Parameters
| 
 group  | 
 The group on which the user is changing state.  | 
| 
 presence  | 
 The presence for the state.  | 
| 
 extension  | 
 The extension with which the user is changing state.  | 
| 
 reason  | 
 The reason to set work not ready.  | 
Returns
Request number.

setWorkReady  
Syntax
setWorkReady(group, presence, extension, reason)
Description
Set the user state as work ready.
Parameters
| 
 group  | 
 The group on which the user is changing state.  | 
| 
 presence  | 
 The presence for the state.  | 
| 
 extension  | 
 The extension with which the user is changing state.  | 
| 
 reason  | 
 The reason to set work ready.  | 
Returns
Request number.

unregister  
Syntax
unregister(extension, reason)
Description
Unregister an extension for the user.
Parameters
| 
 extension  | 
 The extension to be unregistered.  | 
| 
 reason  | 
 The reason to unregister the extension.  | 
Returns
Request number.
User Class Callback Event Methods    
The following are the User class callback event methods.

onCapabilitiesChanged  
Syntax
onCapabilitiesChanged(event)
Description
Fires when capabilities changed.

onCtiBusy  
Syntax
onCtiBusy(event)
Description
Fires when the UQ server is notified that the CTI is busy.

onCTIBUSYUq  
Syntax
onCTIBUSYUq(event)
Description
Fires when the UQ server is notified that the CTI is busy.

onCtiClear  
Syntax
onCtiClear(event)
Description
Fires when the UQ server is notified that the CTI is clear.

onDropped  
Syntax
onDropped(event)
Description
Fires when a user is dropped.

onError  
Syntax
onError(event)
Description
Fires when an error occurs.

onInfo  
Syntax
onInfo(event)
Description
Fires when an information event occurs. Currently only used on UQ server.

onLoggedIn  
Syntax
onLoggedIn(event)
Description
Fires when the user is logged in.

onLoggedOut  
Syntax
onLoggedOut(event)
Description
Fires when the user is logged out.

onLoggingIn  
Syntax
onLoggingIn(event)
Description
Fires when the user is logging in.

onLoggingOut  
Syntax
onLoggingOut(event)
Description
Fires when the user is logging out.

onMediaDisabled  
Syntax
onMediaDisabled(event)
Description
Fires when a media type is disabled.

onMediaEnabled  
Syntax
onMediaEnabled(event)
Description
Fires when a media type is enabled.

onNotReady  
Syntax
onNotReady(event)
Description
Fires when a user state changes to not ready.

onPresenceChanged  
Syntax
onPresenceChanged(event)
Description
Fires when the user's presence is changed.

onReady  
Syntax
onReady(event)
Description
Fires when the user's state changes to ready.

onRegistered  
Syntax
onRegistered(event)
Description
Fires when the address is registered.

onRegistering  
Syntax
onRegistering(event)
Description
Fires when registering the address.

onSettingNotReady  
Syntax
onSettingNotReady(event)
Description
Fires when setting the user's state to not ready.

onSettingPresence  
Syntax
(event)
onSettingPresence
Description
Fires when setting presence for the current state.

onSettingReady  
Syntax
onSettingReady(event)
Description
Fires when setting the user's state to ready.

onSettingWorkNotReady  
Syntax
onSettingWorkNotReady(event)
Description
Fires when setting the user's state to work not ready.

onSettingWorkReady  
Syntax
onSettingWorkReady(event)
Description
Fires when setting the user's state to work ready.

onStat  
Syntax
onStat(event)
Description
Fires when statistics are received.

onStat1  
Syntax
onStat1(event)
Description
Fires when statistics1 is received.

onStat2  
Syntax
onStat2(event)
Description
Fires when statistics2 received.

onUnknown  
Syntax
onUnknown(event)
Description
Fires when the user's state changes to unknown.

onUnregistered  
Syntax
onUnregistered(event)
Description
Fires when the address gets unregistered.

onUnregistering  
Syntax
onUnregistering(event)
Description
Fires when unregistering the address.

onWorkNotReady  
Syntax
onWorkNotReady(event)
Description
Fires when the user's state changes to work not ready.

onWorkReady  
Syntax
onWorkReady(event)
Description
Fires when the user's state changes to work ready.
UserCaps Class Constructor  
The following is the UserCaps class constructor.

UserCaps 
Syntax
UserCaps(strCaps)
Description
The UserCaps object describes the user capabilities.
Parameters
| 
 strCaps  | 
 The user capabilities.  | 
Returns
A UserCaps object.
UserCaps Class Fields  
The following are the UserCaps class fields

canHandleChat  
Description
Chat task handling capability of the user.
Type: boolean.

canHandleEmail  
Description
Email task handling capability of the user.
Type: boolean.

canHandleGeneric  
Description
Generic task handling capability of the user.
Type: boolean.

canHandleVoice  
Description
Voice task handling capability of the user.
Type: boolean.

canLogin  
Description
Login capability of the user.
Type: boolean.

canLogout  
Description
Logout capability of the user.
Type: boolean.

canRefreshState  
Description
The refreshState capability of the user.
Type: boolean.

canSetNotReady  
Description
The setNotReady capability of the user.
Type: boolean.

canSetPresence  
Description
The setPresence capability of the user.
Type: boolean.

canSetReady  
Description
The setReady capability of the user.
Type: boolean.

canSetWorkNotReady  
Description
The setWorkNotReady capability of the user.
Type: boolean.

canSetWorkReady  
Description
The setWorkReady capability of the user.
Type: boolean.
UserData Class Constructor  
The following is the UserData class constructor.

UserData 
Syntax
UserData()
Description
The UserData object describes the key-value pairs of attached user data.
Parameters
None.
Returns
A UserData object.
UserData Class Fields  
The following are the UserData class fields constants.

UserData Class Field Constants 
Description
UserData class uses the following constants.
| 
 Value  | 
 Description  | 
| 
 COMPONENT  | 
 The component.  | 
| 
 DESCR  | 
 The description  | 
| 
 ICSCRIPTPROGRAMNAME  | 
 The IC script program name.  | 
| 
 ICTYPE  | 
 The IC type.  | 
| 
 MARKET  | 
 The market.  | 
| 
 MENU  | 
 The menu.  | 
| 
 REFERENCEID  | 
 The reference ID  | 
| 
 TARGET  | 
 The target.  | 
| 
 URLABS  | 
 The absolute URL.  | 
| 
 URLREL  | 
 The relative URL.  | 
UserData Class Method  
The following is the UserData class method.

addKeyValue  
Syntax
addKeyValue(key, value)
Description
Add the key-value pair to the UserData object.
Parameters
| 
 key  | 
 The key.  | 
| 
 value  | 
 The value.  | 
Returns
None.
UserStatistics1 Class Constructor  
The following is the UseStatistics1 class constructor.

UserStatistics1 
Syntax
UserStatistics1()
Description
UQ User statistics sent on user refresh 1.
Parameters
None.
Returns
A UserStatistics1 object.
UserStatistics1 Class Fields  
The following are the UserStatistics1 class fields.

availableCost  
Description
The amount of unused work.

ctiBusy  
Description
Flag indicating that a user is engaged on CTI task.

currentQueue  
Description
Current queue/group the User last logged into.
Type: string.

mostRecentTaskData  
Description
Most recent task's data.
Type: string.

mostRecentTaskId  
Description
Most recent task's ID.
Type: string.

numTaskAccepted  
Description
The number of tasks accepted by the user.
Type: string.

numTasksDone  
Description
The number of tasks done by the user.

numTasksUnassigned  
Description
The number of tasks unassigned by the user.
Type: string.

presenceText  
Description
The presence text for the user.
Type: string.

reasonFlag  
Description
The reason flag for this event.
Type: string.

state  
Description
Current state of the user.
Type: string.

timeInCurrentState  
Description
Time in current state for the user.
Type: string.

timeSinceLoggedIn  
Description
The time since the user logged in.
Type: string.
UserStatistics2 Class Constructor  
The following is the UserStatistics2 class constructor.

UserStatistics2 
Syntax
UserStatistics2()
Description
UQ User statistics sent on user refresh 2 event.
Parameters
None.
Returns
A UserStatistics2 object.
UserStatistics2 Class Fields  
The following are the UserStatistics2 class fields.

currentQueue  
Description
The current queue or group for the user.
Type: string.

timeIdle  
Description
Idle time for the user.
Type: string.

timeInCurrentState  
Description
The time in the current state for the user.
Type: string.

timeNotReady  
Description
The time during which the user was in the not ready state.
Type: string.

timeSinceLogin  
Description
The time since the user logged in.
Type: string.

totalTimeAvailable  
Description
The total time during which the user has been in the available state.
Type: string.

totalTimeUnavailable  
Description
The total time during which the user has been in the unavailable state.