c195cfb7c0f51814d723ef2cc37dc8ea5ef16abc
[motion.git] / server / config / ami / db / trunk.js
1 var _0xe2bd=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x54\x72\x75\x6E\x6B","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x65\x78\x70\x6F\x72\x74\x73","\x64\x65\x66\x61\x75\x6C\x74\x75\x73\x65\x72","\x73\x74\x61\x74\x75\x73","\x72\x65\x73\x6F\x6C\x76\x65","\x54\x72\x75\x6E\x6B\x20\x2D\x20\x72\x65\x67\x69\x73\x74\x72\x79","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x6F\x67","\x74\x68\x65\x6E","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x64\x6F\x6D\x61\x69\x6E","","\x75\x70\x64\x61\x74\x65","\x54\x72\x75\x6E\x6B\x20\x2D\x20\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x2F","\x73\x70\x6C\x69\x74","\x70\x65\x65\x72"];_0xe2bd[0];var BPromise=require(_0xe2bd[1]);var Trunk=require(_0xe2bd[3])[_0xe2bd[2]];var trunkStates={};module[_0xe2bd[4]]= function(){return {registry:function(_0xd9fcx4){return function(_0xd9fcx5){if(trunkStates[_0xd9fcx4[_0xe2bd[5]]]&& trunkStates[_0xd9fcx4[_0xe2bd[5]]]=== _0xd9fcx4[_0xe2bd[6]]){return BPromise[_0xe2bd[7]]()}else {trunkStates[_0xd9fcx4[_0xe2bd[5]]]= _0xd9fcx4[_0xe2bd[6]]};return Trunk[_0xe2bd[16]]({status:_0xd9fcx4[_0xe2bd[6]]},{where:{defaultuser:_0xd9fcx4[_0xe2bd[13]],host:_0xd9fcx4[_0xe2bd[14]],active:true,$and:[{registry:{$ne:_0xe2bd[15]}},{registry:{$ne:null}}]},individualHooks:true,raw:true})[_0xe2bd[12]](function(){console[_0xe2bd[11]](_0xe2bd[8],_0xd9fcx4[_0xe2bd[6]])})[_0xe2bd[10]](function(_0xd9fcx6){console[_0xe2bd[9]](_0xe2bd[8],_0xd9fcx6)})}},peerstatus:function(_0xd9fcx4){return function(_0xd9fcx5){return Trunk[_0xe2bd[16]]({peerstatus:_0xd9fcx4[_0xe2bd[18]]},{where:{name:_0xd9fcx4[_0xe2bd[21]][_0xe2bd[20]](_0xe2bd[19])[1]},individualHooks:true,raw:true})[_0xe2bd[12]](function(){console[_0xe2bd[11]](_0xe2bd[17],_0xd9fcx4[_0xe2bd[18]])})[_0xe2bd[10]](function(_0xd9fcx6){console[_0xe2bd[9]](_0xe2bd[17],_0xd9fcx6)})}}}}