Built motion from commit f67b3b02.|2.6.31
[motion2.git] / server / api / cmHopperHistory / cmHopperHistory.rpc.js
index c7ec59d..a818541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9099=['jayson/promise','client','http','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','then','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x701c5d,_0x47a566){var _0x617b08=function(_0x41409f){while(--_0x41409f){_0x701c5d['push'](_0x701c5d['shift']());}};_0x617b08(++_0x47a566);}(_0x9099,0x1ac));var _0x9909=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x9099[_0x411add];return _0x238242;};'use strict';var _=require(_0x9909('0x0'));var util=require('util');var moment=require(_0x9909('0x1'));var BPromise=require(_0x9909('0x2'));var rs=require(_0x9909('0x3'));var fs=require('fs');var Redis=require(_0x9909('0x4'));var db=require(_0x9909('0x5'))['db'];var utils=require(_0x9909('0x6'));var logger=require(_0x9909('0x7'))(_0x9909('0x8'));var config=require(_0x9909('0x9'));var jayson=require(_0x9909('0xa'));var client=jayson[_0x9909('0xb')][_0x9909('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b7391,_0x3dc2dd,_0x54011f){return new BPromise(function(_0x6d755a,_0x5dcd39){return client['request'](_0x3b7391,_0x54011f)['then'](function(_0x5023b7){logger[_0x9909('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));logger[_0x9909('0xf')](_0x9909('0x10'),_0x3dc2dd,'request\x20sent',JSON[_0x9909('0x11')](_0x5023b7));if(_0x5023b7['error']){if(_0x5023b7[_0x9909('0x12')][_0x9909('0x13')]===0x1f4){logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x5dcd39(_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);}logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x6d755a(_0x5023b7[_0x9909('0x12')]['message']);}else{logger[_0x9909('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));_0x6d755a(_0x5023b7['result'][_0x9909('0x15')]);}})[_0x9909('0x16')](function(_0x245f0d){logger['error'](_0x9909('0x14'),_0x3dc2dd,_0x245f0d);_0x5dcd39(_0x245f0d);});});}exports[_0x9909('0x17')]=function(_0x180929){var _0x2e6c16=this;return new Promise(function(_0x1106e5,_0x3a38ac){return db[_0x9909('0x18')]['create'](_0x180929[_0x9909('0x19')],{'raw':_0x180929[_0x9909('0x1a')]?_0x180929['options'][_0x9909('0x1b')]===undefined?!![]:![]:!![]})[_0x9909('0x1c')](function(_0x20c236){logger[_0x9909('0xd')](_0x9909('0x17'),_0x180929);logger[_0x9909('0xf')](_0x9909('0x17'),_0x180929,JSON['stringify'](_0x20c236));_0x1106e5(_0x20c236);})[_0x9909('0x16')](function(_0x319c31){logger['error']('CreateCmHopperHistory',_0x319c31[_0x9909('0x15')],_0x180929);_0x3a38ac(_0x2e6c16[_0x9909('0x12')](0x1f4,_0x319c31[_0x9909('0x15')]));});});};exports[_0x9909('0x1d')]=function(_0x2f15fa){var _0x59c5c9=this;return new Promise(function(_0x5f3a5a,_0x2d83a5){return db[_0x9909('0x18')][_0x9909('0x1e')]({'raw':_0x2f15fa[_0x9909('0x1a')]?_0x2f15fa['options'][_0x9909('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f15fa[_0x9909('0x1a')]?_0x2f15fa[_0x9909('0x1a')][_0x9909('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9909('0x20'),db[_0x9909('0x21')][_0x9909('0x22')]('id')),_0x9909('0x23')],[db['sequelize']['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x25')))),_0x9909('0x26')],[db[_0x9909('0x21')]['fn']('COUNT',db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x27')))),_0x9909('0x28')],[db['sequelize']['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x29')))),_0x9909('0x2a')],[db[_0x9909('0x21')]['fn'](_0x9909('0x2b'),db['sequelize']['fn']('IF',db['sequelize'][_0x9909('0x24')](_0x9909('0x2c')))),'predictiveIntervalAvgHoldtime'],[db[_0x9909('0x21')]['fn'](_0x9909('0x2b'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x2d')))),_0x9909('0x2e')]]})['then'](function(_0x17a7bd){logger[_0x9909('0xd')](_0x9909('0x1d'),_0x2f15fa);logger[_0x9909('0xf')](_0x9909('0x1d'),_0x2f15fa,JSON['stringify'](_0x17a7bd));_0x5f3a5a(_0x17a7bd);})[_0x9909('0x16')](function(_0x362851){logger['error'](_0x9909('0x1d'),_0x362851[_0x9909('0x15')],_0x2f15fa);_0x2d83a5(_0x59c5c9[_0x9909('0x12')](0x1f4,_0x362851[_0x9909('0x15')]));});});};exports[_0x9909('0x2f')]=function(_0x12f896){var _0x4e23ed=this;return new Promise(function(_0x21c1c8,_0x1c48bc){return db[_0x9909('0x18')][_0x9909('0x1e')]({'raw':_0x12f896[_0x9909('0x1a')]?_0x12f896[_0x9909('0x1a')][_0x9909('0x1b')]===undefined?!![]:![]:!![],'where':_0x12f896[_0x9909('0x1a')]?_0x12f896[_0x9909('0x1a')][_0x9909('0x1f')]||null:null,'attributes':[[_0x9909('0x30'),_0x9909('0x31')],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x32')))),_0x9909('0x33')],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x9909('0x34')],[db['sequelize']['fn']('COUNT',db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x25')))),'outboundAnswerCallsDay'],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db['sequelize'][_0x9909('0x24')](_0x9909('0x35')))),_0x9909('0x36')],[db['sequelize']['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x37')))),_0x9909('0x38')],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db['sequelize']['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9909('0x39')],[db[_0x9909('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x3a')))),_0x9909('0x3b')],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x3c')))),'outboundUnknownCallsDay'],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x9909('0x3d')],[db['sequelize']['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')]['literal'](_0x9909('0x3e')))),_0x9909('0x3f')],[db[_0x9909('0x21')]['fn']('COUNT',db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x40')))),_0x9909('0x41')],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db['sequelize']['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x9909('0x42')],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')]['literal'](_0x9909('0x43')))),'outboundRejectCallsDay'],[db[_0x9909('0x21')]['fn'](_0x9909('0x20'),db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')][_0x9909('0x24')](_0x9909('0x44')))),_0x9909('0x45')]],'group':[_0x9909('0x30')]})['then'](function(_0x51b214){logger[_0x9909('0xd')]('GetVoiceQueueHopperHistory',_0x12f896);logger['debug'](_0x9909('0x2f'),_0x12f896,JSON[_0x9909('0x11')](_0x51b214));_0x21c1c8(_0x51b214);})['catch'](function(_0x1144e0){logger[_0x9909('0x12')](_0x9909('0x2f'),_0x1144e0[_0x9909('0x15')],_0x12f896);_0x1c48bc(_0x4e23ed[_0x9909('0x12')](0x1f4,_0x1144e0[_0x9909('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x1702a8){var _0x2517ff=this;return new Promise(function(_0x50ada8,_0x55d31e){return db[_0x9909('0x18')]['findAll']({'raw':_0x1702a8[_0x9909('0x1a')]?_0x1702a8[_0x9909('0x1a')][_0x9909('0x1b')]===undefined?!![]:![]:!![],'where':_0x1702a8[_0x9909('0x1a')]?_0x1702a8['options']['where']||null:null,'attributes':[['campaign',_0x9909('0x31')],[db[_0x9909('0x21')]['fn']('COUNT',db['sequelize'][_0x9909('0x22')]('id')),_0x9909('0x46')],[db[_0x9909('0x21')]['fn']('COUNT',db[_0x9909('0x21')]['fn']('IF',db[_0x9909('0x21')]['literal'](_0x9909('0x25')))),_0x9909('0x47')]],'group':[_0x9909('0x30')]})[_0x9909('0x1c')](function(_0x52aaaa){logger['info'](_0x9909('0x48'),_0x1702a8);logger[_0x9909('0xf')](_0x9909('0x48'),_0x1702a8,JSON[_0x9909('0x11')](_0x52aaaa));_0x50ada8(_0x52aaaa);})[_0x9909('0x16')](function(_0x8b6d28){logger[_0x9909('0x12')](_0x9909('0x48'),_0x8b6d28[_0x9909('0x15')],_0x1702a8);_0x55d31e(_0x2517ff[_0x9909('0x12')](0x1f4,_0x8b6d28['message']));});});};
\ No newline at end of file
+var _0x24cf=['findAll','where','sequelize','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','COUNT','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','name','col','ivrTotalCallsDays','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime'];(function(_0x380c6e,_0x536610){var _0x25828c=function(_0x2276eb){while(--_0x2276eb){_0x380c6e['push'](_0x380c6e['shift']());}};_0x25828c(++_0x536610);}(_0x24cf,0x1d5));var _0xf24c=function(_0x2494a3,_0x96013f){_0x2494a3=_0x2494a3-0x0;var _0x53c047=_0x24cf[_0x2494a3];return _0x53c047;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});}exports[_0xf24c('0x14')]=function(_0x2d9015){var _0x3eb8e1=this;return new Promise(function(_0x1a17c6,_0x3a0b61){return db[_0xf24c('0x15')][_0xf24c('0x16')](_0x2d9015[_0xf24c('0x17')],{'raw':_0x2d9015[_0xf24c('0x18')]?_0x2d9015[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x24bf58){logger[_0xf24c('0xb')]('CreateCmHopperHistory',_0x2d9015);logger[_0xf24c('0xe')](_0xf24c('0x14'),_0x2d9015,JSON[_0xf24c('0x1a')](_0x24bf58));_0x1a17c6(_0x24bf58);})['catch'](function(_0x5885a5){logger['error'](_0xf24c('0x14'),_0x5885a5[_0xf24c('0x12')],_0x2d9015);_0x3a0b61(_0x3eb8e1['error'](0x1f4,_0x5885a5[_0xf24c('0x12')]));});});};exports[_0xf24c('0x1b')]=function(_0x106771){var _0x35ba83=this;return new Promise(function(_0x273a80,_0xe6973e){return db[_0xf24c('0x15')][_0xf24c('0x1c')]({'raw':_0x106771[_0xf24c('0x18')]?_0x106771[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![],'where':_0x106771['options']?_0x106771['options'][_0xf24c('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xf24c('0x1e')]['col']('id')),_0xf24c('0x1f')],[db[_0xf24c('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xf24c('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xf24c('0x21')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db['sequelize']['fn']('IF',db[_0xf24c('0x1e')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xf24c('0x23')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db['sequelize'][_0xf24c('0x20')](_0xf24c('0x24')))),_0xf24c('0x25')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x26'),db[_0xf24c('0x1e')]['fn']('IF',db['sequelize'][_0xf24c('0x20')](_0xf24c('0x27')))),_0xf24c('0x28')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x26'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')]['literal'](_0xf24c('0x29')))),'predictiveIntervalAvgTalktime']]})[_0xf24c('0xa')](function(_0x2fa14b){logger['info'](_0xf24c('0x1b'),_0x106771);logger['debug'](_0xf24c('0x1b'),_0x106771,JSON[_0xf24c('0x1a')](_0x2fa14b));_0x273a80(_0x2fa14b);})[_0xf24c('0x13')](function(_0x47f733){logger[_0xf24c('0x10')]('AvgHandleTime',_0x47f733[_0xf24c('0x12')],_0x106771);_0xe6973e(_0x35ba83['error'](0x1f4,_0x47f733['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1c74b7){var _0x2bd44c=this;return new Promise(function(_0x447761,_0x3334b3){return db[_0xf24c('0x15')][_0xf24c('0x1c')]({'raw':_0x1c74b7[_0xf24c('0x18')]?_0x1c74b7['options'][_0xf24c('0x19')]===undefined?!![]:![]:!![],'where':_0x1c74b7[_0xf24c('0x18')]?_0x1c74b7[_0xf24c('0x18')][_0xf24c('0x1d')]||null:null,'attributes':[[_0xf24c('0x2a'),'name'],[db[_0xf24c('0x1e')]['fn']('COUNT',db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x2b')))),_0xf24c('0x2c')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x2d')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x2e')))),_0xf24c('0x2f')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')]('`state`\x20=\x205,\x201,\x20null'))),_0xf24c('0x30')],[db['sequelize']['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x31')))),_0xf24c('0x32')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x33')))),_0xf24c('0x34')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0xf24c('0x20')](_0xf24c('0x35')))),_0xf24c('0x36')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db['sequelize']['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x37')))),_0xf24c('0x38')],[db['sequelize']['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x39')))),_0xf24c('0x3a')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x3b')))),_0xf24c('0x3c')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')]['literal'](_0xf24c('0x3d')))),_0xf24c('0x3e')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x3f')))),_0xf24c('0x40')],[db[_0xf24c('0x1e')]['fn']('COUNT',db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0xf24c('0x3e')],[db[_0xf24c('0x1e')]['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x41')))),_0xf24c('0x42')]],'group':[_0xf24c('0x2a')]})['then'](function(_0x28099c){logger['info']('GetVoiceQueueHopperHistory',_0x1c74b7);logger[_0xf24c('0xe')](_0xf24c('0x43'),_0x1c74b7,JSON[_0xf24c('0x1a')](_0x28099c));_0x447761(_0x28099c);})[_0xf24c('0x13')](function(_0x168df5){logger[_0xf24c('0x10')](_0xf24c('0x43'),_0x168df5[_0xf24c('0x12')],_0x1c74b7);_0x3334b3(_0x2bd44c[_0xf24c('0x10')](0x1f4,_0x168df5[_0xf24c('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x5c2757){var _0x524ef2=this;return new Promise(function(_0x4fca6c,_0x2b9b2d){return db[_0xf24c('0x15')][_0xf24c('0x1c')]({'raw':_0x5c2757[_0xf24c('0x18')]?_0x5c2757[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![],'where':_0x5c2757[_0xf24c('0x18')]?_0x5c2757[_0xf24c('0x18')][_0xf24c('0x1d')]||null:null,'attributes':[[_0xf24c('0x2a'),_0xf24c('0x44')],[db[_0xf24c('0x1e')]['fn']('COUNT',db['sequelize'][_0xf24c('0x45')]('id')),_0xf24c('0x46')],[db['sequelize']['fn'](_0xf24c('0x22'),db[_0xf24c('0x1e')]['fn']('IF',db[_0xf24c('0x1e')][_0xf24c('0x20')](_0xf24c('0x2e')))),'ivrAnswerCallsDay']],'group':[_0xf24c('0x2a')]})[_0xf24c('0xa')](function(_0x52081e){logger['info']('GetCampaignHopperHistory',_0x5c2757);logger[_0xf24c('0xe')]('GetCampaignHopperHistory',_0x5c2757,JSON[_0xf24c('0x1a')](_0x52081e));_0x4fca6c(_0x52081e);})[_0xf24c('0x13')](function(_0x5c92b7){logger['error']('GetCampaignHopperHistory',_0x5c92b7[_0xf24c('0x12')],_0x5c2757);_0x2b9b2d(_0x524ef2[_0xf24c('0x10')](0x1f4,_0x5c92b7['message']));});});};
\ No newline at end of file