Built motion from commit eddce310.|2.6.12
[motion2.git] / server / services / ami / dialer / utils / hopper.js
index 3b00dd3..18b55b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x35ecef,_0x399343){var _0x3061c9=function(_0x2825ef){while(--_0x2825ef){_0x35ecef['push'](_0x35ecef['shift']());}};_0x3061c9(++_0x399343);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory;
\ No newline at end of file
+var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x4500af,_0x1f6997){var _0x335517=function(_0x27b76b){while(--_0x27b76b){_0x4500af['push'](_0x4500af['shift']());}};_0x335517(++_0x1f6997);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory;
\ No newline at end of file