import type { Message } from 'sip.js/lib/api/message'; import { OutgoingInviteRequest } from 'sip.js/lib/core'; import { Inviter } from 'sip.js/lib/api'; import CallSession from '../CallSession'; import type { Phone, AvailablePhoneOptions } from './Phone'; import WebRTCClient from '../../web-rtc-client'; import Emitter from '../../utils/Emitter'; import { WazoSession } from '../types'; export declare const ON_USER_AGENT = "onUserAgent"; export declare const ON_REGISTERED = "onRegistered"; export declare const ON_UNREGISTERED = "onUnRegistered"; export declare const ON_PROGRESS = "onProgress"; export declare const ON_CALL_ACCEPTED = "onCallAccepted"; export declare const ON_CALL_ANSWERED = "onCallAnswered"; export declare const ON_CALL_INCOMING = "onCallIncoming"; export declare const ON_CALL_OUTGOING = "onCallOutgoing"; export declare const ON_CALL_MUTED = "onCallMuted"; export declare const ON_CALL_UNMUTED = "onCallUnmuted"; export declare const ON_CALL_RESUMED = "onCallResumed"; export declare const ON_CALL_HELD = "onCallHeld"; export declare const ON_CALL_UNHELD = "onCallUnHeld"; export declare const ON_CAMERA_DISABLED = "onCameraDisabled"; export declare const ON_CAMERA_RESUMED = "onCameraResumed"; export declare const ON_CALL_CANCELED = "onCallCanceled"; export declare const ON_CALL_FAILED = "onCallFailed"; export declare const ON_CALL_REJECTED = "onCallRejected"; export declare const ON_CALL_ENDED = "onCallEnded"; export declare const ON_CALL_ENDING = "onCallEnding"; export declare const ON_MESSAGE = "onMessage"; export declare const ON_REINVITE = "reinvite"; export declare const ON_TRACK = "onTrack"; export declare const ON_AUDIO_STREAM = "onAudioStream"; export declare const ON_VIDEO_STREAM = "onVideoStream"; export declare const ON_REMOVE_STREAM = "onRemoveStream"; export declare const ON_SHARE_SCREEN_STARTED = "onScreenShareStarted"; export declare const ON_SHARE_SCREEN_ENDING = "onScreenShareEnding"; export declare const ON_SHARE_SCREEN_ENDED = "onScreenShareEnded"; export declare const ON_TERMINATE_SOUND = "terminateSound"; export declare const ON_PLAY_RING_SOUND = "playRingingSound"; export declare const ON_PLAY_INBOUND_CALL_SIGNAL_SOUND = "playInboundCallSignalSound"; export declare const ON_PLAY_HANGUP_SOUND = "playHangupSound"; export declare const ON_PLAY_PROGRESS_SOUND = "playProgressSound"; export declare const ON_VIDEO_INPUT_CHANGE = "videoInputChange"; export declare const ON_CALL_ERROR = "onCallError"; export declare const ON_MESSAGE_TRACK_UPDATED = "onTrackUpdated"; export declare const ON_NETWORK_STATS = "onNetworkStats"; export declare const ON_CHAT = "phone/ON_CHAT"; export declare const ON_SIGNAL = "phone/ON_SIGNAL"; export declare const ON_ICE_DISCONNECTED = "onIceDisconnected"; export declare const ON_ICE_RECONNECTING = "onIceReconnecting"; export declare const ON_ICE_RECONNECTED = "onIceReconnected"; export declare const ON_EARLY_MEDIA = "onEarlyMedia"; export declare const ON_MEDIA_CONNECTED = "onMediaConnected"; export declare const MESSAGE_TYPE_CHAT = "message/TYPE_CHAT"; export declare const MESSAGE_TYPE_SIGNAL = "message/TYPE_SIGNAL"; export declare const events: string[]; export default class WebRTCPhone extends Emitter implements Phone { client: WebRTCClient; allowVideo: boolean; callSessions: Record; incomingSessions: string[]; currentSipSession?: WazoSession; currentCallSession?: CallSession; audioOutputDeviceId?: string; audioRingDeviceId?: string; audioOutputVolume: number; audioRingVolume: number; ringingEnabled: boolean; acceptedSessions: Record; rejectedSessions: Record; ignoredSessions: Record; currentScreenShare: Record | null; lastScreenShare: Record | null; shouldSendReinvite: boolean; fallbackToFirstSipSession: boolean; constructor(client: WebRTCClient, audioOutputDeviceId: string | undefined, allowVideo?: boolean, audioRingDeviceId?: string); register(): Promise; unregister(): Promise | null; stop(): void; removeIncomingSessions(id: string): void; isWebRTC(): boolean; sendReinvite(callSession?: CallSession, constraints?: Record | null | undefined, conference?: boolean, audioOnly?: boolean, iceRestart?: boolean): Promise; getUserAgent(): string; startHeartbeat(): void; stopHeartbeat(): void; setOnHeartbeatTimeout(cb: (...args: Array) => any): void; setOnHeartbeatCallback(cb: (...args: Array) => any): void; reconnect(): void; getOptions(): AvailablePhoneOptions; onConnect(): Promise; onDisconnect(): Promise; _downgradeToAudio(callSession?: CallSession, withMessage?: boolean): boolean; _upgradeToVideo(callSession: CallSession | undefined, constraints: Record, isConference: boolean): Promise; _sendReinviteMessage(callSession: CallSession | undefined, isUpgrade: boolean): void; _bindEvents(sipSession: WazoSession): void; startScreenSharing(constraints: Record, callSession?: CallSession): Promise; stopScreenSharing(restoreLocalStream?: boolean, callSession?: CallSession): Promise; _onScreenSharing(screenStream: MediaStream, sipSession: WazoSession, callSession: CallSession | null | undefined, hadVideo: boolean, desktop?: boolean | null | undefined): void; _onCallAccepted(sipSession: WazoSession, cameraEnabled: boolean): CallSession; changeAudioDevice(id: string): Promise; createAudioElementFor(sessionId: string): Promise; changeRingDevice(id: string): void; changeAudioVolume(volume: number): void; changeRingVolume(volume: number): void; changeAudioInputDevice(id: string, force?: boolean): Promise; changeVideoInputDevice(id: string): Promise; changeSessionVideoInputDevice(id: string | null | undefined): Promise | undefined; _onCallTerminated(sipSession: WazoSession): boolean; setActiveSipSession(callSession: CallSession): void; hasAnActiveCall(): boolean; hasActiveRemoteVideoStream(): boolean; callCount(): number; isCurrentCallSipSession(callSession: CallSession): boolean; hasVideo(callSession: CallSession): boolean; hasAVideoTrack(callSession: CallSession): boolean; getLocalStreamForCall(callSession: CallSession): MediaStream | null | undefined; getRemoteStreamForCall(callSession: CallSession): MediaStream | null | undefined; getRemoteStreamsForCall(callSession: CallSession): MediaStream | null | undefined; accept(callSession: CallSession, cameraEnabled?: boolean): Promise; isAccepted(callSession: CallSession): boolean; reject(callSession: CallSession): Promise; ignore(callSession: CallSession): Promise; atxfer(callSession: CallSession): Record | null | undefined; hold(callSession: CallSession, withEvent?: boolean): Promise | null | undefined; unhold(callSession: CallSession, withEvent?: boolean): Promise; resume(callSession?: CallSession, withEvent?: boolean): Promise; holdSipSession(sipSession: WazoSession, callSession?: CallSession, withEvent?: boolean): Promise; unholdSipSession(sipSession: WazoSession, callSession: CallSession | null | undefined, withEvent?: boolean): Promise; mute(callSession?: CallSession, withEvent?: boolean): void; unmute(callSession?: CallSession, withEvent?: boolean): void; isAudioMuted(callSession: CallSession): boolean; turnCameraOn(callSession?: CallSession): void; turnCameraOff(callSession?: CallSession): void; sendKey(callSession: CallSession | undefined, tone: string): void; makeCall(number: string, line: any, cameraEnabled?: boolean, audioOnly?: boolean, conference?: boolean, options?: {}): Promise; transfer(callSession: CallSession, target: string): void; indirectTransfer(source: CallSession, destination: CallSession): Promise; initiateCTIIndirectTransfer(): Promise; cancelCTIIndirectTransfer(): void; confirmCTIIndirectTransfer(): void; hangup(callSession?: CallSession): Promise; getStats(callSession?: CallSession): Promise; startNetworkMonitoring(callSession?: CallSession, interval?: number): void | null; stopNetworkMonitoring(callSession?: CallSession): void | null; forceCancel(sipSession: Inviter): void; endCurrentCall(callSession: CallSession): void; onConnectionMade(): void; isConference(callSession: CallSession | null | undefined): boolean; close(force?: boolean): Promise; isRegistered(): boolean; enableRinging(): Promise | void; disableRinging(): Promise | void; getCurrentCallSession(): CallSession | null | undefined; hasIncomingCallSession(): boolean; getIncomingCallSession(): CallSession | null | undefined; sendMessage(sipSession: (WazoSession | null) | undefined, body: string, contentType?: string): void; getLocalStream(callSession: CallSession): MediaStream | null | undefined; getLocalVideoStream(callSession: CallSession): MediaStream | null | undefined; getLocalMediaStream(callSession: CallSession): MediaStream | null | undefined; hasLocalVideo(callSession: CallSession): boolean; hasALocalVideoTrack(callSession: CallSession): boolean; getRemoteStream(callSession: CallSession): MediaStream | null | undefined; getRemoteVideoStream(callSession: CallSession): MediaStream | null | undefined; getRemoteVideoStreamFromPc(callSession: CallSession): MediaStream | null | undefined; hasRemoteVideo(callSession: CallSession): boolean; setMediaConstraints(media: MediaStreamConstraints): void; isVideoRemotelyHeld(callSession: CallSession): boolean; bindClientEvents(): void; findSipSession(callSession?: CallSession): WazoSession | null | undefined; getCallSession(sipSessionId: string): CallSession | null | undefined; getSipSessionId(sipSession: WazoSession | null | undefined): string; getSipSessionIdFromCallSession(callSession: CallSession): string | null; _updateCallSession(callSession: CallSession): void; _onMessage(message: Message & { method?: string; body?: string; }): void; _createIncomingCallSession(sipSession: WazoSession, cameraEnabled: boolean, fromSession?: CallSession | null | undefined, autoAnswer?: boolean): CallSession; _createOutgoingCallSession(sipSession: WazoSession, cameraEnabled: boolean, fromSession?: CallSession): CallSession; _createAcceptedCallSession(sipSession: WazoSession, cameraEnabled?: boolean, fromSession?: CallSession): CallSession; _createMutedCallSession(sipSession: WazoSession, fromSession?: CallSession): CallSession; _createUnmutedCallSession(sipSession: WazoSession, fromSession?: CallSession): CallSession; _createCameraResumedCallSession(sipSession: WazoSession, fromSession?: CallSession): CallSession; _createCameraDisabledCallSession(sipSession: WazoSession, fromSession?: CallSession): CallSession; _createCallSession(sipSession: WazoSession, fromSession?: CallSession | null | undefined, extra?: Record): CallSession; } //# sourceMappingURL=WebRTCPhone.d.ts.map