Class

BrandWebsocketConnection

BrandWebsocketConnection()

Represents a brand side websocket connection to UMS.

Constructor

# new BrandWebsocketConnection()

View Source connection/connection-websocket-brand.js, line 19

Methods

# async _getMessageStatistics()

Getting message statistics about current account Provided getForUserId equal to true will take into the account that user is agent Not providing params means that the account owner is manager he will see all the msg statistics

View Source connection/connection-websocket-brand.js, line 310

# async _getWebsocketUrl()

Gets the websocket URL

View Source connection/connection-websocket-brand.js, line 201

# protected _onAuthInvalidError()

Forces a reauth in TokenMaintainer when ._connect() is called again

View Source connection/connection-websocket-brand.js, line 144

# async _subscribeRoutingTasks(accountId, agentId)

Makes the websocket call to Agent Matching to subscribe for rings.

Parameters:
Name Type Description
accountId
agentId

View Source connection/connection-websocket-brand.js, line 272

# async _updateRingState(ringId, ringState)

Updates the state of a ring. If state is accepted, the agent will be assigned to the conversation.

Parameters:
Name Type Description
ringId
ringState

View Source connection/connection-websocket-brand.js, line 283

# async getToken() → {Promise.<string>}

Returns the token from this connection. Throws an error if ConnectionState is not connected

View Source connection/connection-websocket-brand.js, line 61

token maintainer not started

Error

Agent bearer token

Promise.<string>

# async setAgentState(agentId, agentState)

Changes the availability of an agent

Parameters:
Name Type Description
agentId string

{accountId.userId}. Defaults to the agentId for the current connection

agentState string

represents availability states of the agent: ONLINE, OFFLINE, AWAY, BACK_SOON

View Source connection/connection-websocket-brand.js, line 250

void