187879f863a6a4518929427320da154fc7016212
[motion.git] / server / config / ami / db / voiceRecording.js
1 var _0x2665=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6C\x6F\x64\x61\x73\x68","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x61\x6D\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x65\x78\x70\x6F\x72\x74\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x74\x69\x67\x65\x72\x64\x69\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x69\x6E\x62\x6F\x75\x6E\x64","\x73\x6F\x75\x72\x63\x65","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x2D\x20\x63\x64\x72","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x62\x75\x67","\x74\x68\x65\x6E","\x75\x6E\x6B\x6E\x6F\x77\x6E","\x75\x70\x64\x61\x74\x65","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x71\x75\x65\x75\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x6D\x69\x78\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x69\x6C\x65\x6E\x61\x6D\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x76\x61\x72\x69\x61\x62\x6C\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x2D\x20\x6D\x69\x78\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x69\x6C\x65\x6E\x61\x6D\x65","\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x4F\x6E\x65"];_0x2665[0];var BPromise=require(_0x2665[1]);var _=require(_0x2665[2]);var VoiceRecording=require(_0x2665[4])[_0x2665[3]];var User=require(_0x2665[4])[_0x2665[5]];var logger=require(_0x2665[7])(_0x2665[6]);module[_0x2665[8]]= function(){return {cdr:function(_0x574fx6){return function(_0x574fx7){var _0x574fx8=null;if(_[_0x2665[12]]([_0x2665[9],_0x2665[10]],_0x574fx6[_0x2665[11]])){_0x574fx8= _0x574fx6[_0x2665[13]]}else {if(_0x574fx6[_0x2665[11]]=== _0x2665[14]){_0x574fx8= _0x574fx6[_0x2665[15]]}};_0x574fx6[_0x2665[16]]= _0x574fx6[_0x2665[13]];return VoiceRecording[_0x2665[24]]({type:_0x574fx6[_0x2665[11]]|| _0x2665[23],customerPhone:_0x574fx8},{where:{uniqueid:_0x574fx6[_0x2665[20]]},raw:true,individualHooks:true})[_0x2665[22]](function(){logger[_0x2665[21]](_0x2665[17],_0x574fx6[_0x2665[20]])})[_0x2665[19]](function(_0x574fx9){logger[_0x2665[18]](_0x2665[17],_0x574fx9)})}},agentcomplete:function(_0x574fx6){return function(_0x574fx7){return VoiceRecording[_0x2665[24]]({queue:_0x574fx6[_0x2665[26]],membername:_0x574fx6[_0x2665[27]]},{where:{uniqueid:_0x574fx6[_0x2665[20]]},raw:true,individualHooks:true})[_0x2665[22]](function(){logger[_0x2665[21]](_0x2665[25],_0x574fx6[_0x2665[20]])})[_0x2665[19]](function(_0x574fx9){logger[_0x2665[18]](_0x2665[25],_0x574fx9)})}},mixmonitor_filename:function(_0x574fx6){return function(_0x574fx7){if(!_0x574fx6[_0x2665[30]][_0x2665[29]](_0x2665[28])){return BPromise[_0x2665[31]]()};return User[_0x2665[36]]({where:{fullname:_0x574fx6[_0x2665[35]]}})[_0x2665[22]](function(_0x574fxa){if(_0x574fxa){_0x574fx6[_0x2665[27]]= _0x574fxa[_0x2665[33]]};return VoiceRecording[_0x2665[34]](_0x574fx6)})[_0x2665[22]](function(){logger[_0x2665[21]](_0x2665[32],_0x574fx6[_0x2665[20]])})[_0x2665[19]](function(_0x574fx9){logger[_0x2665[18]](_0x2665[32],_0x574fx9)})}}}}