b03bf1d131526603b015b889a62c029d3314005f
[motion.git] / server / config / dashboard / dashboard.js
1 var _0x8c53=["\x75\x74\x69\x6C","\x72\x65\x64\x69\x73","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x64\x61\x73\x68\x62\x6F\x61\x72\x64","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x2E\x2E\x2F\x72\x70\x63\x2F\x63\x6C\x69\x65\x6E\x74","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x67\x63","\x47\x61\x72\x62\x61\x67\x65\x20\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x20\x75\x6E\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x2E\x20\x20\x50\x61\x73\x73\x20\x2D\x2D\x65\x78\x70\x6F\x73\x65\x2D\x67\x63\x20","\x77\x68\x65\x6E\x20\x6C\x61\x75\x6E\x63\x68\x69\x6E\x67\x20\x6E\x6F\x64\x65\x20\x74\x6F\x20\x65\x6E\x61\x62\x6C\x65\x20\x66\x6F\x72\x63\x65\x64\x20\x67\x61\x72\x62\x61\x67\x65\x20\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x2E","\x77\x61\x72\x6E","\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x20\x73\x65\x72\x76\x69\x63\x65\x20\x73\x74\x61\x72\x74\x65\x64\x20\x5B\x50\x49\x44\x3A\x20\x25\x64\x5D","\x70\x69\x64","\x66\x6F\x72\x6D\x61\x74","\x69\x6E\x66\x6F","\x72\x65\x64\x69\x73\x50\x77\x64","\x69\x70","\x63\x72\x65\x61\x74\x65\x43\x6C\x69\x65\x6E\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6D\x61\x69\x6C","\x65\x6D\x69\x74","\x61\x64\x6D\x69\x6E\x73","\x74\x6F","\x75\x73\x65\x72\x73","\x66\x69\x6E\x61\x6C\x6C\x79","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x6D\x61\x69\x6C\x20\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x20\x71\x75\x65\x72\x79\x69\x6E\x67","\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x74\x69\x6D\x65\x6F\x75\x74","\x72\x6F\x75\x74\x69\x6E\x67\x53\x74\x61\x74\x73","\x74\x68\x65\x6E","\x77\x61\x69\x74\x69\x6E\x67","\x63\x6F\x75\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x72\x65\x71\x75\x65\x73\x74","\x73\x74\x61\x74\x75\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x6D\x65\x72\x67\x65","\x72\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x71\x75\x65\x72\x79","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x73\x6D\x73","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x73\x6D\x73\x20\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x20\x71\x75\x65\x72\x79\x69\x6E\x67","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x73\x6D\x73\x5F\x72\x6F\x6F\x6D\x73\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x20\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x20\x71\x75\x65\x72\x79\x69\x6E\x67","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x66\x61\x78","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x66\x61\x78\x20\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x20\x71\x75\x65\x72\x79\x69\x6E\x67","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\x53\x65\x73\x73\x69\x6F\x6E","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x63\x68\x61\x74","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x63\x68\x61\x74\x20\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x20\x71\x75\x65\x72\x79\x69\x6E\x67","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x63\x68\x61\x74\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3E\x3D\x20\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73"];var util=require(_0x8c53[0]);var redis=require(_0x8c53[1]);var _=require(_0x8c53[2]);var moment=require(_0x8c53[3]);var logger=require(_0x8c53[5])(_0x8c53[4]);var rpcClient=require(_0x8c53[6]);var config=require(_0x8c53[7]);setInterval(function(){if(global[_0x8c53[8]]){global[_0x8c53[8]]()}else {logger[_0x8c53[11]](_0x8c53[9]+ _0x8c53[10])}},20000);var mTimeout=null;var cTimeout=null;var fTimeout=null;var oTimeout=null;var sTimeout=null;var timeoutSec=30;logger[_0x8c53[15]](util[_0x8c53[14]](_0x8c53[12],process[_0x8c53[13]]));var redisConf;if(config[_0x8c53[16]]){redisConf= {password:config[_0x8c53[16]]}};var redisClient=redis[_0x8c53[18]](6379,config[_0x8c53[17]],redisConf);var io=require(_0x8c53[19])(redisClient);function mailDashboard(){var _0x152cx12={roomStatus:{new:0,open:0,pending:0,closed:0},routingStats:{waiting:0,timeout:0}};return rpcClient[_0x8c53[38]](_0x8c53[44],[_0x8c53[45]])[_0x8c53[32]](function(_0x152cx15){var _0x152cx16=_[_0x8c53[42]]({new:0,open:0,pending:0,closed:0},_[_0x8c53[41]](_[_0x8c53[40]](_0x152cx15,_0x8c53[39]),_0x8c53[34]));_0x152cx12[_0x8c53[43]]= _0x152cx16;return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[35],{where:{leaveAt:null,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[33]]= _0x152cx14};return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[35],{where:{timeout:true,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[30]]= _0x152cx14}})[_0x8c53[29]](function(_0x152cx13){logger[_0x8c53[27]](_0x8c53[26]);logger[_0x8c53[27]](_0x152cx13[_0x8c53[28]])})[_0x8c53[25]](function(){io[_0x8c53[23]](_0x8c53[22])[_0x8c53[21]](_0x8c53[20],_0x152cx12);io[_0x8c53[23]](_0x8c53[24])[_0x8c53[21]](_0x8c53[20],_0x152cx12);mTimeout= setTimeout(mailDashboard,timeoutSec* 1000)})}function smsDashboard(){var _0x152cx12={roomStatus:{new:0,open:0,pending:0,closed:0},routingStats:{waiting:0,timeout:0}};return rpcClient[_0x8c53[38]](_0x8c53[44],[_0x8c53[49]])[_0x8c53[32]](function(_0x152cx15){var _0x152cx16=_[_0x8c53[42]]({new:0,open:0,pending:0,closed:0},_[_0x8c53[41]](_[_0x8c53[40]](_0x152cx15,_0x8c53[39]),_0x8c53[34]));_0x152cx12[_0x8c53[43]]= _0x152cx16;return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[48],{where:{leaveAt:null,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[33]]= _0x152cx14};return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[48],{where:{timeout:true,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[30]]= _0x152cx14}})[_0x8c53[29]](function(_0x152cx13){logger[_0x8c53[27]](_0x8c53[47]);logger[_0x8c53[27]](_0x152cx13[_0x8c53[28]])})[_0x8c53[25]](function(){io[_0x8c53[23]](_0x8c53[22])[_0x8c53[21]](_0x8c53[46],_0x152cx12);io[_0x8c53[23]](_0x8c53[24])[_0x8c53[21]](_0x8c53[46],_0x152cx12);sTimeout= setTimeout(smsDashboard,timeoutSec* 1000)})}function openchannelDashboard(){var _0x152cx12={roomStatus:{new:0,open:0,pending:0,closed:0},routingStats:{waiting:0,timeout:0}};return rpcClient[_0x8c53[38]](_0x8c53[44],[_0x8c53[53]])[_0x8c53[32]](function(_0x152cx15){var _0x152cx16=_[_0x8c53[42]]({new:0,open:0,pending:0,closed:0},_[_0x8c53[41]](_[_0x8c53[40]](_0x152cx15,_0x8c53[39]),_0x8c53[34]));_0x152cx12[_0x8c53[43]]= _0x152cx16;return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[52],{where:{leaveAt:null,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[33]]= _0x152cx14};return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[52],{where:{timeout:true,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[30]]= _0x152cx14}})[_0x8c53[29]](function(_0x152cx13){logger[_0x8c53[27]](_0x8c53[51]);logger[_0x8c53[27]](_0x152cx13[_0x8c53[28]])})[_0x8c53[25]](function(){io[_0x8c53[23]](_0x8c53[22])[_0x8c53[21]](_0x8c53[50],_0x152cx12);io[_0x8c53[23]](_0x8c53[24])[_0x8c53[21]](_0x8c53[50],_0x152cx12);oTimeout= setTimeout(openchannelDashboard,timeoutSec* 1000)})}function faxDashboard(){var _0x152cx12={roomStatus:{new:0,open:0,pending:0,closed:0},routingStats:{waiting:0,timeout:0}};return rpcClient[_0x8c53[38]](_0x8c53[44],[_0x8c53[57]])[_0x8c53[32]](function(_0x152cx15){var _0x152cx16=_[_0x8c53[42]]({new:0,open:0,pending:0,closed:0},_[_0x8c53[41]](_[_0x8c53[40]](_0x152cx15,_0x8c53[39]),_0x8c53[34]));_0x152cx12[_0x8c53[43]]= _0x152cx16;return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[56],{where:{leaveAt:null,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[33]]= _0x152cx14};return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[56],{where:{timeout:true,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[30]]= _0x152cx14}})[_0x8c53[29]](function(_0x152cx13){logger[_0x8c53[27]](_0x8c53[55]);logger[_0x8c53[27]](_0x152cx13[_0x8c53[28]])})[_0x8c53[25]](function(){io[_0x8c53[23]](_0x8c53[22])[_0x8c53[21]](_0x8c53[54],_0x152cx12);io[_0x8c53[23]](_0x8c53[24])[_0x8c53[21]](_0x8c53[54],_0x152cx12);fTimeout= setTimeout(faxDashboard,timeoutSec* 1000)})}function chatDashboard(){var _0x152cx12={roomStatus:{new:0,open:0,closed:0,abandon:0,unmanaged:0},routingStats:{waiting:0,timeout:0}};return rpcClient[_0x8c53[38]](_0x8c53[44],[util[_0x8c53[14]](_0x8c53[61],moment()[_0x8c53[37]](_0x8c53[36])[_0x8c53[14]](_0x8c53[62]))])[_0x8c53[32]](function(_0x152cx15){var _0x152cx16=_[_0x8c53[42]]({new:0,open:0,closed:0,abandon:0,unmanaged:0},_[_0x8c53[41]](_[_0x8c53[40]](_0x152cx15,_0x8c53[39]),_0x8c53[34]));_0x152cx12[_0x8c53[43]]= _0x152cx16;return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[60],{where:{leaveAt:null,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[33]]= _0x152cx14};return rpcClient[_0x8c53[38]](_0x8c53[34],[_0x8c53[60],{where:{timeout:true,createdAt:{$gte:moment()[_0x8c53[37]](_0x8c53[36])}}}])})[_0x8c53[32]](function(_0x152cx14){if(_0x152cx14){_0x152cx12[_0x8c53[31]][_0x8c53[30]]= _0x152cx14}})[_0x8c53[29]](function(_0x152cx13){logger[_0x8c53[27]](_0x8c53[59]);logger[_0x8c53[27]](_0x152cx13[_0x8c53[28]])})[_0x8c53[25]](function(){io[_0x8c53[23]](_0x8c53[22])[_0x8c53[21]](_0x8c53[58],_0x152cx12);io[_0x8c53[23]](_0x8c53[24])[_0x8c53[21]](_0x8c53[58],_0x152cx12);cTimeout= setTimeout(chatDashboard,timeoutSec* 1000)})}mailDashboard();smsDashboard();openchannelDashboard();faxDashboard();chatDashboard()