Appendix: JSMCAPI Quick Reference

This appendix discusses the constructors, fields, methods, callback event methods, and returns of the JSMCAPI classes.

Click to jump to top of pageClick to jump to parent topicJSMCAPI Classes

This section lists the JSMCAPI classes in alphabetical order, along with the constructor, fields, methods, and callback event methods, and returns associated with each class.

Click to jump to top of pageClick to jump to parent topic_Address

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

_Address()

_Address object

Fields

Field

Type

caps

Object

id

String

Callback Event Methods

Callback Event Methods

Returns

onError(event)

None.

Click to jump to top of pageClick to jump to parent topic_UQAddress

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The _UQAddress class extends the _Address class.

See _Address.

Constructor

Constructor

Returns

_UQAddress()

_UQAddress object

Fields

Field

Type

tasks

Associative array

Methods

Method

Returns

acceptTask(task, reason)

None

dequeueTask(task)

Object.

Callback Event Methods

The _UQAddress class inherits the onError callback event method from the _Address class.

See _Address.

Callback Event Methods

Returns

onAccepted(event)

None.

onAcceptingTask(event)

None.

onDequeueingTask(event)

None.

onNotify(event)

None.

onTaskAdded(event)

None.

onTaskRemoved(event)

None.

onUnassigned(event)

None.

Click to jump to top of pageClick to jump to parent topic_User

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

_User()

_User object.

Fields

Field

Type

agentId

String

caps

Associative array

id

String

name

String

presences

Associative array

states

Associative array of the constants beginning with ST_*.

ST_LOGGEDIN

String

ST_LOGGEDOUT

String

ST_NOTREADY

String

ST_READY

String

ST_UNKNOWN

String

ST_WORKNOTREADY

String

ST_WORKREADY

String

statistics

Object

statistics1

Object

statistics2

Object

Click to jump to top of pageClick to jump to parent topicA2AChat

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The A2AChat class extends the _Address class.

See _Address.

Constructor

Constructor

Returns

A2AChat(event, address, chatType)

A2AChat object.

Fields

Field

Type

address

Object

agentId

String

agentName

String

appData

Object

chatType

String

id

String

jr

String of the PS_JR constant.

type

String of the following constants:

  • TYPE_ANSWER

  • TYPE_CONSULT

uniqueueId

String

Method

Method

Returns

getUrl(defaultUrl)

String

Click to jump to top of pageClick to jump to parent topicA2AChatAddress

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

A2AChatAddress()

A2AChatAddress object.

Fields

The A2AChatAddress class inherits the following fields from the _Address class:

See _Address.

Field

Type

id

String

tasks

Associative array

Methods

Method

Returns

initiateChat(agentId)

None

Callback Event Methods

The A2AChatAddress class inherits the onError callback event method from the _Address class.

See _Address.

Callback Event Methods

Returns

onChatEnded(event)

None

onInitiatingChat(event)

None

onNotify(event)

None

Click to jump to top of pageClick to jump to parent topicAgentStatistics

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

AgentStatistics()

AgentStatistics object

Fields

Field

Type

averageCallDuration

String

averageHoldDuration

String

callsHandled

String

data

Associative array

unavailableDuration

String

waitDuration

String

Click to jump to top of pageClick to jump to parent topicAppData

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

AppData()

AppData object

Fields

Field

Type

data

Associative array

groupId

String

jr

String

question

String

strData

String

subject

String

uniqueId

String

url

String of the constant URL.

userId

String

username

String

wizUrl

String

Method

Method

Returns

addKeyValue(key, value)

None

Click to jump to top of pageClick to jump to parent topicBuddy

This section lists the constructor, methods, and callback event methods associated with this class.

The Buddy class extends the _User class.

See _User.

Constructor

Constructor

Returns

Buddy()

Buddy object.

Fields

The Buddy class inherits the following fields from the _User class:

See _User.

Callback Event Methods

Callback Event Methods

Returns

onStat1(event)

None

onStat2(event)

None

onState(event)

None

Click to jump to top of pageClick to jump to parent topicCall

This section lists the constructor, fields, and returns (if applicable) associated with this class.

The Call class extends the Task class.

See Task.

Constructor

Constructor

Returns

Call(strCall)

Call object

Fields

The Call class inherits the following fields from the Task class:

See Task.

Field

Type

line

