This chapter discusses the JavaScript MultiChannel Application Programming Interface (JSMCAPI) classes.

Understanding JSMCAPI
This section introduces the JSMCAPI, a JavaScript-based 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 upon the REN server JavaScript client and is a pure JavaScript API.
JSMCAPI is the interface with which the application developer accessess the JSMCAPI functionalities. 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.

_Address Class Hierarchy
The _Address class can be extended by other subclasses. The following flowchart 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 ConstructorThe following is the _Address class constructor.

_AddressSyntax
_Address()
Description
Creates an _Address object that describes the address.
Parameters
None.
Returns
An _Address object.

_Address Class FieldsIn this section we discuss the JSMCAPI _Address class fields. These fields are described in alphabetical order.

capsDescription
The capacities of the address.
Type: object.

idDescription
The ID of the address.
Type: string.

_Address Class Callback Event MethodThe following is the callback event method used with a JSMCAPI _Address object.

onErrorSyntax
onError(event)
Description
Fires on the event of an address error.

_UQAddress Class ConstructorThe following is the UQAddress class constructor.

_UQAddressSyntax
_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 FieldsThe _UQAddress class inherits the following fields from the _Address class.
caps
id
The following are the _UQAddress class fields.

TasksDescription
The associative array of the tasks on the queue managed by the address.

_UQAddress MethodsThe following are the _UQAddress methods.

acceptTaskSyntax
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
None.

dequeueTaskSyntax
dequeueTask(task)
Description
Sends a request to the universal queue server to remove the task from its queue.
Parameters
|
task |
The task ID. |
Returns
None.

_UQAddress Class Callback Event MethodsThe _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.

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

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

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

onNotifySyntax
onNotify(event)
Description
Fires on task notification.

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

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

onUnassignedSyntax
onUnassigned(event)
Description
Fired when the task is unassigned.

_User Class Hierarchy
The _User class can be extended by other subclasses. The following flowchart shows the different subclasses, and how they interrelate.

_User class hierarchy
See Also

_User Class ConstructorThe following is the _User class constructor.

_UserSyntax
_User()
Description
Describes the base class of user/agent.
Parameters
None.
Returns
A _User object.

_User Class FieldsThe following are the fields associated with the JSMCAPI _User class. These fields are discussed in alphabetical order.

agentIDDescription
The agent's agent ID.
Type: string.

capsDescription
The agent capabilities on each group.
Type: associative array.

idDescription
The agent's PeopleSoft user ID.
Type: string.

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

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

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

ST_LOGGEDINDescription
The agent is logged in.

ST_LOGGEDOUTDescription
The agent is logged out.

ST_NOTREADYDescription
The agent is not ready.

ST_READYDescription
The agent is ready.

ST_UNKNOWNDescription
The agent's state is unknown.

ST_WORKNOTREADYDescription
The agent is in the work not ready state.

ST_WORKREADYDescription
The agent is in the work ready state.

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

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

statistics2Description
Agent statistics for the universal queue server.
Type: UserStatistcs2 object.
See Also
UserStatistics2 Class Constructor.

A2AChat Class ConstructorThe following is the A2AChat class constructor.

A2AChatSyntax
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 |
Specify the event associated with the agent-to-agent chat. |
|
address |
Specify the address from A2AChatAddress. |
|
chatType |
Specify the chat type. |
Returns
An agent-to-agent chat object.

A2AChat Class FieldsThe following are the A2AChat fields.

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

agentIDDescription
The associated agent's ID.
Type: string.

agentNameDescription
The associated agent's name.
Type: string.

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

chatTypeDescription
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

idDescription
The ID of this chat.
Type: string with PS_JR constant.

jrDescription
JournalRoute
Type: string.

typeDescription
The task type, chat.
Type: string.

uniqueueIdDescription
The unique ID.
Type: string.

A2AChat Class MethodThe following is the A2AChat class method.

getURLSyntax
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 ConstructorThe following is the A2AChatAddress constructor.

