Options
All
  • Public
  • Public/Protected
  • All
Menu

Wrapper class for CXone Voice Connection

Hierarchy

  • CXoneVoiceClient

Index

Constructors

  • Constructor for Voice Client

    example
    voiceClient = new CXoneVoiceClient();
    

    Returns CXoneVoiceClient

Properties

logger: Logger = ...
onCallStatusChanged: Subject<CXoneVoiceCall>
onConnectionStatusChanged: Subject<CXoneVoiceConnection>
voiceCall: CXoneVoiceCall
voiceConnection: CXoneVoiceConnection
webRtcService: ACWebRtcService
singleton: CXoneVoiceClient

Accessors

  • Gets current voice call state

    example
    voiceClient.callState;
    

    Returns CXoneVoiceCall

  • Gets current WebRTC connection state

    example
    voiceClient.connectionState;
    

    Returns CXoneVoiceConnection

  • Method to create singleton object of the class

    @example
    const CXoneVoiceClient = CXoneVoiceClient.instance();

    Returns CXoneVoiceClient

Methods

  • connectAgentLeg(agentLegId: string): void
  • Disconnect from WebRTC server

    example
    voiceClient.disconnectServer();
    

    Parameters

    • agentLegId: string

    Returns void

  • Initialize this client and connect to the WebRTC server. Please use onConnectionStatusChanged event for both success and failure notification for server connectivity

    example
    voiceClient.connectServer('12345', options, audioElement);
    

    Parameters

    • acdAgentId: string

      CXone agent number, that will be used for voice connection

    • options: CXoneVoiceConnectionOptions

      CXone audio connection options that has WebRTC server information

    • audioElement: HTMLAudioElement

      audio element used to open audio stream

    • appName: string

    Returns void

  • disconnectServer(): void
  • Disconnect from WebRTC server

    example
    voiceClient.disconnectServer();
    

    Returns void

  • Send an request to initialize a audio streaming to the connected WebRTC server. Please use onCallStatusChanged event for both success and failure notification for voice call

    example
    voiceClient.handleAgentLegEvent(agentLeg);
    

    Parameters

    • agentLeg: AgentLegEvent

      CXone agent leg having contactId and status

    Returns void

  • triggerAutoAccept(agentLegId: string): void
  • Enables SDK user to auto accept the call in CXone Agent

    example
    triggerAutoAccept(agentLegId);
    

    Parameters

    • agentLegId: string

      input agent leg id

    Returns void

  • volumeChange(volume: number): void
  • Set the webRtc volume

    example

    voiceClient.volumeChange();

    Parameters

    • volume: number

      webRtc volume

    Returns void

Generated using TypeDoc