218cb54394d7217e189704c8ac0772fffdcd20f2
[motion.git] / server / config / tools / user.js
1 var _0xea23=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x73","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x43\x68\x61\x6E\x53\x70\x79","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x62\x6C\x75\x65\x62\x69\x72\x64","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x63\x68\x61\x6E\x73\x70\x79\x2E\x2E\x2E","\x6C\x6F\x67","\x61\x6C\x6C","\x61\x75\x74\x68","\x66\x72\x6F\x6D\x2D\x73\x69\x70","\x25\x73\x25\x73","\x70\x72\x65\x66\x69\x78","\x6E\x61\x6D\x65","\x66\x6F\x72\x6D\x61\x74","\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x69\x64","\x73\x79\x73\x74\x65\x6D","\x70\x75\x73\x68","\x53\x49\x50\x2F\x25\x73\x2C\x25\x73","\x6F\x70\x74\x69\x6F\x6E\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x66\x6F\x72\x45\x61\x63\x68","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x44\x65\x6C\x65\x74\x69\x6E\x67\x20\x63\x68\x61\x6E\x73\x70\x79\x2E\x2E\x2E","\x64\x65\x73\x74\x72\x6F\x79","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x5F\x63\x68\x61\x6E\x67\x65\x64","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x63\x61\x6C\x6C\x65\x72\x49\x44\x2E\x2E\x2E","\x63\x61\x6C\x6C\x65\x72\x69\x64","\x22\x25\x73\x22\x20\x3C\x25\x73\x3E","\x73\x61\x76\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x2E\x2E\x2E","\x5F","\x53\x65\x74","\x43\x44\x52\x28\x74\x79\x70\x65\x29\x3D\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x44\x69\x61\x6C","\x53\x49\x50\x2F","\x2C\x2C\x74\x54\x78\x58","\x48\x61\x6E\x67\x75\x70","","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x71\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x6C\x61\x73\x74\x4C\x6F\x67\x69\x6E\x41\x74","\x6F\x6E\x6C\x69\x6E\x65","\x65\x72\x72","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x63\x68\x61\x6E\x73\x70\x79","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65"];_0xea23[0];var fs=require(_0xea23[1]);var util=require(_0xea23[2]);var path=require(_0xea23[3]);var config=require(_0xea23[4]);var UserModel=require(_0xea23[6])[_0xea23[5]];var VoiceExtension=require(_0xea23[6])[_0xea23[7]];var ChanSpy=require(_0xea23[6])[_0xea23[8]];var sequelize=require(_0xea23[6])[_0xea23[9]];var BPromise=require(_0xea23[10]);function createChanspy(_0x8962xb,_0x8962xc){console[_0xea23[12]](_0xea23[11]);return ChanSpy[_0xea23[32]]()[_0xea23[31]](function(_0x8962xd){var _0x8962xe=[];_0x8962xd[_0xea23[30]](function(_0x8962xf){var _0x8962x10=[];var _0x8962x11=1;if(_0x8962xf[_0xea23[14]]){_0x8962x10[_0xea23[24]]({context:_0xea23[15],exten:util[_0xea23[19]](_0xea23[16],_0x8962xf[_0xea23[17]],_0x8962xb[_0xea23[18]]),priority:_0x8962x11,app:_0xea23[20],appdata:_0x8962xf[_0xea23[21]],UserId:_0x8962xb[_0xea23[22]],ChanSpyId:_0x8962xf[_0xea23[22]],type:_0xea23[23]});_0x8962x11++};_0x8962x10[_0xea23[24]]({context:_0xea23[15],exten:util[_0xea23[19]](_0xea23[16],_0x8962xf[_0xea23[17]],_0x8962xb[_0xea23[18]]),priority:_0x8962x11,app:_0xea23[8],appdata:util[_0xea23[19]](_0xea23[25],_0x8962xb[_0xea23[18]],_0x8962xf[_0xea23[26]]),UserId:_0x8962xb[_0xea23[22]],ChanSpyId:_0x8962xf[_0xea23[22]],type:_0xea23[23]});_0x8962x11= 1;if(_0x8962xf[_0xea23[14]]){_0x8962x10[_0xea23[24]]({context:_0xea23[15],exten:util[_0xea23[19]](_0xea23[16],_0x8962xf[_0xea23[17]],_0x8962xb[_0xea23[27]]),priority:_0x8962x11,app:_0xea23[20],appdata:_0x8962xf[_0xea23[21]],UserId:_0x8962xb[_0xea23[22]],ChanSpyId:_0x8962xf[_0xea23[22]],type:_0xea23[23]});_0x8962x11++};_0x8962x10[_0xea23[24]]({context:_0xea23[15],exten:util[_0xea23[19]](_0xea23[16],_0x8962xf[_0xea23[17]],_0x8962xb[_0xea23[27]]),priority:_0x8962x11,app:_0xea23[8],appdata:util[_0xea23[19]](_0xea23[25],_0x8962xb[_0xea23[18]],_0x8962xf[_0xea23[26]]),UserId:_0x8962xb[_0xea23[22]],ChanSpyId:_0x8962xf[_0xea23[22]],type:_0xea23[23]});_0x8962xe[_0xea23[24]](VoiceExtension[_0xea23[29]](_0x8962x10,{transaction:_0x8962xc[_0xea23[28]]|| null}))});return _0x8962xe})[_0xea23[13]]()}function deleteChanSpy(_0x8962xb,_0x8962xc){console[_0xea23[12]](_0xea23[33]);return VoiceExtension[_0xea23[34]]({where:{UserId:_0x8962xb[_0xea23[22]],ChanSpyId:{$ne:null}},transaction:_0x8962xc[_0xea23[28]]|| null})}function createCallerID(_0x8962xb,_0x8962xc){return function(){if(_0x8962xb[_0xea23[35]]&& _0x8962xb[_0xea23[27]]&& _0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[35])){console[_0xea23[12]](_0xea23[38]);_0x8962xb[_0xea23[39]]= util[_0xea23[19]](_0xea23[40],_0x8962xb[_0xea23[35]],_0x8962xb[_0xea23[27]]);return _0x8962xb[_0xea23[41]]({transaction:_0x8962xc[_0xea23[28]]|| null})}else {return BPromise[_0xea23[42]]()}}}function createExtension(_0x8962xb,_0x8962xc){console[_0xea23[12]](_0xea23[43]);return function(){var _0x8962x15=[{context:_0xea23[15],exten:_0xea23[44]+ _0x8962xb[_0xea23[27]],priority:1,app:_0xea23[45],appdata:_0xea23[46],UserId:_0x8962xb[_0xea23[22]],type:_0xea23[23]},{context:_0xea23[15],exten:_0xea23[44]+ _0x8962xb[_0xea23[27]],priority:2,app:_0xea23[47],appdata:_0xea23[48]+ _0x8962xb[_0xea23[18]]+ _0xea23[49],UserId:_0x8962xb[_0xea23[22]],type:_0xea23[23]},{context:_0xea23[15],exten:_0xea23[44]+ _0x8962xb[_0xea23[27]],priority:3,app:_0xea23[50],appdata:_0xea23[51],UserId:_0x8962xb[_0xea23[22]],type:_0xea23[23]},{context:_0xea23[15],exten:_0x8962xb[_0xea23[18]],priority:1,app:_0xea23[45],appdata:_0xea23[46],UserId:_0x8962xb[_0xea23[22]],type:_0xea23[23]},{context:_0xea23[15],exten:_0x8962xb[_0xea23[18]],priority:2,app:_0xea23[47],appdata:_0xea23[48]+ _0x8962xb[_0xea23[18]]+ _0xea23[49],UserId:_0x8962xb[_0xea23[22]],type:_0xea23[23]},{context:_0xea23[15],exten:_0x8962xb[_0xea23[18]],priority:3,app:_0xea23[50],appdata:_0xea23[51],UserId:_0x8962xb[_0xea23[22]],type:_0xea23[23]}];return VoiceExtension[_0xea23[29]](_0x8962x15,{transaction:_0x8962xc[_0xea23[28]]|| null})}}exports[_0xea23[52]]= function(_0x8962xc){return function(_0x8962xb){if(!_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[53])&& !_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[54])&& !_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[39])&& !_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[55])&& !_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[56])){return BPromise[_0xea23[42]]()[_0xea23[31]](createCallerID(_0x8962xb,_0x8962xc))[_0xea23[31]](function(){if((_0x8962xb[_0xea23[60]]&& _0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[60]))){return createChanspy(_0x8962xb,_0x8962xc)}})[_0xea23[31]](function(){if(_0x8962xb[_0xea23[60]]&& !_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[60])&& _0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[18])){return deleteChanSpy(_0x8962xb,_0x8962xc)}})[_0xea23[31]](function(){if(_0x8962xb[_0xea23[60]]&& !_0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[60])&& _0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[18])){return createChanspy(_0x8962xb,_0x8962xc)}})[_0xea23[31]](function(){if(!_0x8962xb[_0xea23[60]]&& _0x8962xb[_0xea23[37]][_0xea23[36]](_0xea23[60])){return deleteChanSpy(_0x8962xb,_0x8962xc)}})[_0xea23[59]](function(_0x8962x16){console[_0xea23[12]](_0xea23[57],_0x8962x16[_0xea23[58]])})[_0xea23[31]](function(){return _0x8962xb})}else {return BPromise[_0xea23[42]]()[_0xea23[31]](function(){return _0x8962xb})}}};exports[_0xea23[61]]= function(_0x8962xc){return function(_0x8962xb){delete _0x8962xb[_0xea23[37]][_0xea23[27]];return Promise[_0xea23[13]]([])[_0xea23[31]](createCallerID(_0x8962xb,_0x8962xc))[_0xea23[31]](createExtension(_0x8962xb,_0x8962xc))[_0xea23[31]](function(){if(_0x8962xb[_0xea23[60]]){return createChanspy(_0x8962xb,_0x8962xc)}})[_0xea23[31]](function(){return _0x8962xb})}}