Options
All
  • Public
  • Public/Protected
  • All
Menu

JsonRpcClient implements Verto protocol using JSON RPC

Usage:

  • const client = new JsonRpcClient(@debug); // Instantiate a new Json Rpc Client
  • client.openSocket(@socketUrl) // REQUIRED: Promise opening the web socket .then(() => {
    this.login() // REQUIRED: log the agent into the web socket
    // You can now proceed with any requests
    
    });

Hierarchy

  • Verto

Index

Constructors

constructor

Properties

Readonly calls

calls: Call[]

Reference to list of running calls

Private cleaner

cleaner: VertoClear

Optional connectedAgent

connectedAgent: AgentInfo

Store Agent Information

Optional contactCenterName

contactCenterName: undefined | string

Store contact center

Private Readonly debug

debug: boolean

io

Private listeners

listeners: Function[] = []

Callback functions - register using addListener

Private orchestrator

orchestrator: VertoOrchestrator

params

params: VertoParams

Private Optional position

position: AgentPosition

Information about agent

Optional sessid

sessid: undefined | string

Session ID used with the current socket

Private Optional socket

socket: WebSocket

Our communication channel

tag

tag: HTMLDivElement

Media video tags

Methods

addListener

  • addListener(call: Function): void
  • addListener allows to listen for incoming Socket Event

    Parameters

    • call: Function

    Returns void

answerCall

  • answerCall(callId: string, phoneNumber: string, sdp: string): void
  • Answer a call

    Parameters

    • callId: string
    • phoneNumber: string
    • sdp: string

    Returns void

attach

  • attach(callId: string, phoneNumber: string, sdp: string): void
  • Perform an attach query

    Parameters

    • callId: string
    • phoneNumber: string
    • sdp: string

    Returns void

blindTransfer

  • blindTransfer(transferTo: string, callId: string, phoneNumber: string): void
  • Parameters

    • transferTo: string
    • callId: string
    • phoneNumber: string

    Returns void

connectAgent

destroyCall

  • destroyCall(callId: string): void

disconnect

  • disconnect(): void

dtmf

  • dtmf(callId: string, phoneNumber: string, char: string): void
  • DTFM send a char to current call

    Parameters

    • callId: string
    • phoneNumber: string
    • char: string

    Returns void

Protected ensureMediaChannelIsValid

  • ensureMediaChannelIsValid(): Promise<boolean>

getLogin

  • getLogin(): string
  • Concat position to return the login used in Json RTC request

    Returns string

hangupCall

  • hangupCall(callId: string, phoneNumber: string, reason?: VertoByeReason): void
  • Hang up a specific call

    Parameters

    • callId: string
    • phoneNumber: string
    • Default value reason: VertoByeReason = VertoByeReason.NORMAL_CLEARING

    Returns void

holdCall

  • holdCall(callId: string, phoneNumber: string): void
  • Hold a specific call

    Parameters

    • callId: string
    • phoneNumber: string

    Returns void

Private isJsonRpcValid

  • isJsonRpcValid(data: any): boolean

Private login

Private openSocket

  • openSocket(socketUrl: string): Promise<void>
  • openSocket should be called directly after the constructor It initializate the socket and set the handlers

    Parameters

    • socketUrl: string

    Returns Promise<void>

purgeAndDestroyCall

  • purgeAndDestroyCall(callId: string): void

purgeCall

  • purgeCall(callId: string): void

restartSocket

  • restartSocket(): void

send

  • send(data: any): void
  • Send data to socket and log in case of debug

    Parameters

    • data: any

    Returns void

startCall

  • startCall(phoneNumber: string, uuid?: undefined | string): Promise<Call | undefined>

unholdCall

  • unholdCall(callId: string, phoneNumber: string): void
  • Hang up a specific call

    Parameters

    • callId: string
    • phoneNumber: string

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Private property
  • Private method
  • Static property
  • Static method
  • Property
  • Protected method

Generated using TypeDoc