Built motion from commit 420f8c692.|1.0.30
[motion.git] / server / config / forked_routing / fax / queue.js
index ff515ac..77eb537 100644 (file)
@@ -1 +1 @@
-var _0xafbe=["\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","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x46\x61\x78","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\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","\x66\x61\x78\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","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\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\x66\x61\x78\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\x46\x61\x78\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\x46\x61\x78\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","\x66\x61\x78\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"];_0xafbe[0];var _=require(_0xafbe[1]);var util=require(_0xafbe[2]);var moment=require(_0xafbe[3]);var Agent=require(_0xafbe[5])[_0xafbe[4]];var Room=require(_0xafbe[5])[_0xafbe[6]];var Queue=require(_0xafbe[5])[_0xafbe[7]];var Report=require(_0xafbe[5])[_0xafbe[8]];var Session=require(_0xafbe[5])[_0xafbe[9]];module[_0xafbe[10]]= function(_0x4056x9,_0x4056xa,_0x4056xb,_0x4056xc,_0x4056xd){var _0x4056xe=[];var _0x4056xf;var _0x4056x10;var _0x4056x11;var _0x4056x12=0;process[_0xafbe[28]](_0xafbe[11],function(_0x4056xb){switch(_0x4056xb[_0xafbe[27]]){case _0xafbe[26]:console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[20],_0x4056xb[_0xafbe[21]],_0xafbe[22]);_0x4056xe[_0xafbe[25]]({id:_0x4056xb[_0xafbe[24]]});break;default:}});function _0x4056x13(_0x4056x14){var _0x4056x15=_[_0xafbe[29]](_0x4056xe,{id:_0x4056x14[_0xafbe[24]]});return _0x4056x15?true:false}function _0x4056x16(){var _0x4056x17=((_0x4056x9[_0xafbe[30]]- _0x4056x12)> _0x4056x11[_0xafbe[30]])?_0x4056x11[_0xafbe[30]]:(_0x4056x9[_0xafbe[30]]- _0x4056x12);if(_0x4056x17> 0){if(_0x4056x10[_0xafbe[31]]){var _0x4056x18={where:{id:{$in:_[_0xafbe[32]](_0x4056x10,_0xafbe[24])},online:true,faxPause:false},include:[{model:Room,attributes:[_0xafbe[24]],raw:true}],attributes:[_0xafbe[24],_0xafbe[15],_0xafbe[33],_0xafbe[34],_0xafbe[35]],order:[[{raw:util[_0xafbe[38]](_0xafbe[36],_[_0xafbe[32]](_0x4056x10,_0xafbe[24])[_0xafbe[37]]())}]]};Agent[_0xafbe[58]](_0x4056x18)[_0xafbe[42]](function(_0x4056x1b){if(_0x4056x1b[_0xafbe[31]]){var _0x4056x1c;for(var _0x4056x1d=0;_0x4056x1d< _0x4056x1b[_0xafbe[31]];_0x4056x1d++){var _0x4056x14=_0x4056x1b[_0x4056x1d][_0xafbe[48]]({plain:true});if(!_0x4056x13(_0x4056x14)){_0x4056x1c= _0x4056x14;break}};if(_0x4056x1c){console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[49],_0x4056x1c[_0xafbe[24]],_0x4056x1c[_0xafbe[15]]);var _0x4056x1e=_[_0xafbe[50]](_0x4056x10,{"\x69\x64":_0x4056x1c[_0xafbe[24]]});if(_0x4056x1e>= 0){var _0x4056x1f=_0x4056x10[_0xafbe[51]](_0x4056x1e,1);if(_0x4056x1f&& _0x4056x1f[_0xafbe[31]]){_0x4056x10[_0xafbe[25]](_[_0xafbe[52]](_0x4056x1f))}};return Report[_0xafbe[56]](_[_0xafbe[55]](_0x4056xa,{timeslot:_0x4056x17,application:_0xafbe[53],membername:_0x4056x1c[_0xafbe[15]],memberid:_0x4056x1c[_0xafbe[24]],queue:_0x4056x11[_0xafbe[24]],queuename:_0x4056x11[_0xafbe[15]],calledAt:moment()[_0xafbe[38]](_0xafbe[54])}))};console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[57]);return}else {console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[57]);return}})[_0xafbe[42]](function(_0x4056x1a){if(_0x4056x1a){_0x4056xc[_0xafbe[47]](util[_0xafbe[38]](_0xafbe[45],_0x4056x1a[_0xafbe[46]]))[_0xafbe[44]](_0xafbe[43],_0x4056x1a)}})[_0xafbe[42]](function(){_0x4056xf= setTimeout(function(){_0x4056x12+= _0x4056x11[_0xafbe[30]];_0x4056x16()},_0x4056x17* 1000)})[_0xafbe[41]](function(_0x4056x19){console[_0xafbe[40]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[39]);_0x4056xd(_0x4056x19)})}else {console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[57]);_0x4056xf= setTimeout(function(){_0x4056x12+= _0x4056x11[_0xafbe[30]];_0x4056x16()},_0x4056x17* 1000)}}else {return Session[_0xafbe[63]]({leaveAt:moment()[_0xafbe[38]](_0xafbe[54]),timeout:true},{where:{uniqueid:_0x4056xa[_0xafbe[19]],leaveAt:null},individualHooks:true})[_0xafbe[42]](function(_0x4056x20){if(_0x4056x20&& _0x4056x20[_0xafbe[31]]&& _0x4056x20[1][_0xafbe[31]]){for(var _0x4056x1d=0;_0x4056x1d< _0x4056x20[1][_0xafbe[31]];_0x4056x1d++){var _0x4056x21=_0x4056x20[1][_0x4056x1d][_0xafbe[48]]({plain:true});_0x4056xc[_0xafbe[47]](_0xafbe[60])[_0xafbe[44]](_0xafbe[59],_0x4056x21);_0x4056xc[_0xafbe[47]](_0xafbe[61])[_0xafbe[44]](_0xafbe[59],_0x4056x21)}};console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[62]);clearTimeout(_0x4056xf);_0x4056xd()})[_0xafbe[41]](function(_0x4056x19){console[_0xafbe[40]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[39]);_0x4056xd(_0x4056x19)})}}function _0x4056x22(){var _0x4056x17=((_0x4056x9[_0xafbe[30]]- _0x4056x12)> _0x4056x11[_0xafbe[30]])?_0x4056x11[_0xafbe[30]]:(_0x4056x9[_0xafbe[30]]- _0x4056x12);if(_0x4056x17> 0){Queue[_0xafbe[71]](_0x4056x9.FaxQueueId,{attributes:[_0xafbe[24],_0xafbe[15],_0xafbe[30],_0xafbe[17],_0xafbe[70]],include:[{model:Agent,where:{online:true,faxPause:false},attributes:[_0xafbe[24],_0xafbe[15],_0xafbe[33],_0xafbe[34],_0xafbe[35]],raw:true}]})[_0xafbe[42]](function(_0x4056x24){if(_0x4056x24){var _0x4056x1b=_[_0xafbe[66]](_[_0xafbe[65]](_0x4056x24.Users,_0xafbe[64]));if(_0x4056x1b&& _0x4056x1b[_0xafbe[31]]){var _0x4056x25;for(var _0x4056x1d=0;_0x4056x1d< _0x4056x1b[_0xafbe[31]];_0x4056x1d++){_[_0xafbe[67]](_0x4056x1b[_0x4056x1d],function(_0x4056x14){return _0x4056x13(_0x4056x14)});if(_0x4056x1b[_0x4056x1d][_0xafbe[31]]){_0x4056x25= _0x4056x1b[_0x4056x1d];break}};if(_0x4056x25&& _0x4056x25[_0xafbe[31]]){var _0x4056x26=_[_0xafbe[32]](_0x4056x25,function(_0x4056x14){return _[_0xafbe[68]](_[_0xafbe[55]](_0x4056xa,{timeslot:_0x4056x17,application:_0xafbe[53],membername:_0x4056x14[_0xafbe[15]],memberid:_0x4056x14[_0xafbe[24]],queue:_0x4056x11[_0xafbe[24]],queuename:_0x4056x11[_0xafbe[15]],calledAt:moment()[_0xafbe[38]](_0xafbe[54])}))});return Report[_0xafbe[69]](_0x4056x26,{individualHooks:true})}else {console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[57])}}else {console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[57])}}else {console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[57])}})[_0xafbe[42]](function(_0x4056x23){if(_0x4056x23&& _0x4056x23[_0xafbe[31]]){for(var _0x4056x1d=0;_0x4056x1d< _0x4056x23[_0xafbe[31]];_0x4056x1d++){var _0x4056x1a=_0x4056x23[_0x4056x1d][_0xafbe[48]]({plain:true});_0x4056xc[_0xafbe[47]](util[_0xafbe[38]](_0xafbe[45],_0x4056x1a[_0xafbe[46]]))[_0xafbe[44]](_0xafbe[43],_0x4056x1a)}};_0x4056xf= setTimeout(function(){_0x4056x12+= _0x4056x11[_0xafbe[30]];_0x4056x22()},_0x4056x17* 1000)})[_0xafbe[41]](function(_0x4056x19){console[_0xafbe[40]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[39]);_0x4056xd(_0x4056x19)})}else {return Session[_0xafbe[63]]({leaveAt:moment()[_0xafbe[38]](_0xafbe[54]),timeout:true},{where:{uniqueid:_0x4056xa[_0xafbe[19]],leaveAt:null},individualHooks:true})[_0xafbe[42]](function(_0x4056x20){if(_0x4056x20&& _0x4056x20[_0xafbe[31]]&& _0x4056x20[1][_0xafbe[31]]){for(var _0x4056x1d=0;_0x4056x1d< _0x4056x20[1][_0xafbe[31]];_0x4056x1d++){var _0x4056x21=_0x4056x20[1][_0x4056x1d][_0xafbe[48]]({plain:true});_0x4056xc[_0xafbe[47]](_0xafbe[60])[_0xafbe[44]](_0xafbe[59],_0x4056x21);_0x4056xc[_0xafbe[47]](_0xafbe[61])[_0xafbe[44]](_0xafbe[59],_0x4056x21)}};console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[62]);clearTimeout(_0x4056xf);_0x4056xd()})[_0xafbe[41]](function(_0x4056x19){console[_0xafbe[40]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[39]);_0x4056xd(_0x4056x19)})}}return Queue[_0xafbe[71]](_0x4056x9.FaxQueueId,{attributes:[_0xafbe[24],_0xafbe[15],_0xafbe[30],_0xafbe[17],_0xafbe[70]],include:[{model:Agent,attributes:[_0xafbe[24]],raw:true}]})[_0xafbe[42]](function(_0x4056x24){_0x4056x11= _0x4056x24[_0xafbe[48]]({plain:true});console[_0xafbe[23]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[80],_0x4056x9[_0xafbe[30]],_0xafbe[81]);return Session[_0xafbe[56]](_[_0xafbe[55]](_0x4056xa,{timeslot:_0x4056x9[_0xafbe[30]],application:_0xafbe[53],queue:_0x4056x24[_0xafbe[24]],queuename:_0x4056x24[_0xafbe[15]],calledAt:moment()[_0xafbe[38]](_0xafbe[54]),joinAt:moment()[_0xafbe[38]](_0xafbe[54]),membername:null,memberid:null}))})[_0xafbe[42]](function(_0x4056x21){_0x4056xc[_0xafbe[47]](_0xafbe[60])[_0xafbe[44]](_0xafbe[59],_0x4056x21);_0x4056xc[_0xafbe[47]](_0xafbe[61])[_0xafbe[44]](_0xafbe[59],_0x4056x21);return Room[_0xafbe[71]](_0x4056xa[_0xafbe[79]])})[_0xafbe[42]](function(_0x4056x27){if(_0x4056x27){return _0x4056x27[_0xafbe[63]]({waiting:true})}})[_0xafbe[42]](function(_0x4056x27){if(_0x4056x27){_0x4056xc[_0xafbe[44]](_0xafbe[78],_0x4056x27[_0xafbe[48]]({plain:true}))}})[_0xafbe[42]](function(_0x4056x27){switch(_0x4056x11[_0xafbe[17]]){case _0xafbe[72]:_0x4056x22();break;case _0xafbe[76]:_0x4056x10= _[_0xafbe[75]](_0x4056x11.Users,[function(_0x4056x28){return _0x4056x28[_0xafbe[74]][_0xafbe[73]]|| 0}]);_0x4056x16();break;case _0xafbe[77]:_0x4056x10= _[_0xafbe[75]](_0x4056x11.Users,[function(_0x4056x28){return _0x4056x28[_0xafbe[74]][_0xafbe[73]]|| 0}]);_0x4056x16();break;default:}})[_0xafbe[41]](function(_0x4056x19){console[_0xafbe[40]](_0x4056xa[_0xafbe[13]][_0xafbe[12]](),_0xafbe[14],_0x4056x11[_0xafbe[15]][_0xafbe[12]](),_0xafbe[16],_0x4056x11[_0xafbe[17]],_0xafbe[18],_0x4056xa[_0xafbe[19]],_0xafbe[39]);console[_0xafbe[40]](_0x4056x19);_0x4056xd(_0x4056x19)})}
\ No newline at end of file
+var _0x261c=["\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","\x66\x61\x78","\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","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x46\x61\x78","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\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","\x66\x61\x78\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","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\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\x66\x61\x78\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\x46\x61\x78\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","\x73\x74\x61\x63\x6B","\x62\x65\x65\x70\x61\x6C\x6C","\x70\x65\x6E\x61\x6C\x74\x79","\x55\x73\x65\x72\x48\x61\x73\x46\x61\x78\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","\x66\x61\x78\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"];_0x261c[0];var _=require(_0x261c[1]);var util=require(_0x261c[2]);var moment=require(_0x261c[3]);var logger=require(_0x261c[5])(_0x261c[4]);var Agent=require(_0x261c[7])[_0x261c[6]];var Room=require(_0x261c[7])[_0x261c[8]];var Queue=require(_0x261c[7])[_0x261c[9]];var Report=require(_0x261c[7])[_0x261c[10]];var Session=require(_0x261c[7])[_0x261c[11]];module[_0x261c[12]]= function(_0x5fbexa,_0x5fbexb,_0x5fbexc,_0x5fbexd,_0x5fbexe){var _0x5fbexf=[];var _0x5fbex10;var _0x5fbex11;var _0x5fbex12;var _0x5fbex13=0;process[_0x261c[30]](_0x261c[13],function(_0x5fbexc){switch(_0x5fbexc[_0x261c[29]]){case _0x261c[28]:logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[22],_0x5fbexc[_0x261c[23]],_0x261c[24]);_0x5fbexf[_0x261c[27]]({id:_0x5fbexc[_0x261c[26]]});break;default:}});function _0x5fbex14(_0x5fbex15){var _0x5fbex16=_[_0x261c[31]](_0x5fbexf,{id:_0x5fbex15[_0x261c[26]]});return _0x5fbex16?true:false}function _0x5fbex17(){var _0x5fbex18=((_0x5fbexa[_0x261c[32]]- _0x5fbex13)> _0x5fbex12[_0x261c[32]])?_0x5fbex12[_0x261c[32]]:(_0x5fbexa[_0x261c[32]]- _0x5fbex13);if(_0x5fbex18> 0){if(_0x5fbex11[_0x261c[33]]){var _0x5fbex19={where:{id:{$in:_[_0x261c[34]](_0x5fbex11,_0x261c[26])},online:true,faxPause:false},include:[{model:Room,attributes:[_0x261c[26]],raw:true}],attributes:[_0x261c[26],_0x261c[17],_0x261c[35],_0x261c[36],_0x261c[37]],order:[[{raw:util[_0x261c[40]](_0x261c[38],_[_0x261c[34]](_0x5fbex11,_0x261c[26])[_0x261c[39]]())}]]};Agent[_0x261c[60]](_0x5fbex19)[_0x261c[44]](function(_0x5fbex1c){if(_0x5fbex1c[_0x261c[33]]){var _0x5fbex1d;for(var _0x5fbex1e=0;_0x5fbex1e< _0x5fbex1c[_0x261c[33]];_0x5fbex1e++){var _0x5fbex15=_0x5fbex1c[_0x5fbex1e][_0x261c[50]]({plain:true});if(!_0x5fbex14(_0x5fbex15)){_0x5fbex1d= _0x5fbex15;break}};if(_0x5fbex1d){logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[51],_0x5fbex1d[_0x261c[26]],_0x5fbex1d[_0x261c[17]]);var _0x5fbex1f=_[_0x261c[52]](_0x5fbex11,{"\x69\x64":_0x5fbex1d[_0x261c[26]]});if(_0x5fbex1f>= 0){var _0x5fbex20=_0x5fbex11[_0x261c[53]](_0x5fbex1f,1);if(_0x5fbex20&& _0x5fbex20[_0x261c[33]]){_0x5fbex11[_0x261c[27]](_[_0x261c[54]](_0x5fbex20))}};return Report[_0x261c[58]](_[_0x261c[57]](_0x5fbexb,{timeslot:_0x5fbex18,application:_0x261c[55],membername:_0x5fbex1d[_0x261c[17]],memberid:_0x5fbex1d[_0x261c[26]],queue:_0x5fbex12[_0x261c[26]],queuename:_0x5fbex12[_0x261c[17]],calledAt:moment()[_0x261c[40]](_0x261c[56])}))};logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[59]);return}else {logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[59]);return}})[_0x261c[44]](function(_0x5fbex1b){if(_0x5fbex1b){_0x5fbexd[_0x261c[49]](util[_0x261c[40]](_0x261c[47],_0x5fbex1b[_0x261c[48]]))[_0x261c[46]](_0x261c[45],_0x5fbex1b)}})[_0x261c[44]](function(){_0x5fbex10= setTimeout(function(){_0x5fbex13+= _0x5fbex12[_0x261c[32]];_0x5fbex17()},_0x5fbex18* 1000)})[_0x261c[43]](function(_0x5fbex1a){logger[_0x261c[42]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[41]);_0x5fbexe(_0x5fbex1a)})}else {logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[59]);_0x5fbex10= setTimeout(function(){_0x5fbex13+= _0x5fbex12[_0x261c[32]];_0x5fbex17()},_0x5fbex18* 1000)}}else {return Session[_0x261c[65]]({leaveAt:moment()[_0x261c[40]](_0x261c[56]),timeout:true},{where:{uniqueid:_0x5fbexb[_0x261c[21]],leaveAt:null},individualHooks:true})[_0x261c[44]](function(_0x5fbex21){if(_0x5fbex21&& _0x5fbex21[_0x261c[33]]&& _0x5fbex21[1][_0x261c[33]]){for(var _0x5fbex1e=0;_0x5fbex1e< _0x5fbex21[1][_0x261c[33]];_0x5fbex1e++){var _0x5fbex22=_0x5fbex21[1][_0x5fbex1e][_0x261c[50]]({plain:true});_0x5fbexd[_0x261c[49]](_0x261c[62])[_0x261c[46]](_0x261c[61],_0x5fbex22);_0x5fbexd[_0x261c[49]](_0x261c[63])[_0x261c[46]](_0x261c[61],_0x5fbex22)}};logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[64]);clearTimeout(_0x5fbex10);_0x5fbexe()})[_0x261c[43]](function(_0x5fbex1a){logger[_0x261c[42]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[41]);_0x5fbexe(_0x5fbex1a)})}}function _0x5fbex23(){var _0x5fbex18=((_0x5fbexa[_0x261c[32]]- _0x5fbex13)> _0x5fbex12[_0x261c[32]])?_0x5fbex12[_0x261c[32]]:(_0x5fbexa[_0x261c[32]]- _0x5fbex13);if(_0x5fbex18> 0){Queue[_0x261c[73]](_0x5fbexa.FaxQueueId,{attributes:[_0x261c[26],_0x261c[17],_0x261c[32],_0x261c[19],_0x261c[72]],include:[{model:Agent,where:{online:true,faxPause:false},attributes:[_0x261c[26],_0x261c[17],_0x261c[35],_0x261c[36],_0x261c[37]],raw:true}]})[_0x261c[44]](function(_0x5fbex25){if(_0x5fbex25){var _0x5fbex1c=_[_0x261c[68]](_[_0x261c[67]](_0x5fbex25.Users,_0x261c[66]));if(_0x5fbex1c&& _0x5fbex1c[_0x261c[33]]){var _0x5fbex26;for(var _0x5fbex1e=0;_0x5fbex1e< _0x5fbex1c[_0x261c[33]];_0x5fbex1e++){_[_0x261c[69]](_0x5fbex1c[_0x5fbex1e],function(_0x5fbex15){return _0x5fbex14(_0x5fbex15)});if(_0x5fbex1c[_0x5fbex1e][_0x261c[33]]){_0x5fbex26= _0x5fbex1c[_0x5fbex1e];break}};if(_0x5fbex26&& _0x5fbex26[_0x261c[33]]){var _0x5fbex27=_[_0x261c[34]](_0x5fbex26,function(_0x5fbex15){return _[_0x261c[70]](_[_0x261c[57]](_0x5fbexb,{timeslot:_0x5fbex18,application:_0x261c[55],membername:_0x5fbex15[_0x261c[17]],memberid:_0x5fbex15[_0x261c[26]],queue:_0x5fbex12[_0x261c[26]],queuename:_0x5fbex12[_0x261c[17]],calledAt:moment()[_0x261c[40]](_0x261c[56])}))});return Report[_0x261c[71]](_0x5fbex27,{individualHooks:true})}else {logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[59])}}else {logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[59])}}else {logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[59])}})[_0x261c[44]](function(_0x5fbex24){if(_0x5fbex24&& _0x5fbex24[_0x261c[33]]){for(var _0x5fbex1e=0;_0x5fbex1e< _0x5fbex24[_0x261c[33]];_0x5fbex1e++){var _0x5fbex1b=_0x5fbex24[_0x5fbex1e][_0x261c[50]]({plain:true});_0x5fbexd[_0x261c[49]](util[_0x261c[40]](_0x261c[47],_0x5fbex1b[_0x261c[48]]))[_0x261c[46]](_0x261c[45],_0x5fbex1b)}};_0x5fbex10= setTimeout(function(){_0x5fbex13+= _0x5fbex12[_0x261c[32]];_0x5fbex23()},_0x5fbex18* 1000)})[_0x261c[43]](function(_0x5fbex1a){logger[_0x261c[42]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[41]);_0x5fbexe(_0x5fbex1a)})}else {return Session[_0x261c[65]]({leaveAt:moment()[_0x261c[40]](_0x261c[56]),timeout:true},{where:{uniqueid:_0x5fbexb[_0x261c[21]],leaveAt:null},individualHooks:true})[_0x261c[44]](function(_0x5fbex21){if(_0x5fbex21&& _0x5fbex21[_0x261c[33]]&& _0x5fbex21[1][_0x261c[33]]){for(var _0x5fbex1e=0;_0x5fbex1e< _0x5fbex21[1][_0x261c[33]];_0x5fbex1e++){var _0x5fbex22=_0x5fbex21[1][_0x5fbex1e][_0x261c[50]]({plain:true});_0x5fbexd[_0x261c[49]](_0x261c[62])[_0x261c[46]](_0x261c[61],_0x5fbex22);_0x5fbexd[_0x261c[49]](_0x261c[63])[_0x261c[46]](_0x261c[61],_0x5fbex22)}};logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[64]);clearTimeout(_0x5fbex10);_0x5fbexe()})[_0x261c[43]](function(_0x5fbex1a){logger[_0x261c[42]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[41]);_0x5fbexe(_0x5fbex1a)})}}return Queue[_0x261c[73]](_0x5fbexa.FaxQueueId,{attributes:[_0x261c[26],_0x261c[17],_0x261c[32],_0x261c[19],_0x261c[72]],include:[{model:Agent,attributes:[_0x261c[26]],raw:true}]})[_0x261c[44]](function(_0x5fbex25){_0x5fbex12= _0x5fbex25[_0x261c[50]]({plain:true});logger[_0x261c[25]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[83],_0x5fbexa[_0x261c[32]],_0x261c[84]);return Session[_0x261c[58]](_[_0x261c[57]](_0x5fbexb,{timeslot:_0x5fbexa[_0x261c[32]],application:_0x261c[55],queue:_0x5fbex25[_0x261c[26]],queuename:_0x5fbex25[_0x261c[17]],calledAt:moment()[_0x261c[40]](_0x261c[56]),joinAt:moment()[_0x261c[40]](_0x261c[56]),membername:null,memberid:null}))})[_0x261c[44]](function(_0x5fbex22){_0x5fbexd[_0x261c[49]](_0x261c[62])[_0x261c[46]](_0x261c[61],_0x5fbex22);_0x5fbexd[_0x261c[49]](_0x261c[63])[_0x261c[46]](_0x261c[61],_0x5fbex22);return Room[_0x261c[73]](_0x5fbexb[_0x261c[82]])})[_0x261c[44]](function(_0x5fbex28){if(_0x5fbex28){return _0x5fbex28[_0x261c[65]]({waiting:true})}})[_0x261c[44]](function(_0x5fbex28){if(_0x5fbex28){_0x5fbexd[_0x261c[46]](_0x261c[81],_0x5fbex28[_0x261c[50]]({plain:true}))}})[_0x261c[44]](function(_0x5fbex28){switch(_0x5fbex12[_0x261c[19]]){case _0x261c[75]:_0x5fbex23();break;case _0x261c[79]:_0x5fbex11= _[_0x261c[78]](_0x5fbex12.Users,[function(_0x5fbex29){return _0x5fbex29[_0x261c[77]][_0x261c[76]]|| 0}]);_0x5fbex17();break;case _0x261c[80]:_0x5fbex11= _[_0x261c[78]](_0x5fbex12.Users,[function(_0x5fbex29){return _0x5fbex29[_0x261c[77]][_0x261c[76]]|| 0}]);_0x5fbex17();break;default:}})[_0x261c[43]](function(_0x5fbex1a){logger[_0x261c[42]](_0x5fbexb[_0x261c[15]][_0x261c[14]](),_0x261c[16],_0x5fbex12[_0x261c[17]][_0x261c[14]](),_0x261c[18],_0x5fbex12[_0x261c[19]],_0x261c[20],_0x5fbexb[_0x261c[21]],_0x261c[41]);logger[_0x261c[42]](_0x5fbex1a[_0x261c[74]]);_0x5fbexe(_0x5fbex1a)})}
\ No newline at end of file