99109f63ebd6700df6f73095e4dfb703aa99d152
[motion.git] / server / config / ami / db / voiceRecording.js
1 var _0xb31c=["\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","\x70\x61\x74\x68","\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","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\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","\x61\x6C\x6C","\x6C\x65\x6E\x67\x74\x68","\x65\x78\x74\x65\x6E","\x70\x68\x6F\x6E\x65\x62\x61\x72","\x70\x68\x6F\x6E\x65\x62\x61\x72\x2D","\x63\x6F\x6E\x74\x65\x78\x74","\x66\x72\x6F\x6D\x2D\x73\x69\x70","\x63\x75\x73\x74\x6F\x6D\x65\x72\x50\x68\x6F\x6E\x65","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x75\x70\x64\x61\x74\x65","\x70\x75\x73\x68","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\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","\x78\x63\x61\x6C\x6C\x79\x2D\x6D\x69\x78\x6D\x6F\x6E\x69\x74\x6F\x72\x2D\x63\x6F\x6E\x74\x65\x78\x74","\x6E\x61\x6D\x65","\x76\x61\x6C\x75\x65","\x70\x61\x72\x73\x65","\x61\x75\x74\x6F\x2D","\x69\x6E\x64\x65\x78\x4F\x66","\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","\x63\x72\x65\x61\x74\x65","\x61\x63\x63\x6F\x75\x6E\x74\x63\x6F\x64\x65","\x66\x69\x6E\x64\x4F\x6E\x65"];_0xb31c[0];var BPromise=require(_0xb31c[1]);var _=require(_0xb31c[2]);var VoiceRecording=require(_0xb31c[4])[_0xb31c[3]];var User=require(_0xb31c[4])[_0xb31c[5]];var logger=require(_0xb31c[7])(_0xb31c[6]);var path=require(_0xb31c[8]);module[_0xb31c[9]]= function(){return {cdr:function(_0xef86x7){return function(_0xef86x8){var _0xef86x9=null;if(_[_0xb31c[13]]([_0xb31c[10],_0xb31c[11]],_0xef86x7[_0xb31c[12]])){_0xef86x9= _0xef86x7[_0xb31c[14]]}else {if(_[_0xb31c[13]]([_0xb31c[15],_0xb31c[16]],_0xef86x7[_0xb31c[12]])){_0xef86x9= _0xef86x7[_0xb31c[17]]}};_0xef86x7[_0xb31c[18]]= _0xef86x7[_0xb31c[14]];return VoiceRecording[_0xb31c[37]]({where:{uniqueid:[_0xef86x7[_0xb31c[22]],_0xef86x7[_0xb31c[36]]]}})[_0xb31c[24]](function(_0xef86xb){var _0xef86xc=[];if(_0xef86xb){for(var _0xef86xd=0,_0xef86xe=_0xef86xb[_0xb31c[26]];_0xef86xd< _0xef86xe;_0xef86xd++){var _0xef86xf={customerPhone:_0xef86x9};if(!_0xef86xb[_0xef86xd][_0xb31c[27]]){_0xef86xf[_0xb31c[27]]= _0xef86x7[_0xb31c[14]]};if(_0xef86xb[_0xef86xd][_0xb31c[12]]=== _0xb31c[28]){_0xef86xf[_0xb31c[12]]= _0xb31c[29]+ _0xef86x7[_0xb31c[12]];if(_0xef86x7[_0xb31c[12]]=== _0xb31c[10]){_0xef86xf[_0xb31c[30]]= _0xb31c[31];_0xef86xf[_0xb31c[32]]= _0xef86xb[_0xef86xd][_0xb31c[33]];_0xef86xf[_0xb31c[27]]= _0xef86xb[_0xef86xd][_0xb31c[33]]}else {if(_0xef86x7[_0xb31c[12]]=== _0xb31c[16]){_0xef86xf[_0xb31c[32]]= _0xef86xb[_0xef86xd][_0xb31c[33]]}}}else {if(!_0xef86xb[_0xef86xd][_0xb31c[12]]){_0xef86xf[_0xb31c[12]]= _0xef86x7[_0xb31c[12]]}};_0xef86xc[_0xb31c[35]](_0xef86xb[_0xef86xd][_0xb31c[34]](_0xef86xf))}};return _0xef86xc})[_0xb31c[25]]()[_0xb31c[24]](function(){logger[_0xb31c[23]](_0xb31c[19],_0xef86x7[_0xb31c[22]])})[_0xb31c[21]](function(_0xef86xa){logger[_0xb31c[20]](_0xb31c[19],_0xef86xa)})}},agentcomplete:function(_0xef86x7){return function(_0xef86x8){return VoiceRecording[_0xb31c[34]]({queue:_0xef86x7[_0xb31c[39]],membername:_0xef86x7[_0xb31c[40]]},{where:{uniqueid:_0xef86x7[_0xb31c[22]]},raw:true,individualHooks:true})[_0xb31c[24]](function(){logger[_0xb31c[23]](_0xb31c[38],_0xef86x7[_0xb31c[22]])})[_0xb31c[21]](function(_0xef86xa){logger[_0xb31c[20]](_0xb31c[38],_0xef86xa)})}},mixmonitor_filename:function(_0xef86x7){return function(_0xef86x8){if(!_0xef86x7[_0xb31c[43]][_0xb31c[42]](_0xb31c[41])){return BPromise[_0xb31c[44]]()};if(_0xef86x7[_0xb31c[30]]=== _0xb31c[45]){_0xef86x7[_0xb31c[30]]= _0xb31c[31];_0xef86x7[_0xb31c[12]]= _0xb31c[10];_0xef86x7[_0xb31c[22]]= path[_0xb31c[48]](_0xef86x7[_0xb31c[47]])[_0xb31c[46]];_0xef86x7[_0xb31c[27]]= _0xef86x7[_0xb31c[33]]};if(_0xef86x7[_0xb31c[47]][_0xb31c[50]](_0xb31c[49])>= 0){_0xef86x7[_0xb31c[12]]= _0xb31c[28]};return User[_0xb31c[54]]({where:{accountcode:_0xef86x7[_0xb31c[47]][_0xb31c[50]](_0xef86x7[_0xb31c[53]])>= 0?_0xef86x7[_0xb31c[18]]:_0xef86x7[_0xb31c[53]]}})[_0xb31c[24]](function(_0xef86x10){if(_0xef86x10){_0xef86x7[_0xb31c[40]]= _0xef86x10[_0xb31c[46]]};return VoiceRecording[_0xb31c[52]](_0xef86x7)})[_0xb31c[24]](function(){logger[_0xb31c[23]](_0xb31c[51],_0xef86x7[_0xb31c[22]])})[_0xb31c[21]](function(_0xef86xa){logger[_0xb31c[20]](_0xb31c[51],_0xef86xa)})}}}}