2dbe3b71ffed69ec1c7ea2a1d53fa05582a5e8e6
[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 _0xb0df=['outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','loggedin','callers','SIP/','online','incall','includes','status','booked','length','queue','dialer','exten','compareToOutboundQueue','some','active','updateReportFromOutboundQueue','outboundAbandonedCallsDay','exports','loggedIn','loggedInDb','paused','ringing','talking','waiting','available','answered','inUse','originated','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay'];(function(_0x4ab956,_0x50b68c){var _0x1c1f57=function(_0x8e0899){while(--_0x8e0899){_0x4ab956['push'](_0x4ab956['shift']());}};_0x1c1f57(++_0x50b68c);}(_0xb0df,0x85));var _0xfb0d=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0xb0df[_0x65d12e];return _0x4274e0;};'use strict';var INBOUND_COUNTERS=['available',_0xfb0d('0x0'),_0xfb0d('0x1'),_0xfb0d('0x2'),_0xfb0d('0x3'),_0xfb0d('0x4'),_0xfb0d('0x5')];var OUTBOUND_COUNTERS=[_0xfb0d('0x6'),_0xfb0d('0x7'),_0xfb0d('0x8'),'loggedIn',_0xfb0d('0x1'),_0xfb0d('0x9'),'outboundAbandonedCallsDay','outboundAnswerCallsDay',_0xfb0d('0xa'),_0xfb0d('0xb'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0xfb0d('0xc'),_0xfb0d('0xd'),'outboundRejectCallsDay',_0xfb0d('0xe'),_0xfb0d('0x2'),_0xfb0d('0xf'),_0xfb0d('0x4'),_0xfb0d('0x10'),_0xfb0d('0x11'),'total',_0xfb0d('0x5')];function VoiceQueueSummary(_0x580405){this['id']=_0x580405['id'];this[_0xfb0d('0x12')]=_0x580405[_0xfb0d('0x12')];this[_0xfb0d('0x13')]=_0x580405[_0xfb0d('0x13')];this[_0xfb0d('0x14')]=_0x580405[_0xfb0d('0x14')]||0x0;this[_0xfb0d('0x7')]=_0x580405['answered']||0x0;this['available']=_0x580405['available']||0x0;this[_0xfb0d('0x15')]=_0x580405[_0xfb0d('0x15')]||0x0;this[_0xfb0d('0x8')]=_0x580405[_0xfb0d('0x8')]||0x0;this[_0xfb0d('0x16')]=_0x580405[_0xfb0d('0x16')]||0x0;this[_0xfb0d('0x0')]=_0x580405['loggedIn']||0x0;this[_0xfb0d('0x1')]=_0x580405[_0xfb0d('0x1')]||0x0;this[_0xfb0d('0x17')]=_0x580405[_0xfb0d('0x17')]||0x0;this['notInUse']=_0x580405[_0xfb0d('0x18')]||0x0;this[_0xfb0d('0x2')]=_0x580405[_0xfb0d('0x2')]||0x0;this[_0xfb0d('0x3')]=_0x580405[_0xfb0d('0x3')]||0x0;this[_0xfb0d('0x19')]=_0x580405[_0xfb0d('0x19')];this['sumBillable']=_0x580405[_0xfb0d('0x10')];this[_0xfb0d('0x11')]=_0x580405[_0xfb0d('0x11')];this[_0xfb0d('0x1a')]=_0x580405[_0xfb0d('0x1a')]||0x0;this[_0xfb0d('0x4')]=_0x580405[_0xfb0d('0x4')]||0x0;this[_0xfb0d('0x1b')]=_0x580405[_0xfb0d('0x1b')]||0x0;this[_0xfb0d('0x1c')]=_0x580405[_0xfb0d('0x1c')];this[_0xfb0d('0x1d')]=_0x580405['unavailable']||0x0;this[_0xfb0d('0x1e')]=_0x580405[_0xfb0d('0x1e')]||0x0;this['unmanaged']=_0x580405['unmanaged']||0x0;this[_0xfb0d('0x5')]=_0x580405[_0xfb0d('0x5')]||0x0;if(_0x580405['type']===_0xfb0d('0x1f')){this[_0xfb0d('0xf')]=_0x580405[_0xfb0d('0xf')]||0x0;this[_0xfb0d('0x20')]=_0x580405[_0xfb0d('0x20')];this[_0xfb0d('0x21')]=_0x580405[_0xfb0d('0x21')];this[_0xfb0d('0x22')]=_0x580405[_0xfb0d('0x22')];this[_0xfb0d('0x23')]=_0x580405[_0xfb0d('0x23')];this[_0xfb0d('0x24')]=_0x580405['dialOriginateTimeout'];this[_0xfb0d('0x25')]=_0x580405[_0xfb0d('0x25')];this['temp']=_0x580405[_0xfb0d('0x26')];this[_0xfb0d('0x27')]=_0x580405[_0xfb0d('0x27')];this[_0xfb0d('0x28')]=_0x580405['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x580405[_0xfb0d('0xa')];this['outboundBusyCallsDay']=_0x580405[_0xfb0d('0xb')];this['outboundCongestionCallsDay']=_0x580405[_0xfb0d('0x29')];this[_0xfb0d('0x2a')]=_0x580405[_0xfb0d('0x2a')];this[_0xfb0d('0x2b')]=_0x580405['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x580405[_0xfb0d('0x2c')];this[_0xfb0d('0x2d')]=_0x580405[_0xfb0d('0x2d')];this[_0xfb0d('0xc')]=_0x580405['outboundNoSuchCallsDay'];this[_0xfb0d('0x2e')]=_0x580405['outboundOriginateFailureCallsDay'];this[_0xfb0d('0xd')]=_0x580405['outboundReCallsDay'];this[_0xfb0d('0x2f')]=_0x580405[_0xfb0d('0x2f')];this[_0xfb0d('0xe')]=_0x580405[_0xfb0d('0xe')];this[_0xfb0d('0x30')]=_0x580405[_0xfb0d('0x30')];this['predictiveIntervalAvgHoldtime']=_0x580405[_0xfb0d('0x31')];this[_0xfb0d('0x32')]=_0x580405[_0xfb0d('0x32')];this[_0xfb0d('0x33')]=_0x580405[_0xfb0d('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0x580405[_0xfb0d('0x34')];this[_0xfb0d('0x35')]=_0x580405[_0xfb0d('0x35')];this[_0xfb0d('0x36')]=_0x580405['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0x580405['predictiveIntervalHitRate'];this[_0xfb0d('0x37')]=_0x580405[_0xfb0d('0x37')];this[_0xfb0d('0x38')]=_0x580405[_0xfb0d('0x38')];this[_0xfb0d('0x39')]=_0x580405[_0xfb0d('0x39')];this[_0xfb0d('0x3a')]=_0x580405['predictiveIntervalTotalCalls'];this[_0xfb0d('0x9')]=_0x580405[_0xfb0d('0x9')];this['erlangCalls']=_0x580405['erlangCalls'];this[_0xfb0d('0x3b')]=_0x580405[_0xfb0d('0x3b')];this[_0xfb0d('0x3c')]=_0x580405[_0xfb0d('0x3c')];this[_0xfb0d('0x3d')]=_0x580405['erlangBusyFactor'];this[_0xfb0d('0x3e')]=_0x580405[_0xfb0d('0x3e')];this[_0xfb0d('0x3f')]=_0x580405[_0xfb0d('0x3f')];this['message']=_0x580405[_0xfb0d('0x40')];this[_0xfb0d('0x41')]=_0x580405['statusMessage'];}if(_0x580405[_0xfb0d('0x42')]){this[_0xfb0d('0x42')]={'id':_0x580405[_0xfb0d('0x42')]['id'],'name':_0x580405[_0xfb0d('0x42')][_0xfb0d('0x12')],'active':_0x580405[_0xfb0d('0x42')]['active'],'callerid':_0x580405[_0xfb0d('0x42')][_0xfb0d('0x43')]};}}VoiceQueueSummary[_0xfb0d('0x44')]['createReport']=function(_0x22f73b,_0xe571c4,_0x51233a,_0x11e2ae){this['loggedInDb']=0x0;this[_0xfb0d('0x4')]=0x0;this[_0xfb0d('0x2')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0xfb0d('0x8')]=0x0;this['busy']=0x0;this[_0xfb0d('0x16')]=0x0;this[_0xfb0d('0x1d')]=0x0;this[_0xfb0d('0x3')]=0x0;this[_0xfb0d('0x19')]=0x0;this[_0xfb0d('0x17')]=0x0;if(_0x51233a){if(_0x51233a[_0xfb0d('0x6')]){this[_0xfb0d('0x6')]=Number(_0x51233a['available']);}if(_0x51233a[_0xfb0d('0x45')]){this[_0xfb0d('0x0')]=Number(_0x51233a[_0xfb0d('0x45')]);}if(_0x51233a[_0xfb0d('0x46')]){this[_0xfb0d('0x5')]=Number(_0x51233a['callers']);}}for(var _0x3fff94=0x0;_0x3fff94<_0x22f73b['length'];_0x3fff94++){var _0x91cc9e=_0xe571c4[_0xfb0d('0x47')+_0x22f73b[_0x3fff94][_0xfb0d('0x12')]];if(_0x91cc9e&&_0x91cc9e[_0xfb0d('0x48')]){this[_0xfb0d('0x1')]+=0x1;}if(_0x22f73b[_0x3fff94][_0xfb0d('0x49')]==='1'){this[_0xfb0d('0x4')]+=0x1;}if(_0x22f73b[_0x3fff94]['paused']==='1'&&!['2','7','8'][_0xfb0d('0x4a')](_0x22f73b[_0x3fff94][_0xfb0d('0x4b')])){this[_0xfb0d('0x2')]+=0x1;}switch(_0x22f73b[_0x3fff94][_0xfb0d('0x4b')]){case'0':this[_0xfb0d('0x1e')]+=0x1;break;case'1':this[_0xfb0d('0x18')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xfb0d('0x15')]+=0x1;break;case'4':this[_0xfb0d('0x16')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xfb0d('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xfb0d('0x21')]===_0xfb0d('0x4c')){var _0x3bb2dd=Object['keys'](_0x11e2ae);for(var _0x3d6893=0x0;_0x3d6893<_0x3bb2dd[_0xfb0d('0x4d')];_0x3d6893++){var _0x16c6ea=_0x3bb2dd[_0x3d6893];var _0xc6785d=_0x11e2ae[_0x16c6ea];if(_0xc6785d[_0xfb0d('0x4e')]===this[_0xfb0d('0x12')]&&_0xc6785d[_0xfb0d('0x1c')]===_0xfb0d('0x4f')&&_0xc6785d[_0xfb0d('0x50')]==='xcally-motion-preview'){this[_0xfb0d('0x4')]+=0x1;}}if(this['talking']>this[_0xfb0d('0x8')]){this['talking']=this[_0xfb0d('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xfb0d('0x44')]['compareToInboundQueue']=function(_0x16d3b7){var _0x42e06c=![];if(_0x16d3b7){_0x42e06c=INBOUND_COUNTERS['some'](function(_0x46c545){return this[_0x46c545]!==_0x16d3b7[_0x46c545];},this);}return _0x42e06c;};VoiceQueueSummary[_0xfb0d('0x44')][_0xfb0d('0x51')]=function(_0x1b8090){var _0x19a732=![];var _0x53ee4c=![];var _0x1cc7d6=![];if(_0x1b8090){_0x19a732=this['dialMethod']!==_0x1b8090[_0xfb0d('0x21')]||this[_0xfb0d('0x20')]!==_0x1b8090[_0xfb0d('0x20')]||this['message']!==_0x1b8090[_0xfb0d('0x40')]||this[_0xfb0d('0x41')]!==_0x1b8090[_0xfb0d('0x41')];_0x53ee4c=OUTBOUND_COUNTERS[_0xfb0d('0x52')](function(_0x527965){return this[_0x527965]!==_0x1b8090[_0x527965];},this);if(this[_0xfb0d('0x42')]&&_0x1b8090[_0xfb0d('0x42')]){_0x1cc7d6=this[_0xfb0d('0x42')][_0xfb0d('0x12')]!==_0x1b8090[_0xfb0d('0x42')][_0xfb0d('0x12')]||this[_0xfb0d('0x42')][_0xfb0d('0x53')]!==_0x1b8090['Trunk'][_0xfb0d('0x53')];}}return _0x19a732||_0x53ee4c||_0x1cc7d6;};VoiceQueueSummary[_0xfb0d('0x44')][_0xfb0d('0x54')]=function(_0x585848){this[_0xfb0d('0x7')]=_0x585848[_0xfb0d('0x7')];this[_0xfb0d('0x40')]=_0x585848[_0xfb0d('0x40')];this['statusMessage']=_0x585848[_0xfb0d('0x41')];this['originated']=_0x585848[_0xfb0d('0x9')];this['outboundAbandonedCallsDay']=_0x585848[_0xfb0d('0x55')];this[_0xfb0d('0x28')]=_0x585848['outboundAnswerCallsDay'];this[_0xfb0d('0xa')]=_0x585848[_0xfb0d('0xa')];this[_0xfb0d('0xb')]=_0x585848[_0xfb0d('0xb')];this[_0xfb0d('0x29')]=_0x585848[_0xfb0d('0x29')];this[_0xfb0d('0x2d')]=_0x585848['outboundNoAnswerCallsDay'];this[_0xfb0d('0xc')]=_0x585848[_0xfb0d('0xc')];this['outboundReCallsDay']=_0x585848['outboundReCallsDay'];this[_0xfb0d('0x2f')]=_0x585848[_0xfb0d('0x2f')];this[_0xfb0d('0xe')]=_0x585848[_0xfb0d('0xe')];this[_0xfb0d('0x10')]=_0x585848['sumBillable'];this[_0xfb0d('0x11')]=_0x585848['sumDuration'];this[_0xfb0d('0x1b')]=_0x585848[_0xfb0d('0x1b')];if(this[_0xfb0d('0x21')]==='preview'){this['pTalking']=_0x585848[_0xfb0d('0xf')];}};module[_0xfb0d('0x56')]=VoiceQueueSummary;