Built motion from commit 76eb00b9e.|1.0.24
[motion.git] / server / config / forked_routing / sms / queue.js
index edde342..fa9984c 100644 (file)
@@ -1 +1 @@
-var _0xee2f=["\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","\x73\x6D\x73","\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","\x53\x6D\x73\x52\x6F\x6F\x6D","\x53\x6D\x73\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E","\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","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x73\x6D\x73\x50\x61\x75\x73\x65","\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","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\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","\x67\x65\x74","\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","\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","\x63\x72\x65\x61\x74\x65","\x4E\x4F\x20\x41\x56\x41\x49\x4C\x41\x42\x4C\x45\x20\x41\x47\x45\x4E\x54\x53","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\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\x53\x29","\x75\x70\x64\x61\x74\x65","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\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","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x6C\x61\x73\x74\x41\x67\x65\x6E\x74","\x66\x69\x6E\x64\x42\x79\x49\x64","\x62\x65\x65\x70\x61\x6C\x6C","\x70\x65\x6E\x61\x6C\x74\x79","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\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","\x73\x6D\x73\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"];_0xee2f[0];var _=require(_0xee2f[1]);var util=require(_0xee2f[2]);var moment=require(_0xee2f[3]);var logger=require(_0xee2f[5])(_0xee2f[4]);var Agent=require(_0xee2f[7])[_0xee2f[6]];var Room=require(_0xee2f[7])[_0xee2f[8]];var Queue=require(_0xee2f[7])[_0xee2f[9]];var Report=require(_0xee2f[7])[_0xee2f[10]];var Session=require(_0xee2f[7])[_0xee2f[11]];module[_0xee2f[12]]= function(_0x8339xa,_0x8339xb,_0x8339xc,_0x8339xd,_0x8339xe){var _0x8339xf=[];var _0x8339x10;var _0x8339x11;var _0x8339x12;var _0x8339x13=0;process[_0xee2f[30]](_0xee2f[13],function(_0x8339xc){switch(_0x8339xc[_0xee2f[29]]){case _0xee2f[28]:logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[22],_0x8339xc[_0xee2f[23]],_0xee2f[24]);_0x8339xf[_0xee2f[27]]({id:_0x8339xc[_0xee2f[26]]});break;default:}});function _0x8339x14(_0x8339x15){var _0x8339x16=_[_0xee2f[31]](_0x8339xf,{id:_0x8339x15[_0xee2f[26]]});return _0x8339x16?true:false}function _0x8339x17(){var _0x8339x18=((_0x8339xa[_0xee2f[32]]- _0x8339x13)> _0x8339x12[_0xee2f[32]])?_0x8339x12[_0xee2f[32]]:(_0x8339xa[_0xee2f[32]]- _0x8339x13);if(_0x8339x18> 0){if(_0x8339x11[_0xee2f[33]]){var _0x8339x19={where:{id:{$in:_[_0xee2f[34]](_0x8339x11,_0xee2f[26])},online:true,smsPause:false},include:[{model:Room,attributes:[_0xee2f[26]],raw:true}],attributes:[_0xee2f[26],_0xee2f[17],_0xee2f[35],_0xee2f[36],_0xee2f[37]],order:[[{raw:util[_0xee2f[40]](_0xee2f[38],_[_0xee2f[34]](_0x8339x11,_0xee2f[26])[_0xee2f[39]]())}]]};Agent[_0xee2f[61]](_0x8339x19)[_0xee2f[45]](function(_0x8339x1c){if(_0x8339x1c[_0xee2f[33]]){var _0x8339x1d;for(var _0x8339x1e=0;_0x8339x1e< _0x8339x1c[_0xee2f[33]];_0x8339x1e++){var _0x8339x15=_0x8339x1c[_0x8339x1e][_0xee2f[51]]({plain:true});if(!_0x8339x14(_0x8339x15)){_0x8339x1d= _0x8339x15;break}};if(_0x8339x1d){logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[52],_0x8339x1d[_0xee2f[26]],_0x8339x1d[_0xee2f[17]]);var _0x8339x1f=_[_0xee2f[53]](_0x8339x11,{"\x69\x64":_0x8339x1d[_0xee2f[26]]});if(_0x8339x1f>= 0){var _0x8339x20=_0x8339x11[_0xee2f[54]](_0x8339x1f,1);if(_0x8339x20&& _0x8339x20[_0xee2f[33]]){_0x8339x11[_0xee2f[27]](_[_0xee2f[55]](_0x8339x20))}};return Report[_0xee2f[59]](_[_0xee2f[58]](_0x8339xb,{timeslot:_0x8339x18,application:_0xee2f[56],membername:_0x8339x1d[_0xee2f[17]],memberid:_0x8339x1d[_0xee2f[26]],queue:_0x8339x12[_0xee2f[26]],queuename:_0x8339x12[_0xee2f[17]],calledAt:moment()[_0xee2f[40]](_0xee2f[57])}))};logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[60]);return}else {logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[60]);return}})[_0xee2f[45]](function(_0x8339x1b){if(_0x8339x1b){_0x8339xd[_0xee2f[50]](util[_0xee2f[40]](_0xee2f[48],_0x8339x1b[_0xee2f[49]]))[_0xee2f[47]](_0xee2f[46],_0x8339x1b)}})[_0xee2f[45]](function(){_0x8339x10= setTimeout(function(){_0x8339x13+= _0x8339x12[_0xee2f[32]];_0x8339x17()},_0x8339x18* 1000)})[_0xee2f[44]](function(_0x8339x1a){logger[_0xee2f[42]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[41]);logger[_0xee2f[42]](_0x8339x1a[_0xee2f[43]]);_0x8339xe(_0x8339x1a)})}else {logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[60]);_0x8339x10= setTimeout(function(){_0x8339x13+= _0x8339x12[_0xee2f[32]];_0x8339x17()},_0x8339x18* 1000)}}else {return Session[_0xee2f[66]]({leaveAt:moment()[_0xee2f[40]](_0xee2f[57]),timeout:true},{where:{uniqueid:_0x8339xb[_0xee2f[21]],leaveAt:null},individualHooks:true})[_0xee2f[45]](function(_0x8339x21){if(_0x8339x21&& _0x8339x21[_0xee2f[33]]&& _0x8339x21[1][_0xee2f[33]]){for(var _0x8339x1e=0;_0x8339x1e< _0x8339x21[1][_0xee2f[33]];_0x8339x1e++){var _0x8339x22=_0x8339x21[1][_0x8339x1e][_0xee2f[51]]({plain:true});_0x8339xd[_0xee2f[50]](_0xee2f[63])[_0xee2f[47]](_0xee2f[62],_0x8339x22);_0x8339xd[_0xee2f[50]](_0xee2f[64])[_0xee2f[47]](_0xee2f[62],_0x8339x22)}};logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[65]);clearTimeout(_0x8339x10);_0x8339xe()})[_0xee2f[44]](function(_0x8339x1a){logger[_0xee2f[42]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[41]);logger[_0xee2f[42]](_0x8339x1a[_0xee2f[43]]);_0x8339xe(_0x8339x1a)})}}function _0x8339x23(){var _0x8339x18=((_0x8339xa[_0xee2f[32]]- _0x8339x13)> _0x8339x12[_0xee2f[32]])?_0x8339x12[_0xee2f[32]]:(_0x8339xa[_0xee2f[32]]- _0x8339x13);if(_0x8339x18> 0){Queue[_0xee2f[74]](_0x8339xa.SmsQueueId,{attributes:[_0xee2f[26],_0xee2f[17],_0xee2f[32],_0xee2f[19],_0xee2f[73]],include:[{model:Agent,where:{online:true,smsPause:false},attributes:[_0xee2f[26],_0xee2f[17],_0xee2f[35],_0xee2f[36],_0xee2f[37]],raw:true}]})[_0xee2f[45]](function(_0x8339x25){if(_0x8339x25){var _0x8339x1c=_[_0xee2f[69]](_[_0xee2f[68]](_0x8339x25.Users,_0xee2f[67]));if(_0x8339x1c&& _0x8339x1c[_0xee2f[33]]){var _0x8339x26;for(var _0x8339x1e=0;_0x8339x1e< _0x8339x1c[_0xee2f[33]];_0x8339x1e++){_[_0xee2f[70]](_0x8339x1c[_0x8339x1e],function(_0x8339x15){return _0x8339x14(_0x8339x15)});if(_0x8339x1c[_0x8339x1e][_0xee2f[33]]){_0x8339x26= _0x8339x1c[_0x8339x1e];break}};if(_0x8339x26&& _0x8339x26[_0xee2f[33]]){var _0x8339x27=_[_0xee2f[34]](_0x8339x26,function(_0x8339x15){return _[_0xee2f[71]](_[_0xee2f[58]](_0x8339xb,{timeslot:_0x8339x18,application:_0xee2f[56],membername:_0x8339x15[_0xee2f[17]],memberid:_0x8339x15[_0xee2f[26]],queue:_0x8339x12[_0xee2f[26]],queuename:_0x8339x12[_0xee2f[17]],calledAt:moment()[_0xee2f[40]](_0xee2f[57])}))});return Report[_0xee2f[72]](_0x8339x27,{individualHooks:true})}else {logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[60])}}else {logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[60])}}else {logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[60])}})[_0xee2f[45]](function(_0x8339x24){if(_0x8339x24&& _0x8339x24[_0xee2f[33]]){for(var _0x8339x1e=0;_0x8339x1e< _0x8339x24[_0xee2f[33]];_0x8339x1e++){var _0x8339x1b=_0x8339x24[_0x8339x1e][_0xee2f[51]]({plain:true});_0x8339xd[_0xee2f[50]](util[_0xee2f[40]](_0xee2f[48],_0x8339x1b[_0xee2f[49]]))[_0xee2f[47]](_0xee2f[46],_0x8339x1b)}};_0x8339x10= setTimeout(function(){_0x8339x13+= _0x8339x12[_0xee2f[32]];_0x8339x23()},_0x8339x18* 1000)})[_0xee2f[44]](function(_0x8339x1a){logger[_0xee2f[42]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[41]);logger[_0xee2f[42]](_0x8339x1a[_0xee2f[43]]);_0x8339xe(_0x8339x1a)})}else {return Session[_0xee2f[66]]({leaveAt:moment()[_0xee2f[40]](_0xee2f[57]),timeout:true},{where:{uniqueid:_0x8339xb[_0xee2f[21]],leaveAt:null},individualHooks:true})[_0xee2f[45]](function(_0x8339x21){if(_0x8339x21&& _0x8339x21[_0xee2f[33]]&& _0x8339x21[1][_0xee2f[33]]){for(var _0x8339x1e=0;_0x8339x1e< _0x8339x21[1][_0xee2f[33]];_0x8339x1e++){var _0x8339x22=_0x8339x21[1][_0x8339x1e][_0xee2f[51]]({plain:true});_0x8339xd[_0xee2f[50]](_0xee2f[63])[_0xee2f[47]](_0xee2f[62],_0x8339x22);_0x8339xd[_0xee2f[50]](_0xee2f[64])[_0xee2f[47]](_0xee2f[62],_0x8339x22)}};logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[65]);clearTimeout(_0x8339x10);_0x8339xe()})[_0xee2f[44]](function(_0x8339x1a){logger[_0xee2f[42]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[41]);logger[_0xee2f[42]](_0x8339x1a[_0xee2f[43]]);_0x8339xe(_0x8339x1a)})}}return Queue[_0xee2f[74]](_0x8339xa.SmsQueueId,{attributes:[_0xee2f[26],_0xee2f[17],_0xee2f[32],_0xee2f[19],_0xee2f[73]],include:[{model:Agent,attributes:[_0xee2f[26]],raw:true}]})[_0xee2f[45]](function(_0x8339x25){_0x8339x12= _0x8339x25[_0xee2f[51]]({plain:true});logger[_0xee2f[25]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[83],_0x8339xa[_0xee2f[32]],_0xee2f[84]);return Session[_0xee2f[59]](_[_0xee2f[58]](_0x8339xb,{timeslot:_0x8339xa[_0xee2f[32]],application:_0xee2f[56],queue:_0x8339x25[_0xee2f[26]],queuename:_0x8339x25[_0xee2f[17]],calledAt:moment()[_0xee2f[40]](_0xee2f[57]),joinAt:moment()[_0xee2f[40]](_0xee2f[57]),membername:null,memberid:null}))})[_0xee2f[45]](function(_0x8339x22){_0x8339xd[_0xee2f[50]](_0xee2f[63])[_0xee2f[47]](_0xee2f[62],_0x8339x22);_0x8339xd[_0xee2f[50]](_0xee2f[64])[_0xee2f[47]](_0xee2f[62],_0x8339x22);return Room[_0xee2f[74]](_0x8339xb[_0xee2f[82]])})[_0xee2f[45]](function(_0x8339x28){if(_0x8339x28){return _0x8339x28[_0xee2f[66]]({waiting:true})}})[_0xee2f[45]](function(_0x8339x28){if(_0x8339x28){_0x8339xd[_0xee2f[47]](_0xee2f[81],_0x8339x28[_0xee2f[51]]({plain:true}))}})[_0xee2f[45]](function(_0x8339x28){switch(_0x8339x12[_0xee2f[19]]){case _0xee2f[75]:_0x8339x23();break;case _0xee2f[79]:_0x8339x11= _[_0xee2f[78]](_0x8339x12.Users,[function(_0x8339x29){return _0x8339x29[_0xee2f[77]][_0xee2f[76]]|| 0}]);_0x8339x17();break;case _0xee2f[80]:_0x8339x11= _[_0xee2f[78]](_0x8339x12.Users,[function(_0x8339x29){return _0x8339x29[_0xee2f[77]][_0xee2f[76]]|| 0}]);_0x8339x17();break;default:}})[_0xee2f[44]](function(_0x8339x1a){logger[_0xee2f[42]](_0x8339xb[_0xee2f[15]][_0xee2f[14]](),_0xee2f[16],_0x8339x12[_0xee2f[17]][_0xee2f[14]](),_0xee2f[18],_0x8339x12[_0xee2f[19]],_0xee2f[20],_0x8339xb[_0xee2f[21]],_0xee2f[41]);logger[_0xee2f[42]](_0x8339x1a[_0xee2f[43]]);_0x8339xe(_0x8339x1a)})}
\ No newline at end of file
+var _0xa4c6=["\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","\x73\x6D\x73","\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","\x53\x6D\x73\x52\x6F\x6F\x6D","\x53\x6D\x73\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E","\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","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x73\x6D\x73\x50\x61\x75\x73\x65","\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","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\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","\x67\x65\x74","\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","\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","\x63\x72\x65\x61\x74\x65","\x4E\x4F\x20\x41\x56\x41\x49\x4C\x41\x42\x4C\x45\x20\x41\x47\x45\x4E\x54\x53","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\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\x53\x29","\x75\x70\x64\x61\x74\x65","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\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","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x6C\x61\x73\x74\x41\x67\x65\x6E\x74","\x66\x69\x6E\x64\x42\x79\x49\x64","\x62\x65\x65\x70\x61\x6C\x6C","\x70\x65\x6E\x61\x6C\x74\x79","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\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","\x73\x6D\x73\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"];_0xa4c6[0];var _=require(_0xa4c6[1]);var util=require(_0xa4c6[2]);var moment=require(_0xa4c6[3]);var logger=require(_0xa4c6[5])(_0xa4c6[4]);var Agent=require(_0xa4c6[7])[_0xa4c6[6]];var Room=require(_0xa4c6[7])[_0xa4c6[8]];var Queue=require(_0xa4c6[7])[_0xa4c6[9]];var Report=require(_0xa4c6[7])[_0xa4c6[10]];var Session=require(_0xa4c6[7])[_0xa4c6[11]];module[_0xa4c6[12]]= function(_0xcc29xa,_0xcc29xb,_0xcc29xc,_0xcc29xd,_0xcc29xe){var _0xcc29xf=[];var _0xcc29x10;var _0xcc29x11;var _0xcc29x12;var _0xcc29x13=0;process[_0xa4c6[30]](_0xa4c6[13],function(_0xcc29xc){switch(_0xcc29xc[_0xa4c6[29]]){case _0xa4c6[28]:logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[22],_0xcc29xc[_0xa4c6[23]],_0xa4c6[24]);_0xcc29xf[_0xa4c6[27]]({id:_0xcc29xc[_0xa4c6[26]]});break;default:}});function _0xcc29x14(_0xcc29x15){var _0xcc29x16=_[_0xa4c6[31]](_0xcc29xf,{id:_0xcc29x15[_0xa4c6[26]]});return _0xcc29x16?true:false}function _0xcc29x17(){var _0xcc29x18=((_0xcc29xa[_0xa4c6[32]]- _0xcc29x13)> _0xcc29x12[_0xa4c6[32]])?_0xcc29x12[_0xa4c6[32]]:(_0xcc29xa[_0xa4c6[32]]- _0xcc29x13);if(_0xcc29x18> 0){if(_0xcc29x11[_0xa4c6[33]]){var _0xcc29x19={where:{id:{$in:_[_0xa4c6[34]](_0xcc29x11,_0xa4c6[26])},online:true,smsPause:false},include:[{model:Room,attributes:[_0xa4c6[26]],raw:true}],attributes:[_0xa4c6[26],_0xa4c6[17],_0xa4c6[35],_0xa4c6[36],_0xa4c6[37]],order:[[{raw:util[_0xa4c6[40]](_0xa4c6[38],_[_0xa4c6[34]](_0xcc29x11,_0xa4c6[26])[_0xa4c6[39]]())}]]};Agent[_0xa4c6[61]](_0xcc29x19)[_0xa4c6[45]](function(_0xcc29x1c){if(_0xcc29x1c[_0xa4c6[33]]){var _0xcc29x1d;for(var _0xcc29x1e=0;_0xcc29x1e< _0xcc29x1c[_0xa4c6[33]];_0xcc29x1e++){var _0xcc29x15=_0xcc29x1c[_0xcc29x1e][_0xa4c6[51]]({plain:true});if(!_0xcc29x14(_0xcc29x15)){_0xcc29x1d= _0xcc29x15;break}};if(_0xcc29x1d){logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[52],_0xcc29x1d[_0xa4c6[26]],_0xcc29x1d[_0xa4c6[17]]);var _0xcc29x1f=_[_0xa4c6[53]](_0xcc29x11,{"\x69\x64":_0xcc29x1d[_0xa4c6[26]]});if(_0xcc29x1f>= 0){var _0xcc29x20=_0xcc29x11[_0xa4c6[54]](_0xcc29x1f,1);if(_0xcc29x20&& _0xcc29x20[_0xa4c6[33]]){_0xcc29x11[_0xa4c6[27]](_[_0xa4c6[55]](_0xcc29x20))}};return Report[_0xa4c6[59]](_[_0xa4c6[58]](_0xcc29xb,{timeslot:_0xcc29x18,application:_0xa4c6[56],membername:_0xcc29x1d[_0xa4c6[17]],memberid:_0xcc29x1d[_0xa4c6[26]],queue:_0xcc29x12[_0xa4c6[26]],queuename:_0xcc29x12[_0xa4c6[17]],calledAt:moment()[_0xa4c6[40]](_0xa4c6[57])}))};logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[60]);return}else {logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[60]);return}})[_0xa4c6[45]](function(_0xcc29x1b){if(_0xcc29x1b){_0xcc29xd[_0xa4c6[50]](util[_0xa4c6[40]](_0xa4c6[48],_0xcc29x1b[_0xa4c6[49]]))[_0xa4c6[47]](_0xa4c6[46],_0xcc29x1b)}})[_0xa4c6[45]](function(){_0xcc29x10= setTimeout(function(){_0xcc29x13+= _0xcc29x12[_0xa4c6[32]];_0xcc29x17()},_0xcc29x18* 1000)})[_0xa4c6[44]](function(_0xcc29x1a){logger[_0xa4c6[42]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[41]);logger[_0xa4c6[42]](_0xcc29x1a[_0xa4c6[43]]);_0xcc29xe(_0xcc29x1a)})}else {logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[60]);_0xcc29x10= setTimeout(function(){_0xcc29x13+= _0xcc29x12[_0xa4c6[32]];_0xcc29x17()},_0xcc29x18* 1000)}}else {return Session[_0xa4c6[66]]({leaveAt:moment()[_0xa4c6[40]](_0xa4c6[57]),timeout:true},{where:{uniqueid:_0xcc29xb[_0xa4c6[21]],leaveAt:null},individualHooks:true})[_0xa4c6[45]](function(_0xcc29x21){if(_0xcc29x21&& _0xcc29x21[_0xa4c6[33]]&& _0xcc29x21[1][_0xa4c6[33]]){for(var _0xcc29x1e=0;_0xcc29x1e< _0xcc29x21[1][_0xa4c6[33]];_0xcc29x1e++){var _0xcc29x22=_0xcc29x21[1][_0xcc29x1e][_0xa4c6[51]]({plain:true});_0xcc29xd[_0xa4c6[50]](_0xa4c6[63])[_0xa4c6[47]](_0xa4c6[62],_0xcc29x22);_0xcc29xd[_0xa4c6[50]](_0xa4c6[64])[_0xa4c6[47]](_0xa4c6[62],_0xcc29x22)}};logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[65]);clearTimeout(_0xcc29x10);_0xcc29xe()})[_0xa4c6[44]](function(_0xcc29x1a){logger[_0xa4c6[42]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[41]);logger[_0xa4c6[42]](_0xcc29x1a[_0xa4c6[43]]);_0xcc29xe(_0xcc29x1a)})}}function _0xcc29x23(){var _0xcc29x18=((_0xcc29xa[_0xa4c6[32]]- _0xcc29x13)> _0xcc29x12[_0xa4c6[32]])?_0xcc29x12[_0xa4c6[32]]:(_0xcc29xa[_0xa4c6[32]]- _0xcc29x13);if(_0xcc29x18> 0){Queue[_0xa4c6[74]](_0xcc29xa.SmsQueueId,{attributes:[_0xa4c6[26],_0xa4c6[17],_0xa4c6[32],_0xa4c6[19],_0xa4c6[73]],include:[{model:Agent,where:{online:true,smsPause:false},attributes:[_0xa4c6[26],_0xa4c6[17],_0xa4c6[35],_0xa4c6[36],_0xa4c6[37]],raw:true}]})[_0xa4c6[45]](function(_0xcc29x25){if(_0xcc29x25){var _0xcc29x1c=_[_0xa4c6[69]](_[_0xa4c6[68]](_0xcc29x25.Users,_0xa4c6[67]));if(_0xcc29x1c&& _0xcc29x1c[_0xa4c6[33]]){var _0xcc29x26;for(var _0xcc29x1e=0;_0xcc29x1e< _0xcc29x1c[_0xa4c6[33]];_0xcc29x1e++){_[_0xa4c6[70]](_0xcc29x1c[_0xcc29x1e],function(_0xcc29x15){return _0xcc29x14(_0xcc29x15)});if(_0xcc29x1c[_0xcc29x1e][_0xa4c6[33]]){_0xcc29x26= _0xcc29x1c[_0xcc29x1e];break}};if(_0xcc29x26&& _0xcc29x26[_0xa4c6[33]]){var _0xcc29x27=_[_0xa4c6[34]](_0xcc29x26,function(_0xcc29x15){return _[_0xa4c6[71]](_[_0xa4c6[58]](_0xcc29xb,{timeslot:_0xcc29x18,application:_0xa4c6[56],membername:_0xcc29x15[_0xa4c6[17]],memberid:_0xcc29x15[_0xa4c6[26]],queue:_0xcc29x12[_0xa4c6[26]],queuename:_0xcc29x12[_0xa4c6[17]],calledAt:moment()[_0xa4c6[40]](_0xa4c6[57])}))});return Report[_0xa4c6[72]](_0xcc29x27,{individualHooks:true})}else {logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[60])}}else {logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[60])}}else {logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[60])}})[_0xa4c6[45]](function(_0xcc29x24){if(_0xcc29x24&& _0xcc29x24[_0xa4c6[33]]){for(var _0xcc29x1e=0;_0xcc29x1e< _0xcc29x24[_0xa4c6[33]];_0xcc29x1e++){var _0xcc29x1b=_0xcc29x24[_0xcc29x1e][_0xa4c6[51]]({plain:true});_0xcc29xd[_0xa4c6[50]](util[_0xa4c6[40]](_0xa4c6[48],_0xcc29x1b[_0xa4c6[49]]))[_0xa4c6[47]](_0xa4c6[46],_0xcc29x1b)}};_0xcc29x10= setTimeout(function(){_0xcc29x13+= _0xcc29x12[_0xa4c6[32]];_0xcc29x23()},_0xcc29x18* 1000)})[_0xa4c6[44]](function(_0xcc29x1a){logger[_0xa4c6[42]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[41]);logger[_0xa4c6[42]](_0xcc29x1a[_0xa4c6[43]]);_0xcc29xe(_0xcc29x1a)})}else {return Session[_0xa4c6[66]]({leaveAt:moment()[_0xa4c6[40]](_0xa4c6[57]),timeout:true},{where:{uniqueid:_0xcc29xb[_0xa4c6[21]],leaveAt:null},individualHooks:true})[_0xa4c6[45]](function(_0xcc29x21){if(_0xcc29x21&& _0xcc29x21[_0xa4c6[33]]&& _0xcc29x21[1][_0xa4c6[33]]){for(var _0xcc29x1e=0;_0xcc29x1e< _0xcc29x21[1][_0xa4c6[33]];_0xcc29x1e++){var _0xcc29x22=_0xcc29x21[1][_0xcc29x1e][_0xa4c6[51]]({plain:true});_0xcc29xd[_0xa4c6[50]](_0xa4c6[63])[_0xa4c6[47]](_0xa4c6[62],_0xcc29x22);_0xcc29xd[_0xa4c6[50]](_0xa4c6[64])[_0xa4c6[47]](_0xa4c6[62],_0xcc29x22)}};logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[65]);clearTimeout(_0xcc29x10);_0xcc29xe()})[_0xa4c6[44]](function(_0xcc29x1a){logger[_0xa4c6[42]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[41]);logger[_0xa4c6[42]](_0xcc29x1a[_0xa4c6[43]]);_0xcc29xe(_0xcc29x1a)})}}return Queue[_0xa4c6[74]](_0xcc29xa.SmsQueueId,{attributes:[_0xa4c6[26],_0xa4c6[17],_0xa4c6[32],_0xa4c6[19],_0xa4c6[73]],include:[{model:Agent,attributes:[_0xa4c6[26]],raw:true}]})[_0xa4c6[45]](function(_0xcc29x25){_0xcc29x12= _0xcc29x25[_0xa4c6[51]]({plain:true});logger[_0xa4c6[25]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[83],_0xcc29xa[_0xa4c6[32]],_0xa4c6[84]);return Session[_0xa4c6[59]](_[_0xa4c6[58]](_0xcc29xb,{timeslot:_0xcc29xa[_0xa4c6[32]],application:_0xa4c6[56],queue:_0xcc29x25[_0xa4c6[26]],queuename:_0xcc29x25[_0xa4c6[17]],calledAt:moment()[_0xa4c6[40]](_0xa4c6[57]),joinAt:moment()[_0xa4c6[40]](_0xa4c6[57]),membername:null,memberid:null}))})[_0xa4c6[45]](function(_0xcc29x22){_0xcc29xd[_0xa4c6[50]](_0xa4c6[63])[_0xa4c6[47]](_0xa4c6[62],_0xcc29x22);_0xcc29xd[_0xa4c6[50]](_0xa4c6[64])[_0xa4c6[47]](_0xa4c6[62],_0xcc29x22);return Room[_0xa4c6[74]](_0xcc29xb[_0xa4c6[82]])})[_0xa4c6[45]](function(_0xcc29x28){if(_0xcc29x28){return _0xcc29x28[_0xa4c6[66]]({waiting:true})}})[_0xa4c6[45]](function(_0xcc29x28){if(_0xcc29x28){_0xcc29xd[_0xa4c6[47]](_0xa4c6[81],_0xcc29x28[_0xa4c6[51]]({plain:true}))}})[_0xa4c6[45]](function(_0xcc29x28){switch(_0xcc29x12[_0xa4c6[19]]){case _0xa4c6[75]:_0xcc29x23();break;case _0xa4c6[79]:_0xcc29x11= _[_0xa4c6[78]](_0xcc29x12.Users,[function(_0xcc29x29){return _0xcc29x29[_0xa4c6[77]][_0xa4c6[76]]|| 0}]);_0xcc29x17();break;case _0xa4c6[80]:_0xcc29x11= _[_0xa4c6[78]](_0xcc29x12.Users,[function(_0xcc29x29){return _0xcc29x29[_0xa4c6[77]][_0xa4c6[76]]|| 0}]);_0xcc29x17();break;default:}})[_0xa4c6[44]](function(_0xcc29x1a){logger[_0xa4c6[42]](_0xcc29xb[_0xa4c6[15]][_0xa4c6[14]](),_0xa4c6[16],_0xcc29x12[_0xa4c6[17]][_0xa4c6[14]](),_0xa4c6[18],_0xcc29x12[_0xa4c6[19]],_0xa4c6[20],_0xcc29xb[_0xa4c6[21]],_0xa4c6[41]);logger[_0xa4c6[42]](_0xcc29x1a[_0xa4c6[43]]);_0xcc29xe(_0xcc29x1a)})}
\ No newline at end of file