Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to perform Integrated Softphone related task

Hierarchy

  • ACWebRtcService

Index

Constructors

  • constructor for initialization params

    example
    const webRtcService = new ACWebRtcService();
    

    Returns ACWebRtcService

Properties

AudioCodesHeader: "X-InContact-AgentLegId: " = 'X-InContact-AgentLegId: '
AudioCodesHeaderReplace: "Replaces: " = 'Replaces: '
acdAgentId: string = ''
agentLegId: string
agentLegState: string
appName: string = ''
audioCode: any
audioCodeCall: any = null
audioCodeConnectRequested: boolean = false
audioCodeIsConnected: boolean = false
audioElement: HTMLAudioElement = ...
connectedSBC: string = ''
isContactNotEnded: (() => boolean) = ...

Type declaration

    • (): boolean
    • Returns boolean

lastAgentLegIdCall: string = ''
logger: Logger = ...
needToShowAgentLegAcceptReject: (() => boolean) = ...

Type declaration

    • (): boolean
    • Returns boolean

onCallStatusChanged: Subject<CXoneVoiceCall>
onConnectionStatusChanged: Subject<CXoneVoiceConnection>
validationUtilSvc: ValidationUtils = ...

Methods

  • acLog(...args: any): void
  • Callback function for Audiocodes library logger

    Parameters

    • Rest ...args: any

    Returns void

  • audiocodeListeners(): { callConfirmed: ((call: any, message: any, cause: any) => void); callHoldStateChanged: ((call: any, isHold: any, isRemote: any) => void); callShowStreams: ((call: any, _localStream: MediaStream, remoteStream: MediaStream) => void); callTerminated: ((call: any, message: any, cause: any, redirectTo: any) => void); incomingCall: ((call: any, invite: any, replacedCall: any, hasSDP: any) => void); loginStateChanged: ((isLogin: any, cause: any) => void); outgoingCallProgress: ((call: any) => void) }
  • Audiocodes library callback methods

    example
    this.audiocodeListeners.call(this)
    

    Returns { callConfirmed: ((call: any, message: any, cause: any) => void); callHoldStateChanged: ((call: any, isHold: any, isRemote: any) => void); callShowStreams: ((call: any, _localStream: MediaStream, remoteStream: MediaStream) => void); callTerminated: ((call: any, message: any, cause: any, redirectTo: any) => void); incomingCall: ((call: any, invite: any, replacedCall: any, hasSDP: any) => void); loginStateChanged: ((isLogin: any, cause: any) => void); outgoingCallProgress: ((call: any) => void) }

    • callConfirmed: ((call: any, message: any, cause: any) => void)
        • (call: any, message: any, cause: any): void
        • Triggered when the call is established

          Parameters

          • call: any

            [AudioCodesSession] The call session object

          • message: any

            [SipMessage] The OK SIP message of an outgoing call, or 'null' for an incoming call

          • cause: any

            [String] The cause may be one of the following strings: "received ack" "sent ack"

          Returns void

    • callHoldStateChanged: ((call: any, isHold: any, isRemote: any) => void)
        • (call: any, isHold: any, isRemote: any): void
        • Triggered when a SIP local or remote hold state changes (incoming or outgoing re-INVITE).

          Parameters

          • call: any

            [AudioCodesSession] The call session object

          • isHold: any

            [Boolean] Hold (true) or Un-Hold (false)

          • isRemote: any

            [Boolean] Initiator remote side (true) or local side (false)

          Returns void

    • callShowStreams: ((call: any, _localStream: MediaStream, remoteStream: MediaStream) => void)
        • (call: any, _localStream: MediaStream, remoteStream: MediaStream): void
        • Triggered when local and remote audio and video streams are ready to be shown in view panels.

          Parameters

          • call: any

            [AudioCodesSession] The call session object

          • _localStream: MediaStream
          • remoteStream: MediaStream

            [Stream] The stream from the remote camera and microphone

          Returns void

    • callTerminated: ((call: any, message: any, cause: any, redirectTo: any) => void)
        • (call: any, message: any, cause: any, redirectTo: any): void
        • Triggered when a call is terminated or fails.

          Parameters

          • call: any

            [AudioCodesSession] The call session object

          • message: any

            [SipMessage] (Optional) The BYE SIP message

          • cause: any

            [string] (Optional) Reason of termination

          • redirectTo: any

            [string]: (Optional) Destination of redirection, set when the 'cause' parameter is 'Redirected'.

          Returns void

    • incomingCall: ((call: any, invite: any, replacedCall: any, hasSDP: any) => void)
        • (call: any, invite: any, replacedCall: any, hasSDP: any): void
        • Parameters

          • call: any

            [AudioCodesSession] The call session object

          • invite: any

            [SipRequest] The SIP request object

          • replacedCall: any

            [AudioCodesSession] The replaced call session object or null The replacedCall argument is not null, if the received INVITE includes a Replace header. In this case, the programmer in the callback should terminate replacedCall, automatically answer the incoming call, and visually (in GUI panel or window) make it the replacement for the terminated call.

          • hasSDP: any

            [Boolean] Enabled for the phone developer for a special case – incoming INVITE without SDP If it isn’t known whether the other side supports video calls, an answer can be made with or without video).

          Returns void

    • loginStateChanged: ((isLogin: any, cause: any) => void)
        • (isLogin: any, cause: any): void
        • Triggered when the login state is changed.

          Parameters

          • isLogin: any

            [Boolean] isLogin is 'true' if logged in, and 'false' if not logged in.

          • cause: any

            [string] The cause is one of these strings: 'connected', 'disconnected', 'login failed', 'login', 'logout'

          Returns void

    • outgoingCallProgress: ((call: any) => void)
        • (call: any): void
        • Triggered when a SIP 'trying' response or a SIP 'ringing' response is received.

          Parameters

          • call: any

            [AudioCodesSession] The call session object

          Returns void

  • connectAgentLeg(agentLegId: string): void
  • Method to initiate AudioCode server if agent setting is not null or empty

    example
    this.connectAgentLeg('12345');
    

    Parameters

    • agentLegId: string

    Returns void

  • connectAudioCodeServer(): void
  • Method to make Agent Leg call and login to Audio codes server

    example
    this.connectAgentLeg();
    

    Returns void

  • disconnectAgentLeg(): void
  • Method to Disconnect AgentLeg

    example
    this.disconnectAgentLeg();
    

    Returns void

  • disconnectServer(): void
  • Method to disconnect WebRTC server

    example
    webRtcService.disconnectServer()
    

    Returns void

  • getAudioCodeServer(webRTCWSSUrls: any, prevConnectedSBC: any): (string | number)[][]
  • Method get Audio Codes Server details

    Parameters

    • webRTCWSSUrls: any

      contains Get webRTC URL

    • prevConnectedSBC: any

      contains Previous connection details

    Returns (string | number)[][]

    it will return the WebRTC ServerURL to set ServerConfig

  • Method to process agent leg event

    example
    webRtcService.handleAgentLegEvent(AgentLegEvent);
    

    Parameters

    Returns void

  • Method to init and connect to audio code server

    example
    webRtcService.init("12345", options, audioElement);
    

    Parameters

    Returns void

  • isSpeakerandMicAvailable(): Promise<boolean>
  • Method to check if Mic or Speaker is available

    example
    this.isSpeakerandMicAvailable();
    

    Returns Promise<boolean>

  • jssipLog(...args: any): void
  • Callback function for jsSIP library logger

    Parameters

    • Rest ...args: any

    Returns void

  • loginAudioCodeServer(): void
  • Method to initiate Audio codes server

    example
    this.loginAudioCodeServer();
    

    Returns void

  • logoutAudioCodeServer(): void
  • Method to Logout Audio Codes Server

    example
    this.logoutAudioCodeServer();
    

    Returns void

  • makeAgentLegCall(): void
  • Restores the previously connected call or makes new call

    example
    this.makeAgentLegCall();
    

    Returns void

  • onBeforeUnload(event: any): void
  • Method to store AudioCode call data

    example
    this.onBeforeUnload.bind(this);
    

    Parameters

    • event: any

      event from windows

    Returns void

  • requestMediaAccess(): Promise<boolean>
  • Method to request media access

    example
    this.requestMediaAccess();
    

    Returns Promise<boolean>

  • restoreCall(): boolean
  • Makes a call with replace header from previously connected call. In case of refresh to retain a previous call this function is used.

    Returns boolean

    boolean true if there is a active agent leg call in localstorate to restore else return false.

  • stopAudioTrack(mediaStream: MediaStream): void
  • Stop the unused audio tracks of the stream. Fix for SF-13447 - NoAnswer - Call Refusal due to Could not start audio source error.

    Parameters

    • mediaStream: MediaStream

      the requested stream

    Returns void

  • storeAudioCodeCallData(): void
  • Stores the data needed to restore audio call on page refresh

    Returns void

  • volumeChange(volume: number): void
  • Method to set the audio volume

    example

    webRtcService.volumeChange()

    Parameters

    • volume: number

      number

    Returns void

Generated using TypeDoc