Object

statistics

Object

userData

String

Click to jump to top of pageClick to jump to parent topicCallData

This section lists the constructor, fields, methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

CallData()

CallData object

Fields

Field

Type

ani

String.

callId

String.

callType

String.

data

String

dnis

String

Method

Method

Returns

addKeyValue(key , value)

None

Click to jump to top of pageClick to jump to parent topicCallStatistics

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

CallStatistics()

CallStatistics object

Fields

Field

Type

data

Associative array

holdTime

String

queueTime

String

talkTime

String

Click to jump to top of pageClick to jump to parent topicChat

This section lists the constructor, fields, method, and returns (if applicable) associated with this class.

The Chat class extends the Task class.

See Task.

Constructor

Constructor

Returns

Chat(event, address)

Chat object

Fields

The Chat class inherits the following fields from the Task class:

See Task.

Field

Type

address

Object

agentId

String

appData

Object

customerName

String

groupId

String

question

String

subject

String

Method

Method

Returns

getUrl(defaultUrl)

String

Click to jump to top of pageClick to jump to parent topicChatAddress

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The ChatAddress class extends the _UQAddress class.

See _UQAddress.

Constructor

Constructor

Returns

ChatAddress()

ChatAddress object

Fields

The ChatAddress class inherits the following fields from the _Address class:

See _Address.

The ChatAddress class inherits the tasks field from the _UQAddress class.

See _UQAddress.

Methods

The ChatAddress class inherits the following methods from the _UQAddress class:

See _UQAddress.

Callback Event Methods

The ChatAddress class inherits the onError callback event method from the _Address class.

See _UQAddress.

The ChatAddress class inherits the following callback event methods from the _UQAddress class:

See _UQAddress.

Click to jump to top of pageClick to jump to parent topicEmail

This section lists the constructor, fields, method, and returns (if applicable) associated with this class.

The Email class extends the Task class.

See Task.

Constructor

Constructor

Returns

Email(event)

Email object

Fields

The Email class inherits the following fields from the Task class:

See Task.

Field

Type

agentId

Object

appData

Object

customerName

String

Method

Method

Returns

getUrl(defaultUrl)

String

Click to jump to top of pageClick to jump to parent topicEmailAddress

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The EmailAddress class extends the _UQAddress class.

See _UQAddress.

Constructor

Constructor

Returns

EmailAddress()

EmailAddress object

Fields

The EmailAddress class inherits the following fields from the _Address class:

See _Address.

The EmailAddress class inherits the tasks field from the _UQAddress class.

See _UQAddress.

Methods

The EmailAddress class inherits the following methods from the _UQAddress class:

See _UQAddress.

Callback Event Methods

The EmailAddress class inherits the onError callback event method from the _Address class.

See _Address.

The EmailAddress class inherits the following callback event methods from the _UQAddress class:

See _Address.

Click to jump to top of pageClick to jump to parent topicExtension

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The Extension class extends the _Address class.

See _Address.

Constructor

Constructor

Returns

Extension(numOfLines)

Extension object

Fields

The Extension class inherits the following fields from the _Address class:

See _Address.

Field

Type

forwardMode

Object

isDnd

Boolean

lines

Associative array

numOfLines

Number

Methods

Method

Returns

cancelDnd(reason)

None

cancelForwardSet(reason)

None

forwardSet(number, mode, reason)

None

getDialingLine()

Object

getFreeLine()

Object

getLineByConnectionId(connectionId)

Object

getOffHookLine()

Object

setDnd(reason)

None

Callback Event Methods

The Extension class inherits the onError callback event method from the _Address class.

See _Address.

Callback Event Methods

Returns

onCancelingDnd(event)

None

onCancelingForward(event)

None

onDnd(event)

None

onDndCanceled(event)

None

onForwardCanceled(event)

None

onForwarded(event)

None

onForwarding(event)

None

onSettingDnd(event)

None

Click to jump to top of pageClick to jump to parent topicExtensionCaps

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

ExtensionCaps(strCaps)

ExtensionCaps object

Fields

Field

Type

canCancelDnd

Boolean

canDial

Boolean

canFwdBusy

Boolean

canFwdBusyNoAnswer

Boolean

canFwdCancelForward

Boolean

canFwdDefault

Boolean

canFwdNoAnswer

Boolean

canFwdUnconditional

