b43743dc03ad46e9e051acc9ac5c9761fd6d7c6c
[motion.git] / server / api / voice_queue / voice_queue.socket.js
1 var _0x1936=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x2E\x2F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x2E\x65\x76\x65\x6E\x74\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x61\x76\x65","\x72\x65\x6D\x6F\x76\x65","\x72\x65\x67\x69\x73\x74\x65\x72","\x6C\x65\x6E\x67\x74\x68","\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A","\x6F\x6E","\x64\x69\x73\x63\x6F\x6E\x6E\x65\x63\x74","\x45\x72\x72\x6F\x72\x20\x66\x69\x6C\x74\x65\x72\x69\x6E\x67\x20\x71\x75\x65\x75\x65\x73\x20\x61\x66\x74\x65\x72\x20\x71\x75\x65\x75\x65\x20\x73\x61\x76\x65","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x6E\x61\x6D\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x65\x6D\x69\x74","\x74\x68\x65\x6E","\x61\x6C\x6C","\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x72\x65\x6D\x6F\x76\x65\x4C\x69\x73\x74\x65\x6E\x65\x72","\x72\x6F\x77\x73","\x6D\x61\x70","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x75\x73\x65\x72\x49\x64","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x64\x6D\x69\x6E","\x72\x6F\x6C\x65"];_0x1936[0];const VoiceQueueEvents=require(_0x1936[1]);const VoiceQueue=require(_0x1936[3])[_0x1936[2]];const User=require(_0x1936[3])[_0x1936[4]];const Util=require(_0x1936[5]);const _=require(_0x1936[6]);const Promise=require(_0x1936[7]);var events=[_0x1936[8],_0x1936[9]];exports[_0x1936[10]]= function(_0xddfcx8){for(var _0xddfcx9=0,_0xddfcxa=events[_0x1936[11]];_0xddfcx9< _0xddfcxa;_0xddfcx9++){var _0xddfcxb=events[_0xddfcx9];var _0xddfcxc=createListener(_0x1936[12]+ _0xddfcxb,_0xddfcx8);VoiceQueueEvents[_0x1936[13]](_0xddfcxb,_0xddfcxc);_0xddfcx8[_0x1936[13]](_0x1936[14],removeListener(_0xddfcxb,_0xddfcxc))}};function createListener(_0xddfcxb,_0xddfcx8){return function(_0xddfcxe){switch(_0xddfcxb){case _0x1936[23]:return Promise[_0x1936[22]]([])[_0x1936[21]](getVoiceQueues(_0xddfcx8))[_0x1936[21]](function(_0xddfcx10){if(_[_0x1936[19]](_0xddfcx10,_0xddfcxe[_0x1936[18]])){_0xddfcx8[_0x1936[20]](_0xddfcxb,_0xddfcxe)}})[_0x1936[17]](function(_0xddfcxf){console[_0x1936[16]](_0x1936[15],_0xddfcxf)});break;case _0x1936[24]:_0xddfcx8[_0x1936[20]](_0xddfcxb,_0xddfcxe);break;default:}}}function removeListener(_0xddfcxb,_0xddfcxc){return function(){VoiceQueueEvents[_0x1936[25]](_0xddfcxb,_0xddfcxc)}}function getVoiceQueues(_0xddfcx13){return function(){switch(_0xddfcx13[_0x1936[35]]){case _0x1936[32]:return User[_0x1936[31]](_0xddfcx13[_0x1936[29]],{attributes:[_0x1936[30]]})[_0x1936[21]](Util[_0x1936[28]]())[_0x1936[21]](function(_0xddfcx10){return _[_0x1936[27]](_0xddfcx10[_0x1936[26]],_0x1936[18])});case _0x1936[34]:return VoiceQueue[_0x1936[33]]()[_0x1936[21]](function(_0xddfcx14){return {rows:_0xddfcx14}})[_0x1936[21]](function(_0xddfcx10){return _[_0x1936[27]](_0xddfcx10[_0x1936[26]],_0x1936[18])});default:return []}}}