Built motion from commit 3d6333b4.|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 _0xf494=['[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','util','../../../../config/logger','dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[countReScheduled]','countReScheduled','rescheduleContact','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xf494,0x1c6));var _0x4f49=function(_0x232ae0,_0x161b4c){_0x232ae0=_0x232ae0-0x0;var _0x12e1af=_0xf494[_0x232ae0];return _0x12e1af;};'use strict';var util=require(_0x4f49('0x0'));var logger=require(_0x4f49('0x1'))(_0x4f49('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x4f49('0x3'));var cmHopperBlack=require(_0x4f49('0x4'));var cmHopperHistory=require(_0x4f49('0x5'));function inspectError(_0x25677c){return util[_0x4f49('0x6')](_0x25677c,{'showHidden':![],'depth':null});}function getContactDialer(_0x2a15fb,_0x3267c1,_0x790e8b){return cmHopper[_0x4f49('0x7')](_0x2a15fb['id'],_0x3267c1,_0x790e8b,_0x2a15fb[_0x4f49('0x8')])[_0x4f49('0x9')](function(_0x5eb186){_0x2a15fb['temp']=0x0;logger[_0x4f49('0xa')](_0x4f49('0xb'),inspectError(_0x5eb186));});}exports[_0x4f49('0x7')]=getContactDialer;function getContactDialerIvr(_0x30ca57,_0x185174){return cmHopper[_0x4f49('0xc')](_0x30ca57['id'],_0x185174,_0x30ca57[_0x4f49('0x8')])[_0x4f49('0x9')](function(_0x53ee74){_0x30ca57[_0x4f49('0xd')]=0x0;logger[_0x4f49('0xa')]('[getContactDialerIvr]',inspectError(_0x53ee74));});}exports[_0x4f49('0xc')]=getContactDialerIvr;function countReScheduled(_0x5bbc75){return cmHopper['countReScheduled'](_0x5bbc75)[_0x4f49('0x9')](function(_0x12527d){logger['error'](_0x4f49('0xe'),inspectError(_0x12527d));});}exports[_0x4f49('0xf')]=countReScheduled;function rescheduleContact(_0x1b9145){return cmHopper[_0x4f49('0x10')](_0x1b9145)[_0x4f49('0x9')](function(_0x2f0131){logger[_0x4f49('0xa')]('[rescheduleContact]',inspectError(_0x2f0131));});}exports[_0x4f49('0x10')]=rescheduleContact;function unlockContact(_0x1f2d0d,_0x415e83,_0x5878f4){return cmHopper['unlockContact'](_0x1f2d0d,_0x415e83,_0x5878f4)[_0x4f49('0x9')](function(_0x2ecaaa){logger[_0x4f49('0xa')]('[unlockContact]',inspectError(_0x2ecaaa));});}exports[_0x4f49('0x11')]=unlockContact;function moveContactManagedDialer(_0x399be7){return cmHopper[_0x4f49('0x12')](_0x399be7)['catch'](function(_0x5bb23b){logger['error']('[moveContactManagedDialer]',inspectError(_0x5bb23b));});}exports[_0x4f49('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x1834f4){return cmHopperBlack[_0x4f49('0x13')](_0x1834f4)[_0x4f49('0x9')](function(_0x5793ac){logger[_0x4f49('0xa')](_0x4f49('0x14'),inspectError(_0x5793ac));});}exports[_0x4f49('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0xaab5e7){return cmHopperBlack[_0x4f49('0x15')](_0xaab5e7)['catch'](function(_0x3e7e28){logger[_0x4f49('0xa')](_0x4f49('0x16'),inspectError(_0x3e7e28));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x40755e,_0x1d70a7,_0x32ca7b){return cmHopperAdditionalPhone[_0x4f49('0x17')](_0x40755e,_0x1d70a7,_0x32ca7b)[_0x4f49('0x9')](function(_0x36187b){logger['error']('[verifyAdditionalPhone]',inspectError(_0x36187b));});}exports[_0x4f49('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x429de7,_0x4fedbb,_0x408552){return cmHopperAdditionalPhone[_0x4f49('0x18')](_0x429de7,_0x4fedbb,_0x408552)[_0x4f49('0x9')](function(_0x525950){logger[_0x4f49('0xa')](_0x4f49('0x19'),inspectError(_0x525950));});}exports[_0x4f49('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x148153){return cmHopperHistory[_0x4f49('0x1a')](_0x148153)[_0x4f49('0x9')](function(_0x4915af){logger['error'](_0x4f49('0x1b'),inspectError(_0x4915af));});}exports[_0x4f49('0x1a')]=avgHandleTime;function createHistory(_0x605c91){return cmHopperHistory['createHistory'](_0x605c91)[_0x4f49('0x9')](function(_0x206203){logger[_0x4f49('0xa')]('[createHistory]',inspectError(_0x206203));});}exports['createHistory']=createHistory;