Boolean

canRefreshState

Boolean

canSetDnd

Boolean

Click to jump to top of pageClick to jump to parent topicForwardMode

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

ForwardMode()

ForwardMode object

Fields

Field

Type

mode

String of the following constants:

  • BUSY

  • BUSYNOANSWER

  • DEFAULT

  • NOANSWER

  • NONE

  • UNCONDITIONAL

Click to jump to top of pageClick to jump to parent topicGenericAddress

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The GenericAddress class extends the _UQAddress class.

See _UQAddress.

Constructor

Constructor

Returns

GenericAddress()

GenericAddress object

Fields

The GenericAddress class inherits the following fields from the _Address class:

See _Address.

The GenericAddress class inherits the tasks field from the _UQAddress class.

See _UQAddress.

Methods

The GenericAddress class inherits the following methods from the _UQAddress class:

See _UQAddress.

Callback Event Methods

The GenericAddress class inherits the onError callback event method from the _Address class.

See _Address.

The GenericAddress class inherits the following callback event methods from the _UQAddress class:

See _UQAddress.

Click to jump to top of pageClick to jump to parent topicGenericTask

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The GenericTask class extends the Task class.

See Task.

Constructor

Constructor

Returns

GenericTask(event)

GenericTask object

Field

The GenericTask class inherits the following fields from the Task class:

See Task.

Field

Type

agentId

String

appData

Object

customerName

String

groupId

String

question

String

subject

String

Method

Method

Returns

getUrl(defaultUrl)

String

Click to jump to top of pageClick to jump to parent topicGLOBALS

This section lists the fields and methods associated with this class.

Fields

Field

Field Type

A2AChat.PS_JR

Constant

A2AChat.TYPE_ANSWER

Constant

A2AChat.TYPE_CONSULT

Constant

Server.TYPE.CTI

Constant

Server.TYPE_UQ

Constant

Task.TYPE_A2ACHAT

Constant

Task.TYPE_CHAT

Constant

Task.TYPE_CTI

Constant

Task.TYPE_EMAIL

Constant

Task.TYPE_GENERIC

Constant

Methods

Method

Returns

initJSMCAPI()

None

isValid(obj)

Boolean

Click to jump to top of pageClick to jump to parent topicGroup

This section lists the constructor, fields, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

Group()

Group object

Fields

Field

Type

id

String

name

String

registered

Boolean

statistics

Object

statistics1

Object

statistics2

Object

Callback Event Methods

Callback Event Methods

Returns

onStat(event)

None

onStat1(event)

None

onStat2(event)

None

onTaskAdded(event)

None

onTaskRemoved(event)

None

Click to jump to top of pageClick to jump to parent topicGroupStatistics

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

GroupStatistics()

GroupStatistics object

Fields

Field

Type

data

Associative array

numberOfAbandoned

String

numberOfLoggedIn

String

numberOfQueued

String

queuedWaitTime

String

relativeQueueLoad

String

Click to jump to top of pageClick to jump to parent topicGroupStatistics1

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

GroupStatistics1(data)

GroupStatistics1 object

Fields

Field

Type

mostRecentTaskDone

String

mostRecentTaskDoneData

String

mostRecentTaskEnqueued

String

mostRecentTaskEnqueuedData

String

numAgentsAvailable

String

numAgentsLoggedIn

String

numEscalation

String

numOverflow

String

numTaskAccepted

String

numTaskDone

String

numTaskQueued

String

reasonFlag

String

taskTotalTimeInSystem

String

timeSinceStart

String

Click to jump to top of pageClick to jump to parent topicGroupStatistics2

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

GroupStatistics2(data)

GroupStatistics2 object

Fields

Field

Type

averageTaskDuration

String

averageWaitTime

String

oldestTask

String

recentTask

String

timeElapsedOldestTask

String

timeElapsedRecentTask

String

Click to jump to top of pageClick to jump to parent topicLine

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

Line()

Line object

Fields

Field

Type

call

Object

caps

Object

connectionId

String

id

String

state

String of the following constants:

  • ST_DIALING

  • ST_DROPPED

  • ST_HELD

  • ST_IDLE

  • ST_OFFHOOK

  • ST_RINGING

  • ST_TALKING

Methods

Method

Returns

alternate(reason)

None

answer(reason)

None

attachUserData(userdata, reason)

