Built motion from commit f74363e9.|2.6.34
[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 _0x0a6b=['verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','temp','error','getContactDialerIvr','catch','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x4f8ac6,_0x4a8268){_0x4f8ac6=_0x4f8ac6-0x0;var _0x408692=_0x0a6b[_0x4f8ac6];return _0x408692;};'use strict';var util=require(_0xb0a6('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0xb0a6('0x1'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xb0a6('0x2'));function inspectError(_0x13dc41){return util[_0xb0a6('0x3')](_0x13dc41,{'showHidden':![],'depth':null});}function getContactDialer(_0x544a64,_0x102ecd,_0x4cc3ae){return cmHopper[_0xb0a6('0x4')](_0x544a64['id'],_0x102ecd,_0x4cc3ae,_0x544a64[_0xb0a6('0x5')])['catch'](function(_0x11cd5b){_0x544a64[_0xb0a6('0x6')]=0x0;logger[_0xb0a6('0x7')]('[getContactDialer]',inspectError(_0x11cd5b));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x5161af,_0x2ded05){return cmHopper[_0xb0a6('0x8')](_0x5161af['id'],_0x2ded05,_0x5161af[_0xb0a6('0x5')])[_0xb0a6('0x9')](function(_0x5252ed){_0x5161af[_0xb0a6('0x6')]=0x0;logger[_0xb0a6('0x7')]('[getContactDialerIvr]',inspectError(_0x5252ed));});}exports[_0xb0a6('0x8')]=getContactDialerIvr;function countReScheduled(_0x24e4fd){return cmHopper[_0xb0a6('0xa')](_0x24e4fd)[_0xb0a6('0x9')](function(_0x471d0f){logger[_0xb0a6('0x7')](_0xb0a6('0xb'),inspectError(_0x471d0f));});}exports[_0xb0a6('0xa')]=countReScheduled;function rescheduleContact(_0x392f48){return cmHopper[_0xb0a6('0xc')](_0x392f48)['catch'](function(_0x2b801a){logger['error'](_0xb0a6('0xd'),inspectError(_0x2b801a));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x25582f,_0x59730e,_0x1d837f){return cmHopper[_0xb0a6('0xe')](_0x25582f,_0x59730e,_0x1d837f)[_0xb0a6('0x9')](function(_0x5673ad){logger['error'](_0xb0a6('0xf'),inspectError(_0x5673ad));});}exports[_0xb0a6('0xe')]=unlockContact;function moveContactManagedDialer(_0x59bc9c){return cmHopper[_0xb0a6('0x10')](_0x59bc9c)[_0xb0a6('0x9')](function(_0x13a1c8){logger['error'](_0xb0a6('0x11'),inspectError(_0x13a1c8));});}exports[_0xb0a6('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x372457){return cmHopperBlack[_0xb0a6('0x12')](_0x372457)[_0xb0a6('0x9')](function(_0x30ac04){logger['error'](_0xb0a6('0x13'),inspectError(_0x30ac04));});}exports[_0xb0a6('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x2d0fca){return cmHopperBlack[_0xb0a6('0x14')](_0x2d0fca)[_0xb0a6('0x9')](function(_0x10e56b){logger[_0xb0a6('0x7')](_0xb0a6('0x15'),inspectError(_0x10e56b));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3db6a6,_0x5c6e66,_0x1322ec){return cmHopperAdditionalPhone[_0xb0a6('0x16')](_0x3db6a6,_0x5c6e66,_0x1322ec)['catch'](function(_0x4aa68d){logger[_0xb0a6('0x7')](_0xb0a6('0x17'),inspectError(_0x4aa68d));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x3ea787,_0x24574a,_0x259f47){return cmHopperAdditionalPhone[_0xb0a6('0x18')](_0x3ea787,_0x24574a,_0x259f47)['catch'](function(_0x5e2a7c){logger[_0xb0a6('0x7')](_0xb0a6('0x19'),inspectError(_0x5e2a7c));});}exports[_0xb0a6('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x58d923){return cmHopperHistory[_0xb0a6('0x1a')](_0x58d923)[_0xb0a6('0x9')](function(_0x3edd9a){logger[_0xb0a6('0x7')](_0xb0a6('0x1b'),inspectError(_0x3edd9a));});}exports[_0xb0a6('0x1a')]=avgHandleTime;function createHistory(_0x94d47f){return cmHopperHistory[_0xb0a6('0x1c')](_0x94d47f)[_0xb0a6('0x9')](function(_0x4ced9f){logger[_0xb0a6('0x7')](_0xb0a6('0x1d'),inspectError(_0x4ced9f));});}exports[_0xb0a6('0x1c')]=createHistory;