A2AChatAddressSyntax
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 FieldsThe A2AChatAddress class inherits the following fields from the _Address class:
id
caps
The following are the fields associated with the A2AChatAddress class.

idDescription
The address ID.
Type: string.

tasksDescription
The associative array of A2AChats.
Type: associative array.
See Also

A2AChatAddress Class MethodThe following is the A2AChatAddress class method:

initiateChatSyntax
initiateChat(agentId)
Description
Initializes the A2AChatAddress by creating an A2AChat task.
Parameters
|
agentId |
The ID of the agent you wish to chat with. |
Returns
None.

A2AChatAddress Class Callback Event MethodsThe 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:

onChatEndedSyntax
onChatEnded(event)
Description
Fires when an agent-to-agent chat is closed.

onInitiatingChatSyntax
onInitiatingChat(event)
Description
Fires when initiating a chat.

onNotifySyntax
onNotify(event)
Description
Fires when receiving the event notification.

AgentStatistics Class ConstructorThe following is the AgentStatistics class constructor.

AgentStatisticsSyntax
AgentStatistics()
Description
The agent statistics information.
Parameters
None.
Returns
An AgentStatistics object.

AgentStatistics Class FieldsThe following are the AgentStatistics class fields.

averageCallDurationDescription
The average call duration, in seconds, for an agent.
Type: string.

averageHoldDurationDescription
The average hold duration, in seconds, for an agent.
Type: string.

callsHandledDescription
The total number of calls handled by an agent.
Type: string.

dataDescription
An associative array of key value pairs that includes all agent statistics.
Type: associative array.

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

waitDurationDescription
The total time an agent has to wait for a call.
Type: string.

AppData Class ConstructorThe following is the AppData class constructor.

AppDataSyntax
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 FieldsThe following are the AppData class fields.

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

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

jrDescription
The JournalRoute.
Type: string.

questionDescription
The question posed by the chat initiator.
Type: string.

strDataDescription
The raw application data.
Type: string.

subjectDescription
The subject of the chat.
Type: string.

uniqueIdDescription
The unique ID.
Type: string.

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

userIdDescription
The agent's user ID.
Type: string.

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

wizUrlDescription
The chat wizard URL.
Type: string.

AppData Class MethodThe following is the AppData class method.

addKeyValueSyntax
addKeyValue(kdy, value)
Description
Add the key value pair to the AppData object.
Parameters
|
key |
The key. |
|
value |
The value. |
Returns
None.

Buddy Class ConstructorThe Buddy class extends the _User class.
The following is the Buddy class constructor.

BuddySyntax
Buddy()
Description
Describes the buddy. An agent can register buddies and is notified of state changes.
Parameters
None.
Returns
A Buddy object.

Buddy Class Fields
The Buddy class inherits the following fields from the _User class:
agentID
caps
id
name
presences
states
statistics
statistics1
statistics2

Buddy Class Callback Event MethodsThe following are the Buddy class callback event methods.

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

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

onStateSyntax
onState(event)
Description
Fires when the state event is received.

Call Class ConstructorThe Call class extends the Task class.
The following is the Call class constructor.

CallSyntax
Call(strCall)
Description
The Call object describes the call task information associated with the line.
Parameters
|
strCall |
Specify the call to use with this object. |
Returns
A Call object.

Call Class FieldsThe Call class inherits the following fields from Task:
caseid
cost
customerid
group
id
onStat
priority
type
urlAbs
urlRel
See Task Class Fields.
The following are additional Call class fields.

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

statisticsDescription
Statistics associated with the call.
Type: CallStatistics object.
See Also
CallStatistics Class Constructor.

CallData Class ConstructorThe following is the CallData class constructor.

CallDataSyntax
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 FieldsThe following are the CallData class fields:

aniDescription
The ANI caller id.
Type: string.

callIdDescription
The call ID.
Type: string.

callTypeDescription
The call type.
Type: string.

dataDescription
The call data.
Type: string.

dnisDescription
The DNIS callee ID.
Type: string.

