b9cc273e1ff226c5d55fd41738c2ab74ed0237d1
[motion2.git] / server / services / ami / dialer / utils / hopper.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xe2fe=['[countReScheduled]','countReScheduled','[rescheduleContact]','unlockContact','[moveContactManagedDialer]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','[createHistory]','createHistory','util','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','catch','error','getContactDialerIvr','dialOrderByScheduledAt','[getContactDialerIvr]'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xee2f('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require(_0xee2f('0x1'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xee2f('0x2'));var cmHopperHistory=require(_0xee2f('0x3'));function inspectError(_0xe5ad8a){return util[_0xee2f('0x4')](_0xe5ad8a,{'showHidden':![],'depth':null});}function getContactDialer(_0xcb45e6,_0x4ba89f,_0x311a2f){return cmHopper[_0xee2f('0x5')](_0xcb45e6['id'],_0x4ba89f,_0x311a2f,_0xcb45e6['dialOrderByScheduledAt'])[_0xee2f('0x6')](function(_0x2e1c8c){_0xcb45e6['temp']=0x0;logger[_0xee2f('0x7')]('[getContactDialer]',inspectError(_0x2e1c8c));});}exports[_0xee2f('0x5')]=getContactDialer;function getContactDialerIvr(_0x36920f,_0x53f7dd){return cmHopper[_0xee2f('0x8')](_0x36920f['id'],_0x53f7dd,_0x36920f[_0xee2f('0x9')])['catch'](function(_0x5597ea){_0x36920f['temp']=0x0;logger['error'](_0xee2f('0xa'),inspectError(_0x5597ea));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x481ea7){return cmHopper['countReScheduled'](_0x481ea7)[_0xee2f('0x6')](function(_0x346dbc){logger[_0xee2f('0x7')](_0xee2f('0xb'),inspectError(_0x346dbc));});}exports[_0xee2f('0xc')]=countReScheduled;function rescheduleContact(_0x3ab91f){return cmHopper['rescheduleContact'](_0x3ab91f)[_0xee2f('0x6')](function(_0x531c3a){logger[_0xee2f('0x7')](_0xee2f('0xd'),inspectError(_0x531c3a));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x445ba8,_0x145241,_0x28b614){return cmHopper[_0xee2f('0xe')](_0x445ba8,_0x145241,_0x28b614)[_0xee2f('0x6')](function(_0x58f42a){logger[_0xee2f('0x7')]('[unlockContact]',inspectError(_0x58f42a));});}exports[_0xee2f('0xe')]=unlockContact;function moveContactManagedDialer(_0x3359ff){return cmHopper['moveContactManagedDialer'](_0x3359ff)['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0xf'),inspectError(_0x40b5bc));});}exports[_0xee2f('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x28549d){return cmHopperBlack['checkIsBlackList'](_0x28549d)[_0xee2f('0x6')](function(_0x1e70aa){logger[_0xee2f('0x7')](_0xee2f('0x11'),inspectError(_0x1e70aa));});}exports[_0xee2f('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x5d36d4){return cmHopperBlack['checkIsBlackListIvr'](_0x5d36d4)[_0xee2f('0x6')](function(_0x3a1852){logger[_0xee2f('0x7')](_0xee2f('0x13'),inspectError(_0x3a1852));});}exports[_0xee2f('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0xf278cc,_0x39a39c,_0x4d68d3){return cmHopperAdditionalPhone[_0xee2f('0x15')](_0xf278cc,_0x39a39c,_0x4d68d3)[_0xee2f('0x6')](function(_0x15ceda){logger[_0xee2f('0x7')](_0xee2f('0x16'),inspectError(_0x15ceda));});}exports[_0xee2f('0x15')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x15a1b1,_0x13013f,_0x382174){return cmHopperAdditionalPhone[_0xee2f('0x17')](_0x15a1b1,_0x13013f,_0x382174)[_0xee2f('0x6')](function(_0x168adc){logger[_0xee2f('0x7')](_0xee2f('0x18'),inspectError(_0x168adc));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x4ef690){return cmHopperHistory['avgHandleTime'](_0x4ef690)[_0xee2f('0x6')](function(_0x18ff19){logger[_0xee2f('0x7')](_0xee2f('0x19'),inspectError(_0x18ff19));});}exports[_0xee2f('0x1a')]=avgHandleTime;function createHistory(_0x3737fd){return cmHopperHistory['createHistory'](_0x3737fd)[_0xee2f('0x6')](function(_0x52e1fa){logger[_0xee2f('0x7')](_0xee2f('0x1b'),inspectError(_0x52e1fa));});}exports[_0xee2f('0x1c')]=createHistory;