import { Service } from '../../services/service'; export declare const RINGING_SVC = "RingingService"; export declare enum NotificationType { NOTIFICATIONTYPE_STANDARD = "std", NOTIFICATIONTYPE_LOW = "low", NOTIFICATIONTYPE_MIDDLE = "middle", NOTIFICATIONTYPE_HIGH = "high" } interface IAudioTone { audio: HTMLAudioElement; starting: boolean; stopDefered?: any; id?: string; type?: string; } export declare class RingingService extends Service { private settingsService; private contactService; private profileService; private roomService; private deviceManagementService; private supervisionService; private telephonyService; private presenceHelperService; private eventService; private logger; private webrtcP2PService; private bubbleConferenceService; notifs: string[]; alarms: string[]; emergencyAlarms: string[]; audioFileType: string; private recordTone; private joinWebConfTone; private alarmNotifOnce; private audioNotifOnce; private pingAudio; private pingAudioSecondary; private pushToTalkActivateTone; private pushToTalkDeactivateTone; private informationImSoundAudio; private informationImSoundAudioSecondary; private importantImSoundAudio; private importantImSoundAudioSecondary; private emergencyImSoundAudio; private emergencyImSoundAudioSecondary; private webrtcBusyTone; private webrtcRaiseHandTone; private incomingRingingTone; private incomingRingingSecondaryTone; private ringbackTone; private secondCallTone; private holdTone; activeSupervisorRingingTone: Partial; activeSupervisorRingingToneSecondary: Partial; supervisorRingingToneOffRequested: boolean; informationImSound: string; importantImSound: string; emergencyImSound: string; activeNotif: string; activeAlarm: string; private isStartIncomingRingingRequest; private stopWebrtcSounds; private subscriptions; private listeners; private alertSoundLevel; private alertSoundLevelInCall; static getInstance(): RingingService; static build(): RingingService; private constructor(); /********************************************************/ /** LIFE CYCLE STUFF */ /********************************************************/ start(): Promise; stop(): Promise; /********************************************************/ /** EVENT HANDLING */ /********************************************************/ private addListeners; private onAudioOutputDeviceChange; private onSecondaryAudioOutputDeviceChange; /*********************************************************************/ /** PRIVATE FUNCTIONS */ /*********************************************************************/ private manageOnWebrtcBusy; private manageOnWebrtcRaiseHand; /** * Method setAudioCapability * Define type (mp3 or Ogg Vorbis) that will be used for audio files. * Ogg Vorbis is preferred if the current browser is able to play media of this type. * Otherwise mp3 is used. * @memberof RingingService * @private */ private setAudioCapability; private manageEmergencyNotifs; private setEmergencyAlarm; private setActive; private shouldPlayImNotif; private shouldPlaySupervisorNotif; /** * Method play * Play the specified audio tone * This function is adapted for play() method returning a Promise or not. * Note: The recent Audio.play() implementation in javascript does return a Promise * @memberof RingingService * @private * @param {any} tone Audio to play (IM notif, Audio tone ...) * @param {number} count Counter used before stopping the ringing forcibly * @returns {void} Returns no specific value */ private play; /** * Method addEvents * Add an event on the specified audio object (based on HTMLAudioElement) * @memberof RingingService * @private * @param {HTMLAudioElement} audioObject Audio resource * @param {any} alarm Audio infomation (name) */ private addEvents; /** * Callback method called on reception of ON_PRESS_PUSH_TO_TALK_EVENT event */ private playActivatePtT; /** * Callback method called on reception of ON_RELEASE_PUSH_TO_TALK_EVENT event */ private playDeactivatePtT; /** * Method stopRingBackToneDefered * Stop playing the ringback tone in a delayed way * @memberof RingingService * @private * @param {number} count Counter used to check if the ringing should be stopped forcibly */ private stopRingBackToneDefered; /** * Method stopIncomingRingingDefered * Stop playing the Incoming Call ringing tone in a delayed way * @memberof RingingService * @private * @param {number} count Counter used to check if the Incoming Call ringing should be stopped forcibly */ private stopIncomingRingingDefered; /** * Method stopIncomingRingingSecondaryDefered * Stop playing the Incoming Call ringing tone on secondary device in a delayed way * @memberof RingingService * @private * @param {number} count Counter used to check if the Incoming Call ringing should be stopped forcibly */ private stopIncomingRingingSecondaryDefered; /** * Method stopSecondToneDefered * Stop playing the secondary call incoming tone in a delayed way * @memberof RingingService * @private */ private stopSecondToneDefered; /** * Method stopHoldToneDefered * Stop playing the Web conference tonein a delayed way * @memberof RingingService * @private */ private stopHoldToneDefered; /*********************************************************************/ /** PUBLIC FUNCTIONS */ /*********************************************************************/ /** * Method getAudioFileType * Returns type (mp3 or Ogg Vorbis) that will be used for audio files. * @memberof RingingService * @private * @returns {string} Returns type (mp3 or Ogg Vorbis) that will be used for audio files. */ getAudioFileType(): string; /** * Method playWebConferenceJoinNotif * Play a tone when a participant has joined a Web conference * Callback method called on reception of ON_WEB_CONFENRECE_PARTICIPANT_JOINED_EVENT event * @memberof RingingService * @private * @param {Event} __event Native event * @param {any} confSession Web Conference Session */ playWebConferenceJoinNotif(__event: Event, confSession: any): Promise; /** * Method playWebrtcBusyTone * Play a busy tone when a webrtc outgoing call is rejected because called is busy * @memberof RingingService * @private */ playWebrtcBusyTone(): Promise; /** * Method playWebrtcRaiseHandTone * Play a tone when someone raises their hand in a conference (excluding me) * @memberof RingingService * @private */ playWebrtcRaiseHandTone(): Promise; /** * Method setActiveAlarm * Set the specified alarm as active * @memberof RingingService * @private * @param {any} alarm Name of the alarm to set as active, one of defined in 'alarms' array */ setActiveAlarm(alarm: any): void; /** * Method setActiveAlarm * Activate and configure the secondary ringer * @memberof RingingService * @private */ activateSecondaryRinger(): void; changePlayMessagingNotifOnSecondaryRinger(playMessagingNotifOnSecondaryRinger: boolean): void; /** * Method playAlarmOnce * Play once the specified alarm * @memberof RingingService * @private * @param {any} alarm Name of the alarm to play, one of defined in 'alarms' array */ playAlarmOnce(alarm: any): void; /** * Method stopAlarmOnce * stop the alarm that asked to be played only once * @memberof RingingService * @private */ stopAlarmOnce(): void; /** * Method alarmCurPlay * Check if the alarm that asked to be played only once is currently playing * @memberof RingingService * @private * @returns {boolean} Returns true */ private alarmCurPlay; /** * Method setActiveNotif * Set the specified notification (for example, for chat) as active * @memberof RingingService * @private * @param {any} notif Name of the notification to set as active, one of defined in 'notifs' array */ setActiveNotif(notif: any): void; /** * Method playNotifOnce * Play once the specified notification * @memberof RingingService * @private * @param {any} notif Name of the notification to play, one of defined in 'notifs' array */ playNotifOnce(notif: any): void; /** * Method stopNotifOnce * stop the notification that asked to be played only once * @memberof RingingService * @private */ stopNotifOnce(): void; /** * Method notifCurPlay * Check if the notification that asked to be played only once is currently playing * @memberof RingingService * @private * @returns {boolean} Returns true */ private notifCurPlay; /** * Method setInformationImSound * Set the sound for notification regarding information IM * @memberof RingingService * @private * @param {any} notif Set Name of the sound to play as notification for information IM, one of defined in 'notifs' array */ setInformationImSound(notif: any): void; /** * Method setImportantImSound * Set the sound for notification regarding important IM * @memberof RingingService * @private * @param {any} notif Name of the sound to play as notification for important IM, one of defined in 'notifs' array */ setImportantImSound(notif: any): void; /** * Method setEmergencyImSound * Set the sound for notification regarding emergency IM * @memberof RingingService * @private * @param {any} notif Name of the sound to play as notification for emergency IM, one of defined in 'notifs' array */ setEmergencyImSound(notif: any): void; /** * Method stopUrgencyNotif * stop the sound played as notification for emergency IM * @memberof RingingService * @private */ stopUrgencyNotif(): void; /** * Method playCustomNotif * Play the specified custom notification * @memberof RingingService * @private * @param {string} typeNotif Type of notification to play */ playCustomNotif(typeNotif: string): Promise; /** * Method startRingBackTone * Start playing the ringback tone * @memberof RingingService * @private * @param {boolean} isWebrtcCall True if we are in a WebRTC call usecase */ startRingBackTone(isWebrtcCall: boolean): Promise; /** * Method stopRingBackTone * Stop playing the ringback tone * @memberof RingingService * @private * @param {number} count Counter used to stop forcibly the ringback tone */ stopRingBackTone(count?: number): void; /** * Method startIncomingRinging * Start playing the Incoming Call ringing tone * @memberof RingingService * @private * @param {boolean} isWebrtcCall True if we are in a WebRTC call usecase */ startIncomingRinging(isWebrtcCall?: boolean): Promise; /** * Method stopIncomingRinging * Stop playing the Incoming Call ringing tone * @memberof RingingService * @private * @param {number} count Counter used to stop forcibly the Incoming Call ringing tone */ stopIncomingRinging(count?: number): void; /** * Method playSecondCallTone * Start playing the secondary call incoming tone * @memberof RingingService * @private */ playSecondCallTone(): Promise; /** * Method stopSecondCallTone * Stop playing the secondary call incoming tone * @memberof RingingService * @private */ stopSecondCallTone(): void; /** * Method playHoldTone * Start playing the Put On Hold tone * @memberof RingingService * @private */ playHoldTone(): Promise; /** * Method stopHoldTone * Stop playing the Put On Hold tone * @memberof RingingService * @private */ stopHoldTone(): void; /** * Method playImNotif * Stop playing the the Web conference tone * @memberof RingingService * @private */ playImNotif(): Promise; /** * Method setActiveSupervisorAlarm * Set the specified notification as active for supervisor when supervisee receives an incoming call * @memberof RingingService * @private * @param {any} notif Name of the supervisor notification to set as active, one of defined in 'notifs' array */ setActiveSupervisorAlarm(id: string, type: string): void; /** * Method playSupervisorNotif * Start playing the supervisor audio notif * @memberof RingingService * @private */ playSupervisorNotif(): Promise; /** * Method playSupervisorRingingTone * Start playing the Supervisor ringing tone * @memberof RingingService * @private */ playSupervisorRingingTone(): Promise; /** * Method stopSupervisorRingingTone * Stop playing the Put On Hold tone * @memberof RingingService * @private */ stopSupervisorRingingTone(): void; /** * Method stopSupervisorRingingToneDefered * Stop playing the supervisor tone in a delayed way on main device * @memberof RingingService * @private */ private stopSupervisorRingingToneDefered; /** * Method stopSupervisorRingingToneSecondaryDefered * Stop playing the supervisor tone in a delayed way on secondary device * @memberof RingingService * @private */ private stopSupervisorRingingToneSecondaryDefered; /** * Method playRecordTone * Start playing the Conference Record tone * @memberof RingingService * @private */ playRecordTone(): Promise; /** * Method stopIncomingWebrtcSounds * Stop playing the WebRTC Incoming Call ringing tone * @memberof RingingService * @private */ stopIncomingWebrtcSounds(): void; } export {}; //# sourceMappingURL=ringing.service.d.ts.map