CallData Class MethodThe following is the CallData class method.

addKeyValueSyntax
addKeyValue(key), value
Description
Add key value to the CallData object.
Parameters
|
key |
The key. |
|
value |
The value. |
Returns
None.

CallStatistics Class ConstructorThe following is the CallStatistics class constructor.

CallStatisticsSyntax
CallStatistics()
Description
The call statistics information.
Parameters
None.
Returns
A CallStatistics object.

CallStatistics Class FieldsThe following are the CallStatistics class fields.

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

holdTimeDescription
Duration that the call is on hold.
Type: string.

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

talkTimeDescription
Duration that the call is established.
Type: string.

Chat Class ConstructorThe Chat class extends the Task class.
The following is the Chat class constructor.

ChatSyntax
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 FieldsThe Chat class inherits the following fields from 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.

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

agentIdDescription
The agent's ID.
Type: string.

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

customerNameDescription
The customer username.
Type: string.

groupIdDescription
The group ID.
Type: string.

questionDescription
The question for this chat.
Type: string.

subjectDescription
The subject of the chat.
Type: string.

Chat Class MethodThe Chat class extends the Task class.
The following is the Chat class method.

getUrlSyntax
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 ConstructorThe ChatAddress class extends the _UQAddress class.
See _UQAddress Class Constructor.
The following is the ChatAddress class constructor.

ChatAddressSyntax
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

ChatAddress Class Methods
The ChatAddress class inherits the following methods from the _UQAddress class:
acceptTask
dequeueTask
See _UQAddress Methods.

ChatAddress Callback Event MethodsThe 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

Email Class ConstructorThe Email class extends the Task class.
The following is the email class constructor.

EmailSyntax
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 FieldsThe 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:

agentIdDescription
The agent's ID.

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

Email Class MethodThe following is the Email class method.

getUrlSyntax
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 ConstructorThe EmailAddress class extends the _UQAddress class.
See _UQAddress Class Constructor.
The following is the EmailAddress class constructor.

EmailAddressSyntax
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.

EmailAddress Class Methods
The EmailAddress class inherits the following fields from the _UQAddress class:
acceptTask
dequeueTask
See _UQAddress Methods.

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.

Extension Class ConstructorThe Extension class extends the _Address class.
See _Address Class Constructor.
The following is the Extension class constructor.

ExtensionSyntax
Extension(numOfLines)
Description
The Extension object describes the CTI address.
Parameters
|
numOfLines |
Specify the number of lines for this extension. |
Returns
An Extension object.

Extension Class FieldsThe Extension class inherits the following fields from the _Address class:
caps
id
The following are the Extension class fields.

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

isDndDescription
Flag for Do Not Disturb.
Type: boolean.

linesDescription
An associative array of line objects.
Type: associative array.

numOfLinesDescription
The number of lines for this extension.
Type: number.

Extension Class MethodsThe Extension class inherits the onError method from the Address class.
The following are the Extension class methods.

cancelDndSyntax
cancelDnd(reason)
Description
Cancel the DND (do not disturb).
Parameters
|
reason |
The reason for DND cancellation. |
Returns
None.

cancelForwardSetSyntax
cancelForwardSet(reason)
Description
Cancel the forward.
Parameters
|
reason |
The reason for cancelling the forward. |
Returns
None.

forwardSetSyntax
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
None.

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

getFreeLineSyntax
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. Null if there is no free line.

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

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

setDndSyntax
setDnd(event)
Description
Fires when setting DND (do not disturb).
Parameters
|
event |
The event object. |
Returns
None.

Extension Class Callback Event MethodsThe following are the Extension class callback event methods.

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

onCancelingForwardSyntax
onCancelingForward(event)
Description
Fires when canceling forward.

onDndSyntax
onDnd(event)
Description
Fires when DND is selected.

onForwardCanceledSyntax
onForwardCanceled(event)
Description
Fires on cancellation of forwarding.

onForwardedSyntax
onForwarded(event)
Description
Fires when the extension is forwarded.

