Built motion from commit 5b5850835.|1.0.25
[motion.git] / server / config / forked_routing / chat / queue.js
1 var _0xa5a2=["\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","\x63\x68\x61\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x72\x70\x63\x2F\x63\x6C\x69\x65\x6E\x74","\x65\x78\x70\x6F\x72\x74\x73","\x6D\x65\x73\x73\x61\x67\x65","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x41\x50\x50\x20\x51\x55\x45\x55\x45\x2C\x20\x51\x55\x45\x55\x45\x3A","\x6E\x61\x6D\x65","\x53\x54\x52\x41\x54\x45\x47\x59\x3A","\x73\x74\x72\x61\x74\x65\x67\x79","\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x75\x6E\x69\x71\x75\x65\x69\x64","\x41\x47\x45\x4E\x54","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x52\x45\x4A\x45\x43\x54\x45\x44","\x69\x6E\x66\x6F","\x69\x64","\x70\x75\x73\x68","\x72\x65\x6A\x65\x63\x74","\x74\x79\x70\x65","\x6F\x6E","\x66\x69\x6E\x64","\x74\x69\x6D\x65\x6F\x75\x74","\x6C\x65\x6E\x67\x74\x68","\x6D\x61\x70","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x63\x68\x61\x74\x50\x61\x75\x73\x65","\x63\x68\x61\x74\x43\x61\x70\x61\x63\x69\x74\x79","\x46\x49\x45\x4C\x44\x28\x55\x73\x65\x72\x2E\x69\x64\x2C\x25\x73\x29","\x6A\x6F\x69\x6E","\x66\x6F\x72\x6D\x61\x74","\x45\x52\x52\x4F\x52","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\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","\x74\x6F","\x63\x61\x70\x61\x63\x69\x74\x79","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x41\x47\x45\x4E\x54\x20\x53\x45\x4C\x45\x43\x54\x45\x44\x3A","\x66\x69\x6E\x64\x49\x6E\x64\x65\x78","\x73\x70\x6C\x69\x63\x65","\x68\x65\x61\x64","\x63\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74","\x71\x75\x65\x75\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x6D\x65\x72\x67\x65","\x72\x65\x71\x75\x65\x73\x74","\x4E\x4F\x20\x41\x56\x41\x49\x4C\x41\x42\x4C\x45\x20\x41\x47\x45\x4E\x54\x53","\x6B\x65\x79\x42\x79","\x69\x6E\x64\x65\x78","\x55\x73\x65\x72","\x71\x75\x65\x72\x79","\x53\x45\x4C\x45\x43\x54\x20\x6D\x65\x6D\x62\x65\x72\x69\x64\x20\x61\x73\x20\x69\x64\x2C\x20\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65\x2C\x20\x63\x6F\x75\x6E\x74\x28\x2A\x29\x20\x41\x53\x20\x63\x61\x70\x61\x63\x69\x74\x79\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x20\x57\x48\x45\x52\x45\x20\x63\x6F\x6D\x70\x6C\x65\x74\x65\x3D\x30\x20\x41\x4E\x44\x20\x74\x69\x6D\x65\x6F\x75\x74\x3D\x30\x20\x41\x4E\x44\x20\x61\x62\x61\x6E\x64\x6F\x6E\x3D\x30\x20\x41\x4E\x44\x20\x6D\x65\x6D\x62\x65\x72\x69\x64\x20\x49\x53\x20\x4E\x4F\x54\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x6D\x65\x6D\x62\x65\x72\x69\x64\x2C\x20\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x45\x4E\x44\x20\x28\x4E\x4F\x20\x41\x4E\x53\x57\x45\x52\x20\x42\x59\x20\x41\x47\x45\x4E\x54\x53\x29","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x73\x61\x76\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x75\x70\x64\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x51\x75\x65\x75\x65\x2E\x70\x65\x6E\x61\x6C\x74\x79","\x67\x72\x6F\x75\x70\x42\x79","\x76\x61\x6C\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65","\x63\x6C\x6F\x6E\x65","\x61\x6C\x6C","\x73\x68\x6F\x77","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65\x49\x64","\x6C\x61\x73\x74\x41\x67\x65\x6E\x74","\x72\x65\x73\x6F\x6C\x76\x65","\x62\x65\x65\x70\x61\x6C\x6C","\x70\x65\x6E\x61\x6C\x74\x79","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x73\x6F\x72\x74\x42\x79","\x72\x6F\x75\x6E\x64\x72\x6F\x62\x69\x6E","\x72\x72\x6D\x65\x6D\x6F\x72\x79","\x63\x68\x61\x74\x5F\x72\x6F\x6F\x6D\x3A\x73\x61\x76\x65","\x72\x6F\x6F\x6D\x69\x64","\x54\x49\x4D\x45\x4F\x55\x54","\x53\x45\x43"];_0xa5a2[0];var _=require(_0xa5a2[1]);var util=require(_0xa5a2[2]);var moment=require(_0xa5a2[3]);var logger=require(_0xa5a2[5])(_0xa5a2[4]);var rpcClient=require(_0xa5a2[6]);module[_0xa5a2[7]]= function(_0x16bcx6,_0x16bcx7,_0x16bcx8,_0x16bcx9){var _0x16bcxa=[];var _0x16bcxb;var _0x16bcxc;var _0x16bcxd;var _0x16bcxe=0;process[_0xa5a2[25]](_0xa5a2[8],function(_0x16bcxf){switch(_0x16bcxf[_0xa5a2[24]]){case _0xa5a2[23]:logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[17],_0x16bcxf[_0xa5a2[18]],_0xa5a2[19]);_0x16bcxa[_0xa5a2[22]]({id:_0x16bcxf[_0xa5a2[21]]});break;default:}});function _0x16bcx10(_0x16bcx11){var _0x16bcx12=_[_0xa5a2[26]](_0x16bcxa,{id:_0x16bcx11[_0xa5a2[21]]});return _0x16bcx12?true:false}function _0x16bcx13(){var _0x16bcx14=((_0x16bcx6[_0xa5a2[27]]- _0x16bcxe)> _0x16bcxd[_0xa5a2[27]])?_0x16bcxd[_0xa5a2[27]]:(_0x16bcx6[_0xa5a2[27]]- _0x16bcxe);var _0x16bcx15;if(_0x16bcx14> 0){if(_0x16bcxc[_0xa5a2[28]]){var _0x16bcx16={where:{id:{$in:_[_0xa5a2[29]](_0x16bcxc,_0xa5a2[21])},online:true,chatPause:false},include:[{model:_0xa5a2[30],attributes:[_0xa5a2[21]],raw:true}],attributes:[_0xa5a2[21],_0xa5a2[12],_0xa5a2[31],_0xa5a2[32],_0xa5a2[33],_0xa5a2[34]],order:[[{raw:util[_0xa5a2[37]](_0xa5a2[35],_[_0xa5a2[29]](_0x16bcxc,_0xa5a2[21])[_0xa5a2[36]]())}]]};return rpcClient[_0xa5a2[58]](_0xa5a2[63],[_0xa5a2[64]])[_0xa5a2[41]](function(_0x16bcx7){_0x16bcx15= _[_0xa5a2[60]](_0x16bcx7,_0xa5a2[21]);return rpcClient[_0xa5a2[58]](_0xa5a2[61],[_0xa5a2[62],_0x16bcx16])})[_0xa5a2[41]](function(_0x16bcx19){if(_0x16bcx19[_0xa5a2[28]]){var _0x16bcx1a;for(var _0x16bcx1b=0;_0x16bcx1b< _0x16bcx19[_0xa5a2[28]];_0x16bcx1b++){var _0x16bcx11=_0x16bcx19[_0x16bcx1b];var _0x16bcx1c=false;if(_0x16bcx11[_0xa5a2[34]]> 0){if(_0x16bcx15[_0x16bcx11[_0xa5a2[21]]]&& _0x16bcx15[_0x16bcx11[_0xa5a2[21]]][_0xa5a2[48]](_0xa5a2[47])&& _0x16bcx15[_0x16bcx11[_0xa5a2[21]]][_0xa5a2[47]]>= _0x16bcx11[_0xa5a2[34]]){_0x16bcx1c= true}};if(!_0x16bcx10(_0x16bcx11)&&  !_0x16bcx1c){_0x16bcx1a= _0x16bcx11;break}};if(_0x16bcx1a){logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[49],_0x16bcx1a[_0xa5a2[21]],_0x16bcx1a[_0xa5a2[12]]);var _0x16bcx1d=_[_0xa5a2[50]](_0x16bcxc,{"\x69\x64":_0x16bcx1a[_0xa5a2[21]]});if(_0x16bcx1d>= 0){var _0x16bcx1e=_0x16bcxc[_0xa5a2[51]](_0x16bcx1d,1);if(_0x16bcx1e&& _0x16bcx1e[_0xa5a2[28]]){_0x16bcxc[_0xa5a2[22]](_[_0xa5a2[52]](_0x16bcx1e))}};return rpcClient[_0xa5a2[58]](_0xa5a2[53],[_0xa5a2[54],_[_0xa5a2[57]](_0x16bcx7,{timeslot:_0x16bcx14,application:_0xa5a2[55],membername:_0x16bcx1a[_0xa5a2[12]],memberid:_0x16bcx1a[_0xa5a2[21]],queue:_0x16bcxd[_0xa5a2[21]],queuename:_0x16bcxd[_0xa5a2[12]],calledAt:moment()[_0xa5a2[37]](_0xa5a2[56])})])};logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[59]);return}else {logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[59]);return}})[_0xa5a2[41]](function(_0x16bcx18){if(_0x16bcx18){_0x16bcx8[_0xa5a2[46]](util[_0xa5a2[37]](_0xa5a2[44],_0x16bcx18[_0xa5a2[45]]))[_0xa5a2[43]](_0xa5a2[42],_0x16bcx18)}})[_0xa5a2[41]](function(){_0x16bcxb= setTimeout(function(){_0x16bcxe+= _0x16bcxd[_0xa5a2[27]];_0x16bcx13()},_0x16bcx14* 1000)})[_0xa5a2[40]](function(_0x16bcx17){logger[_0xa5a2[39]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[38]);_0x16bcx9(_0x16bcx17)})}else {logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[59]);_0x16bcxb= setTimeout(function(){_0x16bcxe+= _0x16bcxd[_0xa5a2[27]];_0x16bcx13()},_0x16bcx14* 1000)}}else {return rpcClient[_0xa5a2[58]](_0xa5a2[69],[_0xa5a2[70],{leaveAt:moment()[_0xa5a2[37]](_0xa5a2[56]),timeout:true},{where:{uniqueid:_0x16bcx7[_0xa5a2[16]],leaveAt:null},individualHooks:true}])[_0xa5a2[41]](function(_0x16bcx1f){if(_0x16bcx1f&& _0x16bcx1f[_0xa5a2[28]]&& _0x16bcx1f[1][_0xa5a2[28]]){for(var _0x16bcx1b=0;_0x16bcx1b< _0x16bcx1f[1][_0xa5a2[28]];_0x16bcx1b++){var _0x16bcx20=_0x16bcx1f[1][_0x16bcx1b];_0x16bcx8[_0xa5a2[46]](_0xa5a2[67])[_0xa5a2[43]](_0xa5a2[66],_0x16bcx20);_0x16bcx8[_0xa5a2[46]](_0xa5a2[68])[_0xa5a2[43]](_0xa5a2[66],_0x16bcx20)}}})[_0xa5a2[41]](function(){logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[65]);clearTimeout(_0x16bcxb);_0x16bcx9()})[_0xa5a2[40]](function(_0x16bcx17){logger[_0xa5a2[39]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[38]);_0x16bcx9(_0x16bcx17)})}}function _0x16bcx21(){var _0x16bcx14=((_0x16bcx6[_0xa5a2[27]]- _0x16bcxe)> _0x16bcxd[_0xa5a2[27]])?_0x16bcxd[_0xa5a2[27]]:(_0x16bcx6[_0xa5a2[27]]- _0x16bcxe);if(_0x16bcx14> 0){var _0x16bcx15;return rpcClient[_0xa5a2[58]](_0xa5a2[63],[_0xa5a2[64]])[_0xa5a2[41]](function(_0x16bcx7){_0x16bcx15= _[_0xa5a2[60]](_0x16bcx7,_0xa5a2[21]);return rpcClient[_0xa5a2[58]](_0xa5a2[77],[_0xa5a2[78],{where:{id:_0x16bcx6[_0xa5a2[79]]},attributes:[_0xa5a2[21],_0xa5a2[12],_0xa5a2[27],_0xa5a2[14],_0xa5a2[80]],include:[{model:_0xa5a2[62],where:{online:true,chatPause:false},attributes:[_0xa5a2[21],_0xa5a2[12],_0xa5a2[31],_0xa5a2[32],_0xa5a2[33],_0xa5a2[34]],raw:true}]}])})[_0xa5a2[41]](function(_0x16bcx23){if(_0x16bcx23){var _0x16bcx24=_[_0xa5a2[73]](_[_0xa5a2[72]](_0x16bcx23.Users,_0xa5a2[71]));if(_0x16bcx24&& _0x16bcx24[_0xa5a2[28]]){var _0x16bcx25;for(var _0x16bcx1b=0;_0x16bcx1b< _0x16bcx24[_0xa5a2[28]];_0x16bcx1b++){_[_0xa5a2[74]](_0x16bcx24[_0x16bcx1b],function(_0x16bcx11){var _0x16bcx1c=false;if(_0x16bcx11[_0xa5a2[34]]> 0){if(_0x16bcx15[_0x16bcx11[_0xa5a2[21]]]&& _0x16bcx15[_0x16bcx11[_0xa5a2[21]]][_0xa5a2[48]](_0xa5a2[47])&& _0x16bcx15[_0x16bcx11[_0xa5a2[21]]][_0xa5a2[47]]>= _0x16bcx11[_0xa5a2[34]]){_0x16bcx1c= true}};return _0x16bcx10(_0x16bcx11)|| _0x16bcx1c});if(_0x16bcx24[_0x16bcx1b][_0xa5a2[28]]){_0x16bcx25= _0x16bcx24[_0x16bcx1b];break}};if(_0x16bcx25&& _0x16bcx25[_0xa5a2[28]]){var _0x16bcx26=_[_0xa5a2[29]](_0x16bcx25,function(_0x16bcx11){return _[_0xa5a2[75]](_[_0xa5a2[57]](_0x16bcx7,{timeslot:_0x16bcx14,application:_0xa5a2[55],membername:_0x16bcx11[_0xa5a2[12]],memberid:_0x16bcx11[_0xa5a2[21]],queue:_0x16bcxd[_0xa5a2[21]],queuename:_0x16bcxd[_0xa5a2[12]],calledAt:moment()[_0xa5a2[37]](_0xa5a2[56])}))});var _0x16bcx27=[];for(var _0x16bcx28=0;_0x16bcx28< _0x16bcx26[_0xa5a2[28]];_0x16bcx28++){_0x16bcx27[_0xa5a2[22]](rpcClient[_0xa5a2[58]](_0xa5a2[53],[_0xa5a2[54],_0x16bcx26[_0x16bcx28]]))};return Promise[_0xa5a2[76]](_0x16bcx27)}else {logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[59])}}else {logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[59])}}else {logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[59])}})[_0xa5a2[41]](function(_0x16bcx22){if(_0x16bcx22&& _0x16bcx22[_0xa5a2[28]]){for(var _0x16bcx1b=0;_0x16bcx1b< _0x16bcx22[_0xa5a2[28]];_0x16bcx1b++){var _0x16bcx18=_0x16bcx22[_0x16bcx1b];_0x16bcx8[_0xa5a2[46]](util[_0xa5a2[37]](_0xa5a2[44],_0x16bcx18[_0xa5a2[45]]))[_0xa5a2[43]](_0xa5a2[42],_0x16bcx18)}};_0x16bcxb= setTimeout(function(){_0x16bcxe+= _0x16bcxd[_0xa5a2[27]];_0x16bcx21()},_0x16bcx14* 1000)})[_0xa5a2[40]](function(_0x16bcx17){logger[_0xa5a2[39]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[38]);_0x16bcx9(_0x16bcx17)})}else {return rpcClient[_0xa5a2[58]](_0xa5a2[69],[_0xa5a2[70],{leaveAt:moment()[_0xa5a2[37]](_0xa5a2[56]),timeout:true},{where:{uniqueid:_0x16bcx7[_0xa5a2[16]],leaveAt:null},individualHooks:true}])[_0xa5a2[41]](function(_0x16bcx1f){if(_0x16bcx1f&& _0x16bcx1f[_0xa5a2[28]]&& _0x16bcx1f[1][_0xa5a2[28]]){for(var _0x16bcx1b=0;_0x16bcx1b< _0x16bcx1f[1][_0xa5a2[28]];_0x16bcx1b++){var _0x16bcx20=_0x16bcx1f[1][_0x16bcx1b];_0x16bcx8[_0xa5a2[46]](_0xa5a2[67])[_0xa5a2[43]](_0xa5a2[66],_0x16bcx20);_0x16bcx8[_0xa5a2[46]](_0xa5a2[68])[_0xa5a2[43]](_0xa5a2[66],_0x16bcx20)}};logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[65]);clearTimeout(_0x16bcxb);_0x16bcx9();return Promise[_0xa5a2[81]]()})[_0xa5a2[40]](function(_0x16bcx17){logger[_0xa5a2[39]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[38]);_0x16bcx9(_0x16bcx17);return Promise[_0xa5a2[23]](_0x16bcx17)})}}return rpcClient[_0xa5a2[58]](_0xa5a2[77],[_0xa5a2[78],{where:{id:_0x16bcx6[_0xa5a2[79]]},attributes:[_0xa5a2[21],_0xa5a2[12],_0xa5a2[27],_0xa5a2[14],_0xa5a2[80]],include:[{model:_0xa5a2[62],attributes:[_0xa5a2[21]]}]}])[_0xa5a2[41]](function(_0x16bcx23){_0x16bcxd= _0x16bcx23;logger[_0xa5a2[20]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[90],_0x16bcx6[_0xa5a2[27]],_0xa5a2[91]);return rpcClient[_0xa5a2[58]](_0xa5a2[53],[_0xa5a2[70],_[_0xa5a2[57]](_0x16bcx7,{timeslot:_0x16bcx6[_0xa5a2[27]],application:_0xa5a2[55],queue:_0x16bcx23[_0xa5a2[21]],queuename:_0x16bcx23[_0xa5a2[12]],calledAt:moment()[_0xa5a2[37]](_0xa5a2[56]),joinAt:moment()[_0xa5a2[37]](_0xa5a2[56]),membername:null,memberid:null})])})[_0xa5a2[41]](function(_0x16bcx20){_0x16bcx8[_0xa5a2[46]](_0xa5a2[67])[_0xa5a2[43]](_0xa5a2[66],_0x16bcx20);_0x16bcx8[_0xa5a2[46]](_0xa5a2[68])[_0xa5a2[43]](_0xa5a2[66],_0x16bcx20);return rpcClient[_0xa5a2[58]](_0xa5a2[69],[_0xa5a2[30],{waiting:true},{where:{id:_0x16bcx7[_0xa5a2[89]]}}])})[_0xa5a2[41]](function(_0x16bcx29){if(_0x16bcx29){_0x16bcx8[_0xa5a2[43]](_0xa5a2[88],_0x16bcx29)}})[_0xa5a2[41]](function(_0x16bcx29){switch(_0x16bcxd[_0xa5a2[14]]){case _0xa5a2[82]:_0x16bcx21();break;case _0xa5a2[86]:_0x16bcxc= _[_0xa5a2[85]](_0x16bcxd.Users,[function(_0x16bcx2a){return _0x16bcx2a[_0xa5a2[84]][_0xa5a2[83]]|| 0}]);_0x16bcx13();break;case _0xa5a2[87]:_0x16bcxc= _[_0xa5a2[85]](_0x16bcxd.Users,[function(_0x16bcx2a){return _0x16bcx2a[_0xa5a2[84]][_0xa5a2[83]]|| 0}]);_0x16bcx13();break;default:};return Promise[_0xa5a2[81]]()})[_0xa5a2[40]](function(_0x16bcx17){logger[_0xa5a2[39]](_0x16bcx7[_0xa5a2[10]][_0xa5a2[9]](),_0xa5a2[11],_0x16bcxd[_0xa5a2[12]][_0xa5a2[9]](),_0xa5a2[13],_0x16bcxd[_0xa5a2[14]],_0xa5a2[15],_0x16bcx7[_0xa5a2[16]],_0xa5a2[38]);logger[_0xa5a2[39]](_0x16bcx17);_0x16bcx9(_0x16bcx17)})}