@kmhgmbh/dialer-vue-components
Version:
VueJS components for telephony and dialer functions
941 lines (896 loc) • 25.6 kB
JavaScript
// Tools function to return text value for an Enum
function EnumLabel(myenum, value) {
for (var val in myenum)
if (myenum[val] == value)
return val;
// Si la valeur n'est pas dans l'enum, on la renvoi par defaut
return "NoInEnum_" + value;
}
/**
* Enum for All agents context
* @class enum
*/
var ContextTypes = {
/** Out of context (can be seen has the agent "global" context) */
Global: 0,
/** Actions, events, for telephony context */
Telephony: 1,
/** Actions, events, for Video call context */
Video: 2,
/** Actions, events, for VoiceMail context */
VoiceMail: 3,
/** Actions, events, for Chat context */
Chat: 4,
/** Actions, events, for Mail context */
Mail: 5,
/** Actions, events, for Fax context */
Fax: 6,
/** Actions, events, for SMS context */
SMS: 7,
/** Actions, events for telephony context - inbound only (for internal use) */
Inbound : 8,
/** Actions, events for telephony context - outbound only (for internal use) */
Outbound : 9,
/** Actions, events for SocialNetwork context */
SocialNetwork : 10
}
/**
* Define the level for messages received by server
* @class enum
*/
var MessageLevels = {
/** Information level */
Information: 0,
/** Warning level */
Warning: 1,
/** Error level */
Error: 2,
/** Fatal level */
Fatal: 3
}
/**
* @private
*/
var ProxyRunMode = {
// This client is an agent
Agent: 0,
// This client is a supervisor
Supervisor: 1
}
/**
* @private
*/
var MessageFilterType = {
// Send keepalive messages to keep socket connected (usefull with NAT routers)
Keepalive: 1,
// Statistiques concernant les agents
StatAgentState: 2,
// Statistiques concernant les queues, campagnes
StatSupervision: 4,
// Actuellement les qualifications
StatAdvanced: 8,
// Envoi des infos de script (avancement)
StatScript: 16,
// Communcation vers les sup de type UniCast
SendUnicast: 4096,
// Envoi les infos sur les agents deconnect� lors de la connexion d'un superviseur le demandant
SendOldAgents: 8192
}
/**
* @private
*/
var ContextFilters = {
// The information will be sent
NoFilter: 0xFFFF,
// telephony context (inbound or outbound)
Telephony: 1,
// Video call context
Video: 2,
// VoiceMail context
VoiceMail: 4,
// Chat context
Chat: 8,
// Mail context
Mail: 16,
// Fax context
Fax: 32,
// SMS context
SMS: 64
}
/**
* Define all global states of an agent. On state change, the event OnAgentStateChange is fired.
* @class enum
*/
var AgentGlobalStates = {
/** AgentLink component initialised but agent not already logged */
Off: 0,
/** Agent is working on at least one canal. */
Working: 2,
/** Agent is waiting on at least one canal, and working on none. */
Waiting: 1,
/** Agent is at pause on at least one canal, and working or waiting on none. */
Pause: 3
}
/**
* Context state (for all media).
* @class enum
*/
var ContextStates = {
/** Context is stopped */
Stopped: 0,
/** Context is starting and waiting (no active session) */
Waiting: 1,
/** Context is starting (at least session) */
Working: 2,
/** All contexts are at Pause for this agent */
PendingWaiting: 3
}
/**
* Context state details for stopped state
* @class enum
*/
var ContextStoppedDetails = {
/** Context is stopped */
Stopped: 0,
/** Pause request but not all context are stopped */
PausePending: 1,
/** Agent station is used by another context */
PhoneUnavailable: 2,
/** Agent station is called by ACD */
PhoneRinging: 3,
/** Agent en pause */
AgentInPause: 4
}
/**
* Context state details for state waiting, only for telephony
* @class enum
*/
var ContextWaitingDetails = {
/** Context is stopped */
Waiting: 0,
/** Pause request but not all context are stopped */
WaitingInbound: 1,
/** Agent station is used by another context */
WaitingOutbound: 2,
/** Agent station is called by ACD */
WaitingBlended: 3
}
/**
* Telephony session states
* @class enum
*/
var SessionTelephonyStates = {
Off:0,
/** Agent is supervising */
Supervising: 6,
/** After Work */
Wrapup: 7,
/** Agent station is ringing, agent need to answer */
Alerting: 8,
/** Agent is in Search Mode */
SearchMode: 9,
/** Agent is Previewing */
Preview: 96,
/** Client phone is ringing */
Dialing: 99,
/** Agent is on talk */
Online: 100,
/** Agent is dialing a consultation */
OnlineDialing: 1001,
/** Agent is on consultation call */
OnlineConsultation: 1002,
/** Agent put his client on hold */
OnlineOnHold: 1003,
/** Agent is on conference call */
OnlineConference: 1004,
/** Agent is on consultation call, but swapped the calls */
OnlineConsultationOnHold: 1005,
/** Agent is online for a consultation call */
OnlineConsultationReceived: 1006
}
/**
* Telephony online details. Set to all session states, not only Online.
* @class enum
*/
var SessionTelephonyOnlineDetails = {
/** Inbound call */
Inbound: 1,
/** Inbound call */
Outbound: 2,
/** Manual call */
Manual: 3,
/** Personnal call (without telephony session) */
Personnal: 6,
/** Redial call ( BIS ) */
Redial: 12,
/** Callback of any type for Inbound campaign */
CallbackInbound: 21,
/** Callback of any type for Outbound campaign */
CallbackOutbound: 22
}
/**
* Chat session state
* @class enum
*/
var SessionChatStates = {
Off : 0,
/** After Work */
Wrapup: 7,
/** Agent is on talk */
Chatting: 100,
/** Agent is dialing a consultation */
ChattingDialing: 1001,
/** Agent is on consultation call */
ChattingConsultation: 1002,
/** Agent put his client on hold */
ChattingOnHold: 1003,
/** Agent is on conference chat */
ChattingConference: 1004,
/** Agent is online for a consultation chat */
OnlineConsultationReceived: 1006,
/** Agent is online for a non telephony session */
OnlineSessionCall : 1007,
/** Agent is online for a non telephony session that is held */
OnlineSessionCallHeld : 1008
}
/**
* Mail session state
* @class enum
*/
var SessionMailStates = {
Off : 0,
/** After Work */
Wrapup: 7,
/** Agent is in Search Mode */
SearchMode: 9,
/** Agent is working on mail */
Working: 100,
/** Agent is online for a non telephony session */
OnlineSessionCall : 1007,
/** Agent is online for a non telephony session that is held */
OnlineSessionCallHeld : 1008
}
/**
* VoiceMail session state
* @class enum
*/
var SessionVoiceMailStates = {
Off : 0,
/** Agent is in Search Mode */
SearchMode: 9,
/** Agent is working on mail */
Working: 100,
/** Agent is online for a non telephony session */
OnlineSessionCall : 1007,
/** Agent is online for a non telephony session that is held */
OnlineSessionCallHeld : 1008,
/** Agent is listening a voicemail */
OnlineListeningVoiceMail : 1009
}
/**
* Fax session state
* @class enum
*/
var SessionFaxStates = {
Off : 0,
/** Agent is in Search Mode */
SearchMode: 9,
/** Agent is working on mail */
Working: 100,
/** Agent is online for a non telephony session */
OnlineSessionCall : 1007,
/** Agent is online for a non telephony session that is held */
OnlineSessionCallHeld : 1008
}
/**
* SocialNetwork session state
* @class enum
*/
var SessionSocialNetworkStates = {
Off : 0,
/** After Work */
Wrapup: 7,
/** Agent is in Search Mode */
SearchMode: 9,
/** Agent is working on mail */
Working: 100,
/** Agent is online for a non telephony session */
OnlineSessionCall : 1007,
/** Agent is online for a non telephony session that is held */
OnlineSessionCallHeld : 1008
}
/**
* Allowed agent functions, need to be checked before each function call
* @class enum
*/
var AgentActionAllowed = {
/** Agent can login */
Login: 0,
/** Agent can logout */
Logout: 1,
/** Go to ready state for all open contexts, as soon as possible. */
Ready: 2,
/** Go to pause state for all open contexts, as soon as possible. */
Pause: 3,
/** Make call without context, status, ... */
PersonalCall: 4,
/** Send a mail without mail session, status, ... */
SendMail: 5,
/** End current personnal call */
Hangup: 7,
/** Request supervisor help */
HelpMeStart: 30,
/** Stop requesting supervisor help */
HelpMeStop: 31,
/** Allow agent to play a wav file */
PlayWav: 32,
/** Allow agent to play a wav file */
StopWav: 33,
/** Allow agent to play a wav file */
PlayHistoWav: 34,
/** Allow to record the current call */
StartRecording: 35,
/** Allow to stop the current record */
StopRecording: 36,
/** Make a call with a phonenumber chosen by the agent */
ChangeContactInfo: 40,
/** Request dialing pause as soon as possible (maybe now) */
RequestTempNotReady: 100,
/** Return to ready state */
CancelTempNotReady: 101,
/** Allow the agent to see the phone number of the other party on the call */
DisplayContactInfo: 102
}
/**
* Allowed context functions, need to be checked before each function call
* @class enum
*/
var ContextActionAllowed = {
/** Make a call for manual campaign */
ManualCall: 4,
/** Can change his queues affectation for this context */
ChangeAffectation: 20,
/** Can start ou stop this context */
EnableContext: 21,
/** Request search mode as soon as possible (maybe now) */
RequestSearchMode: 200,
/** Request start waiting for incoming feeds */
RequestWaiting: 201,
/** Can change his inbound affectation for this context */
ChangeAffectationInbound: 202,
/** Can change his outbound affectation for this context */
ChangeAffectationOutbound: 203,
/** Can start ou stop his inbound context */
EnableContextInbound: 204,
/** Can start ou stop his outbound context */
EnableContextOutbound: 205
}
/**
* Allowed voicemail functions, need to be checked before each function call
* @class enum
*/
var VoiceMailSessionActionAllowed = {
/** Send an email if a media server is connected */
SendEmail: 5,
/** Make a direct transfer to another agent or campaign */
BlindTransfer: 9,
/** Set the call status of this context */
SetCallStatus: 14,
/** End of this voicemail handling, close the script, send the status and change agent state */
CloseSession: 17,
/** Request a call on the session */
CallSession: 50,
/** Hangup the call made on the session */
HangupCallSession: 51,
/** Hold the call made on the session */
HoldCallSession: 52,
/** Retrieve the call held on the session */
RetrieveCallSession: 53,
/** Go out SearchMode */
CancelSearchMode: 201,
/** Redial the of current session */
Redial: 208,
/** Request a context popup for search mode */
SearchModeSelect: 213,
/** Play a voice mail */
VoicemailPlayStart: 300,
/** Stop a voice mail */
VoicemailPlayStop: 301
}
/**
* Allowed telephony functions, need to be checked before each function call
* @class enum
*/
var TelephonySessionActionAllowed = {
/** Send an email if a media server is connected */
SendEmail: 5,
/** Hangup current call */
Hangup: 7,
/** Make a consultation call (actual call is put on Hol state) */
Consultation: 8,
/** End the consultation call */
CancelConsultation: 89,
/** Make a direct transfer to a phonenumber */
BlindTransfer: 9,
/** Join our two call together an leave this call */
Transfer: 10,
/** Join our two call together an stay on this call */
Conference: 11,
/** Hangup the last partie added to this conference */
ConferenceCancel: 12,
/** For agents in auto ready, request additional wrapup time */
ExtendWrapup: 13,
/** Set the call status of this context */
SetCallStatus: 14,
/** End of this call handling, close the script, send the status and change agent state */
CloseSession: 17,
/** Change call wich is on Hold state */
Alternate: 19,
/** Go out SearchMode page */
CancelSearchMode: 201,
/** Put current call in waiting */
Hold: 206,
/** Retrieve current from Hold state */
Retrieve: 207,
/** Make a redial of the current call */
Redial: 208,
/** Start playing a DTMF sequence */
PlayDTMF: 210,
/** Start previewed call dialing */
PreviewCall: 211,
/** Cancel previewed call and go to wrapup state */
PreviewCancel: 212,
/** Request a context popup for search mode */
SearchModeSelect: 213
}
/**
* List of informations panels allowed on the context
* You should not display an unallowed panel
* @class enum
*/
var ContextSectionsAllowed = {
/** Section displaying the next callbacks */
Callback: 0,
/** Section displaying production statistics */
ProdStat: 1,
/** Section displaying informations on medias */
MediaInfo: 2,
/** Section displaying history of the current contact */
ContactHisto: 3,
/** Section displaying informations of the current contact */
ContactInfo: 4
}
/**
* Types of destinary for all media except telephony
* @class enum
*/
var DestinaryTypes = {
/** The destinary hes been set by the agent */
Free: 0,
/** The destinary is another agent */
Agent: 1,
/** The destinary is a campaign */
Campaign: 2,
/** The destinary is a queue */
Queue: 3
}
/**
* Chat messages type
* @class enum
*/
var ChatMessageTypes = {
/** End of chat between a supervior and a agent */
ChatClose: -1,
/** Text message */
TextMessage: 0,
/** Attachement */
AttachedFile: 1,
/** Chatter identification */
ChatterIdentification: 2,
/** Chatter start writting */
WrittingStart: 3,
/** Chatter stop writting */
WrittingStop: 4,
/** Ask to websurfer the desktop sharing */
DesktopSharingRequest: 5,
/** End the running desktop sharing */
DesktopSharingStop: 6,
/** ACK for the desktop sharing request */
DesktopSharingACK: 7,
/** The desktop sharing session is running */
DesktopSharingStarted: 8,
/** The websurfer browse to another url */
NavigationMessage : 9,
/** The agent act / stop to act on desktop share */
DesktopSharingAct : 10,
/** Datas messages for automatic script filling */
Data : 11,
/** Last message sent by agent has been blacklisted */
BlackListError : 12,
/** List of sentences proposed by NaturalLangage */
NaturalLangageList : 13,
/** Websurfer window has been resized */
WindowResize : 14,
/** The mode of consultation is changing (both or agent only) */
Swap: 15
}
/**
* Type of chat message sender
* @class enum
*/
var ChatterTypes = {
/** Message has been sent automaticaly by Predictive */
Predictive: -1,
/** Message has been sent by an agent */
Agent: 0,
/** Message has been sent by a supervisor */
Supervisor: 1,
/** Message has been sent by a websurfer */
Web: 2,
/** Automatic message */
System: 3,
/** Automatic message from NaturalLangage */
NaturalLangage : 4
}
/**
* Mode of the chat consultation
* @class enum
*/
var ChatConsultMode = {
/** No consult on the session */
Off: -1,
/** Everybody will receive agent messages */
Public: 0,
/** Only supervisor will receive agent messages */
Private : 1
}
/**
* Allow chat session functions, need to be checked before each function call
* @class enum
*/
var ChatSessionActionAllowed = {
/** Send an email if a media server is connected */
SendEmail: 5,
/** End chat session */
Hangup: 7,
/** Consult request */
Consultation: 8,
/** Make a direct transfer to another agent */
BlindTransfer: 9,
/** Transfer the chat to another agent */
Transfer: 10,
/** Terminate the running consult */
CancelConsultation: 89,
/** Join our two chat together an stay on this chat */
Conference: 11,
/** Hangup the last partie added to this conference */
ConferenceCancel: 12,
/** Set the call status of this session */
SetCallStatus: 14,
/** End of this chat handling, close the script, send the status and change agent state */
CloseSession: 17,
/** Change call wich is on Hold state */
Alternate: 19,
/** Request a telephony call on this session */
CallSession: 50,
/** Hangup the call made on this session */
HangupCallSession: 51,
/** Hold the call made on the session */
HoldCallSession: 52,
/** Retrieve the call held on the session */
RetrieveCallSession: 53,
/** Make a redial on the current chat following a previous call */
Redial: 208,
/** Send chat message */
SendChat: 400,
/** Request desktop sharing */
StartDesktopSharing : 401,
/** End the desktop sharing */
StopDesktopSharing : 402,
/** Start acting on the desktop sharing */
StartActOnDesktopSharing : 403,
/** Stop acting on the desktop sharing */
StopActOnDesktopSharing : 404,
/** Send the history of conversation by email */
SendChatConvByMail : 405,
/** Start cobrowsing with the websurfer */
StartCobrowsing : 406,
/** End cobrowsing with the websurfer */
StopCobrowsing : 407,
/** Do not close the chat session UI but create a new session (in stats) */
NextFile : 408
}
/**
* Allowed mail session functions, need to be checked before each function call
* @class enum
*/
var MailSessionActionAllowed = {
/** Send this email */
SendEmail: 5,
/** Transfer this email */
Transfer: 10,
/** Set the call status of this mail session */
SetCallStatus: 14,
/** End of this mail handling, close the script, send the status and change agent state */
CloseSession: 17,
/** Request a call on the session */
CallSession : 50,
/** Hangup the call made on the session */
HangupCallSession : 51,
/** Hold the call made on the session */
HoldCallSession : 52,
/** Retreive the call held on the session */
RetrieveCallSession: 53,
/** Go out SearchMode page */
CancelSearchMode: 201,
/** Make a redial on the current email following a previous call */
Redial: 208,
/** No answer to this mail */
NoAnswer: 500,
/** Send an answer */
Answer: 501,
/** Send an answer to all */
AnswerToAll: 502,
/** Can cancel the edit mode */
BackToMail : 503
}
/**
* Allowed fax functions, need to be checked before each function call
* @class enum
*/
var FaxSessionActionAllowed = {
/** Send an email if a media server is connected */
SendEmail: 5,
/** Make a direct transfer to another agent or campaign */
BlindTransfer: 9,
/** Set the call status of this session */
SetCallStatus: 14,
/** End of this fax handling, close the script, send the status and change agent state */
CloseSession: 17,
/** Request a call on the session */
CallSession: 50,
/** Hangup the call made on the session */
HangupCallSession: 51,
/** Hold the call made on the session */
HoldCallSession: 52,
/** Retrieve the call held on the session */
RetrieveCallSession: 53,
/** Go out SearchMode */
CancelSearchMode: 201,
/** Redial the of current session */
Redial: 208,
/** Request a context popup for search mode */
SearchModeSelect: 213
}
/**
* Allowed social network functions, need to be checked before each function call
* @class enum
*/
var SocialNetworkSessionActionAllowed = {
/** Send an email if a media server is connected */
SendEmail: 5,
/** Make a direct transfer to another agent or campaign */
BlindTransfer: 9,
/** Set the call status of this session */
SetCallStatus: 14,
/** End of this social network handling, close the script, send the status and change agent state */
CloseSession: 17,
/** Request a call on the session */
CallSession: 50,
/** Hangup the call made on the session */
HangupCallSession: 51,
/** Hold the call made on the session */
HoldCallSession: 52,
/** Retrieve the call held on the session */
RetrieveCallSession: 53,
/** Go out SearchMode */
CancelSearchMode: 201,
/** Redial the of current session */
Redial: 208,
/** Request a context popup for search mode */
SearchModeSelect: 213,
/** No answer to this socialnetwork feed */
NoAnswer: 500,
/** Send an answer */
Answer: 501,
/** Can cancel the edit mode */
BackToMail : 503
}
/**
* Campaign type
* @class enum
*/
var CampaignTypes = {
/** Manual campaign */
Manual: 0,
/** Inbound campaign */
Inbound: 1,
/** Outbound campaign */
Outbound: 2,
/** Mail campaign */
Mail: 3,
/** Chat campaign */
Chat: 4,
/** Fax campaign */
Fax : 5,
/** VoiceMail campaign */
SocialNetwork : 6
}
/**
* Outbound Campaign dialing type
* @class enum
*/
var DialingTypes = {
/** Manual dialing */
Manual: 0,
/** Preview dialing */
Preview: 1,
/** Progressive dialing */
Progressive: 2,
/** Predictive dialing */
Predictive: 3,
/** Robot - without agent - */
Robot: 4
}
/**
* Objects type from the Hermes.Net Admin
* @class enum
*/
var ConfigObjects = {
/** Campaign */
Campaign: 0,
/** SuperviseGroup */
SuperviseGroup: 1,
/** SentenceCategory */
SentenceCategory: 2,
/** Manual campaign */
ManualCampaign : 3
}
/**
* Operation type made on Hermes.Net Admin
* @class enum
*/
var ConfigOperations = {
/** Adding this object */
Create: 0,
/** Updating */
Update: 1,
/** Deleting */
Delete: 2
}
/**
* Campaign administrative state
* @class enum
*/
var CampaignStates = {
/** Started and in openning hours */
Open: 0,
/** Started and in closing hours */
Close: 1,
/** Not Started (only for outbound campaigns) */
Inactive: 2
}
/**
* Queue state for current agent
* @class enum
*/
var QueueEnabledBy = {
/** Queue stopped */
Disabled: 0,
/** Queue stopped by supervisor */
DisabledBySupervisor: 1,
/** Queue started */
Enabled: 2,
/** Queue started by supervisor */
EnabledBySupervisor: 3
}
/**
* Specify a phone number type - used to add a prefix to the call
* @class enum
*/
var PhoneNumberTypes = {
/** The out prefix will be add */
External: 0,
/** The phone nuumber will be dialed as it is */
Internal: 1,
/** The phone number is a Did extension (unused in Avaya VSCTI) */
Did: 2,
/** The phone number is a Queue */
Queue: 3
}
/**
* All agent phone line state. Used for his two lines
* @class enum
*/
var LineStates = {
/** Line free */
Cleared: 0,
/** Client phone is ringing (or line is establishing) */
Alerting: 1,
/** Client and agent are online */
Online: 2,
/** Agent put this line on Hold */
Hold: 3,
/** The line is dialing */
Dialing :4
}
/**
* Specify the telephony mode
* @class enum
*/
var TelephonyModes = {
/** Inbound & Outbound */
All: 0,
/** Inbound only */
Inbound: 1,
/** Outbound only */
Outbound: 2
}
/**
* Script marker type
* @class enum
*/
var ScriptMarkerType = {
/** A marker auto sent by the script */
Standard: 0,
/** A marker specified by script author */
Specific: 1
}
/**
* Subtype of chat message
* @class enum
*/
var ChatSentencesType = {
/** Text message */
TEXT: "TEXT",
/** Message contains a link */
HREF: "HREF",
/** Message to specify other party to browse to an url */
BROWSE: "BROWSE",
/** Message to specify other party to show a HTML element */
SHOWID: "SHOWID",
/** Message contains a link to an attached files */
ATTACHMENT: "ATTACHMENT",
/** Message contains the value to set on a HTML element */
DATA: "DATA",
/**
* @deprecated not used anymore
*/
NATURAL_LANGAGE: "NATURAL_LANGAGE",
/** Message for stopping a cobrowsing session */
COBROWSING_STOP: "COBROWSING_STOP",
/** The websurfer has accepted the TheLink application */
THELINK_ACK: "THELINK_ACK",
/** Display an ad configured in sentences in the Hermes.Net Admin */
SHOW_ADV : "SHOW_ADV",
/** Display a video configured in sentences in the Hermes.Net Admin */
SHOW_VIDEO: "SHOW_VIDEO",
/** Notify agent that the surfer is coming from a link posted on Facebook by Hermes.Net */
FACEBOOK_LINK: "FACEBOOK_LINK",
/** Message to ask cobrowsing */
COBROWSING_REQUEST: "COBROWSING_REQUEST",
/** Message to ask the reloading of client address book informations */
CRM_REFRESH: "CRM_REFRESH",
/** Message to notify agent, the chat is open for a webcallback */
WEBCALLBACK_ONLY: "WEBCALLBACK_ONLY",
/** Message to notify agent, the chat is open for a webcallback and the surfer is on the website */
WEBCALLBACK_LINKED: "WEBCALLBACK_LINKED",
/** Text message containing HTML */
HTML : "HTML"
}
/**
* Action to perform when all agent session will be closed
* @class enum
*/
var PENDING_REQUEST_ACTION = {
/** pause */
PAUSE: 0,
/** disconnect from CTIProxy */
DISCONNECT: 1,
/** logout from CTIProxy */
CHANGE_USER: 2,
/** reload the workspace */
REFRESH: 3,
/** quit the workspace */
EXIT:4
}