onForwardingSyntax
onForwarding(event)
Description
Fires when forwarding.

onSettingDndSyntax
onSettingDnd(event)
Description
Fires when setting DND (do not disturb).

ExtensionCaps Class ConstructorThe following is the Extension class constructor.

ExtensionCapsSyntax
ExtensionCaps(strCaps)
Description
Describes the extension's capabilities.
Parameters
|
strCaps |
A string comprising the extension's capabilities |
Returns
An ExtensionCaps object.

ExtensionCaps Class FieldsThe following are the Extension class fields.

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

canDialDescription
This extension can dial out.
Type: boolean.

canFwdBusyDescription
This extension can forward calls if busy.
Type: boolean.

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

canFwdCancelForwardDescription
This extension can cancel forward.
Type: boolean.

canFwdDefaultDescription
This extension can forward.
Type: boolean.

canFwdNoAnswerDescription
This extension can forward if no answer.
Type: boolean.

canFwdUnconditionalDescription
This extension can forward unconditionally.
Type: boolean.

canRefreshStateDescription
This extension can refresh state.
Type: boolean.

canSetDndDescription
This extension can set DND (do not disturb).
Type: boolean.

ForwardMode Class ConstructorThe following is the ForwardMode class constructor.

ForwardModeSyntax
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 FieldThe following is the ForwardMode class field.

modeDescription
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 ConstructorThe GenericAddress class extends the _UQAddress class.
The following is the GenericAddress class constructor.

GenericAddressSyntax
GenericAddress()
Description
Handles the creation of generic tasks.
Parameters
None.
Returns
A GenericAddress object.

GenericAddress Class FieldsThe 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.

GenericAddress Class MethodsThe GenericAddress class inherits the following methods from the _UQAddress class:
acceptTask
dequeueTask
See _UQAddress Methods.

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.

GenericTask Class ConstructorThe GenericTask class extends the Task class.
The following is the GenericTask class constructor

GenericTaskSyntax
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 FieldsThe 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.

agentIdDescription
The agent's ID.
Returns a string.

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

customerNameDescription
The customer username.
Type: string.

groupIdDescription
The group ID.
Type: string.

questionDescription
The question for this generic task.
Type: string.

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

GenericTask Class MethodThe following is the GenericTask class method.

getUrlSyntax
getUrl(defaultUrl)
Description
Returns the URL for the given task.
Parameters
If not null, this value will override the generated base URL.
Returns
Returns the URL for the given task.

GLOBALS Class FieldsThe following are global fields, which may be accessed without instantiating an object. They are accessed as shown.

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

A2AChat.TYPE_ANSWERDescription
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_CONSULTDescription
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_CTIDescription
The constant representing a CTI server.
Example
Server.TYPE_CTI = "CTI";

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

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

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

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

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

Task.TYPE_GENERICDescription
The constant representing a generic task
Example
Task.TYPE_GENERIC = "GENERIC";

GLOBALS Class MethodsThe following are the GLOBALS class methods.

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

isValidSyntax
isValid(obj)
Description
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.

Group Class ConstructorThe following is the Group class constructor.

GroupSyntax
Group()
Description
The Group object describes the group information.
Parameters
None.
Returns
A Group object.

Group Class FieldsThe following are the Group class fields.

idDescription
The group ID.
Type: string.

nameDescription
The group name.
Type: string.

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

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

statistics1Description
The group statistics for UQ server.
Type: GroupStatistics1 object.
See Also
GroupStatistics1 Class Constructor

statistics2Description
The group statistics for UQ server.
Type: GroupStatistics2 object.
See Also
GroupStatistics2 Class Constructor

Group Class Callback Event MethodsThe following are the Group class callback event methods.

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

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

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

onTaskAddedSyntax
onTaskAdded(event)
Description
Fires when there is task added to this group.

onTaskRemovedSyntax
onTaskRemoved(event)
Description
Fires when a task is removed from this group.

