UNPKG

@ama-team/voxengine-definitions

Version:
148 lines (131 loc) 3.65 kB
/** * @module Modules.ACD */ /** * @namespace ACDEvents */ /** * Triggered if ACD service is temporary unavailable * * @event ACDEvents.Error * @name ACDEvents.Error * * @param {string} error Error message * @param {ACDRequest} request Request that generated the event */ /** * Triggered if all operators that can process request in specified queue are offline, in this case request it not * queued. * * @event ACDEvents.Offline * @name ACDEvents.Offline * * @param {ACDRequest} request Request that generated the event */ /** * Dispatched when ACD request tries to reach operator, but operator declines the call. * * Dispatched when ACD request tries to reach operator, but operator declines the call. * IMPORTANT NOTE: This is just a notification, request processing doesn't stop. It will be dispatched to different * operators. * * @event ACDEvents.OperatorFailed * @name ACDEvents.OperatorFailed * * @param {string} operatorUserName Username of failed operator * @param {ACDRequest} request Request that generated the event * @param {number} statusCode Call status code */ /** * @event ACDEvents.OperatorReached * @name ACDEvents.OperatorReached * * @param {Call} operatorCall Established call with operator * @param {ACDRequest} request Request that generated the event */ /** * Triggered if queue has reached its max length or EWT, in this case request it not queued. * * @event ACDEvents.QueueFull * @name ACDEvents.QueueFull * * @param {ACDRequest} request Request that generated the event */ /** * @event ACDEvents.Queued * @name ACDEvents.Queued * * @param {ACDRequest} request Request that generated the event */ /** * Event dispatched as a result of ACDRequest.getStatus() call. * * @event ACDEvents.Waiting * @name ACDEvents.Waiting * * @param {number} ewt Estimated wait time in minutes (value of 0 is also possible) * @param {ACDRequest} request Request that generated the event */ /** * @class ACDEnqueueParams * * @property {object.<string,string>} headers Optional extra headers to be passed with the call to operator * @property {number} priority Priority (1-100, 1 is highest priority) */ /** * Represents request that was put to ACD queue * * @class ACDRequest */ /** * Please note that this is virtual member of {ACDRequest} that doesn't exist in VoxImplant engine * * @callback ACDRequest.eventListener * * @param {object} event Event listener has been subscribed to */ /** * Adds handler for specific event generated by ACD request. * * @function ACDRequest#addEventListener * * @param {function} acdevent Event class (e.g. {@link ACDEvents.Offline}) * @param {ACDRequest.eventListener} [handler] Handler function. A single parameter is passed - object with event * information */ /** * Cancel pending request and remove it from queue. * * @function ACDRequest#cancel */ /** * Request status of current request. * * @function ACDRequest#getStatus */ /** * Returns request id. * * @function ACDRequest#id * * @return {string} */ /** * Removes handler for specific event generated by ACD request * * @function ACDRequest#removeEventListener * * @param {function} acdevent Event class (e.g. {@link ACDEvents.Offline}) * @param {ACDRequest.eventListener} [handler] Handler function. If not specified, all event listeners are removed. */ /** * Submit new request to queue * * @function VoxEngine.enqueueACDRequest * * @param {string} queueName Queue name * @param {string} callerId CallerID of person being put to the queue * @param {ACDEnqueueParams} [params] Extra parameters * * @return {ACDRequest} */