Built motion from commit 228ea3299.|1.0.34
[motion.git] / server / config / tools / interval.js
1 var _0xb7f7=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x49\x6E\x74\x65\x72\x76\x61\x6C","\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","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x76\x6F\x69\x63\x65\x5F\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x49\x6E\x74\x65\x72\x76\x61\x6C\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E","\x64\x65\x62\x75\x67","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x69\x64","\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E\x73\x20\x75\x70\x64\x61\x74\x65\x20\x62\x79\x20\x69\x6E\x74\x65\x72\x76\x61\x6C\x20\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x50\x52\x49\x4D\x41\x52\x59","\x66\x69\x65\x6C\x64\x73","\x6D\x65\x73\x73\x61\x67\x65","\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E\x2F\x63\x6F\x6E\x74\x65\x78\x74\x20\x63\x6F\x6D\x62\x69\x6E\x61\x74\x69\x6F\x6E\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x65\x78\x69\x73\x74","\x74\x72\x61\x6E\x73\x6C\x61\x74\x65\x64\x4D\x65\x73\x73\x61\x67\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x52\x4F\x55\x54\x45","\x61\x6C\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x72\x6F\x75\x74\x65\x55\x70\x64\x61\x74\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x74\x68\x65\x6E","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E\x49\x64","\x6D\x61\x70","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x73\x63\x6F\x70\x65","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73"];_0xb7f7[0];var _=require(_0xb7f7[1]);var util=require(_0xb7f7[2]);var IntervalModel=require(_0xb7f7[4])[_0xb7f7[3]];var VoiceExtension=require(_0xb7f7[4])[_0xb7f7[5]];var veUtil=require(_0xb7f7[6]);var sequelize=require(_0xb7f7[4])[_0xb7f7[7]];var Applications=veUtil[_0xb7f7[8]];var logger=require(_0xb7f7[10])(_0xb7f7[9]);function Interval(){logger[_0xb7f7[12]](_0xb7f7[11]);IntervalModel[_0xb7f7[14]](function(_0xa2e4xa){if(_0xa2e4xa[_0xb7f7[13]]!== null){updatevoiceExtension(_0xa2e4xa)}});IntervalModel[_0xb7f7[15]](function(_0xa2e4xa){if(_0xa2e4xa[_0xb7f7[13]]!== null){updatevoiceExtension(_0xa2e4xa)}});IntervalModel[_0xb7f7[16]](function(_0xa2e4xa){if(_0xa2e4xa[_0xb7f7[13]]!== null){updatevoiceExtension(_0xa2e4xa)}})}function updatevoiceExtension(_0xa2e4xa){var _0xa2e4xc=_0xa2e4xa[_0xb7f7[13]]=== null?_0xa2e4xa[_0xb7f7[17]]:_0xa2e4xa[_0xb7f7[13]];return sequelize[_0xb7f7[39]](function(_0xa2e4xe){return VoiceExtension[_0xb7f7[36]]({where:{VoiceExtensionId:{$ne:null},IntervalId:_0xa2e4xc},raw:true,distinct:_0xb7f7[34],attributes:[_0xb7f7[17],_0xb7f7[34]]})[_0xb7f7[33]](function(_0xa2e4x12){var _0xa2e4x13=_[_0xb7f7[35]](_0xa2e4x12,_0xb7f7[34]);return VoiceExtension[_0xb7f7[38]](_0xb7f7[37])[_0xb7f7[36]]({where:{id:_0xa2e4x13}})})[_0xb7f7[33]](function(_0xa2e4xf){var _0xa2e4x10=[];_0xa2e4xf[_0xb7f7[32]](function(_0xa2e4x11){_0xa2e4x10[_0xb7f7[31]](veUtil[_0xb7f7[30]]({body:_0xa2e4x11[_0xb7f7[29]],params:{id:_0xa2e4x11[_0xb7f7[17]]}},_0xa2e4xe))});return _0xa2e4x10})[_0xb7f7[28]]()})[_0xb7f7[21]](sequelize.UniqueConstraintError,function(_0xa2e4xd){if(_0xa2e4xd[_0xb7f7[23]][_0xb7f7[22]]){_0xa2e4xd[_0xb7f7[24]]= _0xb7f7[25];_0xa2e4xd[_0xb7f7[26]]= _0xb7f7[27]};logger[_0xb7f7[20]](_0xa2e4xd[_0xb7f7[19]])})[_0xb7f7[21]](function(_0xa2e4xd){logger[_0xb7f7[20]](_0xb7f7[18],_0xa2e4xd[_0xb7f7[19]])})}module[_0xb7f7[40]]= Interval