GroupStatistics ConstructorThe following is the GroupStatistics class constructor.

GroupStatisticsSyntax
GroupStatistics()
Description
The group statistics information.
Parameters
None.
Returns
A GroupStatistics object.

GroupStatistics FieldsThe following are the GroupStatistics class fields.

dataDescription
Key value pairs that include all statistics.

numberOfAbandonedDescription
Number of tasks that are abandoned.

numberOfLoggedInDescription
Number of agents that are logged in the queue.

numberOfQueuedDescription
Number of tasks that are queued.

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

relativeQueueLoadDescription
Relative queue load.

GroupStatistics1 Class ConstructorThe following is the GroupStatistics1 class constructor.

GroupStatistics1Syntax
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 FieldsThe following are the GroupStatistics1 class fields.

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

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

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

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

numAgentsAvailableDescription
Number of agents available in the group.
Type: string.

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

numEscalationDescription
Number of escalated tasks in the group.
Type: string.

numOverflowDescription
Number of overflowed tasks in the group.
Type: string.

numTaskAcceptedDescription
Number of tasks accepted in the group.
Type: string.

numTaskDoneDescription
Number of tasks done in the group.
Type: string.

numTaskQueuedDescription
Number of tasks queued in the group.
Type: string.

reasonFlagDescription
The reason flag for this GroupStatistics event.
Type: string.

taskTotalTimeInSystemDescription
The total time in the system.
Type: string.

timeSinceStartDescription
The time since start.
Type: string.

GroupStatistics2 Class ConstructorThe following is the GroupStatistics2 class constructor.

GroupStatistics2Syntax
GroupStatistics2(data)
Description
UQ Group statistics sent on group refresh 2.
Parameters
|
data |
UQ server statistical data. |
Returns
A GroupStatistics2 object.

GroupStatistics2 Class FieldsThe following are the GroupStatistics2 class fields.

averageTaskDurationDescription
The average task duration in the group.
Type: string.

averageWaitTimeDescription
The average wait time in the group.
Type: string.

oldestTaskDescription
The oldest task in the group.
Type: string.

recentTaskDescription
The most recent task in the group.
Type: string.

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

timeElapsedRecentTaskDescription
The time elapsed for the most recent task in the group.

Line Class ConstructorThe following is the Line class constructor.

LineSyntax
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 FieldsThe following are the Line class fields.

callDescription
The Call object on the line.
Type: Call object.
See Also

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

connectionidDescription
The call connection ID on the line.
Type: string.

idDescription
The line ID.
Type: string.

stateDescription
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 MethodsThe following are the Line class methods.

alternateSyntax
alternate(reason)
Description
Alternate a call.
Parameters
|
reason |
The reason to alternate a call. |
Returns
None.

answerSyntax
answer(reason)
Description
Answer a call.
Parameters
|
reason |
The reason to answer a call. |
Returns
None.

attachUserDataSyntax
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
None.

clearSyntax
clear(reason)
Description
Clear a conference call.
Parameters
|
reason |
The reason to clear the conference. |
Returns
None.

completeSyntax
complete(reason)
Description
Complete the two-step transfer/conference.
Parameters
|
reason |
The reason to complete the two-step transfer/conference. |
Returns
None.

conferenceSyntax
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
None.

conferenceSingleSyntax
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
None.

dialSyntax
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
None.

dropPartySyntax
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
None.

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

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

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

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

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

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

holdSyntax
hold(reason)
Description
Hold a call.
Parameters
|
reason |
The reason to hold the call. |
Returns
None.

parkSyntax
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
None.

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

releaseSyntax
release(reason)
Description
Release a call.
Parameters
|
reason |
The reason to release the call. |
Returns
None.

retrieveSyntax
retrieve(reason)
Description
Retrieve a held call.
Parameters
|
reason |
The reason to retrieve the call. |
Returns
None.

transferSyntax
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
None.

transferMuteSyntax
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
None.

