Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AgentAssistNotificationService Abstract

web socket base class for Agent assist notification

Hierarchy

Index

Constructors

Properties

IsSubscribeDummyResponse: boolean = true
agentAssistInput: AgentAssistInput = empytyAgentAssistInput
auth: CXoneAuth = CXoneAuth.instance
connectionId: string = ''
contactId: number = 0
logger: Logger
subscriptions: string[] = []
wssWorker: any

Methods

  • example
    attemptReconnect({reconnectInterval: 300, reconnectAttempts:4});
    

    Parameters

    • reconnectInfo: WsReconnectInfo

      reconnectIntervalInMs in millisecond, maxReconnectAttempts in number and ws url

    • Optional wsWorker: any

    Returns void

  • attemptToReconnect(): void
  • Use to attempt to reconnect to the web socket worker

    example
    this.attemptToReconnect();
    

    Returns void

  • close(): void
  • used to unsubscribe events and clear props.

    example
    • close()

    Returns void

  • connect(websocketServerUri: string, providerId?: string): boolean
  • used to connect to the socket.

    example
    • connect();

    Parameters

    • websocketServerUri: string

      websocketServer uri

    • providerId: string = 'Agent-Assist'

    Returns boolean

  • disconnectWebsocket(): void
  • used to unsubscribe and disconnect to socket events.

    example
    • disconnectWebsocket();

    Returns void

  • initLogger(providerId: string): void
  • Use to initializing the web socket worker and will return the method inside the worker

    example
    this.initLogger('ccai');
    

    Parameters

    • providerId: string

      AAH provider

    Returns void

  • initWebSocketWorker(providerId: string): void
  • Use to initializing the web socket worker and will return the method inside the worker

    example
    this.initWebSocketWorker();
    

    Parameters

    • providerId: string

    Returns void

  • onClosed(): void
  • onError(): void
  • onMessage(responseMessage: any): void
  • function to recieve websocket messages

    example

    Parameters

    • responseMessage: any

      message

    Returns void

  • onOpen(): void
  • Callback method when a connection is open and ready to send and receive data

    example
    • onOpen()

    Returns void

  • onReconnect(_msg: any): void
  • Callback method when a ws reconnect attempts in progress

    example
    • this.onReconnect()

    Parameters

    • _msg: any

    Returns void

  • onReconnectComplete(): void
  • onReconnectSuccess(): void
  • reconnectWebsocket(): void
  • used to Reconnect to the socket.

    example
    • reConnectToSocket();

    Returns void

  • sendMessage(msg: unknown, wsWorker: any): void
  • Method to send to websocket worker

    example
    sendMessage('hi');
    

    Parameters

    • msg: unknown

      message send to websocket

    • wsWorker: any

    Returns void

  • Used to open the webSocket data and subscribe to it.

    example
    subscribe();
    @param agentAssistInput - input for subscribing to wwebscket comprising of webSocketUri,contactId, subscriptions & providerId

    Parameters

    Returns boolean

  • subscribeToSocket(topic: string): boolean
  • used to subscribe to socket events.

    example
    • subscribeToSocket('');

    Parameters

    • topic: string

      topic to subscribe

    Returns boolean

  • terminateWebSocketWorker(): void
  • Use to terminate the web socket worker

    example
    this.terminateWebSocketWorker();
    

    Returns void

Generated using TypeDoc