Options
All
  • Public
  • Public/Protected
  • All
Menu

Wrapper class for CXone Voice Connection

Hierarchy

  • CXoneVoiceClient

Index

Constructors

Properties

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

Accessors

Methods

  • connectAgentLeg(agentLegId: string): 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
  • getActiveAudioTrackLabel(): string
  • Returns the active audio input track label from the current sender to seed the known active device on call connect.

    example
    voiceClient.getActiveAudioTrackLabel();
    

    Returns string

    the track label string, or null if unavailable

  • 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

  • replaceTrack(newTrack: MediaStreamTrack): Promise<void>
  • Replaces the active audio input track on the live RTP sender during mid-call audio device failover.

    example
    voiceClient.replaceTrack(newTrack);
    

    Parameters

    • newTrack: MediaStreamTrack

      the new MediaStreamTrack for the microphone input

    Returns Promise<void>

  • setSinkId(deviceId: string): Promise<void>
  • Sets the audio output device on the audio element during mid-call audio device failover

    example
    voiceClient.setSinkId('device-id');
    

    Parameters

    • deviceId: string

      the deviceId of the target audio output device

    Returns Promise<void>

  • triggerAutoAccept(agentLegId: string): void
  • volumeChange(volume: number): void

Generated using TypeDoc