updateCallDataSyntax
updateCallData(calldata, reason)
Description
Update call data to a call.
Parameters
|
calldata |
The call data to update. |
|
reason |
The reason to update. |
Returns
None.

Line Class Callback Event MethodsThe following are the Line class callback event methods.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

onUserDataChangedSyntax
onUserDataChanged(event)
Description
Fires when the user data attached on the call is changed.

LineCaps Class ConstructorThe following is the LineCaps class constructor.

LineCapsSyntax
LineCaps(strCaps)
Description
Describes the line's capabilities.
Parameters
|
strCaps |
The line's capabilities. |
Returns
A LineCaps object.

LineCaps Class FieldsThe following are the LineCaps class fields.

canAlternateDescription
The line has alternate capability.
Type: boolean.

canAnswerDescription
The line has answer capability.
Type: boolean.

canAttachUserDateDescription
The line has attach user data capability.
Type: boolean.

canClearDescription
The line has clear capability.
Type: boolean.

canCompleteDescription
The line has complete capability.
Type: boolean.

canConferenceDescription
The line has conference capability.
Type: boolean.

canConferenceSingleDescription
The line has conference single capability.
Type: boolean.

canDropPartyDescription
The line has drop party capability.
Type: boolean.

canHoldDescription
The line has hold capability.
Type: boolean.

canParkDescription
The line has park capability.
Type: boolean.

canReconnectDescription
The line has reconnect capability.
Type: boolean.

canReleaseDescription
The line has release capability.
Type: boolean.

canRetrieveDescription
The line has retrieve capability.
Type: boolean.

canTransferDescription
The line has transfer capability.
Type: boolean.

canTransferMuteDescription
The line has transfer mute capability.
Type: boolean.

canUpdateCallDataDescription
The line has update call data capability.
Type: boolean.

MCEvent Class ConstructorThe following is the MCEvent class constructor.

MCEventSyntax
MCEvent()
Description
The MCEvent will be passed to the application event handler.
Parameters
None
Returns
An MCEvent object.

MCEvent Class FieldsThe following are the MCEvent class fields.

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

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

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

userDescription
The user associated with the event.
Type: User object.
See Also

MediaType Class ConstructorThe following is the MediaType class constructor.

MediaTypeSyntax
MediaType()
Description
Distinguishes between email and CTI media types.
Parameters
None.
Returns
A MediaType object.

MediaType Class FieldThe following is the MediaType field.

typeDescription
The media type.
Type: string with the following constants:
|
Value |
Description |
|
MT_EMAIL |
The email media type. |
|
MT_VOICE |
The voice media type (CTI). |

PSMC Class ConstructorThe following is the PSMC class constructor.

PSMCSyntax
PSMC()
Description
The global object that the application can access.
Parameters
None.
Returns
A PSMC object.

PSMC Class FieldsThe following are the PSMC class fields.

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

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

sessionsDescription
An associative array that holds the different Session objects, indexed by server ID.
Type: associative array.
See Also

PSMC Class MethodsThe following are the PSMC class methods.

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

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

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

openSessionSyntax
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.

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

stopSyntax
stop()
Description
Stop the JSMCAPI.
Parameters
None.
Returns
None.

Reason Class ConstructorThe following is the Reason class constructor.

ReasonSyntax
reason(code, desc)
Description
The Reason object carries the reason code and reason description.
Parameters
|
code |
The reason code. |
|
desc |
The reason description. |
Returns
Type: Reason object.

Reason Class FieldsThe following are the Reason class fields.

codeDescription
The reason code.
Type: string.

descDescription
The reason description.
Type: string.

RenServer Class ConstructorThe following is the RenServer class constructor.

RenServerSyntax
RenServer()
Description
The RenServer object describes the REN server cluster information.
Parameters
None.
Returns
A RenServer object.

RenServer Class FieldsThe following are the RenServer class fields.

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

urlDescription
The REN server URL.
Type: string.

RenServer Class Callback Event MethodsThe following are the RenServer class callback event methods.

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

onUpSyntax
onUp(event)
Description
Fires when the REN server is up.

