Built motion from commit b33b832.|1.0.17
[motion.git] / server / config / tools / user.js
index 54997db..9f8e63f 100644 (file)
@@ -1 +1 @@
-var _0xe07d=["\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\x70\x72\x65\x76\x69\x6F\x75\x73\x44\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x61\x70\x70\x64\x61\x74\x61","\x53\x49\x50\x2F","\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","\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","\x48\x61\x6E\x67\x75\x70","","\x65\x78\x70\x6F\x72\x74\x73"];_0xe07d[0];var fs=require(_0xe07d[1]);var util=require(_0xe07d[2]);var path=require(_0xe07d[3]);var config=require(_0xe07d[4]);var UserModel=require(_0xe07d[6])[_0xe07d[5]];var VoiceExtension=require(_0xe07d[6])[_0xe07d[7]];var ChanSpy=require(_0xe07d[6])[_0xe07d[8]];var sequelize=require(_0xe07d[6])[_0xe07d[9]];var Promise=require(_0xe07d[10]);function User(){UserModel[_0xe07d[16]](function(_0x675cxb,_0x675cxc){delete _0x675cxb[_0xe07d[12]][_0xe07d[11]];return Promise[_0xe07d[15]]([])[_0xe07d[14]](createCallerID(_0x675cxb,_0x675cxc))[_0xe07d[14]](createExtension(_0x675cxb,_0x675cxc))[_0xe07d[14]](function(){if(_0x675cxb[_0xe07d[13]]){createChanspy(_0x675cxb,_0x675cxc)}})});UserModel[_0xe07d[19]](function(_0x675cxb,_0x675cxc){if(_0x675cxb[_0xe07d[17]](_0xe07d[11])){throw  new sequelize.Error(_0xe07d[18])}});UserModel[_0xe07d[26]](function(_0x675cxb,_0x675cxc){if(!_0x675cxb[_0xe07d[17]](_0xe07d[20])&&!_0x675cxb[_0xe07d[17]](_0xe07d[21])&&!_0x675cxb[_0xe07d[17]](_0xe07d[22])&&!_0x675cxb[_0xe07d[17]](_0xe07d[23])&&!_0x675cxb[_0xe07d[17]](_0xe07d[24])){return Promise[_0xe07d[15]]([])[_0xe07d[14]](updateExtension(_0x675cxb,_0x675cxc))[_0xe07d[14]](createCallerID(_0x675cxb,_0x675cxc))[_0xe07d[14]](function(){if((_0x675cxb[_0xe07d[13]]&&_0x675cxb[_0xe07d[17]](_0xe07d[13]))){createChanspy(_0x675cxb,_0x675cxc)}})[_0xe07d[14]](function(){if(_0x675cxb[_0xe07d[13]]&&!_0x675cxb[_0xe07d[17]](_0xe07d[13])&&_0x675cxb[_0xe07d[17]](_0xe07d[25])){deleteChanSpy(_0x675cxb,_0x675cxc)}})[_0xe07d[14]](function(){if(_0x675cxb[_0xe07d[13]]&&!_0x675cxb[_0xe07d[17]](_0xe07d[13])&&_0x675cxb[_0xe07d[17]](_0xe07d[25])){createChanspy(_0x675cxb,_0x675cxc)}})[_0xe07d[14]](function(){if(!_0x675cxb[_0xe07d[13]]&&_0x675cxb[_0xe07d[17]](_0xe07d[13])){deleteChanSpy(_0x675cxb,_0x675cxc)}})}})}function createChanspy(_0x675cxb,_0x675cxc){console[_0xe07d[28]](_0xe07d[27]);return function(){return ChanSpy[_0xe07d[44]]()[_0xe07d[14]](function(_0x675cxe){var _0x675cxf=[];_0x675cxe[_0xe07d[43]](function(_0x675cx10){var _0x675cx11=[];var _0x675cx12=1;if(_0x675cx10[_0xe07d[29]]){_0x675cx11[_0xe07d[38]]({context:_0xe07d[30],exten:util[_0xe07d[33]](_0xe07d[31],_0x675cx10[_0xe07d[32]],_0x675cxb[_0xe07d[25]]),priority:_0x675cx12,app:_0xe07d[34],appdata:_0x675cx10[_0xe07d[35]],UserId:_0x675cxb[_0xe07d[36]],ChanSpyId:_0x675cx10[_0xe07d[36]],type:_0xe07d[37]});_0x675cx12++};_0x675cx11[_0xe07d[38]]({context:_0xe07d[30],exten:util[_0xe07d[33]](_0xe07d[31],_0x675cx10[_0xe07d[32]],_0x675cxb[_0xe07d[25]]),priority:_0x675cx12,app:_0xe07d[8],appdata:util[_0xe07d[33]](_0xe07d[39],_0x675cxb[_0xe07d[25]],_0x675cx10[_0xe07d[40]]),UserId:_0x675cxb[_0xe07d[36]],ChanSpyId:_0x675cx10[_0xe07d[36]],type:_0xe07d[37]});_0x675cx12=1;if(_0x675cx10[_0xe07d[29]]){_0x675cx11[_0xe07d[38]]({context:_0xe07d[30],exten:util[_0xe07d[33]](_0xe07d[31],_0x675cx10[_0xe07d[32]],_0x675cxb[_0xe07d[11]]),priority:_0x675cx12,app:_0xe07d[34],appdata:_0x675cx10[_0xe07d[35]],UserId:_0x675cxb[_0xe07d[36]],ChanSpyId:_0x675cx10[_0xe07d[36]],type:_0xe07d[37]});_0x675cx12++};_0x675cx11[_0xe07d[38]]({context:_0xe07d[30],exten:util[_0xe07d[33]](_0xe07d[31],_0x675cx10[_0xe07d[32]],_0x675cxb[_0xe07d[11]]),priority:_0x675cx12,app:_0xe07d[8],appdata:util[_0xe07d[33]](_0xe07d[39],_0x675cxb[_0xe07d[25]],_0x675cx10[_0xe07d[40]]),UserId:_0x675cxb[_0xe07d[36]],ChanSpyId:_0x675cx10[_0xe07d[36]],type:_0xe07d[37]});_0x675cxf[_0xe07d[38]](VoiceExtension[_0xe07d[42]](_0x675cx11,{transaction:_0x675cxc[_0xe07d[41]]}))});return _0x675cxf})[_0xe07d[15]]()}}function deleteChanSpy(_0x675cxb,_0x675cxc){console[_0xe07d[28]](_0xe07d[45]);return function(){return VoiceExtension[_0xe07d[46]]({where:{UserId:_0x675cxb[_0xe07d[36]],ChanSpyId:{$ne:null}},transaction:_0x675cxc[_0xe07d[41]]})}}function createCallerID(_0x675cxb,_0x675cxc){return function(){if(_0x675cxb[_0xe07d[47]]&&_0x675cxb[_0xe07d[11]]&&_0x675cxb[_0xe07d[17]](_0xe07d[47])){console[_0xe07d[28]](_0xe07d[48]);_0x675cxb[_0xe07d[22]]=util[_0xe07d[33]](_0xe07d[49],_0x675cxb[_0xe07d[47]],_0x675cxb[_0xe07d[11]]);return _0x675cxb[_0xe07d[50]]({transaction:_0x675cxc[_0xe07d[41]]})};return}}function updateExtension(_0x675cxb,_0x675cxc){return function(){if(_0x675cxb[_0xe07d[17]](_0xe07d[25])){console[_0xe07d[28]](_0xe07d[51]);return _0x675cxb[_0xe07d[56]]()[_0xe07d[14]](function(_0x675cx16){_0x675cx16[_0xe07d[43]](function(_0x675cx10){_0x675cx10[_0xe07d[52]]=(_0x675cx10[_0xe07d[52]]===_0x675cxb[_0xe07d[53]][_0xe07d[11]])?_0x675cxb[_0xe07d[11]]:_0x675cxb[_0xe07d[25]];_0x675cx10[_0xe07d[54]]=_0xe07d[55]+_0x675cxb[_0xe07d[25]];return _0x675cx10[_0xe07d[50]]({transaction:_0x675cxc[_0xe07d[41]]})})})}}}function createExtension(_0x675cxb,_0x675cxc){console[_0xe07d[28]](_0xe07d[57]);return function(){var _0x675cx18=[{context:_0xe07d[30],exten:_0xe07d[58]+_0x675cxb[_0xe07d[11]],priority:1,app:_0xe07d[59],appdata:_0xe07d[60],UserId:_0x675cxb[_0xe07d[36]],type:_0xe07d[37]},{context:_0xe07d[30],exten:_0xe07d[58]+_0x675cxb[_0xe07d[11]],priority:2,app:_0xe07d[61],appdata:_0xe07d[55]+_0x675cxb[_0xe07d[25]],UserId:_0x675cxb[_0xe07d[36]],type:_0xe07d[37]},{context:_0xe07d[30],exten:_0xe07d[58]+_0x675cxb[_0xe07d[11]],priority:3,app:_0xe07d[62],appdata:_0xe07d[63],UserId:_0x675cxb[_0xe07d[36]],type:_0xe07d[37]},{context:_0xe07d[30],exten:_0x675cxb[_0xe07d[25]],priority:1,app:_0xe07d[59],appdata:_0xe07d[60],UserId:_0x675cxb[_0xe07d[36]],type:_0xe07d[37]},{context:_0xe07d[30],exten:_0x675cxb[_0xe07d[25]],priority:2,app:_0xe07d[61],appdata:_0xe07d[55]+_0x675cxb[_0xe07d[25]],UserId:_0x675cxb[_0xe07d[36]],type:_0xe07d[37]},{context:_0xe07d[30],exten:_0x675cxb[_0xe07d[25]],priority:3,app:_0xe07d[62],appdata:_0xe07d[63],UserId:_0x675cxb[_0xe07d[36]],type:_0xe07d[37]}];return VoiceExtension[_0xe07d[42]](_0x675cx18,{transaction:_0x675cxc[_0xe07d[41]]})}}module[_0xe07d[64]]=User
\ No newline at end of file
+var _0x1080=["\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","\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\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","\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","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65"];_0x1080[0];var fs=require(_0x1080[1]);var util=require(_0x1080[2]);var path=require(_0x1080[3]);var config=require(_0x1080[4]);var UserModel=require(_0x1080[6])[_0x1080[5]];var VoiceExtension=require(_0x1080[6])[_0x1080[7]];var ChanSpy=require(_0x1080[6])[_0x1080[8]];var sequelize=require(_0x1080[6])[_0x1080[9]];var BPromise=require(_0x1080[10]);function createChanspy(_0x7579xb,_0x7579xc){console[_0x1080[12]](_0x1080[11]);return ChanSpy[_0x1080[41]]()[_0x1080[40]](function(_0x7579xd){var _0x7579xe=[];_0x7579xd[_0x1080[39]](function(_0x7579xf){var _0x7579x10=[];var _0x7579x11=1;_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[17]]),priority:_0x7579x11,app:_0x1080[19],appdata:util[_0x1080[18]](_0x1080[20],_0x1080[21]),UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++;if(_0x7579xf[_0x1080[25]]){_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[17]]),priority:_0x7579x11,app:_0x1080[26],appdata:_0x7579xf[_0x1080[27]],UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++};if(_0x7579xf[_0x1080[28]]&& _0x7579xf[_0x1080[29]]){_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[17]]),priority:_0x7579x11,app:_0x1080[30],appdata:util[_0x1080[18]](_0x1080[31],_0x7579xf[_0x1080[29]]),UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++};_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[17]]),priority:_0x7579x11,app:_0x1080[8],appdata:util[_0x1080[18]](_0x1080[32],_0x7579xb[_0x1080[17]],_0x7579xf[_0x1080[33]]),UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++;if(_0x7579xf[_0x1080[28]]&& _0x7579xf[_0x1080[29]]){_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[17]]),priority:_0x7579x11,app:_0x1080[34],appdata:_0x1080[35],UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]})};_0x7579x11= 1;_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[36]]),priority:_0x7579x11,app:_0x1080[19],appdata:util[_0x1080[18]](_0x1080[20],_0x1080[21]),UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++;if(_0x7579xf[_0x1080[25]]){_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[36]]),priority:_0x7579x11,app:_0x1080[26],appdata:_0x7579xf[_0x1080[27]],UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++};if(_0x7579xf[_0x1080[28]]&& _0x7579xf[_0x1080[29]]){_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[36]]),priority:_0x7579x11,app:_0x1080[30],appdata:util[_0x1080[18]](_0x1080[31],_0x7579xf[_0x1080[29]]),UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++};_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[36]]),priority:_0x7579x11,app:_0x1080[8],appdata:util[_0x1080[18]](_0x1080[32],_0x7579xb[_0x1080[17]],_0x7579xf[_0x1080[33]]),UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]});_0x7579x11++;if(_0x7579xf[_0x1080[28]]&& _0x7579xf[_0x1080[29]]){_0x7579x10[_0x1080[24]]({context:_0x1080[14],exten:util[_0x1080[18]](_0x1080[15],_0x7579xf[_0x1080[16]],_0x7579xb[_0x1080[36]]),priority:_0x7579x11,app:_0x1080[34],appdata:_0x1080[35],UserId:_0x7579xb[_0x1080[22]],ChanSpyId:_0x7579xf[_0x1080[22]],type:_0x1080[23]})};_0x7579xe[_0x1080[24]](VoiceExtension[_0x1080[38]](_0x7579x10,{transaction:_0x7579xc[_0x1080[37]]|| null}))});return _0x7579xe})[_0x1080[13]]()}function deleteChanSpy(_0x7579xb,_0x7579xc){console[_0x1080[12]](_0x1080[42]);return VoiceExtension[_0x1080[43]]({where:{UserId:_0x7579xb[_0x1080[22]],ChanSpyId:{$ne:null}},transaction:_0x7579xc[_0x1080[37]]|| null})}function createCallerID(_0x7579xb,_0x7579xc){return function(){if(_0x7579xb[_0x1080[44]]&& _0x7579xb[_0x1080[36]]&& _0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[44])){console[_0x1080[12]](_0x1080[47]);_0x7579xb[_0x1080[48]]= util[_0x1080[18]](_0x1080[49],_0x7579xb[_0x1080[44]],_0x7579xb[_0x1080[36]]);return _0x7579xb[_0x1080[50]]({transaction:_0x7579xc[_0x1080[37]]|| null})}else {return BPromise[_0x1080[51]]()}}}function createExtension(_0x7579xb,_0x7579xc){console[_0x1080[12]](_0x1080[52]);return function(){var _0x7579x15=[{context:_0x1080[14],exten:_0x1080[53]+ _0x7579xb[_0x1080[36]],priority:1,app:_0x1080[19],appdata:_0x1080[54],UserId:_0x7579xb[_0x1080[22]],type:_0x1080[23]},{context:_0x1080[14],exten:_0x1080[53]+ _0x7579xb[_0x1080[36]],priority:2,app:_0x1080[55],appdata:_0x1080[56]+ _0x7579xb[_0x1080[17]]+ _0x1080[57],UserId:_0x7579xb[_0x1080[22]],type:_0x1080[23]},{context:_0x1080[14],exten:_0x1080[53]+ _0x7579xb[_0x1080[36]],priority:3,app:_0x1080[58],appdata:_0x1080[35],UserId:_0x7579xb[_0x1080[22]],type:_0x1080[23]},{context:_0x1080[14],exten:_0x7579xb[_0x1080[17]],priority:1,app:_0x1080[19],appdata:_0x1080[54],UserId:_0x7579xb[_0x1080[22]],type:_0x1080[23]},{context:_0x1080[14],exten:_0x7579xb[_0x1080[17]],priority:2,app:_0x1080[55],appdata:_0x1080[56]+ _0x7579xb[_0x1080[17]]+ _0x1080[57],UserId:_0x7579xb[_0x1080[22]],type:_0x1080[23]},{context:_0x1080[14],exten:_0x7579xb[_0x1080[17]],priority:3,app:_0x1080[58],appdata:_0x1080[35],UserId:_0x7579xb[_0x1080[22]],type:_0x1080[23]}];return VoiceExtension[_0x1080[38]](_0x7579x15,{transaction:_0x7579xc[_0x1080[37]]|| null})}}exports[_0x1080[59]]= function(_0x7579xc){return function(_0x7579xb){if(!_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[60])&&  !_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[61]) &&  !_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[48]) &&  !_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[62]) &&  !_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[63])){return BPromise[_0x1080[51]]()[_0x1080[40]](createCallerID(_0x7579xb,_0x7579xc))[_0x1080[40]](function(){if((_0x7579xb[_0x1080[21]]&& _0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[21]))){return createChanspy(_0x7579xb,_0x7579xc)}})[_0x1080[40]](function(){if(_0x7579xb[_0x1080[21]]&&  !_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[21])&& _0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[17])){return deleteChanSpy(_0x7579xb,_0x7579xc)}})[_0x1080[40]](function(){if(_0x7579xb[_0x1080[21]]&&  !_0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[21])&& _0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[17])){return createChanspy(_0x7579xb,_0x7579xc)}})[_0x1080[40]](function(){if(!_0x7579xb[_0x1080[21]]&& _0x7579xb[_0x1080[46]][_0x1080[45]](_0x1080[21])){return deleteChanSpy(_0x7579xb,_0x7579xc)}})[_0x1080[66]](function(_0x7579x16){console[_0x1080[12]](_0x1080[64],_0x7579x16[_0x1080[65]])})[_0x1080[40]](function(){return _0x7579xb})}else {return BPromise[_0x1080[51]]()[_0x1080[40]](function(){return _0x7579xb})}}};exports[_0x1080[67]]= function(_0x7579xc){return function(_0x7579xb){delete _0x7579xb[_0x1080[46]][_0x1080[36]];return Promise[_0x1080[13]]([])[_0x1080[40]](createCallerID(_0x7579xb,_0x7579xc))[_0x1080[40]](createExtension(_0x7579xb,_0x7579xc))[_0x1080[40]](function(){if(_0x7579xb[_0x1080[21]]){return createChanspy(_0x7579xb,_0x7579xc)}})[_0x1080[40]](function(){return _0x7579xb})}}
\ No newline at end of file