Built motion from commit 6a5ce012e.|1.0.35
[motion.git] / server / config / ami / db / voiceDialReport.js
1 var _0xbc48=["\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\x44\x69\x61\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C\x20\x2D\x20\x64\x69\x61\x6C\x62\x65\x67\x69\x6E","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x40","\x69\x6E\x64\x65\x78\x4F\x66","\x73\x70\x6C\x69\x74","\x6C\x65\x6E\x67\x74\x68","\x2F","\x6E\x6F\x77","\x63\x61\x6C\x6C\x65\x64","\x6D\x65\x72\x67\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","\x69\x64\x20\x44\x45\x53\x43","\x66\x69\x6E\x64\x4F\x6E\x65","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C\x20\x2D\x20\x64\x69\x61\x6C\x65\x6E\x64","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x41\x4E\x53\x57\x45\x52","\x63\x6F\x6E\x6E\x65\x63\x74","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C\x20\x2D\x20\x68\x61\x6E\x67\x75\x70","\x73\x74\x61\x72\x74\x74\x69\x6D\x65","\x46\x41\x49\x4C\x45\x44","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\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","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C\x20\x2D\x20\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x64\x65\x62\x75\x67","\x76\x61\x6C\x75\x65","\x63\x72\x65\x61\x74\x65"];_0xbc48[0];var BPromise=require(_0xbc48[1]);var moment=require(_0xbc48[2]);var _=require(_0xbc48[3]);var ReportDial=require(_0xbc48[5])[_0xbc48[4]];var logger=require(_0xbc48[7])(_0xbc48[6]);module[_0xbc48[8]]= function(){return {dialbegin:function(_0x596bx6){return function(_0x596bx7){return ReportDial[_0xbc48[27]]({where:{uniqueid:_0x596bx6[_0xbc48[25]]},order:_0xbc48[26]})[_0xbc48[24]](function(_0x596bx9){if(_0x596bx9){var _0x596bxa=_0x596bx6[_0xbc48[12]];var _0x596bxb=_0x596bx6[_0xbc48[13]];if(_0x596bx6[_0xbc48[14]]){var _0x596bxc;if(_0x596bx6[_0xbc48[14]][_0xbc48[16]](_0xbc48[15])> 0){_0x596bxc= _0x596bx6[_0xbc48[14]][_0xbc48[17]](_0xbc48[15]);if(_0x596bxc[_0xbc48[18]]> 1){_0x596bxa= _0x596bxc[0];_0x596bxb= _0x596bxc[0]}}else {_0x596bxc= _0x596bx6[_0xbc48[14]][_0xbc48[17]](_0xbc48[19]);if(_0x596bxc[_0xbc48[18]]> 1){_0x596bxa= _0x596bxc[1];_0x596bxb= _0x596bxc[1]}}};return _0x596bx9[_0xbc48[23]](_[_0xbc48[22]](_0x596bx6,{starttime:_0x596bx6[_0xbc48[20]],lastevent:_0xbc48[21],destcalleridnum:_0x596bxa,destcalleridname:_0x596bxb}))}})[_0xbc48[11]](function(_0x596bx8){logger[_0xbc48[10]](_0xbc48[9],_0x596bx8)})}},dialend:function(_0x596bx6){return function(_0x596bx7){return ReportDial[_0xbc48[27]]({where:{uniqueid:_0x596bx6[_0xbc48[25]],linkedid:_0x596bx6[_0xbc48[33]],destuniqueid:_0x596bx6[_0xbc48[34]],destlinkedid:_0x596bx6[_0xbc48[35]]},order:_0xbc48[26]})[_0xbc48[24]](function(_0x596bx9){if(_0x596bx9){return _0x596bx9[_0xbc48[23]]({dialstatus:_0x596bx6[_0xbc48[29]],lastevent:(_0x596bx6[_0xbc48[29]]=== _0xbc48[30])?_0xbc48[31]:_0xbc48[32],answertime:(_0x596bx6[_0xbc48[29]]=== _0xbc48[30])?_0x596bx6[_0xbc48[20]]:null})}})[_0xbc48[11]](function(_0x596bx8){logger[_0xbc48[10]](_0xbc48[28],_0x596bx8)})}},hangup:function(_0x596bx6){return function(_0x596bx7){return ReportDial[_0xbc48[27]]({where:{uniqueid:_0x596bx6[_0xbc48[25]]},order:_0xbc48[26]})[_0xbc48[24]](function(_0x596bx9){if(_0x596bx9){var _0x596bxd={endtime:_0x596bx6[_0xbc48[20]],lastevent:_0xbc48[32]};if(!_0x596bx9[_0xbc48[37]]){_0x596bxd[_0xbc48[29]]= _0xbc48[38]};return _0x596bx9[_0xbc48[23]](_0x596bxd)}})[_0xbc48[11]](function(_0x596bx8){logger[_0xbc48[10]](_0xbc48[36],_0x596bx8)})}},outboundrouteid:function(_0x596bx6){return function(_0x596bx7){if(!_0x596bx6[_0xbc48[41]][_0xbc48[40]](_0xbc48[39])){return BPromise[_0xbc48[42]]()};return ReportDial[_0xbc48[46]]({uniqueid:_0x596bx6[_0xbc48[25]],routeId:_0x596bx6[_0xbc48[45]]},{raw:true})[_0xbc48[24]](function(){logger[_0xbc48[44]](_0xbc48[43],_0x596bx6[_0xbc48[25]])})[_0xbc48[11]](function(_0x596bx8){logger[_0xbc48[10]](_0xbc48[43],_0x596bx8)})}}}}