Server Class ConstructorThe following is the Server class constructor.

ServerSyntax
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 FieldsThe following are the Server class fields.

idDescription
The server ID.
Type: string.

infoDescription
The server information string.
Type: string.

stateDescription
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. |

typeDescription
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_UQ |
The server is a UQ 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 MethodsThe following are the Server class callback event methods.

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

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

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

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

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

onRestartSyntax
onRestart(event)
Description
Fires when server restarts.

Session Class ConstructorThe following is the Session class constructor.

SessionSyntax
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 FieldsThe following are the Session class fields.

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

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

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

idDescription
The session ID generated by the server.
Type: string.

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

stateDescription
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. |

userDescription
The current user for the session.
Type: User object.
See Also

Session Class MethodsThe following are the Session class methods.

closeSyntax
close()
Description
Close the session with the server.
Parameters
None.
Returns
None.

openSyntax
open()
Description
Open the session with the server.
Parameters
None.
Returns
None.

registerAddressSyntax
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
None.

registerBuddySyntax
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
None.

registerGroupSyntax
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
None.

registerUserSyntax
registerUser(user)
Description
Register the user to the server so that the server will report all those events happened on this user.
Parameters
|
user |
The user to be registered. |
Returns
None.

statPublishSyntax
statPublish(userStat, groupStat)
Description
Sets the Statistics publishing levels for the UQ server.
Parameters
|
userStat |
Either 0, 1, or 2 for UserStatistics publishing. Specify 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. Specify 0 for no statistics publishing, 1 for Statistics1 publishing, and 2 for Statistics2 and Statistic1 publishing. |
Returns
None.

unregisterAddressSyntax
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
None.

unregisterBuddySyntax
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

unregisterGroupSyntax
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
None.

unregisterUserSyntax
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
None.

Session Class Callback Event MethodsThe following are the Session class callback event methods.

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

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

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

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

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

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

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

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

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

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

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

onUserUnregisteredSyntax
onUserUnregistered(event)
Description
Fires when the user gets unregistered by the session.

Task Class HierarchyThe Task class can be extended by other subclasses. The following flowchart shows the different subclasses, and how they interrelate.

Task class hierarchy
See Also
GenericAddress Class Constructor

Task Class ConstructorThe following is the Task class constructor.

TaskSyntax
Task()
Description
Task is an abstract base class.
Parameters
None.
Returns
Type: Task object.

Task Class FieldsThe following are the Task class fields.

caseidDescription
The associated case ID.
Type: string.

costDescription
The associated cost.
Type: string.

customeridDescription
The associated customer ID.
Type: string.

groupDescription
The associated group.
Type: string.

idDescription
The associated ID.
Type: string.

onStatDescription
The associated onStat.
Type: string.

priorityDescription
The associated priority.
Type: string.

typeDescription
The associated type.
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

urlAbsDescription
The associated absolute URL.
Type: urlAbs object.

urlRelDescription
The associated relative URL.
Type: urlRel object.

User Class ConstructorThe User class extends the _User class.
The following is the User class constructor.

UserSyntax
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 FieldsThe 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.

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

agentPasswordDescription
The password for this agent.
Type: string.

languageDescription
The language for this agent.
Type: string.

registeredAddressesDescription
The registered addresses for this user.
Type: associative array.

User Class MethodsThe following are the User class methods.

disableMediaSyntax
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
None.

enableMediaSyntax
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
None.

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

loginSyntax
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
None.

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

logoutSyntax
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 lout. |
Returns
None.

logoutUqSyntax
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
None.

registerSyntax
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
None.

setNotReadySyntax
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 that the user is changing state with. |
|
reason |
The reason to set not ready. |
Returns
None.

setPresenceSyntax
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 that the user is changing presence with. |
|
reason |
The reason to set the presence. |
Returns
None.

setPresenceUqSyntax
setPresenceUq(group, presenceText, reason)
Description
Set the Presence for UQ servers.
Parameters
|
group |
The group (queue) the user is changing their presence on. |
|
presenceText |
The new presence. |
|
reason |
The reason to set the new presence. |
Returns
None.

