Built motion from commit 3d3e98f2.|2.6.29
[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 _0x2cd3=['invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','active','callerid','prototype','loggedin','callers','SIP/','online','incall','includes','status','booked','keys','length','queue','exten','compareToInboundQueue','some','compareToOutboundQueue','dialActive','updateReportFromOutboundQueue','preview','exports','available','loggedInDb','paused','ringing','talking','waiting','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','strategy','abandoned','answered','busy','inUse'];(function(_0x2af334,_0x29ef88){var _0x32e27a=function(_0x35f003){while(--_0x35f003){_0x2af334['push'](_0x2af334['shift']());}};_0x32e27a(++_0x29ef88);}(_0x2cd3,0xf1));var _0x32cd=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x2cd3[_0x34021d];return _0x16597b;};'use strict';var INBOUND_COUNTERS=[_0x32cd('0x0'),'loggedIn',_0x32cd('0x1'),_0x32cd('0x2'),_0x32cd('0x3'),_0x32cd('0x4'),_0x32cd('0x5')];var OUTBOUND_COUNTERS=[_0x32cd('0x0'),'answered','inUse',_0x32cd('0x6'),_0x32cd('0x1'),_0x32cd('0x7'),_0x32cd('0x8'),_0x32cd('0x9'),_0x32cd('0xa'),_0x32cd('0xb'),_0x32cd('0xc'),_0x32cd('0xd'),_0x32cd('0xe'),_0x32cd('0xf'),_0x32cd('0x10'),_0x32cd('0x11'),_0x32cd('0x2'),_0x32cd('0x12'),_0x32cd('0x4'),_0x32cd('0x13'),_0x32cd('0x14'),'total','waiting'];function VoiceQueueSummary(_0x39525c){this['id']=_0x39525c['id'];this['name']=_0x39525c['name'];this[_0x32cd('0x15')]=_0x39525c[_0x32cd('0x15')];this[_0x32cd('0x16')]=_0x39525c[_0x32cd('0x16')]||0x0;this[_0x32cd('0x17')]=_0x39525c[_0x32cd('0x17')]||0x0;this[_0x32cd('0x0')]=_0x39525c['available']||0x0;this['busy']=_0x39525c[_0x32cd('0x18')]||0x0;this[_0x32cd('0x19')]=_0x39525c[_0x32cd('0x19')]||0x0;this[_0x32cd('0x1a')]=_0x39525c['invalid']||0x0;this[_0x32cd('0x6')]=_0x39525c['loggedIn']||0x0;this['loggedInDb']=_0x39525c[_0x32cd('0x1')]||0x0;this[_0x32cd('0x1b')]=_0x39525c[_0x32cd('0x1b')]||0x0;this[_0x32cd('0x1c')]=_0x39525c[_0x32cd('0x1c')]||0x0;this[_0x32cd('0x2')]=_0x39525c['paused']||0x0;this[_0x32cd('0x3')]=_0x39525c[_0x32cd('0x3')]||0x0;this[_0x32cd('0x1d')]=_0x39525c['ringInUse'];this['sumBillable']=_0x39525c[_0x32cd('0x13')];this[_0x32cd('0x14')]=_0x39525c[_0x32cd('0x14')];this[_0x32cd('0x1e')]=_0x39525c[_0x32cd('0x1e')]||0x0;this['talking']=_0x39525c[_0x32cd('0x4')]||0x0;this[_0x32cd('0x1f')]=_0x39525c[_0x32cd('0x1f')]||0x0;this[_0x32cd('0x20')]=_0x39525c[_0x32cd('0x20')];this[_0x32cd('0x21')]=_0x39525c[_0x32cd('0x21')]||0x0;this[_0x32cd('0x22')]=_0x39525c['unknown']||0x0;this[_0x32cd('0x23')]=_0x39525c['unmanaged']||0x0;this['waiting']=_0x39525c[_0x32cd('0x5')]||0x0;if(_0x39525c['type']==='outbound'){this[_0x32cd('0x12')]=_0x39525c[_0x32cd('0x12')]||0x0;this['dialActive']=_0x39525c['dialActive'];this[_0x32cd('0x24')]=_0x39525c[_0x32cd('0x24')];this[_0x32cd('0x25')]=_0x39525c[_0x32cd('0x25')];this['dialOriginateCallerIdNumber']=_0x39525c['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x39525c[_0x32cd('0x26')];this[_0x32cd('0x27')]=_0x39525c['dialPrefix'];this[_0x32cd('0x28')]=_0x39525c[_0x32cd('0x28')];this[_0x32cd('0x29')]=_0x39525c[_0x32cd('0x29')];this[_0x32cd('0x9')]=_0x39525c[_0x32cd('0x9')];this['outboundBlacklistCallsDay']=_0x39525c[_0x32cd('0xa')];this[_0x32cd('0xb')]=_0x39525c[_0x32cd('0xb')];this[_0x32cd('0xc')]=_0x39525c[_0x32cd('0xc')];this[_0x32cd('0x2a')]=_0x39525c['outboundDropCallsDayACS'];this[_0x32cd('0x2b')]=_0x39525c[_0x32cd('0x2b')];this[_0x32cd('0x2c')]=_0x39525c[_0x32cd('0x2c')];this[_0x32cd('0xd')]=_0x39525c[_0x32cd('0xd')];this['outboundNoSuchCallsDay']=_0x39525c[_0x32cd('0xe')];this[_0x32cd('0x2d')]=_0x39525c['outboundOriginateFailureCallsDay'];this[_0x32cd('0xf')]=_0x39525c[_0x32cd('0xf')];this[_0x32cd('0x10')]=_0x39525c[_0x32cd('0x10')];this[_0x32cd('0x11')]=_0x39525c[_0x32cd('0x11')];this[_0x32cd('0x2e')]=_0x39525c[_0x32cd('0x2e')];this[_0x32cd('0x2f')]=_0x39525c[_0x32cd('0x2f')];this[_0x32cd('0x30')]=_0x39525c[_0x32cd('0x30')];this[_0x32cd('0x31')]=_0x39525c['predictiveIntervalDroppedCallsCallersExit'];this[_0x32cd('0x32')]=_0x39525c[_0x32cd('0x32')];this[_0x32cd('0x33')]=_0x39525c[_0x32cd('0x33')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x39525c['predictiveIntervalErlangCallsDroppedCalls'];this[_0x32cd('0x34')]=_0x39525c[_0x32cd('0x34')];this[_0x32cd('0x35')]=_0x39525c['predictiveIntervalMultiplicativeFactor'];this[_0x32cd('0x36')]=_0x39525c[_0x32cd('0x36')];this[_0x32cd('0x37')]=_0x39525c[_0x32cd('0x37')];this[_0x32cd('0x38')]=_0x39525c[_0x32cd('0x38')];this[_0x32cd('0x7')]=_0x39525c[_0x32cd('0x7')];this[_0x32cd('0x39')]=_0x39525c['erlangCalls'];this[_0x32cd('0x3a')]=_0x39525c['erlangCallToSecond'];this[_0x32cd('0x3b')]=_0x39525c[_0x32cd('0x3b')];this[_0x32cd('0x3c')]=_0x39525c[_0x32cd('0x3c')];this['startPredictive']=_0x39525c[_0x32cd('0x3d')];this[_0x32cd('0x3e')]=_0x39525c[_0x32cd('0x3e')];this[_0x32cd('0x3f')]=_0x39525c[_0x32cd('0x3f')];this[_0x32cd('0x40')]=_0x39525c[_0x32cd('0x40')];}if(_0x39525c[_0x32cd('0x41')]){this[_0x32cd('0x41')]={'id':_0x39525c[_0x32cd('0x41')]['id'],'name':_0x39525c[_0x32cd('0x41')][_0x32cd('0x42')],'active':_0x39525c[_0x32cd('0x41')][_0x32cd('0x43')],'callerid':_0x39525c[_0x32cd('0x41')][_0x32cd('0x44')]};}}VoiceQueueSummary[_0x32cd('0x45')]['createReport']=function(_0x285a48,_0x21370e,_0x4ba018,_0x2fdc69){this[_0x32cd('0x1')]=0x0;this[_0x32cd('0x4')]=0x0;this['paused']=0x0;this['unknown']=0x0;this[_0x32cd('0x1c')]=0x0;this[_0x32cd('0x19')]=0x0;this[_0x32cd('0x18')]=0x0;this[_0x32cd('0x1a')]=0x0;this['unavailable']=0x0;this[_0x32cd('0x3')]=0x0;this[_0x32cd('0x1d')]=0x0;this[_0x32cd('0x1b')]=0x0;if(_0x4ba018){if(_0x4ba018[_0x32cd('0x0')]){this[_0x32cd('0x0')]=Number(_0x4ba018[_0x32cd('0x0')]);}if(_0x4ba018[_0x32cd('0x46')]){this['loggedIn']=Number(_0x4ba018[_0x32cd('0x46')]);}if(_0x4ba018[_0x32cd('0x47')]){this['waiting']=Number(_0x4ba018[_0x32cd('0x47')]);}}for(var _0x13b579=0x0;_0x13b579<_0x285a48['length'];_0x13b579++){var _0x3b7d22=_0x21370e[_0x32cd('0x48')+_0x285a48[_0x13b579]['name']];if(_0x3b7d22&&_0x3b7d22[_0x32cd('0x49')]){this[_0x32cd('0x1')]+=0x1;}if(_0x285a48[_0x13b579][_0x32cd('0x4a')]==='1'){this['talking']+=0x1;}if(_0x285a48[_0x13b579][_0x32cd('0x2')]==='1'&&!['2','7','8'][_0x32cd('0x4b')](_0x285a48[_0x13b579][_0x32cd('0x4c')])){this['paused']+=0x1;}switch(_0x285a48[_0x13b579][_0x32cd('0x4c')]){case'0':this[_0x32cd('0x22')]+=0x1;break;case'1':this[_0x32cd('0x1c')]+=0x1;break;case'2':this[_0x32cd('0x19')]+=0x1;break;case'3':this[_0x32cd('0x18')]+=0x1;break;case'4':this[_0x32cd('0x1a')]+=0x1;break;case'5':this[_0x32cd('0x21')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x32cd('0x1d')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x32cd('0x24')]===_0x32cd('0x4d')){var _0x492320=Object[_0x32cd('0x4e')](_0x2fdc69);for(var _0x27aabc=0x0;_0x27aabc<_0x492320[_0x32cd('0x4f')];_0x27aabc++){var _0x18aa11=_0x492320[_0x27aabc];var _0xe18f78=_0x2fdc69[_0x18aa11];if(_0xe18f78[_0x32cd('0x50')]===this[_0x32cd('0x42')]&&_0xe18f78[_0x32cd('0x20')]==='dialer'&&_0xe18f78[_0x32cd('0x51')]==='xcally-motion-preview'){this[_0x32cd('0x4')]+=0x1;}}if(this[_0x32cd('0x4')]>this[_0x32cd('0x19')]){this[_0x32cd('0x4')]=this[_0x32cd('0x19')];}this[_0x32cd('0x12')]=0x0;}return this;};VoiceQueueSummary[_0x32cd('0x45')][_0x32cd('0x52')]=function(_0x523ad2){var _0x3abb23=![];if(_0x523ad2){_0x3abb23=INBOUND_COUNTERS[_0x32cd('0x53')](function(_0x22a0af){return this[_0x22a0af]!==_0x523ad2[_0x22a0af];},this);}return _0x3abb23;};VoiceQueueSummary['prototype'][_0x32cd('0x54')]=function(_0x1eb5e5){var _0x182d71=![];var _0x5d85e7=![];var _0x503a8e=![];if(_0x1eb5e5){_0x182d71=this[_0x32cd('0x24')]!==_0x1eb5e5['dialMethod']||this[_0x32cd('0x55')]!==_0x1eb5e5[_0x32cd('0x55')]||this['message']!==_0x1eb5e5['message']||this['statusMessage']!==_0x1eb5e5[_0x32cd('0x40')];_0x5d85e7=OUTBOUND_COUNTERS['some'](function(_0x5a10d3){return this[_0x5a10d3]!==_0x1eb5e5[_0x5a10d3];},this);if(this[_0x32cd('0x41')]&&_0x1eb5e5[_0x32cd('0x41')]){_0x503a8e=this[_0x32cd('0x41')][_0x32cd('0x42')]!==_0x1eb5e5[_0x32cd('0x41')][_0x32cd('0x42')]||this[_0x32cd('0x41')][_0x32cd('0x43')]!==_0x1eb5e5['Trunk']['active'];}}return _0x182d71||_0x5d85e7||_0x503a8e;};VoiceQueueSummary[_0x32cd('0x45')][_0x32cd('0x56')]=function(_0x54ea80){this[_0x32cd('0x17')]=_0x54ea80[_0x32cd('0x17')];this['message']=_0x54ea80[_0x32cd('0x3f')];this[_0x32cd('0x40')]=_0x54ea80[_0x32cd('0x40')];this[_0x32cd('0x7')]=_0x54ea80[_0x32cd('0x7')];this[_0x32cd('0x8')]=_0x54ea80['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x54ea80[_0x32cd('0x9')];this[_0x32cd('0xa')]=_0x54ea80[_0x32cd('0xa')];this[_0x32cd('0xb')]=_0x54ea80[_0x32cd('0xb')];this['outboundCongestionCallsDay']=_0x54ea80[_0x32cd('0xc')];this[_0x32cd('0xd')]=_0x54ea80[_0x32cd('0xd')];this[_0x32cd('0xe')]=_0x54ea80['outboundNoSuchCallsDay'];this[_0x32cd('0xf')]=_0x54ea80[_0x32cd('0xf')];this[_0x32cd('0x10')]=_0x54ea80[_0x32cd('0x10')];this['outboundUnknownCallsDay']=_0x54ea80[_0x32cd('0x11')];this['sumBillable']=_0x54ea80[_0x32cd('0x13')];this[_0x32cd('0x14')]=_0x54ea80[_0x32cd('0x14')];this[_0x32cd('0x1f')]=_0x54ea80['total'];if(this[_0x32cd('0x24')]===_0x32cd('0x57')){this[_0x32cd('0x12')]=_0x54ea80[_0x32cd('0x12')];}};module[_0x32cd('0x58')]=VoiceQueueSummary;