1 var _0x1678=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73","\x69\x64","\x66\x69\x6E\x64","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x41\x50\x50\x20\x41\x47\x45\x4E\x54\x2C\x20\x41\x47\x45\x4E\x54\x20\x49\x44\x3A","\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x75\x6E\x69\x71\x75\x65\x69\x64","\x45\x52\x52\x4F\x52","\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x64","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x66\x6F\x72\x6D\x61\x74","\x74\x6F","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x73\x61\x76\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x45\x4E\x44\x20\x28\x4E\x4F\x20\x41\x4E\x53\x57\x45\x52\x20\x42\x59\x20\x41\x47\x45\x4E\x54\x29","\x69\x6E\x66\x6F","\x74\x68\x65\x6E","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x75\x70\x64\x61\x74\x65","\x74\x69\x6D\x65\x6F\x75\x74","\x54\x49\x4D\x45\x4F\x55\x54","\x53\x45\x43","\x61\x67\x65\x6E\x74","\x6E\x61\x6D\x65","\x6D\x65\x72\x67\x65","\x63\x72\x65\x61\x74\x65","\x53\x4B\x49\x50\x50\x45\x44\x20\x28\x41\x47\x45\x4E\x54\x20\x4E\x4F\x54\x20\x41\x56\x41\x49\x4C\x41\x42\x4C\x45\x29","\x55\x73\x65\x72\x49\x64"];_0x1678[0];var _=require(_0x1678[1]);var util=require(_0x1678[2]);var moment=require(_0x1678[3]);var logger=require(_0x1678[5])(_0x1678[4]);var Agent=require(_0x1678[7])[_0x1678[6]];var Room=require(_0x1678[7])[_0x1678[8]];var Report=require(_0x1678[7])[_0x1678[9]];var Session=require(_0x1678[7])[_0x1678[10]];module[_0x1678[11]]= function(_0xdaedx9,_0xdaedxa,_0xdaedxb,_0xdaedxc,_0xdaedxd){var _0xdaedxe=[];var _0xdaedxf;var _0xdaedx10;function _0xdaedx11(_0xdaedx12){var _0xdaedx13=_[_0x1678[13]](_0xdaedxe,{id:_0xdaedx12[_0x1678[12]]});return _0xdaedx13?true:false}return Agent[_0x1678[13]]({where:{id:_0xdaedx9[_0x1678[47]],online:true,openchannelPause:false},raw:true})[_0x1678[36]](function(_0xdaedx12){_0xdaedx10= _0xdaedx12;logger[_0x1678[35]](_0xdaedxa[_0x1678[15]][_0x1678[14]](),_0x1678[16],_0xdaedx9.UserId,_0x1678[17],_0xdaedxa[_0x1678[18]],_0x1678[40],_0xdaedx9[_0x1678[39]],_0x1678[41]);if(_0xdaedx12){if(!_0xdaedx11(_0xdaedx10)){var _0xdaedx15=_[_0x1678[44]](_0xdaedxa,{timeslot:_0xdaedx9[_0x1678[39]],application:_0x1678[42],membername:_0xdaedx12[_0x1678[43]],memberid:_0xdaedx12[_0x1678[12]],calledAt:moment()[_0x1678[27]](_0x1678[37]),joinAt:moment()[_0x1678[27]](_0x1678[37])});return Session[_0x1678[45]](_0xdaedx15)[_0x1678[36]](function(_0xdaedx18){_0xdaedxc[_0x1678[28]](_0x1678[32])[_0x1678[24]](_0x1678[31],_0xdaedx18);_0xdaedxc[_0x1678[28]](_0x1678[33])[_0x1678[24]](_0x1678[31],_0xdaedx18);_0xdaedxc[_0x1678[28]](util[_0x1678[27]](_0x1678[25],_0xdaedx18[_0x1678[26]]))[_0x1678[24]](_0x1678[31],_0xdaedx18);return Report[_0x1678[45]](_0xdaedx15,{raw:true})})}}else {logger[_0x1678[35]](_0xdaedxa[_0x1678[15]][_0x1678[14]](),_0x1678[16],_0xdaedx9.UserId,_0x1678[17],_0xdaedxa[_0x1678[18]],_0x1678[46]);_0xdaedxd()}})[_0x1678[36]](function(_0xdaedx15){if(_0xdaedx15){_0xdaedxc[_0x1678[28]](util[_0x1678[27]](_0x1678[25],_0xdaedx15[_0x1678[26]]))[_0x1678[24]](_0x1678[23],_0xdaedx15)};_0xdaedxf= setTimeout(function(){return Session[_0x1678[38]]({leaveAt:moment()[_0x1678[27]](_0x1678[37]),timeout:true},{where:{uniqueid:_0xdaedxa[_0x1678[18]],leaveAt:null},individualHooks:true})[_0x1678[36]](function(_0xdaedx16){if(_0xdaedx16&& _0xdaedx16[_0x1678[29]]&& _0xdaedx16[1][_0x1678[29]]){for(var _0xdaedx17=0;_0xdaedx17< _0xdaedx16[1][_0x1678[29]];_0xdaedx17++){var _0xdaedx18=_0xdaedx16[1][_0xdaedx17][_0x1678[30]]({plain:true});_0xdaedxc[_0x1678[28]](_0x1678[32])[_0x1678[24]](_0x1678[31],_0xdaedx18);_0xdaedxc[_0x1678[28]](_0x1678[33])[_0x1678[24]](_0x1678[31],_0xdaedx18);_0xdaedxc[_0x1678[28]](util[_0x1678[27]](_0x1678[25],_0xdaedx18[_0x1678[26]]))[_0x1678[24]](_0x1678[31],_0xdaedx18)}};logger[_0x1678[35]](_0xdaedxa[_0x1678[15]][_0x1678[14]](),_0x1678[16],_0xdaedx9.UserId,_0x1678[17],_0xdaedxa[_0x1678[18]],_0x1678[34]);clearTimeout(_0xdaedxf);_0xdaedxd()})},_0xdaedx9[_0x1678[39]]* 1000)})[_0x1678[22]](function(_0xdaedx14){logger[_0x1678[20]](_0xdaedxa[_0x1678[15]][_0x1678[14]](),_0x1678[16],_0xdaedx9.UserId,_0x1678[17],_0xdaedxa[_0x1678[18]],_0x1678[19]);logger[_0x1678[20]](_0xdaedx14[_0x1678[21]]);_0xdaedxd(_0xdaedx14)})}