setReadySyntax
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 that the user is changing state with. |
|
reason |
The reason to set the state. |
Returns
None.

setWorkNotReadySyntax
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 that the user is changing state with. |
|
reason |
The reason to set work not ready. |
Returns
None.

setWorkReadySyntax
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 that the user is changing state with. |
|
reason |
The reason to set work ready. |
Returns
None.

unregisterSyntax
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
None.

User Class Callback Event MethodsThe following are the User class callback event methods.

onCapabilitiesChangedSyntax
onCapabilitiesChanged(event)
Description
Fires when capabilities changed.

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

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

onDroppedSyntax
onDropped(event)
Description
Fires when user is dropped.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

onStat2Syntax
onStat2(event)
Description
Fires when statistics2 received.

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

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

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

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

onWorkReadySyntax
onWorkReady(event)
Description
Fires when the user's state changes to work ready.

UserCaps Class ConstructorThe following is the UserCaps class constructor.

UserCapsSyntax
UserCaps(strCaps)
Description
The UserCaps object describes the user capabilities.
Parameters
|
strCaps |
The user capabilities. |
Returns
A UserCaps object.

UserCaps Class FieldsThe following are the UserCaps class fields

canLoginDescription
Login capability of the user.
Type: boolean.

canLogoutDescription
Logout capability of the user.
Type: boolean.

canRefreshStateDescription
The refreshState capability of the user.
Type: boolean.

canSetNotReadyDescription
The setNotReady capability of the user.
Type: boolean.

canSetPresenceDescription
The setPresence capability of the user.
Type: boolean.

canSetReadyDescription
The setReady capability of the user.
Type: boolean.

canSetWorkNotReadyDescription
The setWorkNotReady capability of the user.
Type: boolean.

canSetWorkReadyDescription
The setWorkReady capability of the user.
Type: boolean.

UserData Class ConstructorThe following is the UserData class constructor.

UserDataSyntax
UserData()
Description
The UserData object describes the key-value pairs of attached user data.
Parameters
None.
Returns
A UserData object.

UserData Class FieldsThe following are the UserData class fields constants.

UserData Class Field ConstantsDescription
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 MethodThe following is the UserData class method.

addKeyValueSyntax
addKeyValue(key, value)
Description
Add the key-value pair to the UserData object.
Parameters
|
key |
The key. |
|
value |
The value. |
Returns
None.

UserStatistics1 Class ConstructorThe following is the UseStatistics1 class constructor.

UserStatistics1Syntax
UserStatistics1()
Description
UQ User statistics sent on user refresh 1.
Parameters
None.
Returns
A UserStatistics1 object.

UserStatistics1 Class FieldsThe following are the UserStatistics1 class fields.

availableCostDescription
The amount of unused work.

ctiBusyDescription
Flag indicating that a user is engaged on CTI task.

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

mostRecentTaskDataDescription
Most recent task's data.
Type: string.

mostRecentTaskIdDescription
Most recent task's ID.
Type: string.

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

numTasksDoneDescription
The number of tasks done by the user.

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

presenceTextDescription
The presence text for the user.
Type: string.

reasonFlagDescription
The reason flag for this event.
Type: string.

stateDescription
Current state of the User
Type: string.

timeInCurrentStateDescription
Time in current state for the user.
Type: string.

timeSinceLoggedInDescription
The time since the user logged in.
Type: string.

UserStatistics2 Class ConstructorThe following is the UserStatistics2 class constructor.

UserStatistics2Syntax
UserStatistics2()
Description
UQ User statistics sent on user refresh 2 event.
Parameters
None.
Returns
A UserStatistics2 object.

UserStatistics2 Class FieldsThe following are the UserStatistics2 class fields.

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

timeIdleDescription
Idle time for the user.
Type: string.

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

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

timeSinceLoginDescription
The time since the user logged in.
Type: string.

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

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