Built motion from commit 78ef1e9a0.|1.0.36
[motion.git] / server / config / tools / user.js
index 02e9550..bc9b52b 100644 (file)
@@ -1 +1 @@
-var _0x9f20=["\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","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x75\x73\x65\x72\x20\x63\x68\x61\x6E\x73\x70\x79\x2E\x2E\x2E","\x64\x65\x62\x75\x67","\x61\x6C\x6C","\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","\x53\x65\x74","\x43\x44\x52\x28\x74\x79\x70\x65\x29\x3D\x25\x73","\x63\x68\x61\x6E\x73\x70\x79","\x69\x64","\x73\x79\x73\x74\x65\x6D","\x70\x75\x73\x68","\x61\x75\x74\x68","\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x72\x65\x63\x6F\x72\x64","\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x46\x6F\x72\x6D\x61\x74","\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x24\x7B\x55\x4E\x49\x51\x55\x45\x49\x44\x7D\x2E\x25\x73","\x53\x49\x50\x2F\x25\x73\x2C\x25\x73","\x6F\x70\x74\x69\x6F\x6E\x73","\x53\x74\x6F\x70\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","","\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\x75\x73\x65\x72\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","\x55\x70\x64\x61\x74\x69\x6E\x67\x20\x75\x73\x65\x72\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\x75\x73\x65\x72\x20\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x73\x2E\x2E\x2E","\x5F","\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","\x43\x68\x61\x6E\x73\x70\x79\x20\x75\x70\x64\x61\x74\x65\x20\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65"];_0x9f20[0];var fs=require(_0x9f20[1]);var util=require(_0x9f20[2]);var path=require(_0x9f20[3]);var config=require(_0x9f20[4]);var UserModel=require(_0x9f20[6])[_0x9f20[5]];var VoiceExtension=require(_0x9f20[6])[_0x9f20[7]];var ChanSpy=require(_0x9f20[6])[_0x9f20[8]];var sequelize=require(_0x9f20[6])[_0x9f20[9]];var BPromise=require(_0x9f20[10]);var logger=require(_0x9f20[12])(_0x9f20[11]);function createChanspy(_0x910exc,_0x910exd){logger[_0x9f20[14]](_0x9f20[13]);return ChanSpy[_0x9f20[43]]()[_0x9f20[42]](function(_0x910exe){var _0x910exf=[];_0x910exe[_0x9f20[41]](function(_0x910ex10){var _0x910ex11=[];var _0x910ex12=1;_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[19]]),priority:_0x910ex12,app:_0x9f20[21],appdata:util[_0x9f20[20]](_0x9f20[22],_0x9f20[23]),UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++;if(_0x910ex10[_0x9f20[27]]){_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[19]]),priority:_0x910ex12,app:_0x9f20[28],appdata:_0x910ex10[_0x9f20[29]],UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++};if(_0x910ex10[_0x9f20[30]]&& _0x910ex10[_0x9f20[31]]){_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[19]]),priority:_0x910ex12,app:_0x9f20[32],appdata:util[_0x9f20[20]](_0x9f20[33],_0x910ex10[_0x9f20[31]]),UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++};_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[19]]),priority:_0x910ex12,app:_0x9f20[8],appdata:util[_0x9f20[20]](_0x9f20[34],_0x910exc[_0x9f20[19]],_0x910ex10[_0x9f20[35]]),UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++;if(_0x910ex10[_0x9f20[30]]&& _0x910ex10[_0x9f20[31]]){_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[19]]),priority:_0x910ex12,app:_0x9f20[36],appdata:_0x9f20[37],UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]})};_0x910ex12= 1;_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[38]]),priority:_0x910ex12,app:_0x9f20[21],appdata:util[_0x9f20[20]](_0x9f20[22],_0x9f20[23]),UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++;if(_0x910ex10[_0x9f20[27]]){_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[38]]),priority:_0x910ex12,app:_0x9f20[28],appdata:_0x910ex10[_0x9f20[29]],UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++};if(_0x910ex10[_0x9f20[30]]&& _0x910ex10[_0x9f20[31]]){_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[38]]),priority:_0x910ex12,app:_0x9f20[32],appdata:util[_0x9f20[20]](_0x9f20[33],_0x910ex10[_0x9f20[31]]),UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++};_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[38]]),priority:_0x910ex12,app:_0x9f20[8],appdata:util[_0x9f20[20]](_0x9f20[34],_0x910exc[_0x9f20[19]],_0x910ex10[_0x9f20[35]]),UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]});_0x910ex12++;if(_0x910ex10[_0x9f20[30]]&& _0x910ex10[_0x9f20[31]]){_0x910ex11[_0x9f20[26]]({context:_0x9f20[16],exten:util[_0x9f20[20]](_0x9f20[17],_0x910ex10[_0x9f20[18]],_0x910exc[_0x9f20[38]]),priority:_0x910ex12,app:_0x9f20[36],appdata:_0x9f20[37],UserId:_0x910exc[_0x9f20[24]],ChanSpyId:_0x910ex10[_0x9f20[24]],type:_0x9f20[25]})};_0x910exf[_0x9f20[26]](VoiceExtension[_0x9f20[40]](_0x910ex11,{transaction:_0x910exd[_0x9f20[39]]|| null}))});return _0x910exf})[_0x9f20[15]]()}function deleteChanSpy(_0x910exc,_0x910exd){logger[_0x9f20[14]](_0x9f20[44]);return VoiceExtension[_0x9f20[45]]({where:{UserId:_0x910exc[_0x9f20[24]],ChanSpyId:{$ne:null}},transaction:_0x910exd[_0x9f20[39]]|| null})}function createCallerID(_0x910exc,_0x910exd){return function(){if(_0x910exc[_0x9f20[46]]&& _0x910exc[_0x9f20[38]]&& _0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[46])){logger[_0x9f20[14]](_0x9f20[49]);_0x910exc[_0x9f20[50]]= util[_0x9f20[20]](_0x9f20[51],_0x910exc[_0x9f20[46]],_0x910exc[_0x9f20[38]]);return _0x910exc[_0x9f20[52]]({transaction:_0x910exd[_0x9f20[39]]|| null})}else {return BPromise[_0x9f20[53]]()}}}function createExtension(_0x910exc,_0x910exd){logger[_0x9f20[14]](_0x9f20[54]);return function(){var _0x910ex16=[{context:_0x9f20[16],exten:_0x9f20[55]+ _0x910exc[_0x9f20[38]],priority:1,app:_0x9f20[21],appdata:_0x9f20[56],UserId:_0x910exc[_0x9f20[24]],type:_0x9f20[25]},{context:_0x9f20[16],exten:_0x9f20[55]+ _0x910exc[_0x9f20[38]],priority:2,app:_0x9f20[57],appdata:_0x9f20[58]+ _0x910exc[_0x9f20[19]]+ _0x9f20[59],UserId:_0x910exc[_0x9f20[24]],type:_0x9f20[25]},{context:_0x9f20[16],exten:_0x9f20[55]+ _0x910exc[_0x9f20[38]],priority:3,app:_0x9f20[60],appdata:_0x9f20[37],UserId:_0x910exc[_0x9f20[24]],type:_0x9f20[25]},{context:_0x9f20[16],exten:_0x910exc[_0x9f20[19]],priority:1,app:_0x9f20[21],appdata:_0x9f20[56],UserId:_0x910exc[_0x9f20[24]],type:_0x9f20[25]},{context:_0x9f20[16],exten:_0x910exc[_0x9f20[19]],priority:2,app:_0x9f20[57],appdata:_0x9f20[58]+ _0x910exc[_0x9f20[19]]+ _0x9f20[59],UserId:_0x910exc[_0x9f20[24]],type:_0x9f20[25]},{context:_0x9f20[16],exten:_0x910exc[_0x9f20[19]],priority:3,app:_0x9f20[60],appdata:_0x9f20[37],UserId:_0x910exc[_0x9f20[24]],type:_0x9f20[25]}];return VoiceExtension[_0x9f20[40]](_0x910ex16,{transaction:_0x910exd[_0x9f20[39]]|| null})}}exports[_0x9f20[61]]= function(_0x910exd){return function(_0x910exc){if(!_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[62])&&  !_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[63]) &&  !_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[50]) &&  !_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[64]) &&  !_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[65])){return BPromise[_0x9f20[53]]()[_0x9f20[42]](createCallerID(_0x910exc,_0x910exd))[_0x9f20[42]](function(){if((_0x910exc[_0x9f20[23]]&& _0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[23]))){return createChanspy(_0x910exc,_0x910exd)}})[_0x9f20[42]](function(){if(_0x910exc[_0x9f20[23]]&&  !_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[23])&& _0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[19])){return deleteChanSpy(_0x910exc,_0x910exd)}})[_0x9f20[42]](function(){if(_0x910exc[_0x9f20[23]]&&  !_0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[23])&& _0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[19])){return createChanspy(_0x910exc,_0x910exd)}})[_0x9f20[42]](function(){if(!_0x910exc[_0x9f20[23]]&& _0x910exc[_0x9f20[48]][_0x9f20[47]](_0x9f20[23])){return deleteChanSpy(_0x910exc,_0x910exd)}})[_0x9f20[69]](function(_0x910ex17){logger[_0x9f20[68]](_0x9f20[66],_0x910ex17[_0x9f20[67]])})[_0x9f20[42]](function(){return _0x910exc})}else {return BPromise[_0x9f20[53]]()[_0x9f20[42]](function(){return _0x910exc})}}};exports[_0x9f20[70]]= function(_0x910exd){return function(_0x910exc){delete _0x910exc[_0x9f20[48]][_0x9f20[38]];return Promise[_0x9f20[15]]([])[_0x9f20[42]](createCallerID(_0x910exc,_0x910exd))[_0x9f20[42]](createExtension(_0x910exc,_0x910exd))[_0x9f20[42]](function(){if(_0x910exc[_0x9f20[23]]){return createChanspy(_0x910exc,_0x910exd)}})[_0x9f20[42]](function(){return _0x910exc})}}
\ No newline at end of file
+var _0xbea8=["\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","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x75\x73\x65\x72\x20\x63\x68\x61\x6E\x73\x70\x79\x2E\x2E\x2E","\x64\x65\x62\x75\x67","\x61\x6C\x6C","\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","\x53\x65\x74","\x43\x44\x52\x28\x74\x79\x70\x65\x29\x3D\x25\x73","\x63\x68\x61\x6E\x73\x70\x79","\x69\x64","\x73\x79\x73\x74\x65\x6D","\x70\x75\x73\x68","\x61\x75\x74\x68","\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x72\x65\x63\x6F\x72\x64","\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x46\x6F\x72\x6D\x61\x74","\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x24\x7B\x55\x4E\x49\x51\x55\x45\x49\x44\x7D\x2E\x25\x73","\x53\x49\x50\x2F\x25\x73\x2C\x25\x73","\x6F\x70\x74\x69\x6F\x6E\x73","\x53\x74\x6F\x70\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","","\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\x75\x73\x65\x72\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","\x55\x70\x64\x61\x74\x69\x6E\x67\x20\x75\x73\x65\x72\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\x75\x73\x65\x72\x20\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x73\x2E\x2E\x2E","\x5F","\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","\x43\x68\x61\x6E\x73\x70\x79\x20\x75\x70\x64\x61\x74\x65\x20\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65"];_0xbea8[0];var fs=require(_0xbea8[1]);var util=require(_0xbea8[2]);var path=require(_0xbea8[3]);var config=require(_0xbea8[4]);var UserModel=require(_0xbea8[6])[_0xbea8[5]];var VoiceExtension=require(_0xbea8[6])[_0xbea8[7]];var ChanSpy=require(_0xbea8[6])[_0xbea8[8]];var sequelize=require(_0xbea8[6])[_0xbea8[9]];var BPromise=require(_0xbea8[10]);var logger=require(_0xbea8[12])(_0xbea8[11]);function createChanspy(_0xf1acxc,_0xf1acxd){logger[_0xbea8[14]](_0xbea8[13]);return ChanSpy[_0xbea8[43]]()[_0xbea8[42]](function(_0xf1acxe){var _0xf1acxf=[];_0xf1acxe[_0xbea8[41]](function(_0xf1acx10){var _0xf1acx11=[];var _0xf1acx12=1;_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[19]]),priority:_0xf1acx12,app:_0xbea8[21],appdata:util[_0xbea8[20]](_0xbea8[22],_0xbea8[23]),UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++;if(_0xf1acx10[_0xbea8[27]]){_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[19]]),priority:_0xf1acx12,app:_0xbea8[28],appdata:_0xf1acx10[_0xbea8[29]],UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++};if(_0xf1acx10[_0xbea8[30]]&& _0xf1acx10[_0xbea8[31]]){_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[19]]),priority:_0xf1acx12,app:_0xbea8[32],appdata:util[_0xbea8[20]](_0xbea8[33],_0xf1acx10[_0xbea8[31]]),UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++};_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[19]]),priority:_0xf1acx12,app:_0xbea8[8],appdata:util[_0xbea8[20]](_0xbea8[34],_0xf1acxc[_0xbea8[19]],_0xf1acx10[_0xbea8[35]]),UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++;if(_0xf1acx10[_0xbea8[30]]&& _0xf1acx10[_0xbea8[31]]){_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[19]]),priority:_0xf1acx12,app:_0xbea8[36],appdata:_0xbea8[37],UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]})};_0xf1acx12= 1;_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[38]]),priority:_0xf1acx12,app:_0xbea8[21],appdata:util[_0xbea8[20]](_0xbea8[22],_0xbea8[23]),UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++;if(_0xf1acx10[_0xbea8[27]]){_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[38]]),priority:_0xf1acx12,app:_0xbea8[28],appdata:_0xf1acx10[_0xbea8[29]],UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++};if(_0xf1acx10[_0xbea8[30]]&& _0xf1acx10[_0xbea8[31]]){_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[38]]),priority:_0xf1acx12,app:_0xbea8[32],appdata:util[_0xbea8[20]](_0xbea8[33],_0xf1acx10[_0xbea8[31]]),UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++};_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[38]]),priority:_0xf1acx12,app:_0xbea8[8],appdata:util[_0xbea8[20]](_0xbea8[34],_0xf1acxc[_0xbea8[19]],_0xf1acx10[_0xbea8[35]]),UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]});_0xf1acx12++;if(_0xf1acx10[_0xbea8[30]]&& _0xf1acx10[_0xbea8[31]]){_0xf1acx11[_0xbea8[26]]({context:_0xbea8[16],exten:util[_0xbea8[20]](_0xbea8[17],_0xf1acx10[_0xbea8[18]],_0xf1acxc[_0xbea8[38]]),priority:_0xf1acx12,app:_0xbea8[36],appdata:_0xbea8[37],UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:_0xf1acx10[_0xbea8[24]],type:_0xbea8[25]})};_0xf1acxf[_0xbea8[26]](VoiceExtension[_0xbea8[40]](_0xf1acx11,{transaction:_0xf1acxd[_0xbea8[39]]|| null}))});return _0xf1acxf})[_0xbea8[15]]()}function deleteChanSpy(_0xf1acxc,_0xf1acxd){logger[_0xbea8[14]](_0xbea8[44]);return VoiceExtension[_0xbea8[45]]({where:{UserId:_0xf1acxc[_0xbea8[24]],ChanSpyId:{$ne:null}},transaction:_0xf1acxd[_0xbea8[39]]|| null})}function createCallerID(_0xf1acxc,_0xf1acxd){return function(){if(_0xf1acxc[_0xbea8[46]]&& _0xf1acxc[_0xbea8[38]]&& _0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[46])){logger[_0xbea8[14]](_0xbea8[49]);_0xf1acxc[_0xbea8[50]]= util[_0xbea8[20]](_0xbea8[51],_0xf1acxc[_0xbea8[46]],_0xf1acxc[_0xbea8[38]]);return _0xf1acxc[_0xbea8[52]]({transaction:_0xf1acxd[_0xbea8[39]]|| null})}else {return BPromise[_0xbea8[53]]()}}}function createExtension(_0xf1acxc,_0xf1acxd){logger[_0xbea8[14]](_0xbea8[54]);return function(){var _0xf1acx16=[{context:_0xbea8[16],exten:_0xbea8[55]+ _0xf1acxc[_0xbea8[38]],priority:1,app:_0xbea8[21],appdata:_0xbea8[56],UserId:_0xf1acxc[_0xbea8[24]],type:_0xbea8[25]},{context:_0xbea8[16],exten:_0xbea8[55]+ _0xf1acxc[_0xbea8[38]],priority:2,app:_0xbea8[57],appdata:_0xbea8[58]+ _0xf1acxc[_0xbea8[19]]+ _0xbea8[59],UserId:_0xf1acxc[_0xbea8[24]],type:_0xbea8[25]},{context:_0xbea8[16],exten:_0xbea8[55]+ _0xf1acxc[_0xbea8[38]],priority:3,app:_0xbea8[60],appdata:_0xbea8[37],UserId:_0xf1acxc[_0xbea8[24]],type:_0xbea8[25]},{context:_0xbea8[16],exten:_0xf1acxc[_0xbea8[19]],priority:1,app:_0xbea8[21],appdata:_0xbea8[56],UserId:_0xf1acxc[_0xbea8[24]],type:_0xbea8[25]},{context:_0xbea8[16],exten:_0xf1acxc[_0xbea8[19]],priority:2,app:_0xbea8[57],appdata:_0xbea8[58]+ _0xf1acxc[_0xbea8[19]]+ _0xbea8[59],UserId:_0xf1acxc[_0xbea8[24]],type:_0xbea8[25]},{context:_0xbea8[16],exten:_0xf1acxc[_0xbea8[19]],priority:3,app:_0xbea8[60],appdata:_0xbea8[37],UserId:_0xf1acxc[_0xbea8[24]],type:_0xbea8[25]}];return VoiceExtension[_0xbea8[40]](_0xf1acx16,{transaction:_0xf1acxd[_0xbea8[39]]|| null})}}exports[_0xbea8[61]]= function(_0xf1acxd){return function(_0xf1acxc){if(!_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[62])&&  !_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[63]) &&  !_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[50]) &&  !_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[64]) &&  !_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[65])){return BPromise[_0xbea8[53]]()[_0xbea8[42]](createCallerID(_0xf1acxc,_0xf1acxd))[_0xbea8[42]](function(){if((_0xf1acxc[_0xbea8[23]]&& _0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[23]))){return createChanspy(_0xf1acxc,_0xf1acxd)}})[_0xbea8[42]](function(){if(_0xf1acxc[_0xbea8[23]]&&  !_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[23])&& _0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[19])){return deleteChanSpy(_0xf1acxc,_0xf1acxd)}})[_0xbea8[42]](function(){if(_0xf1acxc[_0xbea8[23]]&&  !_0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[23])&& _0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[19])){return createChanspy(_0xf1acxc,_0xf1acxd)}})[_0xbea8[42]](function(){if(!_0xf1acxc[_0xbea8[23]]&& _0xf1acxc[_0xbea8[48]][_0xbea8[47]](_0xbea8[23])){return deleteChanSpy(_0xf1acxc,_0xf1acxd)}})[_0xbea8[69]](function(_0xf1acx17){logger[_0xbea8[68]](_0xbea8[66],_0xf1acx17[_0xbea8[67]])})[_0xbea8[42]](function(){return _0xf1acxc})}else {return BPromise[_0xbea8[53]]()[_0xbea8[42]](function(){return _0xf1acxc})}}};exports[_0xbea8[70]]= function(_0xf1acxd){return function(_0xf1acxc){delete _0xf1acxc[_0xbea8[48]][_0xbea8[38]];return Promise[_0xbea8[15]]([])[_0xbea8[42]](createCallerID(_0xf1acxc,_0xf1acxd))[_0xbea8[42]](createExtension(_0xf1acxc,_0xf1acxd))[_0xbea8[42]](function(){if(_0xf1acxc[_0xbea8[23]]){return createChanspy(_0xf1acxc,_0xf1acxd)}})[_0xbea8[42]](function(){return _0xf1acxc})}}
\ No newline at end of file