0311192fd68c2c8f490ac909e61a2fcd73727946
[motion2.git] / server / services / ami / model / voiceQueueSummary.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x17c4=['outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumDuration','total','strategy','busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','loggedin','callers','length','online','incall','includes','status','booked','keys','name','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','prototype','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay'];(function(_0xd582c5,_0xb3ea1b){var _0x40539c=function(_0x4e0953){while(--_0x4e0953){_0xd582c5['push'](_0xd582c5['shift']());}};_0x40539c(++_0xb3ea1b);}(_0x17c4,0x102));var _0x417c=function(_0x3dd174,_0x31fcf6){_0x3dd174=_0x3dd174-0x0;var _0x2d0e06=_0x17c4[_0x3dd174];return _0x2d0e06;};'use strict';var INBOUND_COUNTERS=[_0x417c('0x0'),_0x417c('0x1'),_0x417c('0x2'),_0x417c('0x3'),_0x417c('0x4'),_0x417c('0x5'),_0x417c('0x6')];var OUTBOUND_COUNTERS=[_0x417c('0x0'),_0x417c('0x7'),_0x417c('0x8'),_0x417c('0x1'),'loggedInDb',_0x417c('0x9'),_0x417c('0xa'),_0x417c('0xb'),_0x417c('0xc'),_0x417c('0xd'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x417c('0xe'),_0x417c('0xf'),_0x417c('0x10'),_0x417c('0x11'),_0x417c('0x3'),'pTalking',_0x417c('0x5'),'sumBillable',_0x417c('0x12'),_0x417c('0x13'),_0x417c('0x6')];function VoiceQueueSummary(_0xbc0548){this['id']=_0xbc0548['id'];this['name']=_0xbc0548['name'];this[_0x417c('0x14')]=_0xbc0548['strategy'];this['abandoned']=_0xbc0548['abandoned']||0x0;this[_0x417c('0x7')]=_0xbc0548['answered']||0x0;this[_0x417c('0x0')]=_0xbc0548[_0x417c('0x0')]||0x0;this['busy']=_0xbc0548[_0x417c('0x15')]||0x0;this[_0x417c('0x8')]=_0xbc0548[_0x417c('0x8')]||0x0;this[_0x417c('0x16')]=_0xbc0548['invalid']||0x0;this['loggedIn']=_0xbc0548[_0x417c('0x1')]||0x0;this[_0x417c('0x2')]=_0xbc0548[_0x417c('0x2')]||0x0;this['onHold']=_0xbc0548[_0x417c('0x17')]||0x0;this[_0x417c('0x18')]=_0xbc0548[_0x417c('0x18')]||0x0;this[_0x417c('0x3')]=_0xbc0548[_0x417c('0x3')]||0x0;this[_0x417c('0x4')]=_0xbc0548[_0x417c('0x4')]||0x0;this[_0x417c('0x19')]=_0xbc0548[_0x417c('0x19')];this[_0x417c('0x1a')]=_0xbc0548[_0x417c('0x1a')];this[_0x417c('0x12')]=_0xbc0548[_0x417c('0x12')];this[_0x417c('0x1b')]=_0xbc0548[_0x417c('0x1b')]||0x0;this[_0x417c('0x5')]=_0xbc0548[_0x417c('0x5')]||0x0;this[_0x417c('0x13')]=_0xbc0548[_0x417c('0x13')]||0x0;this[_0x417c('0x1c')]=_0xbc0548[_0x417c('0x1c')];this[_0x417c('0x1d')]=_0xbc0548['unavailable']||0x0;this['unknown']=_0xbc0548[_0x417c('0x1e')]||0x0;this[_0x417c('0x1f')]=_0xbc0548[_0x417c('0x1f')]||0x0;this[_0x417c('0x6')]=_0xbc0548[_0x417c('0x6')]||0x0;if(_0xbc0548[_0x417c('0x1c')]===_0x417c('0x20')){this[_0x417c('0x21')]=_0xbc0548[_0x417c('0x21')]||0x0;this['dialActive']=_0xbc0548[_0x417c('0x22')];this[_0x417c('0x23')]=_0xbc0548['dialMethod'];this['dialOriginateCallerIdName']=_0xbc0548['dialOriginateCallerIdName'];this[_0x417c('0x24')]=_0xbc0548['dialOriginateCallerIdNumber'];this[_0x417c('0x25')]=_0xbc0548[_0x417c('0x25')];this[_0x417c('0x26')]=_0xbc0548[_0x417c('0x26')];this[_0x417c('0x27')]=_0xbc0548[_0x417c('0x27')];this[_0x417c('0x28')]=_0xbc0548[_0x417c('0x28')];this[_0x417c('0xb')]=_0xbc0548[_0x417c('0xb')];this['outboundBlacklistCallsDay']=_0xbc0548[_0x417c('0xc')];this[_0x417c('0xd')]=_0xbc0548[_0x417c('0xd')];this[_0x417c('0x29')]=_0xbc0548[_0x417c('0x29')];this[_0x417c('0x2a')]=_0xbc0548[_0x417c('0x2a')];this[_0x417c('0x2b')]=_0xbc0548[_0x417c('0x2b')];this[_0x417c('0x2c')]=_0xbc0548[_0x417c('0x2c')];this['outboundNoAnswerCallsDay']=_0xbc0548[_0x417c('0x2d')];this['outboundNoSuchCallsDay']=_0xbc0548['outboundNoSuchCallsDay'];this[_0x417c('0x2e')]=_0xbc0548['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0xbc0548['outboundReCallsDay'];this['outboundRejectCallsDay']=_0xbc0548[_0x417c('0x10')];this[_0x417c('0x11')]=_0xbc0548['outboundUnknownCallsDay'];this[_0x417c('0x2f')]=_0xbc0548['predictiveIntervalAnsweredCalls'];this[_0x417c('0x30')]=_0xbc0548[_0x417c('0x30')];this[_0x417c('0x31')]=_0xbc0548['predictiveIntervalAvgTalktime'];this[_0x417c('0x32')]=_0xbc0548[_0x417c('0x32')];this[_0x417c('0x33')]=_0xbc0548[_0x417c('0x33')];this[_0x417c('0x34')]=_0xbc0548[_0x417c('0x34')];this[_0x417c('0x35')]=_0xbc0548['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0xbc0548[_0x417c('0x36')];this[_0x417c('0x37')]=_0xbc0548['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0xbc0548[_0x417c('0x38')];this[_0x417c('0x39')]=_0xbc0548['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0xbc0548[_0x417c('0x3a')];this['originated']=_0xbc0548[_0x417c('0x9')];this[_0x417c('0x3b')]=_0xbc0548['erlangCalls'];this['erlangCallToSecond']=_0xbc0548[_0x417c('0x3c')];this[_0x417c('0x3d')]=_0xbc0548[_0x417c('0x3d')];this[_0x417c('0x3e')]=_0xbc0548[_0x417c('0x3e')];this['startPredictive']=_0xbc0548['startPredictive'];this[_0x417c('0x3f')]=_0xbc0548[_0x417c('0x3f')];this['message']=_0xbc0548[_0x417c('0x40')];this[_0x417c('0x41')]=_0xbc0548[_0x417c('0x41')];}if(_0xbc0548[_0x417c('0x42')]){this[_0x417c('0x42')]={'id':_0xbc0548[_0x417c('0x42')]['id'],'name':_0xbc0548['Trunk']['name'],'active':_0xbc0548[_0x417c('0x42')][_0x417c('0x43')],'callerid':_0xbc0548[_0x417c('0x42')][_0x417c('0x44')]};}}VoiceQueueSummary['prototype'][_0x417c('0x45')]=function(_0x3d7ec3,_0x195ba0,_0x12ea90,_0x43ab2a){this[_0x417c('0x2')]=0x0;this[_0x417c('0x5')]=0x0;this[_0x417c('0x3')]=0x0;this[_0x417c('0x1e')]=0x0;this[_0x417c('0x18')]=0x0;this[_0x417c('0x8')]=0x0;this[_0x417c('0x15')]=0x0;this[_0x417c('0x16')]=0x0;this[_0x417c('0x1d')]=0x0;this[_0x417c('0x4')]=0x0;this[_0x417c('0x19')]=0x0;this['onHold']=0x0;if(_0x12ea90){if(_0x12ea90[_0x417c('0x0')]){this[_0x417c('0x0')]=Number(_0x12ea90['available']);}if(_0x12ea90[_0x417c('0x46')]){this[_0x417c('0x1')]=Number(_0x12ea90[_0x417c('0x46')]);}if(_0x12ea90[_0x417c('0x47')]){this[_0x417c('0x6')]=Number(_0x12ea90[_0x417c('0x47')]);}}for(var _0x2616f3=0x0;_0x2616f3<_0x3d7ec3[_0x417c('0x48')];_0x2616f3++){var _0x397e12=_0x195ba0['SIP/'+_0x3d7ec3[_0x2616f3]['name']];if(_0x397e12&&_0x397e12[_0x417c('0x49')]){this[_0x417c('0x2')]+=0x1;}if(_0x3d7ec3[_0x2616f3][_0x417c('0x4a')]==='1'){this[_0x417c('0x5')]+=0x1;}if(_0x3d7ec3[_0x2616f3][_0x417c('0x3')]==='1'&&!['2','7','8'][_0x417c('0x4b')](_0x3d7ec3[_0x2616f3][_0x417c('0x4c')])){this['paused']+=0x1;}switch(_0x3d7ec3[_0x2616f3][_0x417c('0x4c')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x417c('0x16')]+=0x1;break;case'5':this[_0x417c('0x1d')]+=0x1;break;case'6':this[_0x417c('0x4')]+=0x1;break;case'7':this[_0x417c('0x19')]+=0x1;break;case'8':this[_0x417c('0x17')]+=0x1;break;}}if(this[_0x417c('0x23')]===_0x417c('0x4d')){var _0x416e42=Object[_0x417c('0x4e')](_0x43ab2a);for(var _0x19b001=0x0;_0x19b001<_0x416e42[_0x417c('0x48')];_0x19b001++){var _0x529190=_0x416e42[_0x19b001];var _0x9a4a6f=_0x43ab2a[_0x529190];if(_0x9a4a6f['queue']===this[_0x417c('0x4f')]&&_0x9a4a6f[_0x417c('0x1c')]===_0x417c('0x50')&&_0x9a4a6f[_0x417c('0x51')]===_0x417c('0x52')){this[_0x417c('0x5')]+=0x1;}}if(this[_0x417c('0x5')]>this[_0x417c('0x8')]){this['talking']=this['inUse'];}this[_0x417c('0x21')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0x417c('0x53')]=function(_0xf16f53){var _0x41b516=![];if(_0xf16f53){_0x41b516=INBOUND_COUNTERS[_0x417c('0x54')](function(_0x2abf02){return this[_0x2abf02]!==_0xf16f53[_0x2abf02];},this);}return _0x41b516;};VoiceQueueSummary[_0x417c('0x55')][_0x417c('0x56')]=function(_0x4cc021){var _0xee3f78=![];var _0x4bd14f=![];var _0x591678=![];if(_0x4cc021){_0xee3f78=this[_0x417c('0x23')]!==_0x4cc021[_0x417c('0x23')]||this['dialActive']!==_0x4cc021[_0x417c('0x22')]||this[_0x417c('0x40')]!==_0x4cc021[_0x417c('0x40')]||this[_0x417c('0x41')]!==_0x4cc021[_0x417c('0x41')];_0x4bd14f=OUTBOUND_COUNTERS[_0x417c('0x54')](function(_0x166cd4){return this[_0x166cd4]!==_0x4cc021[_0x166cd4];},this);if(this['Trunk']&&_0x4cc021[_0x417c('0x42')]){_0x591678=this[_0x417c('0x42')]['name']!==_0x4cc021[_0x417c('0x42')][_0x417c('0x4f')]||this[_0x417c('0x42')]['active']!==_0x4cc021['Trunk'][_0x417c('0x43')];}}return _0xee3f78||_0x4bd14f||_0x591678;};VoiceQueueSummary[_0x417c('0x55')][_0x417c('0x57')]=function(_0x36de64){this[_0x417c('0x7')]=_0x36de64['answered'];this[_0x417c('0x40')]=_0x36de64[_0x417c('0x40')];this['statusMessage']=_0x36de64['statusMessage'];this[_0x417c('0x9')]=_0x36de64['originated'];this['outboundAbandonedCallsDay']=_0x36de64[_0x417c('0xa')];this[_0x417c('0xb')]=_0x36de64[_0x417c('0xb')];this[_0x417c('0xc')]=_0x36de64[_0x417c('0xc')];this[_0x417c('0xd')]=_0x36de64[_0x417c('0xd')];this[_0x417c('0x29')]=_0x36de64[_0x417c('0x29')];this[_0x417c('0x2d')]=_0x36de64[_0x417c('0x2d')];this[_0x417c('0xe')]=_0x36de64[_0x417c('0xe')];this['outboundReCallsDay']=_0x36de64[_0x417c('0xf')];this['outboundRejectCallsDay']=_0x36de64[_0x417c('0x10')];this[_0x417c('0x11')]=_0x36de64[_0x417c('0x11')];this[_0x417c('0x1a')]=_0x36de64[_0x417c('0x1a')];this['sumDuration']=_0x36de64[_0x417c('0x12')];this[_0x417c('0x13')]=_0x36de64[_0x417c('0x13')];if(this[_0x417c('0x23')]===_0x417c('0x58')){this[_0x417c('0x21')]=_0x36de64[_0x417c('0x21')];}};module[_0x417c('0x59')]=VoiceQueueSummary;