None

clear(reason)

None

complete(reason)

None

conference(destination, reason, userdata, calldata)

None

conferenceSingle(destination, reason, userdata, calldata)

None

dial(number, reason, userdata)

None

dropParty(destination, reason)

None

getAni()

String

getDescr()

String

getDnis()

String

getReferenceId()

String

getUrl(defaultUrl)

String

grabCall(destination, reason)

String

hold(reason)

String

park(destination, reason)

None

reconnect(reason)

None

release(reason)

None

retrieve(reason)

None

transfer(destination, reason, userdata, calldata)

None

transferMute(destination, reason, userdata, calldata)

None

updateCallData(calldata, reason)

None

Callback Event Methods

Callback Event Methods

Returns

onAlternating(event)

None

onAnswering(event)

None

onAttachingUD(event)

None

onCallDataChanged(event)

None

onCapabilitiesChanged(event)

None

onClearing(event)

None

onCompleting(event)

None

onConferencing(event)

None

onDialing(event)

None

onDropped(event)

None

onError(event)

None

onGrabbing(event)

None

onHeld(event)

None

onHolding(event)

None

onOffHook(event)

None

onHook(event)

None

onParking(event)

None

onPartyAdded(event)

None

onPartyChanged(event)

None

onPartyRemoved(event)

None

onReconnecting(event)

None

onReleasing(event)

None

onRetrieving(event)

None

onRinging(event)

None

onTalking(event)

None

onTransfering(event)

None

onUpdatingCD(event)

None

onUserDataChanged(event)

None

Click to jump to top of pageClick to jump to parent topicLineCaps

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

LineCaps(strCaps)

LineCaps object

Fields

Field

Type

canAlternate

Boolean

canAnswer

Boolean

canAttachUserData

Boolean

canClear

Boolean

canComplete

Boolean

canConference

Boolean

canConferenceSingle

Boolean

canDropParty

Boolean

canHold

Boolean

canPark

Boolean

canReconnect

Boolean

canRelease

Boolean

canRetrievee

Boolean

canTransfer

Boolean

canTransferMute

Boolean

canUpdateCallData

Boolean

Click to jump to top of pageClick to jump to parent topicMCEvent

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

MCEvent()

MCEvent object

Fields

Field

Type

extension

Object

group

Object

reason

Object

user

Object

Click to jump to top of pageClick to jump to parent topicMediaType

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

MediaType()

MediaType object

Field

Field

Type

type

String of the following constants:

  • MT_EMAIL

  • MT_VOICE

Click to jump to top of pageClick to jump to parent topicPSMC

This section lists the constructor, fields, methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

PSMC()

PSMC object

Fields

Field

Type

renServer

Object

servers

Associative array

sessions

Associative array

Methods

Method

Returns

closeSession(serverId)

None

getCallById(id)

Object

getLineById(id)

Object

openSession(serverId)

None

start()

None

stop()

None

Click to jump to top of pageClick to jump to parent topicReason

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

Reason(code, desc)

Reason object

Fields

Field

Type

code

String

description

String

Click to jump to top of pageClick to jump to parent topicRenServer

This section lists the constructor, fields, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

RenServer()

RenServer object

Fields

Field

Type

isRunning

Boolean

url

String

Callback Event Methods

Callback Event Methods

Returns

onDown(event)

None

onUp(event)

None

Click to jump to top of pageClick to jump to parent topicServer

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

Server(serverID)

Server object

Fields

Field

Type

id

String

info

String

state

String of the following constants:

  • ST_INSERVICE

  • ST_OUTOFSERVICE

type

String of the following constants:

  • TYPE_CTI

  • TYPE_UQ

Callback Event Methods

Callback Event Methods

Returns

onBroadcast(event)

None

onHbLost(event)

None

onHbRecovered(event)

None

onInService(event)

None

onOutOfService(event)

None

onRestart(event)

None

Click to jump to top of pageClick to jump to parent topicSession

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

Session(serverID)

Session object

Fields

Field

Type

addresses

Associative array

buddies

Associative array

groups

Associative array

id

String

serverID

String

state

String of the following constants:

  • ST_ACTIVE

  • ST_CLOSED

  • ST_CLOSING

  • ST_IDLE

user

User object

Methods

Method

Returns

close()

None

open()

None

registerAddress(address)

None

