01ac4d30cd3418fc86a1ed81e577b73261b25a13
[motion.git] / server / config / ami / db / voiceAgentReport.js
1 var _0x803b=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x65\x78\x70\x6F\x72\x74\x73","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x63\x61\x6C\x6C\x65\x64","\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","\x6D\x65\x72\x67\x65","\x63\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x74\x68\x65\x6E","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x66\x69\x6E\x64\x4F\x6E\x65","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x20\x2D\x20\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x20\x2D\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x72\x65\x61\x73\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x20\x2D\x20\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\x72\x65\x6A\x65\x63\x74\x65\x64","\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x20\x2D\x20\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x75\x70\x64\x61\x74\x65","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74\x72\x65\x61\x73\x6F\x6E"];_0x803b[0];var BPromise=require(_0x803b[1]);var moment=require(_0x803b[2]);var _=require(_0x803b[3]);var ReportAgent=require(_0x803b[5])[_0x803b[4]];module[_0x803b[6]]= function(){return {agentcalled:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[14]](_[_0x803b[13]](_0x1873x5,{lastevent:_0x803b[10],agentcalledAt:moment()[_0x803b[12]](_0x803b[11])}))[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[7],_0x1873x7)})}},agentconnect:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[22]]({where:{uniqueid:_0x1873x5[_0x803b[20]],destuniqueid:_0x1873x5[_0x803b[21]]}})[_0x803b[19]](function(_0x1873x8){if(_0x1873x8){return _0x1873x8[_0x803b[18]]({lastevent:_0x803b[16],agentconnectAt:moment()[_0x803b[12]](_0x803b[11]),holdtime:_0x1873x5[_0x803b[17]]})}})[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[15],_0x1873x7)})}},answered_elsewhere:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[22]]({where:{uniqueid:_0x1873x5[_0x803b[20]],destuniqueid:{$ne:_0x1873x5[_0x803b[21]]},reason:null}})[_0x803b[19]](function(_0x1873x8){if(_0x1873x8){return _0x1873x8[_0x803b[18]]({lastevent:_0x803b[24],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x803b[12]](_0x803b[11]),reason:_0x803b[24],answeredelsewheredestinationuniqueid:_0x1873x5[_0x803b[21]],answeredelsewheremembername:_0x1873x5[_0x803b[25]]})}})[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[23],_0x1873x7)})}},agentcomplete:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[22]]({where:{uniqueid:_0x1873x5[_0x803b[20]],destuniqueid:_0x1873x5[_0x803b[21]]}})[_0x803b[19]](function(_0x1873x8){if(_0x1873x8){return _0x1873x8[_0x803b[18]]({lastevent:_0x803b[27],agentcomplete:true,agentcompleteAt:moment()[_0x803b[12]](_0x803b[11]),talktime:_0x1873x5[_0x803b[28]],reason:_0x1873x5[_0x803b[29]]})}})[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[26],_0x1873x7)})}},agentringnoanswer:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[22]]({where:{uniqueid:_0x1873x5[_0x803b[20]],destuniqueid:_0x1873x5[_0x803b[21]]}})[_0x803b[19]](function(_0x1873x8){if(_0x1873x8){return _0x1873x8[_0x803b[18]]({lastevent:_0x803b[31],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x803b[12]](_0x803b[11]),reason:_0x803b[32]})}})[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[30],_0x1873x7)})}},queuecallerabandon:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[35]]({lastevent:_0x803b[34],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x803b[12]](_0x803b[11]),reason:_0x803b[34]},{where:{uniqueid:_0x1873x5[_0x803b[20]],reason:null},individualHooks:true})[_0x803b[19]](function(_0x1873x9){return {reportAgent:_0x1873x9,reportQueue:_0x1873x6}})[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[33],_0x1873x7)})}},queuecallerunmanaged:function(_0x1873x5){return function(_0x1873x6){return ReportAgent[_0x803b[35]]({lastevent:_0x803b[36],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x803b[12]](_0x803b[11]),reason:_0x1873x5[_0x803b[37]]},{where:{uniqueid:_0x1873x5[_0x803b[20]],reason:null},individualHooks:true})[_0x803b[9]](function(_0x1873x7){console[_0x803b[8]](_0x803b[33],_0x1873x7)})}}}}