Built motion from commit e3a5454.|0.0.47
[motion.git] / server / config / ami / action.js
1 var _0xbc98=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6D\x6F\x6D\x65\x6E\x74","\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72","\x41\x63\x74\x69\x6F\x6E","\x55\x73\x65\x72","\x41\x63\x74\x69\x6F\x6E\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x76\x6F\x69\x63\x65","\x63\x68\x61\x74","\x6D\x61\x69\x6C","\x66\x61\x78","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72\x2E\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x6C\x6C","\x65\x6E\x74\x65\x72\x41\x74","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x75\x70\x64\x61\x74\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x74\x68\x65\x6E","\x63\x68\x61\x6E\x6E\x65\x6C","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x62\x65\x66\x6F\x72\x65\x43\x72\x65\x61\x74\x65","\x6E\x61\x6D\x65","\x25\x73\x2F\x25\x73","\x53\x49\x50","\x74\x79\x70\x65","\x62\x6F\x64\x79","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x51\x75\x65\x75\x65\x50\x61\x75\x73\x65","\x61\x63\x74\x69\x6F\x6E","\x70\x72\x6F\x6D\x69\x73\x69\x66\x79","\x41\x6C\x72\x65\x61\x64\x79\x20\x50\x61\x75\x73\x65\x20\x4F\x66\x66","\x66\x69\x6E\x64\x4F\x6E\x65","\x25\x73\x25\x73","\x50\x61\x75\x73\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x4C\x4F\x47\x49\x4E","\x51\x75\x65\x75\x65\x41\x64\x64","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x51\x75\x65\x75\x65\x52\x65\x6D\x6F\x76\x65","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x67\x65\x6E\x74","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64\x42\x79\x49\x64","\x70\x61\x75\x73\x65","\x75\x6E\x70\x61\x75\x73\x65","\x64\x61\x74\x61\x31","\x6C\x6F\x67\x69\x6E","\x6C\x6F\x67\x6F\x75\x74","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x63\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73"];_0xbc98[0];var moment=require(_0xbc98[1]);var util=require(_0xbc98[2]);var Promise=require(_0xbc98[3]);var Sequelize=require(_0xbc98[5])[_0xbc98[4]];var ReportMember=require(_0xbc98[5])[_0xbc98[6]];var _Action=require(_0xbc98[5])[_0xbc98[7]];var Agent=require(_0xbc98[5])[_0xbc98[8]];function Action(_0xafb6x9){console[_0xbc98[10]](_0xbc98[9]);var _0xafb6xa=[_0xbc98[11],_0xbc98[12],_0xbc98[13],_0xbc98[14]];_Action[_0xbc98[15]](function(_0xafb6xb,_0xafb6xc){return _0xafb6x24(_0xafb6xb,_0xafb6xc,_0xafb6x9)});ReportMember[_0xbc98[31]](function(_0xafb6xb,_0xafb6xc){console[_0xbc98[10]](_0xbc98[16]);return ReportMember[_0xbc98[30]]({where:{channel:_0xafb6xb[_0xbc98[27]],membername:_0xafb6xb[_0xbc98[28]],interface:_0xafb6xb[_0xbc98[29]],exitAt:null}})[_0xbc98[26]](function(_0xafb6xd){var _0xafb6xe=[];var _0xafb6xf=moment();_0xafb6xd[_0xbc98[25]](function(_0xafb6x10){var _0xafb6x11=moment(_0xafb6x10[_0xbc98[18]]);_0xafb6xe[_0xbc98[24]](_0xafb6x10[_0xbc98[23]]({exitAt:_0xafb6xf[_0xbc98[20]](_0xbc98[19]),duration:_0xafb6xf[_0xbc98[22]](_0xafb6x11,_0xbc98[21])}))});return _0xafb6xe})[_0xbc98[17]]()});function _0xafb6x12(_0xafb6xc,_0xafb6x13){return function(_0xafb6x14){return Promise[_0xbc98[41]](_0xafb6x9[_0xbc98[40]])({action:_0xbc98[39],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),paused:true,reason:_0xafb6xc[_0xbc98[36]][_0xbc98[35]]})[_0xbc98[26]](function(_0xafb6x17){return _0xafb6x14[_0xbc98[23]]({voicePause:true,chatPause:true,mailPause:true,faxPause:true,pauseType:_0xafb6xc[_0xbc98[36]][_0xbc98[35]]},{transaction:_0xafb6xc[_0xbc98[37]]})})[_0xbc98[26]](function(_0xafb6x14){var _0xafb6x15=[];_0xafb6xa[_0xbc98[25]](function(_0xafb6x16){_0xafb6x15[_0xbc98[24]]({channel:_0xafb6x16,membername:_0xafb6x14[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),type:_0xafb6xc[_0xbc98[36]][_0xbc98[35]],enterAt:moment()[_0xbc98[20]](_0xbc98[19])})});return ReportMember[_0xbc98[38]](_0xafb6x15,{individualHooks:true,transaction:_0xafb6xc[_0xbc98[37]]})})}}function _0xafb6x18(_0xafb6xc,_0xafb6x13){return function(_0xafb6x14){if(!_0xafb6xc[_0xbc98[36]]){_0xafb6xc[_0xbc98[36]]={}};switch(_0xafb6xc[_0xbc98[36]][_0xbc98[27]]){case _0xbc98[11]:return Promise[_0xbc98[41]](_0xafb6x9[_0xbc98[40]])({action:_0xbc98[39],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),paused:false,reason:_0xafb6xc[_0xbc98[36]][_0xbc98[35]]})[_0xbc98[26]](function(){return _0xafb6x14[_0xbc98[23]]({voicePause:false},{transaction:_0xafb6xc[_0xbc98[37]]})})[_0xbc98[26]](function(_0xafb6x14){var _0xafb6xf=moment();return ReportMember[_0xbc98[43]]({where:{channel:_0xafb6xc[_0xbc98[36]][_0xbc98[27]],membername:_0xafb6x14[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),exitAt:null}})})[_0xbc98[26]](_0xafb6x21({message:_0xbc98[42]}))[_0xbc98[26]](function(_0xafb6x19){var _0xafb6xf=moment();var _0xafb6x11=moment(_0xafb6x19[_0xbc98[18]]);return _0xafb6x19[_0xbc98[23]]({exitAt:_0xafb6xf[_0xbc98[20]](_0xbc98[19]),duration:_0xafb6xf[_0xbc98[22]](_0xafb6x11,_0xbc98[21])},{individualHooks:true,transaction:_0xafb6xc[_0xbc98[37]]})})[_0xbc98[26]](function(){return _0xafb6x14});case _0xbc98[12]:;case _0xbc98[13]:;case _0xbc98[14]:var _0xafb6x1a={};_0xafb6x1a[util[_0xbc98[20]](_0xbc98[44],_0xafb6xc[_0xbc98[36]][_0xbc98[27]],_0xbc98[45])]=false;return _0xafb6x14[_0xbc98[23]](_0xafb6x1a,{transaction:_0xafb6xc[_0xbc98[37]]})[_0xbc98[26]](function(_0xafb6x14){var _0xafb6xf=moment();return ReportMember[_0xbc98[43]]({where:{channel:_0xafb6xc[_0xbc98[36]][_0xbc98[27]],membername:_0xafb6x14[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),exitAt:null}})})[_0xbc98[26]](_0xafb6x21({message:_0xbc98[42]}))[_0xbc98[26]](function(_0xafb6x19){var _0xafb6xf=moment();var _0xafb6x11=moment(_0xafb6x19[_0xbc98[18]]);return _0xafb6x19[_0xbc98[23]]({exitAt:_0xafb6xf[_0xbc98[20]](_0xbc98[19]),duration:_0xafb6xf[_0xbc98[22]](_0xafb6x11,_0xbc98[21])},{individualHooks:true,transaction:_0xafb6xc[_0xbc98[37]]})})[_0xbc98[26]](function(){return _0xafb6x14});default:var _0xafb6x13=Promise[_0xbc98[41]](_0xafb6x9[_0xbc98[40]]);return _0xafb6x13({action:_0xbc98[39],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),paused:false})[_0xbc98[47]](function(_0xafb6x1b){console[_0xbc98[46]](_0xafb6x1b)})[_0xbc98[26]](function(){return _0xafb6x14[_0xbc98[23]]({voicePause:false,mailPause:false,chatPause:false,faxPause:false},{transaction:_0xafb6xc[_0xbc98[37]]})})[_0xbc98[26]](function(_0xafb6x14){var _0xafb6xf=moment();return ReportMember[_0xbc98[23]]({exitAt:_0xafb6xf},{where:{membername:_0xafb6x14[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),exitAt:null},transaction:_0xafb6xc[_0xbc98[37]]})})[_0xbc98[26]](function(){return _0xafb6x14})}}}function _0xafb6x1c(_0xafb6xc,_0xafb6x13){return function(_0xafb6x14){return _0xafb6x14[_0xbc98[50]]()[_0xbc98[26]](function(_0xafb6x1d){var _0xafb6x1e=[];_0xafb6x1d[_0xbc98[25]](function(_0xafb6x1f){_0xafb6x1e[_0xbc98[24]](_0xafb6x9[_0xbc98[40]]({action:_0xbc98[49],queue:_0xafb6x1f[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),membername:_0xafb6x14[_0xbc98[32]]}))});return Promise[_0xbc98[17]](_0xafb6x1e)})[_0xbc98[26]](function(_0xafb6x17){var _0xafb6x15=[];_0xafb6xa[_0xbc98[25]](function(_0xafb6x16){_0xafb6x15[_0xbc98[24]]({channel:_0xafb6x16,membername:_0xafb6x14[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),type:_0xbc98[48],enterAt:moment()[_0xbc98[20]](_0xbc98[19])})});return ReportMember[_0xbc98[38]](_0xafb6x15,{individualHooks:true})})}}function _0xafb6x20(_0xafb6xc,_0xafb6x13){return function(_0xafb6x14){return _0xafb6x14[_0xbc98[50]]()[_0xbc98[26]](function(_0xafb6x1d){var _0xafb6x1e=[];_0xafb6x1d[_0xbc98[25]](function(_0xafb6x1f){_0xafb6x1e[_0xbc98[24]](_0xafb6x9[_0xbc98[40]]({action:_0xbc98[51],queue:_0xafb6x1f[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]])}))});return Promise[_0xbc98[17]](_0xafb6x1e)[_0xbc98[47]](function(_0xafb6x1b){console[_0xbc98[46]](_0xafb6x1b)})})[_0xbc98[26]](function(_0xafb6x17){return ReportMember[_0xbc98[23]]({exitAt:moment()[_0xbc98[20]](_0xbc98[19])},{where:{membername:_0xafb6x14[_0xbc98[32]],interface:util[_0xbc98[20]](_0xbc98[33],_0xbc98[34],_0xafb6x14[_0xbc98[32]]),type:_0xbc98[48],exitAt:null},individualHooks:true,transaction:_0xafb6xc[_0xbc98[37]]})})}}function _0xafb6x21(_0xafb6x22){return function(_0xafb6x23){if(!_0xafb6x23){throw _0xafb6x22};return _0xafb6x23}}function _0xafb6x24(_0xafb6x13,_0xafb6xc,_0xafb6x9){switch(_0xafb6x13[_0xbc98[32]]){case _0xbc98[55]:return Agent[_0xbc98[54]](_0xafb6xc[_0xbc98[36]][_0xbc98[53]])[_0xbc98[26]](_0xafb6x21({message:_0xbc98[52]}))[_0xbc98[26]](_0xafb6x12(_0xafb6xc,_0xafb6x13));case _0xbc98[56]:return Agent[_0xbc98[54]](_0xafb6xc[_0xbc98[36]][_0xbc98[53]])[_0xbc98[26]](_0xafb6x21({message:_0xbc98[52]}))[_0xbc98[26]](_0xafb6x18(_0xafb6xc,_0xafb6x13));case _0xbc98[58]:return Agent[_0xbc98[54]](_0xafb6x13[_0xbc98[57]])[_0xbc98[26]](_0xafb6x21({message:_0xbc98[52]}))[_0xbc98[26]](_0xafb6x1c(_0xafb6xc,_0xafb6x13));case _0xbc98[59]:return Agent[_0xbc98[54]](_0xafb6x13[_0xbc98[57]])[_0xbc98[26]](_0xafb6x21({message:_0xbc98[52]}))[_0xbc98[26]](_0xafb6x18(_0xafb6xc,_0xafb6x13))[_0xbc98[26]](_0xafb6x20(_0xafb6xc,_0xafb6x13));default:throw {message:_0xbc98[60]}}}return {}}module[_0xbc98[61]]=Action