export {}; import { Call } from "../common/models/Call"; import { EventEmitter } from "events"; import { Logger } from "../common/Logger"; import { Core } from "../Core"; import { GenericService } from "./GenericService"; declare class TelephonyService extends GenericService { private _contacts; private _bubbles; private _profiles; private _calls; private voiceMail; private userJidTel; private agentStatus; private voicemailNumber; private pbxId; private forwardObject; private nomadicObject; private nomadicAnswerNotTakedIntoAccount; private isBasicCallAllowed; private isSecondCallAllowed; private isTransferAllowed; private isConferenceAllowed; private isVMDeflectCallAllowed; private voiceMailFeatureEnabled; private isForwardEnabled; private isNomadicEnabled; private telephonyHandlerToken; private telephonyHistoryHandlerToken; private _telephonyEventHandler; private makingCall; private starting; private stats; static getClassName(): string; getClassName(): string; static getAccessorName(): string; getAccessorName(): string; constructor(_core: Core, _eventEmitter: EventEmitter, logger: Logger, _startConfig: { start_up: boolean; optional: boolean; }); start(_options: any): Promise; stop(): Promise; attachHandlers(): void; init(useRestAtStartup: boolean): Promise; /** * @private * @method onTelPresenceChange * @instance * @description * Method called when receiving an update on user presence
*/ onTelPresenceChange(__event: any, attr?: any): boolean; /** * @private * @method onCallUpdated * @instance * @description * Method called when receiving an update on a call
*/ onCallUpdated(callInfo: Call): void; /** * @public * @method isTelephonyAvailable * @category Telephony MANAGEMENT * @instance * @description * Check if the telephony service can be used or not (if the connected user has a phone monitored by a PBX)
* @return {boolean} Return true if the telephony service is configured */ isTelephonyAvailable(): boolean; /** * @public * @nodered true * @method getAgentVersion * @instance * @category Telephony MANAGEMENT * @description * Get the associated PBX agent version
* @return {string} Return the version of the agent or "unknown" */ getAgentVersion(): any; /** * @public * @nodered true * @method getXMPPAgentStatus * @instance * @category Telephony MANAGEMENT * @description * Get the status of the XMPP connection to the PBX Agent
* @return {string} Return the status of the connections to the agent or "unknown" */ getXMPPAgentStatus(): any; /** * @public * @nodered true * @method getPhoneAPIStatus * @instance * @category Telephony MANAGEMENT * @description * Get the status of the Phone API status for the PBX Agent
* @return {string} Return the Phone API status for to this Agent or "unknown" */ getPhoneAPIStatus(): any; getAgentStatus(): Promise; /** * @private * @method getTelephonyState * @instance * @category Telephony MANAGEMENT * @param second */ getTelephonyState(second: any): Promise; /** * /** * @public * @nodered true * @method getMediaPillarInfo * @instance * @category Telephony MANAGEMENT * @description * This API allows user to retrieve the Jabber id of the Media Pillar linked to the system he belongs, or Media Pillar user to retrieve the Jabber id credentials and data of the Media Pillar he belongs.
* @async * @return {Promise} * @category async */ getMediaPillarInfo(): Promise; /** * @private * @category Telephony CALL * @instance * @param connectionElemObj */ private createCallFromConnectionElem; /** * @private * @category Telephony CALL * @instance * @method getParticipantsFromParticipantsElem * @param participants */ getParticipantsFromParticipantsElem(participants: any): Promise; /** * @public * @nodered true * @method getVoiceMessageCounter * @async * @category Telephony CALL * @instance * @description * Get the number of voice message
* @return {Promise} Return resolved promise if succeed with the number of messages, and a rejected else. */ getVoiceMessageCounter(): Promise; /*********************************************************/ /** CALL HANDLERS **/ /*********************************************************/ /** * @public * @nodered true * @method getCallToHangOut * @category Telephony CALL * @instance * @description * Get the call which can be hang out
* @return {Call} The call with the ability to be hang out. */ getCallToHangOut(): any; /** * @public * @nodered true * @method getActiveCall * @category Telephony CALL * @instance * @description * get the active call
* @return {Call} The active call */ getActiveCall(): any; /** * @public * @nodered true * @method getActiveCalls * @category Telephony CALL * @instance * @description * get active calls
* @return {Call} The active call */ getActiveCalls(): any[]; /** * @public * @nodered true * @method getCalls * @category Telephony CALL * @instance * @description * get calls
* @return {Call} The calls */ getCalls(): any[]; /** * @public * @nodered true * @method getCallsSize * @category Telephony CALL * @instance * @description * get calls tab size. Warning do not use length on the getCalls method result because it is the last index id +1
* @return {Call} The calls tab size */ getCallsSize(): number; /** * @private * @category Telephony CALL * @instance * @param {Array} tab The tab which need to be sized */ getTabSize(tab: any): number; /** * @public * @nodered true * @method getActiveCall * @param {Contact} contact The contact with an active call with us. * @category Telephony CALL * @instance * @description * get the active call for a contact
* @return {Call} The active call */ getActiveCallsForContact(contact: any): any[]; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method makeCall * @instance * @async * @category Telephony CALL * @description * Call a number
* Contacts and numbers are allowed
* Return a promise
* @param {Contact} contact - contact object that you want to call * @param {String} phoneNumber The number to call * @param {String} correlatorData contains User-to-User information to be sent out as a SIP header via underlying PBX trunk for a given call * @return {Promise} Return a promise with the call created */ makeCall(contact: any, phoneNumber: any, correlatorData: any): Promise; /** * @private * @method makeSimpleCall * @async * @category Telephony CALL * @instance * @param contact * @param phoneNumber * @param correlatorData contains User-to-User information to be sent out as a SIP header via underlying PBX trunk for a given call */ private makeSimpleCall; /** * @private * @method makeConsultationCall * @category Telephony CALL * @instance * @param contact * @param phoneNumber * @param {String} correlatorData contains User-to-User information to be sent out as a SIP header via underlying PBX trunk for a given call * @param callId */ private makeConsultationCall; /** * @public * @nodered true * @method makeCall * @async * @category Telephony CALL * @instance * @description * Call a number
* Return a promise
* @param {String} phoneNumber The number to call * @param {String} correlatorData contains User-to-User information to be sent out as a SIP header via underlying PBX trunk for a given call * @return {Promise} Return a promise with the call created */ makeCallByPhoneNumber(phoneNumber: any, correlatorData: any): Promise; /** * @private * @method getPhoneInfo * @category Telephony CALL * @instance * @param contact * @param phoneNumber * @param correlatorData contains User-to-User information to be sent out as a SIP header via underlying PBX trunk for a given call */ private getPhoneInfo; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method releaseCall * @async * @category Telephony CALL * @instance * @description * Release a call
* Return a promise
* @param {Call} call The call to release * @return {Promise} Return a promise with the call released */ releaseCall(call: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method answerCall * @async * @category Telephony CALL * @instance * @description * Answer a call
* Return a promise
* @param {Call} call The call to answer * @return {Promise} Return a promise with the answered call. */ answerCall(call: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method holdCall * @category Telephony CALL * @instance * @description * Hold a call
* Return a promise
* @param {Call} call The call to hold * @return {Call} Return a promise with the held call. */ holdCall(call: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method retrieveCall * @async * @category Telephony CALL * @instance * @description * Retrieve a call
* Return a promise
* @param {Call} call The call to retrieve * @return {Promise} Return a promise with the call retrieved */ retrieveCall(call: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method deflectCallToVM * @async * @category Telephony CALL * @instance * @description * Deflect a call to the voice mail
* Return a promise
* @param {Call} call The call to deflect * @return {Promise} Return resolved promise if succeed, and a rejected else. */ deflectCallToVM(call: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method deflectCall * @async * @category Telephony CALL * @instance * @description * Deflect a call to an other telephone number
* Return a promise
* @param {Call} call The call to deflect * @param {Object} callee The callee phone number informations where the call shopuld be deflecte'd. * @param {string} callee.calleeExtNumber : The phone number where the call is deflected, the format could be anything the user can type, it will be transformed in E164 format., * @param {string} callee.calleeIntNumber : Internal number if available, * @param {string} callee.calleePbxId : The pbx id if available, * @param {string} [callee.calleeShortNumber] : Short number, * @param {string} [callee.calleeDisplayName] : The displayed name, * @param {string} [callee.calleeCountry] : The contry whe the call will be deflected. * @return {Promise} Return resolved promise if succeed, and a rejected else. */ deflectCall(call: any, callee: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method transfertCall * @async * @category Telephony CALL * @instance * @description * Transfer a held call to the active call
* User should have transfer rights
* Return a promise
* @param {Call} activeCall The active call * @param {Call} heldCall The held call to transfer to the activeCall * @return {Promise} Return resolved promise if succeed, and a rejected else. */ transfertCall(activeCall: any, heldCall: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method conferenceCall * @async * @category Telephony CALL * @instance * @description * Create a conference with a held call and the active call
* User should have conference rights
* Return a promise
* @param {Call} activeCall The active call * @param {Call} heldCall The held call to transfer to the activeCall * @return {Promise} Return a resolved promise . */ conferenceCall(activeCall: any, heldCall: any): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method forwardToDevice * @async * @category Telephony CALL * @instance * @description * Activate the forward to a number
* Return a promise
* @param {String} phoneNumber The number to call * @return {Promise} Return a promise resolved. */ forwardToDevice(phoneNumber: any): Promise; /** * @public * @nodered true * @method forwardToVoicemail * @async * @category Telephony CALL * @instance * @description * Activate the forward to VM
* Return a promise
* @return {Promise} Return a promise resolved. */ forwardToVoicemail(): Promise; /** * @public * @nodered true * @method cancelForward * @async * @category Telephony CALL * @instance * @description * Cancel the forward
* Return a promise
* @return {Promise} Return a promise with the canceled forward call. */ cancelForward(): Promise; getForwardStatus(): Promise; /*************************************************************/ /*************************************************************/ /** * @public * @nodered true * @method sendDtmf * @async * @category Telephony CALL * @instance * @description * send dtmf to the remote party
* @param {string} connectionId * @param {string} dtmf * @return {Promise} Return resolved promise if succeed, and a rejected else. */ sendDtmf(connectionId: any, dtmf: any): Promise; /** * @private * @method clearCall * @category Telephony CALL * @instance * @param Call call the call to reset. * @return nothing. */ private clearCall; private startAsPhoneNumber; /** * @private * @method getOrCreateCall * @category Telephony CALL * @instance * @param status * @param connectionId * @param deviceType * @param contact */ getOrCreateCall(status: any, connectionId: any, deviceType: any, contact?: any): Call; /** * @private * @category Telephony CALL * @instance * @param callId * @description * GET A CALL FROM CACHE
*/ private getCallFromCache; addOrUpdateCallToCache(call: any): Call; private removeCallFromCache; /** * @public * @nodered true * @method logon * @async * @category Telephony CALL * @instance * @param {String} endpointTel The endpoint device phone number. * @param {String} agentId optionnel CCD Agent identifier (agent device number). * @param {String} password optionnel Password or authorization code. * @param {String} groupId optionnel CCD Agent's group number * @description * This api allows an CCD Agent to logon into the CCD system.
* @return {Promise} Return resolved promise if succeed, and a rejected else. */ logon(endpointTel: any, agentId: any, password: any, groupId: any): Promise; /** * @public * @nodered true * @method logoff * @async * @category Telephony CALL * @instance * @param {String} endpointTel The endpoint device phone number. * @param {String} agentId optionnel CCD Agent identifier (agent device number). * @param {String} password optionnel Password or authorization code. * @param {String} groupId optionnel CCD Agent's group number * @description * This api allows an CCD Agent logoff logon from the CCD system.
* @return {Promise} Return resolved promise if succeed, and a rejected else. */ logoff(endpointTel: any, agentId: any, password: any, groupId: any): Promise; /** * @public * @nodered true * @method withdrawal * @async * @category Telephony CALL * @instance * @param {String} agentId optionnel CCD Agent identifier (agent device number). * @param {String} groupId optionnel CCD Agent's group number * @param {String} status optionnel Used to deactivate the withdrawal state. Values: 'on', 'off'; 'on' is optional. * @description * This api allows an CCD Agent to change to the state 'Not Ready' on the CCD system. When the parameter 'status' is passed and has the value 'off', the state is changed to 'Ready'
* @return {Promise} Return resolved promise if succeed, and a rejected else. */ withdrawal(agentId: any, groupId: any, status: any): Promise; /** * @public * @nodered true * @method wrapup * @async * @category Telephony CALL * @instance * @param {String} agentId CCD Agent identifier (agent device number). * @param {String} groupId CCD Agent's group number * @param {String} password optionnel Password or authorization code. * @param {String} status optionnel Used to deactivate the WrapUp state. Values: 'on', 'off'; 'on' is optional. * @description * This api allows an CCD Agent to change to the state Working After Call in the CCD system. When the parameter 'status' is passed and has the value 'off', the state is changed to 'Ready'.
* @return {Promise} Return resolved promise if succeed, and a rejected else. */ wrapup(agentId: any, groupId: any, password: any, status: any): Promise; /*************************************************************/ /*************************************************************/ nomadicLogin(phoneNumber: any, NotTakeIntoAccount?: any): Promise; /** * @public * @nodered true * @method getNomadicStatus * @async * @category Telephony NOMADIC * @instance * @description * This api allows to get the nomadic status.
* @return {Promise} Return resolved promise if succeed, and a rejected else. */ getNomadicStatus(): Promise; /** * @private * @param response */ updateNomadicData(response: any): Promise; getNomadicObject(): any; getNomadicDestination(): any; /** * @public * @nodered true * @method deleteAllMyVoiceMessagesFromPbx * @async * @category Telephony Voice Messages * @instance * @description * This api allows to Delete all user's present (read and unread) voice messages from the Pbx.
* This command is to be used to remove all read and unread messages for one user, on the pbx side, it has no effect on the file storage side.
* Do not use this API command to delete the voice messages file from the file storage.
* * return : * * | Champ | Type | Description | * | --- | --- | --- | * | status | String | | * * @return {Promise} Return resolved promise if succeed, and a rejected else. */ deleteAllMyVoiceMessagesFromPbx(): Promise; /** * @public * @nodered true * @method deleteAVoiceMessageFromPbx * @async * @category Telephony Voice Messages * @instance * @param {string} messageId The message Id * @description * This api allows to Delete a voice message from the Pbx, using it's unique identifier (messageId), which is the one given in the messages list.
* This command is to be used to remove the message on the pbx side; it has no effect on the file storage side.
* Do not use this API command to delete the voice message file from the file storage.
* * return : * * | Champ | Type | Description | * | --- | --- | --- | * | status | String | | * * @return {Promise} Return resolved promise if succeed, and a rejected else. */ deleteAVoiceMessageFromPbx(messageId: string): Promise; /** * @public * @nodered true * @method getAVoiceMessageFromPbx * @async * @category Telephony Voice Messages * @instance * @param {string} messageId The message Id * @param {string} messageDate The date in ISO 8601 format, used form : YYYY-MM-DDTHH:MM:SSTZ * @param {string} messageFrom The message sender phone number (can an external number in E164 form or an internal short). * @description * This api allows to Get a voice message from the Pbx, using it's unique identifier (messageId), which is the one given in the messages list.
* But, in order to build a proper file name, we also need the message's creation date (ISO 8601) and the distant user's phone number.
* Initialy all voice messages are stored in the pbx, therefore they have to be transfered to Rainbow server before being given to the asking client.
* The positive acknowledged of this request only signifies that the pbx has accepted the download request. The client will be informed further once the message is available on file storage server. In the case the file transfer should fail, the client will also be informed..
* * parameters:
* * messageDate : mandatory, date in ISO 8601 format, used form : YYYY-MM-DDTHH:MM:SSTZ.
* * messageFrom : the message sender phone number (can an external number in E164 form or an internal short).
* * return : * * | Champ | Type | Description | * | --- | --- | --- | * | status | String | | * | resultCode | String | Pbx result code | * * @return {Promise} Return resolved promise if succeed, and a rejected else. */ getAVoiceMessageFromPbx(messageId: string, messageDate: string, messageFrom: string): Promise; /** * @public * @nodered true * @method getDetailedListOfVoiceMessages * @async * @category Telephony Voice Messages * @instance * @description * This api allows to Get the detailed list of all available voice messages.
* For a user, which has a voice mail box, it is possible to get the detailed list of it's messages.
* A voice message can be :
* * a message recorded by a calling party which couldn't reach the user,
* * a conversation recorded by the user itself.
* * return : * * | Champ | Type | Description | * | --- | --- | --- | * | status | String | | * | data | Object | | * | voicemessages | Object | | * | voiceMessageList | Object\[\] | Table of message descriptor. | * | id | String | Message unique id. | * | unread | String | Message state, false for already read, true elsewhere. | * | length | String | Message length is seconds. | * | date | Date-Time | Message date in ISO 8601 (usual form : YYYY-MM-DDTHH:MM:SSTZ). | * | from | String | Message sender's number. | * | jid | String | Message sender's jid. | * | callable | String | Message sender can be called back or not. | * | identity | Object | Message sender names. | * | displayName | String | Message sender's display name. | * | firstName | String | Message sender's first name. | * | lastName | String | Message sender's last name. | * * @return {Promise} Return resolved promise if succeed, and a rejected else. */ getDetailedListOfVoiceMessages(): Promise; /** * @public * @nodered true * @method getNumbersOfVoiceMessages * @async * @category Telephony Voice Messages * @instance * @description * This api allows to Get voice messages counters, total and unlistened.
* For a user, which has a voice mail box, it is possible to get the number of not yet listened message (aka unread messages).
* When possible the total number of messages is also given.
* Some VoiceMail units only gives if the users has or not one or more messages in his box, the number of them is unknown.
* * * return : * * | Champ | Type | Description | * | --- | --- | --- | * | status | String | | * | data | Object | | * | voicemessages | Object | | * | unread | Number | Number of unlistened messages | * | total | Number | Total number of voice messages | * | present optionnel | Boolean | Pbx doesn't know how much messages a user has, only that one or more are present | * * @return {Promise} Return resolved promise if succeed, and a rejected else. */ getNumbersOfVoiceMessages(): Promise; } export { TelephonyService as TelephonyService };