registerBuddy(buddy)

None

registerGroup(group)

None

registerUser(user)

None

statPublish(userStat, userStat)

None

unregisterAddress(address)

None

unregisterBuddy(buddy)

None

unregisterGroup(group)

None

unregisterUser(user)

None

Callback Event Methods

Callback Event Methods

Returns

onAddressRegistered(event)

None

onAddressUnregistered(event)

None

onBuddyRegistered(event)

None

onBuddyUnregistered(event)

None

onClosed(event)

None

onError(event)

None

onGroupRegistered(event)

None

onGroupUnregistered(event)

None

onInfo(event)

None

onOpened(event)

None

onUserRegistered(event)

None

onUserUnregistered(event)

None

Click to jump to top of pageClick to jump to parent topicTask

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

Task()

Task object

Fields

Field

Type

caseid

String

cost

String

customerid

String

group

String

id

String

onStat

String

priority

String

type

String; one of the following:

  • TYPE_A2ACHAT

  • TYPE_CHAT

  • TYPE_CTI

  • TYPE_EMAIL

  • TYPE_GENERIC

urlAbs

Object

urlRel

Object

Click to jump to top of pageClick to jump to parent topicUser

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

The User class extends the _User class.

See _User.

Constructor

Constructor

Returns

User(id, name, agentId, agentPassword)

User object

Fields

The User class inherits the following fields from the _User class:

See _User.

Field

Type

addresses

Associative array

agentPassword

String

language

String

registeredAddresses

Associative array

Methods

Method

Returns

disableMedia(group, mediaType, extension, reason)

None

enableMedia(group, mediaType, extension, reason)

None

isMediaEnabled(mediaTypegroup)

None

login(group, extension, reason)

None

loginUq(group)

None

logout(group, extension, reason)

None

logoutUq(group)

None

register(extension, reason)

None

setNotReady(group, presence, extension, reason)

None

setPresence(group, presence, extension, reason)

None

setPresenceUq(group, presenceText, reason)

None

setReady(group, presence, extension, reason)

None

setWorkNotReady(group, presence, extension, reason)

None

setWorkReady(group, presence, extension, reason)

None

unRegister(extension, reason)

None

Callback Event Methods

Callback Event Methods

Returns

onCapabilitiesChanged(event)

None

onCtiBusy(event)

None

onCtiClear(event)

None

onDropped(event)

None

onError(event)

None

onInfo(event)

None

onLoggedIn(event)

None

onLoggedOut(event)

None

onLoggingIn(event)

None

onLoggingOut(event)

None

onMediaDisabled(event)

None

onMediaEnabled(event)

None

onNotReady(event)

None

onPresenceChanged(event)

None

onReady(event)

None

onRegistered(event)

None

onRegistering(event)

None

onSettingNotReady(event)

None

onSettingPresence(event)

None

onSettingReady(event)

None

onSettingWorkNotReady(event)

None

onSettingWorkReady(event)

None

onStat(event)

None

onStat1(event)

None

onStat2(event)

None

onUnkown(event)

None

onUnregistered(event)

None

onUnregistering(event)

None

onWorkNotReady(event)

None

onWorkReady(event)

None

Click to jump to top of pageClick to jump to parent topicUserData

This section lists the constructor, fields, method, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

UserData()

UserData object

Constants

The UserData class uses the following constants:

Method

Method

Returns

addKeyValue(key, value)

None

Click to jump to top of pageClick to jump to parent topicUserStatistics1

This section lists the constructor, fields, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

UserStatistics1()

UserStatistics1 object

Fields

Field

Type

availableCost

String

ctiBusy

String

currentQueue

String

mostRecentTaskData

String

mostRecentTaskId

String

numTaskAccepted

String

numTasksDone

String

numTasksUnassigned

String

presenceText

String

reasonFlag

String

state

String

timeInCurrentState

String

timeSinceLoggedIn

String

Click to jump to top of pageClick to jump to parent topicUserStatistics2

This section lists the constructor, fields, methods, and callback event methods, and returns (if applicable) associated with this class.

Constructor

Constructor

Returns

UserStatistics2()

UserStatistics2 object

Fields

Field

Type

currentQueue

String

timeIdle

String

timeInCurrentState

String

timeNotReady

String

timeSinceLogin

String

totalTimeAvailable

String

totalTimeUnavailable

String