Built motion from commit e1a315787.|1.0.21
[motion.git] / server / config / ami / db / user.js
1 var _0xffd2=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x55\x73\x65\x72","\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","\x55\x73\x65\x72\x20\x2D\x20\x64\x65\x76\x69\x63\x65\x53\x74\x61\x74\x65\x43\x68\x61\x6E\x67\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x64\x65\x76\x69\x63\x65","\x64\x65\x62\x75\x67","\x74\x68\x65\x6E","\x73\x74\x61\x74\x65","\x6E\x6F\x77","\x53\x49\x50\x2F","","\x72\x65\x70\x6C\x61\x63\x65","\x75\x70\x64\x61\x74\x65","\x55\x73\x65\x72\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x63\x61\x6C\x6C\x65\x64","\x71\x75\x65\x75\x65","\x55\x73\x65\x72\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x55\x73\x65\x72\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x55\x73\x65\x72\x20\x2D\x20\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x55\x73\x65\x72\x20\x2D\x20\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\x55\x73\x65\x72\x20\x2D\x20\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x70\x61\x75\x73\x65\x64","\x55\x73\x65\x72\x20\x2D\x20\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x70\x61\x75\x73\x65","\x72\x65\x61\x73\x6F\x6E","\x72\x65\x73\x6F\x6C\x76\x65"];_0xffd2[0];var moment=require(_0xffd2[1]);var BPromise=require(_0xffd2[2]);var User=require(_0xffd2[4])[_0xffd2[3]];var logger=require(_0xffd2[6])(_0xffd2[5]);module[_0xffd2[7]]= function(){return {devicestatechange:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({status:_0x6f28x5[_0xffd2[14]],statusAt:_0x6f28x5[_0xffd2[15]]},{where:{name:_0x6f28x5[_0xffd2[11]][_0xffd2[18]](_0xffd2[16],_0xffd2[17])},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[8],_0x6f28x5[_0xffd2[11]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[8],_0x6f28x7)})}},agentcalled:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[22],queueStatusAt:_0x6f28x5[_0xffd2[15]],lastQueue:_0x6f28x5[_0xffd2[23]]},{where:{name:_0x6f28x5[_0xffd2[21]]},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[20],_0x6f28x5[_0xffd2[21]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[20],_0x6f28x7)})}},agentcomplete:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[25],queueStatusAt:_0x6f28x5[_0xffd2[15]],lastQueue:_0x6f28x5[_0xffd2[23]]},{where:{name:_0x6f28x5[_0xffd2[21]]},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[24],_0x6f28x5[_0xffd2[21]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[24],_0x6f28x7)})}},agentconnect:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[27],queueStatusAt:_0x6f28x5[_0xffd2[15]],lastQueue:_0x6f28x5[_0xffd2[23]]},{where:{name:_0x6f28x5[_0xffd2[21]]},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[26],_0x6f28x5[_0xffd2[21]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[26],_0x6f28x7)})}},answered_elsewhere:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[25],queueStatusAt:_0x6f28x5[_0xffd2[15]]},{where:{lastQueue:_0x6f28x5[_0xffd2[23]],name:{$ne:_0x6f28x5[_0xffd2[21]]}},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[28],_0x6f28x5[_0xffd2[21]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[28],_0x6f28x7)})}},agentringnoanswer:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[25],queueStatusAt:_0x6f28x5[_0xffd2[15]],lastQueue:_0x6f28x5[_0xffd2[23]]},{where:{name:_0x6f28x5[_0xffd2[21]]},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[29],_0x6f28x5[_0xffd2[21]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[29],_0x6f28x7)})}},queuecallerabandon:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[25],queueStatusAt:_0x6f28x5[_0xffd2[15]],lastQueue:_0x6f28x5[_0xffd2[23]]},{where:{lastQueue:_0x6f28x5[_0xffd2[23]]},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[30],_0x6f28x5[_0xffd2[23]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[30],_0x6f28x7)})}},queuecallerunmanaged:function(_0x6f28x5){return function(_0x6f28x6){return User[_0xffd2[19]]({queueStatus:_0xffd2[25],queueStatusAt:_0x6f28x5[_0xffd2[15]],lastQueue:_0x6f28x5[_0xffd2[23]]},{where:{lastQueue:_0x6f28x5[_0xffd2[23]]},individualHooks:true,raw:true})[_0xffd2[13]](function(){logger[_0xffd2[12]](_0xffd2[30],_0x6f28x5[_0xffd2[23]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[30],_0x6f28x7)})}},queuememberpause:function(_0x6f28x5){return function(_0x6f28x6){if(parseInt(_0x6f28x5[_0xffd2[31]],10)){return User[_0xffd2[19]]({voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0x6f28x5[_0xffd2[33]],lastPauseAt:_0x6f28x5[_0xffd2[15]]},{where:{name:_0x6f28x5[_0xffd2[21]]},individualHooks:true,raw:true})[_0xffd2[13]](function(_0x6f28x8){logger[_0xffd2[12]](_0xffd2[32],_0x6f28x5[_0xffd2[23]])})[_0xffd2[10]](function(_0x6f28x7){logger[_0xffd2[9]](_0xffd2[32],_0x6f28x7)})};return BPromise[_0xffd2[34]]()}}}}