Built motion from commit 3c2ce842.|2.6.31
[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 _0x814b=['rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','getContactDialer','catch','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','temp','countReScheduled','[countReScheduled]'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x814b,0x1a2));var _0xb814=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0x814b[_0x121b1a];return _0x2d89a6;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var cmHopper=require(_0xb814('0x3'));var cmHopperAdditionalPhone=require(_0xb814('0x4'));var cmHopperBlack=require(_0xb814('0x5'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x38c21a){return util[_0xb814('0x6')](_0x38c21a,{'showHidden':![],'depth':null});}function getContactDialer(_0x258866,_0x4237bc,_0x44931c){return cmHopper[_0xb814('0x7')](_0x258866['id'],_0x4237bc,_0x44931c,_0x258866['dialOrderByScheduledAt'])[_0xb814('0x8')](function(_0x2e6272){_0x258866['temp']=0x0;logger[_0xb814('0x9')](_0xb814('0xa'),inspectError(_0x2e6272));});}exports[_0xb814('0x7')]=getContactDialer;function getContactDialerIvr(_0x41166c,_0x1fea33){return cmHopper[_0xb814('0xb')](_0x41166c['id'],_0x1fea33,_0x41166c[_0xb814('0xc')])[_0xb814('0x8')](function(_0x207dbc){_0x41166c[_0xb814('0xd')]=0x0;logger[_0xb814('0x9')]('[getContactDialerIvr]',inspectError(_0x207dbc));});}exports[_0xb814('0xb')]=getContactDialerIvr;function countReScheduled(_0x56278f){return cmHopper[_0xb814('0xe')](_0x56278f)[_0xb814('0x8')](function(_0x35b10d){logger[_0xb814('0x9')](_0xb814('0xf'),inspectError(_0x35b10d));});}exports[_0xb814('0xe')]=countReScheduled;function rescheduleContact(_0x1438e7){return cmHopper[_0xb814('0x10')](_0x1438e7)[_0xb814('0x8')](function(_0x2ab627){logger[_0xb814('0x9')](_0xb814('0x11'),inspectError(_0x2ab627));});}exports[_0xb814('0x10')]=rescheduleContact;function unlockContact(_0x39bfcf,_0x303aca,_0x3a71d6){return cmHopper[_0xb814('0x12')](_0x39bfcf,_0x303aca,_0x3a71d6)[_0xb814('0x8')](function(_0x125ce2){logger[_0xb814('0x9')](_0xb814('0x13'),inspectError(_0x125ce2));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x168a48){return cmHopper['moveContactManagedDialer'](_0x168a48)[_0xb814('0x8')](function(_0xfac75b){logger['error']('[moveContactManagedDialer]',inspectError(_0xfac75b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x399b43){return cmHopperBlack['checkIsBlackList'](_0x399b43)['catch'](function(_0xb684ea){logger[_0xb814('0x9')](_0xb814('0x14'),inspectError(_0xb684ea));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0xf5b8aa){return cmHopperBlack['checkIsBlackListIvr'](_0xf5b8aa)[_0xb814('0x8')](function(_0x1808a3){logger[_0xb814('0x9')](_0xb814('0x15'),inspectError(_0x1808a3));});}exports[_0xb814('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2bd039,_0x1f5d40,_0x594470){return cmHopperAdditionalPhone[_0xb814('0x17')](_0x2bd039,_0x1f5d40,_0x594470)['catch'](function(_0x3f81d0){logger[_0xb814('0x9')](_0xb814('0x18'),inspectError(_0x3f81d0));});}exports[_0xb814('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1c8a2e,_0xb9e57d,_0x3d836c){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1c8a2e,_0xb9e57d,_0x3d836c)[_0xb814('0x8')](function(_0xc0ef66){logger[_0xb814('0x9')](_0xb814('0x19'),inspectError(_0xc0ef66));});}exports[_0xb814('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x1d5965){return cmHopperHistory[_0xb814('0x1b')](_0x1d5965)[_0xb814('0x8')](function(_0x5a6291){logger[_0xb814('0x9')](_0xb814('0x1c'),inspectError(_0x5a6291));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x9008b2){return cmHopperHistory[_0xb814('0x1d')](_0x9008b2)[_0xb814('0x8')](function(_0x499f22){logger[_0xb814('0x9')](_0xb814('0x1e'),inspectError(_0x499f22));});}exports['createHistory']=createHistory;