Built motion from commit 511216ff.|2.6.34
[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 _0x1bce=['erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','unavailable','callers','length','SIP/','online','incall','status','booked','keys','dialer','xcally-motion-preview','compareToInboundQueue','some','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedIn','paused','ringing','talking','waiting','answered','inUse','loggedInDb','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','type','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x54df1f,_0x163295){var _0x43c97a=function(_0x152598){while(--_0x152598){_0x54df1f['push'](_0x54df1f['shift']());}};_0x43c97a(++_0x163295);}(_0x1bce,0x73));var _0xe1bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bce[_0x2641f9];return _0x585741;};'use strict';var INBOUND_COUNTERS=[_0xe1bc('0x0'),_0xe1bc('0x1'),'loggedInDb',_0xe1bc('0x2'),_0xe1bc('0x3'),_0xe1bc('0x4'),_0xe1bc('0x5')];var OUTBOUND_COUNTERS=[_0xe1bc('0x0'),_0xe1bc('0x6'),_0xe1bc('0x7'),_0xe1bc('0x1'),_0xe1bc('0x8'),'originated','outboundAbandonedCallsDay',_0xe1bc('0x9'),_0xe1bc('0xa'),_0xe1bc('0xb'),_0xe1bc('0xc'),_0xe1bc('0xd'),_0xe1bc('0xe'),'outboundReCallsDay',_0xe1bc('0xf'),'outboundUnknownCallsDay',_0xe1bc('0x2'),_0xe1bc('0x10'),_0xe1bc('0x4'),'sumBillable',_0xe1bc('0x11'),_0xe1bc('0x12'),'waiting'];function VoiceQueueSummary(_0x44a556){this['id']=_0x44a556['id'];this[_0xe1bc('0x13')]=_0x44a556['name'];this['strategy']=_0x44a556[_0xe1bc('0x14')];this[_0xe1bc('0x15')]=_0x44a556[_0xe1bc('0x15')]||0x0;this['answered']=_0x44a556['answered']||0x0;this[_0xe1bc('0x0')]=_0x44a556[_0xe1bc('0x0')]||0x0;this[_0xe1bc('0x16')]=_0x44a556['busy']||0x0;this[_0xe1bc('0x7')]=_0x44a556[_0xe1bc('0x7')]||0x0;this[_0xe1bc('0x17')]=_0x44a556[_0xe1bc('0x17')]||0x0;this['loggedIn']=_0x44a556[_0xe1bc('0x1')]||0x0;this['loggedInDb']=_0x44a556[_0xe1bc('0x8')]||0x0;this[_0xe1bc('0x18')]=_0x44a556['onHold']||0x0;this[_0xe1bc('0x19')]=_0x44a556[_0xe1bc('0x19')]||0x0;this[_0xe1bc('0x2')]=_0x44a556[_0xe1bc('0x2')]||0x0;this[_0xe1bc('0x3')]=_0x44a556[_0xe1bc('0x3')]||0x0;this['ringInUse']=_0x44a556[_0xe1bc('0x1a')];this['sumBillable']=_0x44a556[_0xe1bc('0x1b')];this[_0xe1bc('0x11')]=_0x44a556[_0xe1bc('0x11')];this[_0xe1bc('0x1c')]=_0x44a556[_0xe1bc('0x1c')]||0x0;this['talking']=_0x44a556[_0xe1bc('0x4')]||0x0;this['total']=_0x44a556['total']||0x0;this[_0xe1bc('0x1d')]=_0x44a556[_0xe1bc('0x1d')];this['unavailable']=_0x44a556['unavailable']||0x0;this[_0xe1bc('0x1e')]=_0x44a556[_0xe1bc('0x1e')]||0x0;this[_0xe1bc('0x1f')]=_0x44a556[_0xe1bc('0x1f')]||0x0;this[_0xe1bc('0x5')]=_0x44a556[_0xe1bc('0x5')]||0x0;if(_0x44a556[_0xe1bc('0x1d')]===_0xe1bc('0x20')){this[_0xe1bc('0x10')]=_0x44a556[_0xe1bc('0x10')]||0x0;this[_0xe1bc('0x21')]=_0x44a556[_0xe1bc('0x21')];this[_0xe1bc('0x22')]=_0x44a556['dialMethod'];this['dialOriginateCallerIdName']=_0x44a556[_0xe1bc('0x23')];this['dialOriginateCallerIdNumber']=_0x44a556[_0xe1bc('0x24')];this['dialOriginateTimeout']=_0x44a556[_0xe1bc('0x25')];this['dialPrefix']=_0x44a556['dialPrefix'];this[_0xe1bc('0x26')]=_0x44a556[_0xe1bc('0x26')];this['outboundAnswerAgiCallsDay']=_0x44a556['outboundAnswerAgiCallsDay'];this[_0xe1bc('0x9')]=_0x44a556[_0xe1bc('0x9')];this[_0xe1bc('0xa')]=_0x44a556[_0xe1bc('0xa')];this[_0xe1bc('0xb')]=_0x44a556[_0xe1bc('0xb')];this[_0xe1bc('0xc')]=_0x44a556[_0xe1bc('0xc')];this[_0xe1bc('0x27')]=_0x44a556['outboundDropCallsDayACS'];this[_0xe1bc('0x28')]=_0x44a556[_0xe1bc('0x28')];this[_0xe1bc('0x29')]=_0x44a556['outboundDropCallsDayTimeout'];this[_0xe1bc('0xd')]=_0x44a556[_0xe1bc('0xd')];this[_0xe1bc('0xe')]=_0x44a556[_0xe1bc('0xe')];this[_0xe1bc('0x2a')]=_0x44a556['outboundOriginateFailureCallsDay'];this[_0xe1bc('0x2b')]=_0x44a556['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x44a556[_0xe1bc('0xf')];this[_0xe1bc('0x2c')]=_0x44a556[_0xe1bc('0x2c')];this['predictiveIntervalAnsweredCalls']=_0x44a556[_0xe1bc('0x2d')];this[_0xe1bc('0x2e')]=_0x44a556['predictiveIntervalAvgHoldtime'];this[_0xe1bc('0x2f')]=_0x44a556[_0xe1bc('0x2f')];this[_0xe1bc('0x30')]=_0x44a556[_0xe1bc('0x30')];this[_0xe1bc('0x31')]=_0x44a556[_0xe1bc('0x31')];this['predictiveIntervalErlangCalls']=_0x44a556[_0xe1bc('0x32')];this[_0xe1bc('0x33')]=_0x44a556['predictiveIntervalErlangCallsDroppedCalls'];this[_0xe1bc('0x34')]=_0x44a556['predictiveIntervalHitRate'];this[_0xe1bc('0x35')]=_0x44a556[_0xe1bc('0x35')];this[_0xe1bc('0x36')]=_0x44a556[_0xe1bc('0x36')];this['predictiveIntervalAvailable']=_0x44a556[_0xe1bc('0x37')];this[_0xe1bc('0x38')]=_0x44a556[_0xe1bc('0x38')];this[_0xe1bc('0x39')]=_0x44a556[_0xe1bc('0x39')];this[_0xe1bc('0x3a')]=_0x44a556[_0xe1bc('0x3a')];this[_0xe1bc('0x3b')]=_0x44a556[_0xe1bc('0x3b')];this[_0xe1bc('0x3c')]=_0x44a556[_0xe1bc('0x3c')];this[_0xe1bc('0x3d')]=_0x44a556[_0xe1bc('0x3d')];this[_0xe1bc('0x3e')]=_0x44a556['startPredictive'];this[_0xe1bc('0x3f')]=_0x44a556[_0xe1bc('0x3f')];this['message']=_0x44a556[_0xe1bc('0x40')];this['statusMessage']=_0x44a556[_0xe1bc('0x41')];}if(_0x44a556[_0xe1bc('0x42')]){this[_0xe1bc('0x42')]={'id':_0x44a556[_0xe1bc('0x42')]['id'],'name':_0x44a556[_0xe1bc('0x42')]['name'],'active':_0x44a556['Trunk'][_0xe1bc('0x43')],'callerid':_0x44a556[_0xe1bc('0x42')][_0xe1bc('0x44')]};}}VoiceQueueSummary[_0xe1bc('0x45')][_0xe1bc('0x46')]=function(_0xbe9e0e,_0x4e1479,_0x16d64c,_0x22bfd7){this[_0xe1bc('0x8')]=0x0;this['talking']=0x0;this[_0xe1bc('0x2')]=0x0;this['unknown']=0x0;this[_0xe1bc('0x19')]=0x0;this[_0xe1bc('0x7')]=0x0;this[_0xe1bc('0x16')]=0x0;this['invalid']=0x0;this[_0xe1bc('0x47')]=0x0;this[_0xe1bc('0x3')]=0x0;this[_0xe1bc('0x1a')]=0x0;this['onHold']=0x0;if(_0x16d64c){if(_0x16d64c[_0xe1bc('0x0')]){this['available']=Number(_0x16d64c['available']);}if(_0x16d64c['loggedin']){this['loggedIn']=Number(_0x16d64c['loggedin']);}if(_0x16d64c['callers']){this[_0xe1bc('0x5')]=Number(_0x16d64c[_0xe1bc('0x48')]);}}for(var _0x594ab5=0x0;_0x594ab5<_0xbe9e0e[_0xe1bc('0x49')];_0x594ab5++){var _0x3a2e0b=_0x4e1479[_0xe1bc('0x4a')+_0xbe9e0e[_0x594ab5]['name']];if(_0x3a2e0b&&_0x3a2e0b[_0xe1bc('0x4b')]){this[_0xe1bc('0x8')]+=0x1;}if(_0xbe9e0e[_0x594ab5][_0xe1bc('0x4c')]==='1'){this[_0xe1bc('0x4')]+=0x1;}if(_0xbe9e0e[_0x594ab5][_0xe1bc('0x2')]==='1'&&!['2','7','8']['includes'](_0xbe9e0e[_0x594ab5][_0xe1bc('0x4d')])){this[_0xe1bc('0x2')]+=0x1;}switch(_0xbe9e0e[_0x594ab5]['status']){case'0':this[_0xe1bc('0x1e')]+=0x1;break;case'1':this[_0xe1bc('0x19')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xe1bc('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0xe1bc('0x47')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xe1bc('0x18')]+=0x1;break;}}if(this[_0xe1bc('0x22')]===_0xe1bc('0x4e')){var _0x1198d6=Object[_0xe1bc('0x4f')](_0x22bfd7);for(var _0x2dccb7=0x0;_0x2dccb7<_0x1198d6['length'];_0x2dccb7++){var _0x324740=_0x1198d6[_0x2dccb7];var _0x33c18e=_0x22bfd7[_0x324740];if(_0x33c18e['queue']===this[_0xe1bc('0x13')]&&_0x33c18e['type']===_0xe1bc('0x50')&&_0x33c18e['exten']===_0xe1bc('0x51')){this[_0xe1bc('0x4')]+=0x1;}}if(this[_0xe1bc('0x4')]>this['inUse']){this[_0xe1bc('0x4')]=this['inUse'];}this[_0xe1bc('0x10')]=0x0;}return this;};VoiceQueueSummary[_0xe1bc('0x45')][_0xe1bc('0x52')]=function(_0x58c3a9){var _0x167dd2=![];if(_0x58c3a9){_0x167dd2=INBOUND_COUNTERS['some'](function(_0x274131){return this[_0x274131]!==_0x58c3a9[_0x274131];},this);}return _0x167dd2;};VoiceQueueSummary[_0xe1bc('0x45')]['compareToOutboundQueue']=function(_0xca01ae){var _0x51d349=![];var _0x210b66=![];var _0x1c3b9c=![];if(_0xca01ae){_0x51d349=this['dialMethod']!==_0xca01ae[_0xe1bc('0x22')]||this[_0xe1bc('0x21')]!==_0xca01ae[_0xe1bc('0x21')]||this[_0xe1bc('0x40')]!==_0xca01ae[_0xe1bc('0x40')]||this[_0xe1bc('0x41')]!==_0xca01ae[_0xe1bc('0x41')];_0x210b66=OUTBOUND_COUNTERS[_0xe1bc('0x53')](function(_0x3edfb0){return this[_0x3edfb0]!==_0xca01ae[_0x3edfb0];},this);if(this['Trunk']&&_0xca01ae['Trunk']){_0x1c3b9c=this[_0xe1bc('0x42')][_0xe1bc('0x13')]!==_0xca01ae[_0xe1bc('0x42')][_0xe1bc('0x13')]||this[_0xe1bc('0x42')][_0xe1bc('0x43')]!==_0xca01ae['Trunk'][_0xe1bc('0x43')];}}return _0x51d349||_0x210b66||_0x1c3b9c;};VoiceQueueSummary[_0xe1bc('0x45')][_0xe1bc('0x54')]=function(_0x104d5f){this['answered']=_0x104d5f[_0xe1bc('0x6')];this[_0xe1bc('0x40')]=_0x104d5f[_0xe1bc('0x40')];this[_0xe1bc('0x41')]=_0x104d5f['statusMessage'];this[_0xe1bc('0x39')]=_0x104d5f['originated'];this[_0xe1bc('0x55')]=_0x104d5f['outboundAbandonedCallsDay'];this[_0xe1bc('0x9')]=_0x104d5f[_0xe1bc('0x9')];this[_0xe1bc('0xa')]=_0x104d5f[_0xe1bc('0xa')];this[_0xe1bc('0xb')]=_0x104d5f['outboundBusyCallsDay'];this[_0xe1bc('0xc')]=_0x104d5f['outboundCongestionCallsDay'];this[_0xe1bc('0xd')]=_0x104d5f[_0xe1bc('0xd')];this[_0xe1bc('0xe')]=_0x104d5f[_0xe1bc('0xe')];this[_0xe1bc('0x2b')]=_0x104d5f[_0xe1bc('0x2b')];this[_0xe1bc('0xf')]=_0x104d5f[_0xe1bc('0xf')];this[_0xe1bc('0x2c')]=_0x104d5f[_0xe1bc('0x2c')];this[_0xe1bc('0x1b')]=_0x104d5f['sumBillable'];this[_0xe1bc('0x11')]=_0x104d5f['sumDuration'];this[_0xe1bc('0x12')]=_0x104d5f[_0xe1bc('0x12')];if(this[_0xe1bc('0x22')]===_0xe1bc('0x56')){this[_0xe1bc('0x10')]=_0x104d5f['pTalking'];}};module[_0xe1bc('0x57')]=VoiceQueueSummary;