b596cff3c96356be384366245b367e92b318f70d
[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 _0xdb28=['createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','temp','error','[getContactDialer]','dialOrderByScheduledAt','catch','[getContactDialerIvr]','countReScheduled','rescheduleContact','[rescheduleContact]','[unlockContact]','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xdb28,0x106));var _0x8db2=function(_0x248a9f,_0x67ddc8){_0x248a9f=_0x248a9f-0x0;var _0x1e1f91=_0xdb28[_0x248a9f];return _0x1e1f91;};'use strict';var util=require(_0x8db2('0x0'));var logger=require(_0x8db2('0x1'))(_0x8db2('0x2'));var cmHopper=require(_0x8db2('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x8db2('0x4'));var cmHopperHistory=require(_0x8db2('0x5'));function inspectError(_0xfcf49f){return util[_0x8db2('0x6')](_0xfcf49f,{'showHidden':![],'depth':null});}function getContactDialer(_0x11109e,_0x52bf99,_0x21a03e){return cmHopper[_0x8db2('0x7')](_0x11109e['id'],_0x52bf99,_0x21a03e,_0x11109e['dialOrderByScheduledAt'])['catch'](function(_0x477f50){_0x11109e[_0x8db2('0x8')]=0x0;logger[_0x8db2('0x9')](_0x8db2('0xa'),inspectError(_0x477f50));});}exports[_0x8db2('0x7')]=getContactDialer;function getContactDialerIvr(_0x1ff362,_0x126c78){return cmHopper['getContactDialerIvr'](_0x1ff362['id'],_0x126c78,_0x1ff362[_0x8db2('0xb')])[_0x8db2('0xc')](function(_0x1f62af){_0x1ff362['temp']=0x0;logger[_0x8db2('0x9')](_0x8db2('0xd'),inspectError(_0x1f62af));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x41beda){return cmHopper[_0x8db2('0xe')](_0x41beda)[_0x8db2('0xc')](function(_0x204f49){logger[_0x8db2('0x9')]('[countReScheduled]',inspectError(_0x204f49));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x15070d){return cmHopper[_0x8db2('0xf')](_0x15070d)[_0x8db2('0xc')](function(_0x1d6a15){logger[_0x8db2('0x9')](_0x8db2('0x10'),inspectError(_0x1d6a15));});}exports[_0x8db2('0xf')]=rescheduleContact;function unlockContact(_0x3c96a7,_0x131252,_0x16c8c2){return cmHopper['unlockContact'](_0x3c96a7,_0x131252,_0x16c8c2)[_0x8db2('0xc')](function(_0x24da1b){logger['error'](_0x8db2('0x11'),inspectError(_0x24da1b));});}exports[_0x8db2('0x12')]=unlockContact;function moveContactManagedDialer(_0x21db8c){return cmHopper[_0x8db2('0x13')](_0x21db8c)[_0x8db2('0xc')](function(_0x46ce14){logger['error']('[moveContactManagedDialer]',inspectError(_0x46ce14));});}exports[_0x8db2('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x104e33){return cmHopperBlack[_0x8db2('0x14')](_0x104e33)[_0x8db2('0xc')](function(_0x58562e){logger[_0x8db2('0x9')](_0x8db2('0x15'),inspectError(_0x58562e));});}exports[_0x8db2('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x297ba3){return cmHopperBlack[_0x8db2('0x16')](_0x297ba3)['catch'](function(_0x124467){logger[_0x8db2('0x9')](_0x8db2('0x17'),inspectError(_0x124467));});}exports[_0x8db2('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2260d8,_0x21704c,_0x796ec1){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2260d8,_0x21704c,_0x796ec1)[_0x8db2('0xc')](function(_0x4f6516){logger['error']('[verifyAdditionalPhone]',inspectError(_0x4f6516));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xec8cd2,_0x29b5cd,_0x3be281){return cmHopperAdditionalPhone[_0x8db2('0x18')](_0xec8cd2,_0x29b5cd,_0x3be281)[_0x8db2('0xc')](function(_0x8d4f54){logger['error'](_0x8db2('0x19'),inspectError(_0x8d4f54));});}exports[_0x8db2('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x430dd5){return cmHopperHistory[_0x8db2('0x1a')](_0x430dd5)['catch'](function(_0x2e0691){logger[_0x8db2('0x9')](_0x8db2('0x1b'),inspectError(_0x2e0691));});}exports[_0x8db2('0x1a')]=avgHandleTime;function createHistory(_0xbe5ece){return cmHopperHistory[_0x8db2('0x1c')](_0xbe5ece)[_0x8db2('0xc')](function(_0x3124d5){logger[_0x8db2('0x9')]('[createHistory]',inspectError(_0x3124d5));});}exports[_0x8db2('0x1c')]=createHistory;