Built motion from commit 8d1370ff4.|1.0.34
[motion.git] / server / config / forked_routing / fax / queue.js
1 var _0xe820=["\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"];_0xe820[0];var _=require(_0xe820[1]);var util=require(_0xe820[2]);var moment=require(_0xe820[3]);var logger=require(_0xe820[5])(_0xe820[4]);var Agent=require(_0xe820[7])[_0xe820[6]];var Room=require(_0xe820[7])[_0xe820[8]];var Queue=require(_0xe820[7])[_0xe820[9]];var Report=require(_0xe820[7])[_0xe820[10]];var Session=require(_0xe820[7])[_0xe820[11]];module[_0xe820[12]]= function(_0xbf31xa,_0xbf31xb,_0xbf31xc,_0xbf31xd,_0xbf31xe){var _0xbf31xf=[];var _0xbf31x10;var _0xbf31x11;var _0xbf31x12;var _0xbf31x13=0;process[_0xe820[30]](_0xe820[13],function(_0xbf31xc){switch(_0xbf31xc[_0xe820[29]]){case _0xe820[28]:logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[22],_0xbf31xc[_0xe820[23]],_0xe820[24]);_0xbf31xf[_0xe820[27]]({id:_0xbf31xc[_0xe820[26]]});break;default:}});function _0xbf31x14(_0xbf31x15){var _0xbf31x16=_[_0xe820[31]](_0xbf31xf,{id:_0xbf31x15[_0xe820[26]]});return _0xbf31x16?true:false}function _0xbf31x17(){var _0xbf31x18=((_0xbf31xa[_0xe820[32]]- _0xbf31x13)> _0xbf31x12[_0xe820[32]])?_0xbf31x12[_0xe820[32]]:(_0xbf31xa[_0xe820[32]]- _0xbf31x13);if(_0xbf31x18> 0){if(_0xbf31x11[_0xe820[33]]){var _0xbf31x19={where:{id:{$in:_[_0xe820[34]](_0xbf31x11,_0xe820[26])},online:true,faxPause:false},include:[{model:Room,attributes:[_0xe820[26]],raw:true}],attributes:[_0xe820[26],_0xe820[17],_0xe820[35],_0xe820[36],_0xe820[37]],order:[[{raw:util[_0xe820[40]](_0xe820[38],_[_0xe820[34]](_0xbf31x11,_0xe820[26])[_0xe820[39]]())}]]};Agent[_0xe820[60]](_0xbf31x19)[_0xe820[44]](function(_0xbf31x1c){if(_0xbf31x1c[_0xe820[33]]){var _0xbf31x1d;for(var _0xbf31x1e=0;_0xbf31x1e< _0xbf31x1c[_0xe820[33]];_0xbf31x1e++){var _0xbf31x15=_0xbf31x1c[_0xbf31x1e][_0xe820[50]]({plain:true});if(!_0xbf31x14(_0xbf31x15)){_0xbf31x1d= _0xbf31x15;break}};if(_0xbf31x1d){logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[51],_0xbf31x1d[_0xe820[26]],_0xbf31x1d[_0xe820[17]]);var _0xbf31x1f=_[_0xe820[52]](_0xbf31x11,{"\x69\x64":_0xbf31x1d[_0xe820[26]]});if(_0xbf31x1f>= 0){var _0xbf31x20=_0xbf31x11[_0xe820[53]](_0xbf31x1f,1);if(_0xbf31x20&& _0xbf31x20[_0xe820[33]]){_0xbf31x11[_0xe820[27]](_[_0xe820[54]](_0xbf31x20))}};return Report[_0xe820[58]](_[_0xe820[57]](_0xbf31xb,{timeslot:_0xbf31x18,application:_0xe820[55],membername:_0xbf31x1d[_0xe820[17]],memberid:_0xbf31x1d[_0xe820[26]],queue:_0xbf31x12[_0xe820[26]],queuename:_0xbf31x12[_0xe820[17]],calledAt:moment()[_0xe820[40]](_0xe820[56])}))};logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[59]);return}else {logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[59]);return}})[_0xe820[44]](function(_0xbf31x1b){if(_0xbf31x1b){_0xbf31xd[_0xe820[49]](util[_0xe820[40]](_0xe820[47],_0xbf31x1b[_0xe820[48]]))[_0xe820[46]](_0xe820[45],_0xbf31x1b)}})[_0xe820[44]](function(){_0xbf31x10= setTimeout(function(){_0xbf31x13+= _0xbf31x12[_0xe820[32]];_0xbf31x17()},_0xbf31x18* 1000)})[_0xe820[43]](function(_0xbf31x1a){logger[_0xe820[42]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[41]);_0xbf31xe(_0xbf31x1a)})}else {logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[59]);_0xbf31x10= setTimeout(function(){_0xbf31x13+= _0xbf31x12[_0xe820[32]];_0xbf31x17()},_0xbf31x18* 1000)}}else {return Session[_0xe820[65]]({leaveAt:moment()[_0xe820[40]](_0xe820[56]),timeout:true},{where:{uniqueid:_0xbf31xb[_0xe820[21]],leaveAt:null},individualHooks:true})[_0xe820[44]](function(_0xbf31x21){if(_0xbf31x21&& _0xbf31x21[_0xe820[33]]&& _0xbf31x21[1][_0xe820[33]]){for(var _0xbf31x1e=0;_0xbf31x1e< _0xbf31x21[1][_0xe820[33]];_0xbf31x1e++){var _0xbf31x22=_0xbf31x21[1][_0xbf31x1e][_0xe820[50]]({plain:true});_0xbf31xd[_0xe820[49]](_0xe820[62])[_0xe820[46]](_0xe820[61],_0xbf31x22);_0xbf31xd[_0xe820[49]](_0xe820[63])[_0xe820[46]](_0xe820[61],_0xbf31x22)}};logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[64]);clearTimeout(_0xbf31x10);_0xbf31xe()})[_0xe820[43]](function(_0xbf31x1a){logger[_0xe820[42]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[41]);_0xbf31xe(_0xbf31x1a)})}}function _0xbf31x23(){var _0xbf31x18=((_0xbf31xa[_0xe820[32]]- _0xbf31x13)> _0xbf31x12[_0xe820[32]])?_0xbf31x12[_0xe820[32]]:(_0xbf31xa[_0xe820[32]]- _0xbf31x13);if(_0xbf31x18> 0){Queue[_0xe820[73]](_0xbf31xa.FaxQueueId,{attributes:[_0xe820[26],_0xe820[17],_0xe820[32],_0xe820[19],_0xe820[72]],include:[{model:Agent,where:{online:true,faxPause:false},attributes:[_0xe820[26],_0xe820[17],_0xe820[35],_0xe820[36],_0xe820[37]],raw:true}]})[_0xe820[44]](function(_0xbf31x25){if(_0xbf31x25){var _0xbf31x1c=_[_0xe820[68]](_[_0xe820[67]](_0xbf31x25.Users,_0xe820[66]));if(_0xbf31x1c&& _0xbf31x1c[_0xe820[33]]){var _0xbf31x26;for(var _0xbf31x1e=0;_0xbf31x1e< _0xbf31x1c[_0xe820[33]];_0xbf31x1e++){_[_0xe820[69]](_0xbf31x1c[_0xbf31x1e],function(_0xbf31x15){return _0xbf31x14(_0xbf31x15)});if(_0xbf31x1c[_0xbf31x1e][_0xe820[33]]){_0xbf31x26= _0xbf31x1c[_0xbf31x1e];break}};if(_0xbf31x26&& _0xbf31x26[_0xe820[33]]){var _0xbf31x27=_[_0xe820[34]](_0xbf31x26,function(_0xbf31x15){return _[_0xe820[70]](_[_0xe820[57]](_0xbf31xb,{timeslot:_0xbf31x18,application:_0xe820[55],membername:_0xbf31x15[_0xe820[17]],memberid:_0xbf31x15[_0xe820[26]],queue:_0xbf31x12[_0xe820[26]],queuename:_0xbf31x12[_0xe820[17]],calledAt:moment()[_0xe820[40]](_0xe820[56])}))});return Report[_0xe820[71]](_0xbf31x27,{individualHooks:true})}else {logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[59])}}else {logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[59])}}else {logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[59])}})[_0xe820[44]](function(_0xbf31x24){if(_0xbf31x24&& _0xbf31x24[_0xe820[33]]){for(var _0xbf31x1e=0;_0xbf31x1e< _0xbf31x24[_0xe820[33]];_0xbf31x1e++){var _0xbf31x1b=_0xbf31x24[_0xbf31x1e][_0xe820[50]]({plain:true});_0xbf31xd[_0xe820[49]](util[_0xe820[40]](_0xe820[47],_0xbf31x1b[_0xe820[48]]))[_0xe820[46]](_0xe820[45],_0xbf31x1b)}};_0xbf31x10= setTimeout(function(){_0xbf31x13+= _0xbf31x12[_0xe820[32]];_0xbf31x23()},_0xbf31x18* 1000)})[_0xe820[43]](function(_0xbf31x1a){logger[_0xe820[42]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[41]);_0xbf31xe(_0xbf31x1a)})}else {return Session[_0xe820[65]]({leaveAt:moment()[_0xe820[40]](_0xe820[56]),timeout:true},{where:{uniqueid:_0xbf31xb[_0xe820[21]],leaveAt:null},individualHooks:true})[_0xe820[44]](function(_0xbf31x21){if(_0xbf31x21&& _0xbf31x21[_0xe820[33]]&& _0xbf31x21[1][_0xe820[33]]){for(var _0xbf31x1e=0;_0xbf31x1e< _0xbf31x21[1][_0xe820[33]];_0xbf31x1e++){var _0xbf31x22=_0xbf31x21[1][_0xbf31x1e][_0xe820[50]]({plain:true});_0xbf31xd[_0xe820[49]](_0xe820[62])[_0xe820[46]](_0xe820[61],_0xbf31x22);_0xbf31xd[_0xe820[49]](_0xe820[63])[_0xe820[46]](_0xe820[61],_0xbf31x22)}};logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[64]);clearTimeout(_0xbf31x10);_0xbf31xe()})[_0xe820[43]](function(_0xbf31x1a){logger[_0xe820[42]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[41]);_0xbf31xe(_0xbf31x1a)})}}return Queue[_0xe820[73]](_0xbf31xa.FaxQueueId,{attributes:[_0xe820[26],_0xe820[17],_0xe820[32],_0xe820[19],_0xe820[72]],include:[{model:Agent,attributes:[_0xe820[26]],raw:true}]})[_0xe820[44]](function(_0xbf31x25){_0xbf31x12= _0xbf31x25[_0xe820[50]]({plain:true});logger[_0xe820[25]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[83],_0xbf31xa[_0xe820[32]],_0xe820[84]);return Session[_0xe820[58]](_[_0xe820[57]](_0xbf31xb,{timeslot:_0xbf31xa[_0xe820[32]],application:_0xe820[55],queue:_0xbf31x25[_0xe820[26]],queuename:_0xbf31x25[_0xe820[17]],calledAt:moment()[_0xe820[40]](_0xe820[56]),joinAt:moment()[_0xe820[40]](_0xe820[56]),membername:null,memberid:null}))})[_0xe820[44]](function(_0xbf31x22){_0xbf31xd[_0xe820[49]](_0xe820[62])[_0xe820[46]](_0xe820[61],_0xbf31x22);_0xbf31xd[_0xe820[49]](_0xe820[63])[_0xe820[46]](_0xe820[61],_0xbf31x22);return Room[_0xe820[73]](_0xbf31xb[_0xe820[82]])})[_0xe820[44]](function(_0xbf31x28){if(_0xbf31x28){return _0xbf31x28[_0xe820[65]]({waiting:true})}})[_0xe820[44]](function(_0xbf31x28){if(_0xbf31x28){_0xbf31xd[_0xe820[46]](_0xe820[81],_0xbf31x28[_0xe820[50]]({plain:true}))}})[_0xe820[44]](function(_0xbf31x28){switch(_0xbf31x12[_0xe820[19]]){case _0xe820[75]:_0xbf31x23();break;case _0xe820[79]:_0xbf31x11= _[_0xe820[78]](_0xbf31x12.Users,[function(_0xbf31x29){return _0xbf31x29[_0xe820[77]][_0xe820[76]]|| 0}]);_0xbf31x17();break;case _0xe820[80]:_0xbf31x11= _[_0xe820[78]](_0xbf31x12.Users,[function(_0xbf31x29){return _0xbf31x29[_0xe820[77]][_0xe820[76]]|| 0}]);_0xbf31x17();break;default:}})[_0xe820[43]](function(_0xbf31x1a){logger[_0xe820[42]](_0xbf31xb[_0xe820[15]][_0xe820[14]](),_0xe820[16],_0xbf31x12[_0xe820[17]][_0xe820[14]](),_0xe820[18],_0xbf31x12[_0xe820[19]],_0xe820[20],_0xbf31xb[_0xe820[21]],_0xe820[41]);logger[_0xe820[42]](_0xbf31x1a[_0xe820[74]]);_0xbf31xe(_0xbf31x1a)})}