63f73b5af5a4f565b6890a0b30b6e3a1ebb8348d
[motion.git] / server / config / tools / queueParameters.js
1 var _0x7c39=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x72\x65\x67\x69\x73\x74\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x63\x68\x61\x6E\x67\x65\x64","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x74\x68\x65\x6E","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x55\x73\x65\x72","\x75\x73\x65\x72","\x66\x69\x6E\x64\x41\x6C\x6C","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x57\x41\x49\x54\x49\x4E\x47\x20\x45\x52\x52\x4F\x52","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x71\x75\x65\x75\x65","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x73","\x65\x6D\x69\x74","\x72\x6F\x77\x73","\x66\x69\x6E\x64","\x6E\x61\x6D\x65","\x43\x4F\x55\x4E\x54","\x63\x6F\x6C","\x66\x6E","\x77\x61\x69\x74\x69\x6E\x67","\x75\x73\x65\x72\x49\x64","\x72\x6F\x6C\x65","\x61\x6C\x6C","\x41\x43\x54\x49\x56\x45\x20\x45\x52\x52\x4F\x52","\x61\x63\x74\x69\x76\x65","\x41\x42\x41\x4E\x44\x4F\x4E\x45\x44\x20\x45\x52\x52\x4F\x52","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44\x20\x45\x52\x52\x4F\x52","\x61\x6E\x73\x77\x65\x72\x65\x64","\x48\x4F\x4C\x44\x54\x49\x4D\x45\x20\x45\x52\x52\x4F\x52","\x30\x30\x3A\x30\x30\x3A\x30\x30","","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x68\x6F\x6C\x64\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x3D\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x71\x75\x65\x72\x79","\x54\x41\x4C\x4B\x54\x49\x4D\x45\x20\x45\x52\x52\x4F\x52","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x74\x61\x6C\x6B\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x3D\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x54\x4F\x54\x41\x4C\x43\x41\x4C\x4C\x53\x20\x45\x52\x52\x4F\x52","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x3D\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44\x20\x45\x52\x52\x4F\x52","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64"];_0x7c39[0];var sequelize=require(_0x7c39[2])[_0x7c39[1]];var models=require(_0x7c39[2]);var Util=require(_0x7c39[3]);var Promise=require(_0x7c39[4]);var _=require(_0x7c39[5]);var util=require(_0x7c39[6]);exports[_0x7c39[7]]= function(_0x85c1x7){models[_0x7c39[9]][_0x7c39[8]](function(_0x85c1x8){onWaiting(_0x85c1x7,_0x85c1x8)});models[_0x7c39[9]][_0x7c39[12]](function(_0x85c1x8){if(_0x85c1x8[_0x7c39[11]](_0x7c39[10])){onWaiting(_0x85c1x7,_0x85c1x8);onActive(_0x85c1x7,_0x85c1x8)}});models[_0x7c39[9]][_0x7c39[12]](function(_0x85c1x8){if(_0x85c1x8[_0x7c39[11]](_0x7c39[13])|| _0x85c1x8[_0x7c39[11]](_0x7c39[14])){onAbandon(_0x85c1x7,_0x85c1x8);onComplete(_0x85c1x7,_0x85c1x8);onActive(_0x85c1x7,_0x85c1x8);onAvgAnswerTime(_0x85c1x7,_0x85c1x8);onAvgTalkTime(_0x85c1x7,_0x85c1x8);onTotalOffered(_0x85c1x7,_0x85c1x8);onUnmanaged(_0x85c1x7,_0x85c1x8)}})};function getQueues(_0x85c1xa,_0x85c1xb){return function(){switch(_0x85c1xb){case _0x7c39[20]:return models[_0x7c39[19]][_0x7c39[18]](_0x85c1xa,{attributes:[_0x7c39[17]]})[_0x7c39[16]](Util[_0x7c39[15]]());default:return models[_0x7c39[22]][_0x7c39[21]]()[_0x7c39[16]](function(_0x85c1xc){return {rows:_0x85c1xc}})}}}function onWaiting(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){return models[_0x7c39[9]][_0x7c39[21]]({where:{queuecallerleaveAt:null,queue:_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:[]},group:_0x7c39[28],attributes:[[_0x7c39[28],_0x7c39[33]],[sequelize[_0x7c39[36]](_0x7c39[34],sequelize[_0x7c39[35]](_0x7c39[17])),_0x7c39[37]]]})};return null})[_0x7c39[16]](function(_0x85c1xf){if(_0x85c1xf){var _0x85c1x10;if(_0x85c1xf[_0x7c39[26]]){_0x85c1x10= _0x85c1xf[0][_0x7c39[27]]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],waiting:0}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[23],_0x85c1xe)})}function onActive(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){return models[_0x7c39[9]][_0x7c39[21]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:[]},group:_0x7c39[28],attributes:[[_0x7c39[28],_0x7c39[33]],[sequelize[_0x7c39[36]](_0x7c39[34],sequelize[_0x7c39[35]](_0x7c39[17])),_0x7c39[42]]]})};return null})[_0x7c39[16]](function(_0x85c1x13){if(_0x85c1x13){var _0x85c1x10;if(_0x85c1x13[_0x7c39[26]]){_0x85c1x10= _0x85c1x13[0][_0x7c39[27]]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],active:0}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[41],_0x85c1xe)})}function onAbandon(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){return models[_0x7c39[9]][_0x7c39[21]]({where:{queuecallerabandon:true,queue:_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:[]},group:_0x7c39[28],attributes:[[_0x7c39[28],_0x7c39[33]],[sequelize[_0x7c39[36]](_0x7c39[34],sequelize[_0x7c39[35]](_0x7c39[17])),_0x7c39[44]]]})};return null})[_0x7c39[16]](function(_0x85c1x15){if(_0x85c1x15){var _0x85c1x10;if(_0x85c1x15[_0x7c39[26]]){_0x85c1x10= _0x85c1x15[0][_0x7c39[27]]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],abandoned:0}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[43],_0x85c1xe)})}function onComplete(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){return models[_0x7c39[9]][_0x7c39[21]]({where:{queuecallercomplete:true,queue:_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:[]},group:_0x7c39[28],attributes:[[_0x7c39[28],_0x7c39[33]],[sequelize[_0x7c39[36]](_0x7c39[34],sequelize[_0x7c39[35]](_0x7c39[17])),_0x7c39[46]]]})};return null})[_0x7c39[16]](function(_0x85c1x17){if(_0x85c1x17){var _0x85c1x10;if(_0x85c1x17[_0x7c39[26]]){_0x85c1x10= _0x85c1x17[0][_0x7c39[27]]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],answered:0}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[45],_0x85c1xe)})}function onAvgAnswerTime(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){var _0x85c1x1a=_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:_0x7c39[49];var _0x85c1x1b=util[_0x7c39[51]](_0x7c39[50],_0x85c1x1a);return sequelize[_0x7c39[54]](_0x85c1x1b,{type:sequelize[_0x7c39[53]][_0x7c39[52]]})};return null})[_0x7c39[16]](function(_0x85c1x19){if(_0x85c1x19){var _0x85c1x10;if(_0x85c1x19[_0x7c39[26]]){_0x85c1x10= _0x85c1x19[0]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],holdtime:_0x7c39[48]}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[47],_0x85c1xe)})}function onAvgTalkTime(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){var _0x85c1x1a=_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:_0x7c39[49];return sequelize[_0x7c39[54]](util[_0x7c39[51]](_0x7c39[56],_0x85c1x1a),{type:sequelize[_0x7c39[53]][_0x7c39[52]]})};return null})[_0x7c39[16]](function(_0x85c1x1d){if(_0x85c1x1d){var _0x85c1x10;if(_0x85c1x1d[_0x7c39[26]]){_0x85c1x10= _0x85c1x1d[0]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],talktime:_0x7c39[48]}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[55],_0x85c1xe)})}function onTotalOffered(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){var _0x85c1x1a=_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:_0x7c39[49];return sequelize[_0x7c39[54]](util[_0x7c39[51]](_0x7c39[58],_0x85c1x1a),{type:sequelize[_0x7c39[53]][_0x7c39[52]]})};return null})[_0x7c39[16]](function(_0x85c1x1f){if(_0x85c1x1f){var _0x85c1x10;if(_0x85c1x1f[_0x7c39[26]]){_0x85c1x10= _0x85c1x1f[0]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],totalcalls:0}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[57],_0x85c1xe)})}function onUnmanaged(_0x85c1x7,_0x85c1x8){return Promise[_0x7c39[40]]([])[_0x7c39[16]](getQueues(_0x85c1x7[_0x7c39[38]],_0x85c1x7[_0x7c39[39]]))[_0x7c39[16]](function(_0x85c1x11){if(_0x85c1x11[_0x7c39[31]][_0x7c39[26]]){return models[_0x7c39[9]][_0x7c39[21]]({where:{queuecallerexit:true,queue:_[_0x7c39[32]](_0x85c1x11[_0x7c39[31]],{name:_0x85c1x8[_0x7c39[28]]})?_0x85c1x8[_0x7c39[28]]:[]},group:_0x7c39[28],attributes:[[_0x7c39[28],_0x7c39[33]],[sequelize[_0x7c39[36]](_0x7c39[34],sequelize[_0x7c39[35]](_0x7c39[17])),_0x7c39[60]]]})};return null})[_0x7c39[16]](function(_0x85c1x21){if(_0x85c1x21){var _0x85c1x10;if(_0x85c1x21[_0x7c39[26]]){_0x85c1x10= _0x85c1x21[0][_0x7c39[27]]}else {_0x85c1x10= {name:_0x85c1x8[_0x7c39[28]],_parameters:0}};_0x85c1x7[_0x7c39[30]](_0x7c39[29],_0x85c1x10)}})[_0x7c39[25]](function(_0x85c1xe){console[_0x7c39[24]](_0x7c39[59],_0x85c1xe)})}