Built motion from commit 1333b3551.|1.0.38
[motion.git] / server / config / tools / user.js
index cc75c83..60cf020 100644 (file)
@@ -1 +1 @@
-var _0x2c76=["\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","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x5F\x63\x68\x61\x6E\x67\x65\x64","\x63\x68\x61\x6E\x73\x70\x79","\x74\x68\x65\x6E","\x61\x6C\x6C","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x63\x68\x61\x6E\x67\x65\x64","\x59\x6F\x75\x20\x63\x61\x6E\x27\x74\x20\x6D\x6F\x64\x69\x66\x79\x20\x74\x68\x65\x20\x69\x6E\x74\x65\x72\x6E\x61\x6C\x20\x6F\x66\x20\x61\x20\x55\x73\x65\x72\x2F\x41\x67\x65\x6E\x74\x2F\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x62\x65\x66\x6F\x72\x65\x55\x70\x64\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x71\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64","\x6C\x61\x73\x74\x4C\x6F\x67\x69\x6E\x41\x74","\x6F\x6E\x6C\x69\x6E\x65","\x6E\x61\x6D\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x63\x68\x61\x6E\x73\x70\x79\x2E\x2E\x2E","\x6C\x6F\x67","\x61\x75\x74\x68","\x66\x72\x6F\x6D\x2D\x73\x69\x70","\x25\x73\x25\x73","\x70\x72\x65\x66\x69\x78","\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","\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","\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","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x63\x61\x6C\x6C\x65\x72\x49\x44\x2E\x2E\x2E","\x22\x25\x73\x22\x20\x3C\x25\x73\x3E","\x73\x61\x76\x65","\x55\x70\x64\x61\x74\x69\x6E\x67\x20\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x2E\x2E\x2E","\x65\x78\x74\x65\x6E","\x5F","\x61\x70\x70","\x44\x69\x61\x6C","\x61\x70\x70\x64\x61\x74\x61","\x53\x49\x50\x2F","\x2C\x74\x54\x78\x58","\x67\x65\x74\x55\x73\x65\x72\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E\x73","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x2E\x2E\x2E","\x53\x65\x74","\x43\x44\x52\x28\x74\x79\x70\x65\x29\x3D\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x48\x61\x6E\x67\x75\x70","","\x65\x78\x70\x6F\x72\x74\x73"];_0x2c76[0];var fs=require(_0x2c76[1]);var util=require(_0x2c76[2]);var path=require(_0x2c76[3]);var config=require(_0x2c76[4]);var UserModel=require(_0x2c76[6])[_0x2c76[5]];var VoiceExtension=require(_0x2c76[6])[_0x2c76[7]];var ChanSpy=require(_0x2c76[6])[_0x2c76[8]];var sequelize=require(_0x2c76[6])[_0x2c76[9]];var Promise=require(_0x2c76[10]);function User(){UserModel[_0x2c76[16]](function(_0xe32bxb,_0xe32bxc){delete _0xe32bxb[_0x2c76[12]][_0x2c76[11]];return Promise[_0x2c76[15]]([])[_0x2c76[14]](createCallerID(_0xe32bxb,_0xe32bxc))[_0x2c76[14]](createExtension(_0xe32bxb,_0xe32bxc))[_0x2c76[14]](function(){if(_0xe32bxb[_0x2c76[13]]){createChanspy(_0xe32bxb,_0xe32bxc)}})});UserModel[_0x2c76[19]](function(_0xe32bxb,_0xe32bxc){if(_0xe32bxb[_0x2c76[17]](_0x2c76[11])){throw  new sequelize.Error(_0x2c76[18])}});UserModel[_0x2c76[26]](function(_0xe32bxb,_0xe32bxc){if(!_0xe32bxb[_0x2c76[17]](_0x2c76[20])&& !_0xe32bxb[_0x2c76[17]](_0x2c76[21])&& !_0xe32bxb[_0x2c76[17]](_0x2c76[22])&& !_0xe32bxb[_0x2c76[17]](_0x2c76[23])&& !_0xe32bxb[_0x2c76[17]](_0x2c76[24])){return Promise[_0x2c76[15]]([])[_0x2c76[14]](updateExtension(_0xe32bxb,_0xe32bxc))[_0x2c76[14]](createCallerID(_0xe32bxb,_0xe32bxc))[_0x2c76[14]](function(){if((_0xe32bxb[_0x2c76[13]]&& _0xe32bxb[_0x2c76[17]](_0x2c76[13]))){createChanspy(_0xe32bxb,_0xe32bxc)}})[_0x2c76[14]](function(){if(_0xe32bxb[_0x2c76[13]]&& !_0xe32bxb[_0x2c76[17]](_0x2c76[13])&& _0xe32bxb[_0x2c76[17]](_0x2c76[25])){deleteChanSpy(_0xe32bxb,_0xe32bxc)}})[_0x2c76[14]](function(){if(_0xe32bxb[_0x2c76[13]]&& !_0xe32bxb[_0x2c76[17]](_0x2c76[13])&& _0xe32bxb[_0x2c76[17]](_0x2c76[25])){createChanspy(_0xe32bxb,_0xe32bxc)}})[_0x2c76[14]](function(){if(!_0xe32bxb[_0x2c76[13]]&& _0xe32bxb[_0x2c76[17]](_0x2c76[13])){deleteChanSpy(_0xe32bxb,_0xe32bxc)}})}})}function createChanspy(_0xe32bxb,_0xe32bxc){console[_0x2c76[28]](_0x2c76[27]);return function(){return ChanSpy[_0x2c76[44]]()[_0x2c76[14]](function(_0xe32bxe){var _0xe32bxf=[];_0xe32bxe[_0x2c76[43]](function(_0xe32bx10){var _0xe32bx11=[];var _0xe32bx12=1;if(_0xe32bx10[_0x2c76[29]]){_0xe32bx11[_0x2c76[38]]({context:_0x2c76[30],exten:util[_0x2c76[33]](_0x2c76[31],_0xe32bx10[_0x2c76[32]],_0xe32bxb[_0x2c76[25]]),priority:_0xe32bx12,app:_0x2c76[34],appdata:_0xe32bx10[_0x2c76[35]],UserId:_0xe32bxb[_0x2c76[36]],ChanSpyId:_0xe32bx10[_0x2c76[36]],type:_0x2c76[37]});_0xe32bx12++};_0xe32bx11[_0x2c76[38]]({context:_0x2c76[30],exten:util[_0x2c76[33]](_0x2c76[31],_0xe32bx10[_0x2c76[32]],_0xe32bxb[_0x2c76[25]]),priority:_0xe32bx12,app:_0x2c76[8],appdata:util[_0x2c76[33]](_0x2c76[39],_0xe32bxb[_0x2c76[25]],_0xe32bx10[_0x2c76[40]]),UserId:_0xe32bxb[_0x2c76[36]],ChanSpyId:_0xe32bx10[_0x2c76[36]],type:_0x2c76[37]});_0xe32bx12= 1;if(_0xe32bx10[_0x2c76[29]]){_0xe32bx11[_0x2c76[38]]({context:_0x2c76[30],exten:util[_0x2c76[33]](_0x2c76[31],_0xe32bx10[_0x2c76[32]],_0xe32bxb[_0x2c76[11]]),priority:_0xe32bx12,app:_0x2c76[34],appdata:_0xe32bx10[_0x2c76[35]],UserId:_0xe32bxb[_0x2c76[36]],ChanSpyId:_0xe32bx10[_0x2c76[36]],type:_0x2c76[37]});_0xe32bx12++};_0xe32bx11[_0x2c76[38]]({context:_0x2c76[30],exten:util[_0x2c76[33]](_0x2c76[31],_0xe32bx10[_0x2c76[32]],_0xe32bxb[_0x2c76[11]]),priority:_0xe32bx12,app:_0x2c76[8],appdata:util[_0x2c76[33]](_0x2c76[39],_0xe32bxb[_0x2c76[25]],_0xe32bx10[_0x2c76[40]]),UserId:_0xe32bxb[_0x2c76[36]],ChanSpyId:_0xe32bx10[_0x2c76[36]],type:_0x2c76[37]});_0xe32bxf[_0x2c76[38]](VoiceExtension[_0x2c76[42]](_0xe32bx11,{transaction:_0xe32bxc[_0x2c76[41]]}))});return _0xe32bxf})[_0x2c76[15]]()}}function deleteChanSpy(_0xe32bxb,_0xe32bxc){console[_0x2c76[28]](_0x2c76[45]);return function(){return VoiceExtension[_0x2c76[46]]({where:{UserId:_0xe32bxb[_0x2c76[36]],ChanSpyId:{$ne:null}},transaction:_0xe32bxc[_0x2c76[41]]})}}function createCallerID(_0xe32bxb,_0xe32bxc){return function(){if(_0xe32bxb[_0x2c76[47]]&& _0xe32bxb[_0x2c76[11]]&& _0xe32bxb[_0x2c76[17]](_0x2c76[47])){console[_0x2c76[28]](_0x2c76[48]);_0xe32bxb[_0x2c76[22]]= util[_0x2c76[33]](_0x2c76[49],_0xe32bxb[_0x2c76[47]],_0xe32bxb[_0x2c76[11]]);return _0xe32bxb[_0x2c76[50]]({transaction:_0xe32bxc[_0x2c76[41]]})};return}}function updateExtension(_0xe32bxb,_0xe32bxc){return function(){if(_0xe32bxb[_0x2c76[17]](_0x2c76[25])){console[_0x2c76[28]](_0x2c76[51]);return _0xe32bxb[_0x2c76[59]]()[_0x2c76[14]](function(_0xe32bx16){var _0xe32bx17,_0xe32bx18=[];_0xe32bx16[_0x2c76[43]](function(_0xe32bx10){_0xe32bx17= false;if(_0xe32bx10[_0x2c76[52]]!== _0x2c76[53]+ _0xe32bxb[_0x2c76[11]]){_0xe32bx10[_0x2c76[52]]= _0xe32bxb[_0x2c76[25]];_0xe32bx17= true};if(_0xe32bx10[_0x2c76[54]]=== _0x2c76[55]){_0xe32bx10[_0x2c76[56]]= _0x2c76[57]+ _0xe32bxb[_0x2c76[25]]+ _0x2c76[58];_0xe32bx17= true};if(_0xe32bx17){_0xe32bx18[_0x2c76[38]](_0xe32bx10[_0x2c76[50]]({transaction:_0xe32bxc[_0x2c76[41]]}))}});return _0xe32bx18})[_0x2c76[15]]()}}}function createExtension(_0xe32bxb,_0xe32bxc){console[_0x2c76[28]](_0x2c76[60]);return function(){var _0xe32bx1a=[{context:_0x2c76[30],exten:_0x2c76[53]+ _0xe32bxb[_0x2c76[11]],priority:1,app:_0x2c76[61],appdata:_0x2c76[62],UserId:_0xe32bxb[_0x2c76[36]],type:_0x2c76[37]},{context:_0x2c76[30],exten:_0x2c76[53]+ _0xe32bxb[_0x2c76[11]],priority:2,app:_0x2c76[55],appdata:_0x2c76[57]+ _0xe32bxb[_0x2c76[25]]+ _0x2c76[58],UserId:_0xe32bxb[_0x2c76[36]],type:_0x2c76[37]},{context:_0x2c76[30],exten:_0x2c76[53]+ _0xe32bxb[_0x2c76[11]],priority:3,app:_0x2c76[63],appdata:_0x2c76[64],UserId:_0xe32bxb[_0x2c76[36]],type:_0x2c76[37]},{context:_0x2c76[30],exten:_0xe32bxb[_0x2c76[25]],priority:1,app:_0x2c76[61],appdata:_0x2c76[62],UserId:_0xe32bxb[_0x2c76[36]],type:_0x2c76[37]},{context:_0x2c76[30],exten:_0xe32bxb[_0x2c76[25]],priority:2,app:_0x2c76[55],appdata:_0x2c76[57]+ _0xe32bxb[_0x2c76[25]]+ _0x2c76[58],UserId:_0xe32bxb[_0x2c76[36]],type:_0x2c76[37]},{context:_0x2c76[30],exten:_0xe32bxb[_0x2c76[25]],priority:3,app:_0x2c76[63],appdata:_0x2c76[64],UserId:_0xe32bxb[_0x2c76[36]],type:_0x2c76[37]}];return VoiceExtension[_0x2c76[42]](_0xe32bx1a,{transaction:_0xe32bxc[_0x2c76[41]]})}}module[_0x2c76[65]]= User
\ No newline at end of file
+var _0xd4ae=["\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"];_0xd4ae[0];var fs=require(_0xd4ae[1]);var util=require(_0xd4ae[2]);var path=require(_0xd4ae[3]);var config=require(_0xd4ae[4]);var UserModel=require(_0xd4ae[6])[_0xd4ae[5]];var VoiceExtension=require(_0xd4ae[6])[_0xd4ae[7]];var ChanSpy=require(_0xd4ae[6])[_0xd4ae[8]];var sequelize=require(_0xd4ae[6])[_0xd4ae[9]];var BPromise=require(_0xd4ae[10]);var logger=require(_0xd4ae[12])(_0xd4ae[11]);function createChanspy(_0xcfeaxc,_0xcfeaxd){logger[_0xd4ae[14]](_0xd4ae[13]);return ChanSpy[_0xd4ae[43]]()[_0xd4ae[42]](function(_0xcfeaxe){var _0xcfeaxf=[];_0xcfeaxe[_0xd4ae[41]](function(_0xcfeax10){var _0xcfeax11=[];var _0xcfeax12=1;_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[19]]),priority:_0xcfeax12,app:_0xd4ae[21],appdata:util[_0xd4ae[20]](_0xd4ae[22],_0xd4ae[23]),UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++;if(_0xcfeax10[_0xd4ae[27]]){_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[19]]),priority:_0xcfeax12,app:_0xd4ae[28],appdata:_0xcfeax10[_0xd4ae[29]],UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++};if(_0xcfeax10[_0xd4ae[30]]&& _0xcfeax10[_0xd4ae[31]]){_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[19]]),priority:_0xcfeax12,app:_0xd4ae[32],appdata:util[_0xd4ae[20]](_0xd4ae[33],_0xcfeax10[_0xd4ae[31]]),UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++};_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[19]]),priority:_0xcfeax12,app:_0xd4ae[8],appdata:util[_0xd4ae[20]](_0xd4ae[34],_0xcfeaxc[_0xd4ae[19]],_0xcfeax10[_0xd4ae[35]]),UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++;if(_0xcfeax10[_0xd4ae[30]]&& _0xcfeax10[_0xd4ae[31]]){_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[19]]),priority:_0xcfeax12,app:_0xd4ae[36],appdata:_0xd4ae[37],UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]})};_0xcfeax12= 1;_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[38]]),priority:_0xcfeax12,app:_0xd4ae[21],appdata:util[_0xd4ae[20]](_0xd4ae[22],_0xd4ae[23]),UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++;if(_0xcfeax10[_0xd4ae[27]]){_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[38]]),priority:_0xcfeax12,app:_0xd4ae[28],appdata:_0xcfeax10[_0xd4ae[29]],UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++};if(_0xcfeax10[_0xd4ae[30]]&& _0xcfeax10[_0xd4ae[31]]){_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[38]]),priority:_0xcfeax12,app:_0xd4ae[32],appdata:util[_0xd4ae[20]](_0xd4ae[33],_0xcfeax10[_0xd4ae[31]]),UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++};_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[38]]),priority:_0xcfeax12,app:_0xd4ae[8],appdata:util[_0xd4ae[20]](_0xd4ae[34],_0xcfeaxc[_0xd4ae[19]],_0xcfeax10[_0xd4ae[35]]),UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]});_0xcfeax12++;if(_0xcfeax10[_0xd4ae[30]]&& _0xcfeax10[_0xd4ae[31]]){_0xcfeax11[_0xd4ae[26]]({context:_0xd4ae[16],exten:util[_0xd4ae[20]](_0xd4ae[17],_0xcfeax10[_0xd4ae[18]],_0xcfeaxc[_0xd4ae[38]]),priority:_0xcfeax12,app:_0xd4ae[36],appdata:_0xd4ae[37],UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:_0xcfeax10[_0xd4ae[24]],type:_0xd4ae[25]})};_0xcfeaxf[_0xd4ae[26]](VoiceExtension[_0xd4ae[40]](_0xcfeax11,{transaction:_0xcfeaxd[_0xd4ae[39]]|| null}))});return _0xcfeaxf})[_0xd4ae[15]]()}function deleteChanSpy(_0xcfeaxc,_0xcfeaxd){logger[_0xd4ae[14]](_0xd4ae[44]);return VoiceExtension[_0xd4ae[45]]({where:{UserId:_0xcfeaxc[_0xd4ae[24]],ChanSpyId:{$ne:null}},transaction:_0xcfeaxd[_0xd4ae[39]]|| null})}function createCallerID(_0xcfeaxc,_0xcfeaxd){return function(){if(_0xcfeaxc[_0xd4ae[46]]&& _0xcfeaxc[_0xd4ae[38]]&& _0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[46])){logger[_0xd4ae[14]](_0xd4ae[49]);_0xcfeaxc[_0xd4ae[50]]= util[_0xd4ae[20]](_0xd4ae[51],_0xcfeaxc[_0xd4ae[46]],_0xcfeaxc[_0xd4ae[38]]);return _0xcfeaxc[_0xd4ae[52]]({transaction:_0xcfeaxd[_0xd4ae[39]]|| null})}else {return BPromise[_0xd4ae[53]]()}}}function createExtension(_0xcfeaxc,_0xcfeaxd){logger[_0xd4ae[14]](_0xd4ae[54]);return function(){var _0xcfeax16=[{context:_0xd4ae[16],exten:_0xd4ae[55]+ _0xcfeaxc[_0xd4ae[38]],priority:1,app:_0xd4ae[21],appdata:_0xd4ae[56],UserId:_0xcfeaxc[_0xd4ae[24]],type:_0xd4ae[25]},{context:_0xd4ae[16],exten:_0xd4ae[55]+ _0xcfeaxc[_0xd4ae[38]],priority:2,app:_0xd4ae[57],appdata:_0xd4ae[58]+ _0xcfeaxc[_0xd4ae[19]]+ _0xd4ae[59],UserId:_0xcfeaxc[_0xd4ae[24]],type:_0xd4ae[25]},{context:_0xd4ae[16],exten:_0xd4ae[55]+ _0xcfeaxc[_0xd4ae[38]],priority:3,app:_0xd4ae[60],appdata:_0xd4ae[37],UserId:_0xcfeaxc[_0xd4ae[24]],type:_0xd4ae[25]},{context:_0xd4ae[16],exten:_0xcfeaxc[_0xd4ae[19]],priority:1,app:_0xd4ae[21],appdata:_0xd4ae[56],UserId:_0xcfeaxc[_0xd4ae[24]],type:_0xd4ae[25]},{context:_0xd4ae[16],exten:_0xcfeaxc[_0xd4ae[19]],priority:2,app:_0xd4ae[57],appdata:_0xd4ae[58]+ _0xcfeaxc[_0xd4ae[19]]+ _0xd4ae[59],UserId:_0xcfeaxc[_0xd4ae[24]],type:_0xd4ae[25]},{context:_0xd4ae[16],exten:_0xcfeaxc[_0xd4ae[19]],priority:3,app:_0xd4ae[60],appdata:_0xd4ae[37],UserId:_0xcfeaxc[_0xd4ae[24]],type:_0xd4ae[25]}];return VoiceExtension[_0xd4ae[40]](_0xcfeax16,{transaction:_0xcfeaxd[_0xd4ae[39]]|| null})}}exports[_0xd4ae[61]]= function(_0xcfeaxd){return function(_0xcfeaxc){if(!_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[62])&&  !_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[63]) &&  !_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[50]) &&  !_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[64]) &&  !_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[65])){return BPromise[_0xd4ae[53]]()[_0xd4ae[42]](createCallerID(_0xcfeaxc,_0xcfeaxd))[_0xd4ae[42]](function(){if((_0xcfeaxc[_0xd4ae[23]]&& _0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[23]))){return createChanspy(_0xcfeaxc,_0xcfeaxd)}})[_0xd4ae[42]](function(){if(_0xcfeaxc[_0xd4ae[23]]&&  !_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[23])&& _0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[19])){return deleteChanSpy(_0xcfeaxc,_0xcfeaxd)}})[_0xd4ae[42]](function(){if(_0xcfeaxc[_0xd4ae[23]]&&  !_0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[23])&& _0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[19])){return createChanspy(_0xcfeaxc,_0xcfeaxd)}})[_0xd4ae[42]](function(){if(!_0xcfeaxc[_0xd4ae[23]]&& _0xcfeaxc[_0xd4ae[48]][_0xd4ae[47]](_0xd4ae[23])){return deleteChanSpy(_0xcfeaxc,_0xcfeaxd)}})[_0xd4ae[69]](function(_0xcfeax17){logger[_0xd4ae[68]](_0xd4ae[66],_0xcfeax17[_0xd4ae[67]])})[_0xd4ae[42]](function(){return _0xcfeaxc})}else {return BPromise[_0xd4ae[53]]()[_0xd4ae[42]](function(){return _0xcfeaxc})}}};exports[_0xd4ae[70]]= function(_0xcfeaxd){return function(_0xcfeaxc){delete _0xcfeaxc[_0xd4ae[48]][_0xd4ae[38]];return Promise[_0xd4ae[15]]([])[_0xd4ae[42]](createCallerID(_0xcfeaxc,_0xcfeaxd))[_0xd4ae[42]](createExtension(_0xcfeaxc,_0xcfeaxd))[_0xd4ae[42]](function(){if(_0xcfeaxc[_0xd4ae[23]]){return createChanspy(_0xcfeaxc,_0xcfeaxd)}})[_0xd4ae[42]](function(){return _0xcfeaxc})}}
\ No newline at end of file