Built motion from commit c8dd8619.|2.0.42
[motion2.git] / server / services / ami / report / voiceAgentReport.js
1 var _0x8391=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x75\x74\x69\x6C","\x61\x6D\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x2E\x2E\x2F\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74","\x6C\x6F\x67","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x76\x61\x72\x69\x61\x62\x6C\x65\x73","\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64","\x62\x69\x6E\x64","\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x43\x61\x6C\x6C\x65\x64","\x6F\x6E","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74","\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x43\x6F\x6E\x6E\x65\x63\x74","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x52\x69\x6E\x67\x4E\x6F\x41\x6E\x73\x77\x65\x72","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x73\x79\x6E\x63\x51\x75\x65\x75\x65\x43\x61\x6C\x6C\x65\x72\x41\x62\x61\x6E\x64\x6F\x6E","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x43\x6F\x6D\x70\x6C\x65\x74\x65","\x76\x61\x72\x73\x65\x74","\x73\x79\x6E\x63\x56\x61\x72\x53\x65\x74","\x68\x61\x6E\x67\x75\x70","\x73\x79\x6E\x63\x48\x61\x6E\x67\x75\x70","\x65\x6D\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x74\x6F","\x69\x73\x4E\x6F\x74\x4E\x75\x6C\x6C","\x69\x73\x55\x6E\x64\x65\x66\x69\x6E\x65\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\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","\x63\x61\x6C\x6C\x65\x64","\x71\x75\x65\x75\x65","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x65\x76\x65\x6E\x74","\x70\x72\x69\x76\x69\x6C\x65\x67\x65","\x6F\x6D\x69\x74","\x6D\x65\x72\x67\x65","\x63\x75\x73\x74\x6F\x6D\x3A\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64","\x75\x73\x65\x72\x3A\x25\x73","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x75\x73\x65\x72\x3A\x63\x61\x6C\x6C\x65\x64","\x5B\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x43\x61\x6C\x6C\x65\x64\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x69\x6E\x73\x70\x65\x63\x74","\x65\x72\x72\x6F\x72","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x41\x74","\x6C\x61\x73\x74\x65\x76\x65\x6E\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x64\x65\x73\x74\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x64\x65\x73\x74\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x75\x73\x74\x6F\x6D\x3A\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72\x41\x74","\x72\x65\x61\x73\x6F\x6E","\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\x65\x6C\x73\x65\x77\x68\x65\x72\x65\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E\x75\x6E\x69\x71\x75\x65\x69\x64","\x61\x6E\x73\x77\x65\x72\x65\x64\x65\x6C\x73\x65\x77\x68\x65\x72\x65\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x63\x75\x73\x74\x6F\x6D\x3A\x61\x67\x65\x6E\x74\x61\x6E\x73\x77\x65\x72\x65\x64\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x5B\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x43\x6F\x6E\x6E\x65\x63\x74\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x72\x65\x6A\x65\x63\x74\x65\x64","\x63\x75\x73\x74\x6F\x6D\x3A\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\x5B\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x52\x69\x6E\x67\x4E\x6F\x41\x6E\x73\x77\x65\x72\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x63\x75\x73\x74\x6F\x6D\x3A\x61\x67\x65\x6E\x74\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x5B\x73\x79\x6E\x63\x51\x75\x65\x75\x65\x43\x61\x6C\x6C\x65\x72\x41\x62\x61\x6E\x64\x6F\x6E\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x61\x63\x77","\x61\x67\x65\x6E\x74\x61\x63\x77","\x61\x63\x77\x74\x69\x6D\x65","\x61\x63\x77\x54\x69\x6D\x65\x6F\x75\x74","\x63\x75\x73\x74\x6F\x6D\x3A\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x5B\x73\x79\x6E\x63\x41\x67\x65\x6E\x74\x43\x6F\x6D\x70\x6C\x65\x74\x65\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x76\x61\x72\x69\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x76\x61\x6C\x75\x65","\x61\x64\x64\x56\x61\x72\x69\x61\x62\x6C\x65","\x5B\x73\x79\x6E\x63\x56\x61\x72\x53\x65\x74\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x63\x75\x73\x74\x6F\x6D\x3A\x76\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74","\x76\x61\x6C\x75\x65\x73","\x5B\x73\x79\x6E\x63\x48\x61\x6E\x67\x75\x70\x5D\x5B\x56\x6F\x69\x63\x65\x41\x67\x65\x6E\x74\x52\x65\x70\x6F\x72\x74\x5D","\x65\x78\x70\x6F\x72\x74\x73"];_0x8391[0];var _=require(_0x8391[1]);var moment=require(_0x8391[2]);var util=require(_0x8391[3]);var logger=require(_0x8391[5])(_0x8391[4]);var ami=require(_0x8391[6]);var io=require(_0x8391[8])({host:_0x8391[7],port:6379});function VoiceAgentReport(_0x43f1x8){console[_0x8391[10]](_0x8391[9]);this[_0x8391[11]]= {};this[_0x8391[12]]= _0x43f1x8[_0x8391[12]];this[_0x8391[13]]= {};ami[_0x8391[17]](_0x8391[14],this[_0x8391[16]][_0x8391[15]](this));ami[_0x8391[17]](_0x8391[18],this[_0x8391[19]][_0x8391[15]](this));ami[_0x8391[17]](_0x8391[20],this[_0x8391[21]][_0x8391[15]](this));ami[_0x8391[17]](_0x8391[22],this[_0x8391[23]][_0x8391[15]](this));ami[_0x8391[17]](_0x8391[24],this[_0x8391[25]][_0x8391[15]](this));ami[_0x8391[17]](_0x8391[26],this[_0x8391[27]][_0x8391[15]](this));ami[_0x8391[17]](_0x8391[28],this[_0x8391[29]][_0x8391[15]](this))}VoiceAgentReport[_0x8391[31]][_0x8391[30]]= function(_0x43f1x9,_0x43f1xa,_0x43f1xb){io[_0x8391[32]](_0x43f1x9)[_0x8391[30]](_0x43f1xa,_0x43f1xb)};VoiceAgentReport[_0x8391[31]][_0x8391[33]]= function(_0x43f1xb){return _0x43f1xb!== null&&  !_[_0x8391[34]](_0x43f1xb)};VoiceAgentReport[_0x8391[31]][_0x8391[16]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){if(_[_0x8391[34]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]= {}};if(_[_0x8391[34]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]]= {agentcalledAt:moment()[_0x8391[38]](_0x8391[37]),lastevent:_0x8391[39],variables:this[_0x8391[13]][_0x43f1xa[_0x8391[35]]],type:this[_0x8391[12]][_0x43f1xa[_0x8391[40]]]?this[_0x8391[12]][_0x43f1xa[_0x8391[40]]][_0x8391[41]]|| _0x8391[42]:_0x8391[42]}};_[_0x8391[46]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]],_[_0x8391[45]](_0x43f1xa,[_0x8391[43],_0x8391[44]]));ami[_0x8391[30]](_0x8391[47],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]]);this[_0x8391[30]](util[_0x8391[38]](_0x8391[48],_0x43f1xa[_0x8391[49]]),_0x8391[50],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]])}}catch(e){logger[_0x8391[53]](_0x8391[51],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};VoiceAgentReport[_0x8391[31]][_0x8391[19]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){for(var _0x43f1xc in this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x8391[54]](_0x43f1xc)){if(_0x43f1xa[_0x8391[36]]=== _0x43f1xc){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[55]]= moment()[_0x8391[38]](_0x8391[37]);this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[56]]= _0x8391[57];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[58]]= _0x43f1xa[_0x8391[58]];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[59]]= _0x43f1xa[_0x8391[59]];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[60]]= _0x43f1xa[_0x8391[60]];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[61]]= _0x43f1xa[_0x8391[61]];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[62]]= _0x43f1xa[_0x8391[62]];ami[_0x8391[30]](_0x8391[63],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc])}else {if(this[_0x8391[33]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[20]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[20]]= true;this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[64]]= moment()[_0x8391[38]](_0x8391[37]);this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[65]]= _0x8391[66];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[56]]= _0x8391[66];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[67]]= _0x43f1xa[_0x8391[36]];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[68]]= _0x43f1xa[_0x8391[49]];ami[_0x8391[30]](_0x8391[69],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc])}}}}}}}catch(e){logger[_0x8391[53]](_0x8391[70],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};VoiceAgentReport[_0x8391[31]][_0x8391[21]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]&& this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]]&& _[_0x8391[34]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[20]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[20]]= true;this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[64]]= moment()[_0x8391[38]](_0x8391[37]);this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[65]]= _0x8391[71];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[56]]= _0x8391[71];ami[_0x8391[30]](_0x8391[72],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]])}}}catch(e){logger[_0x8391[53]](_0x8391[73],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};VoiceAgentReport[_0x8391[31]][_0x8391[23]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){for(var _0x43f1xc in this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x8391[54]](_0x43f1xc)&& _[_0x8391[34]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[20]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[20]]= true;this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[64]]= moment()[_0x8391[38]](_0x8391[37]);this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[65]]= _0x8391[74];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[56]]= _0x8391[74];ami[_0x8391[30]](_0x8391[75],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc])}}}}}catch(e){logger[_0x8391[53]](_0x8391[76],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};VoiceAgentReport[_0x8391[31]][_0x8391[25]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]&& this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]]&& _[_0x8391[34]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[24]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[24]]= true;this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[77]]= moment()[_0x8391[38]](_0x8391[37]);this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[56]]= _0x8391[78];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[79]]= _0x43f1xa[_0x8391[79]];this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[65]]= _0x43f1xa[_0x8391[65]];if(this[_0x8391[12]][_0x43f1xa[_0x8391[40]]]&& this[_0x8391[12]][_0x43f1xa[_0x8391[40]]][_0x8391[80]]){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[81]]= true;this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]][_0x8391[82]]= this[_0x8391[12]][_0x43f1xa[_0x8391[40]]][_0x8391[83]]};ami[_0x8391[30]](_0x8391[84],this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xa[_0x8391[36]]])}}}catch(e){logger[_0x8391[53]](_0x8391[85],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};VoiceAgentReport[_0x8391[31]][_0x8391[27]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){this[_0x8391[89]](_0x43f1xa[_0x8391[35]],_[_0x8391[87]](_0x43f1xa[_0x8391[86]])[0],_0x43f1xa[_0x8391[88]]);if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){for(var _0x43f1xc in this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x8391[54]](_0x43f1xc)){if(_[_0x8391[34]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[13]])){this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[13]]= {}};this[_0x8391[11]][_0x43f1xa[_0x8391[35]]][_0x43f1xc][_0x8391[13]]= this[_0x8391[13]][_0x43f1xa[_0x8391[35]]]}}}}}catch(e){logger[_0x8391[53]](_0x8391[90],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};VoiceAgentReport[_0x8391[31]][_0x8391[89]]= function(_0x43f1xd,_0x43f1xe,_0x43f1xf){if(_[_0x8391[34]](this[_0x8391[13]][_0x43f1xd])){this[_0x8391[13]][_0x43f1xd]= {}};this[_0x8391[13]][_0x43f1xd][_0x43f1xe]= _0x43f1xf};VoiceAgentReport[_0x8391[31]][_0x8391[29]]= function(_0x43f1xa){try{if(this[_0x8391[33]](_0x43f1xa)){if(this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]){ami[_0x8391[30]](_0x8391[91],_[_0x8391[92]](this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]));delete this[_0x8391[11]][_0x43f1xa[_0x8391[35]]]};if(this[_0x8391[13]][_0x43f1xa[_0x8391[35]]]){delete this[_0x8391[13]][_0x43f1xa[_0x8391[35]]]}}}catch(e){logger[_0x8391[53]](_0x8391[93],util[_0x8391[52]](e,{showHidden:false,depth:null}))}};module[_0x8391[94]]= VoiceAgentReport