7f2a2624e66f993d601aa2e53865b52bebd8a513
[motion.git] / server / config / ami / db / voiceQueueReport.js
1 var _0xed2f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x61\x6D\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x65\x78\x70\x6F\x72\x74\x73","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6E\x6F\x77","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x74\x68\x65\x6E","\x75\x6E\x69\x71\x75\x65\x69\x64","\x69\x64\x20\x44\x45\x53\x43","\x66\x69\x6E\x64\x4F\x6E\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x71\x75\x65\x75\x65\x74\x72\x61\x6E\x73\x66\x65\x72","\x74\x72\x61\x6E\x73\x66\x65\x72","\x74\x72\x61\x6E\x73\x66\x65\x72\x74\x79\x70\x65","\x74\x72\x61\x6E\x73\x66\x65\x72\x75\x6E\x69\x71\x75\x65\x69\x64","\x74\x72\x61\x6E\x73\x66\x65\x72\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74\x72\x65\x61\x73\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x6D\x65\x72\x67\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E","\x63\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x41\x74","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x71\x75\x65\x75\x65\x73\x74\x61\x74\x75\x73\x20\x63\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x71\x75\x65\x75\x65\x73\x74\x61\x74\x75\x73\x20\x75\x70\x64\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x20\x2D\x20\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65"];_0xed2f[0];var BPromise=require(_0xed2f[1]);var moment=require(_0xed2f[2]);var _=require(_0xed2f[3]);var ReportQueue=require(_0xed2f[5])[_0xed2f[4]];var logger=require(_0xed2f[7])(_0xed2f[6]);module[_0xed2f[8]]= function(){return {agentcomplete:function(_0xbf08x6){return function(_0xbf08x7){return ReportQueue[_0xed2f[17]]({where:{uniqueid:_0xbf08x6[_0xed2f[15]],queuecallerleaveAt:{$ne:null},transfer:false},order:_0xed2f[16]})[_0xed2f[14]](function(_0xbf08x9){if(_0xbf08x9){return _0xbf08x9[_0xed2f[13]]({queuecallercomplete:true,queuecallercompleteAt:_0xbf08x6[_0xed2f[12]]})}})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[9],_0xbf08x8)})}},queuetransfer:function(_0xbf08x6){return function(_0xbf08x7){return ReportQueue[_0xed2f[17]]({where:{uniqueid:_0xbf08x6[_0xed2f[15]]},order:_0xed2f[16]})[_0xed2f[14]](function(_0xbf08x9){if(_0xbf08x9){var _0xbf08xa={transfer:_0xbf08x6[_0xed2f[19]],transfertype:_0xbf08x6[_0xed2f[20]],transferuniqueid:_0xbf08x6[_0xed2f[21]],transferextension:_0xbf08x6[_0xed2f[22]],queuecallerexitreason:_0xbf08x6[_0xed2f[23]]};if(!_0xbf08x9[_0xed2f[24]]){_0xbf08xa[_0xed2f[24]]= true;_0xbf08xa[_0xed2f[25]]= _0xbf08x6[_0xed2f[12]]};if(!_0xbf08x9[_0xed2f[26]]){_0xbf08xa[_0xed2f[26]]= _0xbf08x6[_0xed2f[12]]};return _0xbf08x9[_0xed2f[13]](_0xbf08xa)}})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[18],_0xbf08x8)})}},agentconnect:function(_0xbf08x6){return function(_0xbf08x7){return ReportQueue[_0xed2f[17]]({where:{uniqueid:_0xbf08x6[_0xed2f[15]]},order:_0xed2f[16]})[_0xed2f[14]](function(_0xbf08x9){if(_0xbf08x9){return _0xbf08x9[_0xed2f[13]]({holdtime:_0xbf08x6[_0xed2f[28]],assigned:true,lastAssignedTo:_0xbf08x6[_0xed2f[29]],connectedlinenum:_0xbf08x6[_0xed2f[30]],connectedlinename:_0xbf08x6[_0xed2f[31]]})}})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[27],_0xbf08x8)})}},queuecallerjoin:function(_0xbf08x6){return function(_0xbf08x7){_[_0xed2f[32]](_0xbf08x6,{queuecallerjoinAt:_0xbf08x6[_0xed2f[12]]});return ReportQueue[_0xed2f[34]](_0xbf08x6,{raw:true})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[33],_0xbf08x8)})}},queuecallerabandon:function(_0xbf08x6){return function(_0xbf08x7){return ReportQueue[_0xed2f[17]]({where:{uniqueid:_0xbf08x6[_0xed2f[15]],queuecallercomplete:false,$or:{queuecallerexitreason:null,queuecallerexit:false}},order:_0xed2f[16]})[_0xed2f[14]](function(_0xbf08x9){if(_0xbf08x9){return _0xbf08x9[_0xed2f[13]]({queuecallerabandon:true,queuecallerabandonAt:_0xbf08x6[_0xed2f[12]],queuecallerleaveAt:_0xbf08x6[_0xed2f[12]],queuecallerexit:false,queuecallerexitAt:null,queuecallerexitreason:null,connectedlinenum:null,connectedlinename:null,originalposition:_0xbf08x6[_0xed2f[36]],position:_0xbf08x6[_0xed2f[37]],holdtime:_0xbf08x6[_0xed2f[28]]})}})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[35],_0xbf08x8)})}},queuecallerunmanaged:function(_0xbf08x6){return function(_0xbf08x7){var _0xbf08xa={queuecallerabandon:false,queuecallerabandonAt:null,queuecallerexit:true,queuecallerexitAt:_0xbf08x6[_0xed2f[12]],connectedlinenum:null,connectedlinename:null,queuecallerleaveAt:_0xbf08x6[_0xed2f[12]],queuecallerexitreason:_0xbf08x6[_0xed2f[23]]};if(_0xbf08x6[_0xed2f[34]]){_0xbf08xa[_0xed2f[38]]= _0xbf08x6[_0xed2f[12]];return ReportQueue[_0xed2f[34]](_[_0xed2f[32]](_0xbf08x6,_0xbf08xa))[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[39],_0xbf08x8)})}else {return ReportQueue[_0xed2f[17]]({where:{uniqueid:_0xbf08x6[_0xed2f[15]],queuecallerexitreason:null},order:_0xed2f[16]})[_0xed2f[14]](function(_0xbf08x9){if(_0xbf08x9){return _0xbf08x9[_0xed2f[13]](_0xbf08xa)}})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[40],_0xbf08x8)})}}},queuecallerleave:function(_0xbf08x6){return function(_0xbf08x7){var _0xbf08xb={queuecallerleaveAt:_0xbf08x6[_0xed2f[12]]};return ReportQueue[_0xed2f[17]]({where:{uniqueid:_0xbf08x6[_0xed2f[15]],queuecallerleaveAt:null},order:_0xed2f[16]})[_0xed2f[14]](function(_0xbf08x9){if(_0xbf08x9){return _0xbf08x9[_0xed2f[13]](_0xbf08xb)}})[_0xed2f[11]](function(_0xbf08x8){logger[_0xed2f[10]](_0xed2f[41],_0xbf08x8)})}}}}