Built motion from commit d5e4af8c.|2.6.23
[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 _0xfdbd=['[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','error','[getContactDialer]','getContactDialerIvr','catch','temp','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime'];(function(_0x35c165,_0x1bb4d3){var _0x43e64b=function(_0x249cf7){while(--_0x249cf7){_0x35c165['push'](_0x35c165['shift']());}};_0x43e64b(++_0x1bb4d3);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0xfdbd[_0x3f3a47];return _0x57a682;};'use strict';var util=require(_0xdfdb('0x0'));var logger=require(_0xdfdb('0x1'))(_0xdfdb('0x2'));var cmHopper=require(_0xdfdb('0x3'));var cmHopperAdditionalPhone=require(_0xdfdb('0x4'));var cmHopperBlack=require(_0xdfdb('0x5'));var cmHopperHistory=require(_0xdfdb('0x6'));function inspectError(_0x66533b){return util[_0xdfdb('0x7')](_0x66533b,{'showHidden':![],'depth':null});}function getContactDialer(_0x5945e0,_0x3f5b2d,_0x4a4a3f){return cmHopper[_0xdfdb('0x8')](_0x5945e0['id'],_0x3f5b2d,_0x4a4a3f,_0x5945e0[_0xdfdb('0x9')])['catch'](function(_0x556dc0){_0x5945e0['temp']=0x0;logger[_0xdfdb('0xa')](_0xdfdb('0xb'),inspectError(_0x556dc0));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x11d845,_0x444c19){return cmHopper[_0xdfdb('0xc')](_0x11d845['id'],_0x444c19,_0x11d845[_0xdfdb('0x9')])[_0xdfdb('0xd')](function(_0x1ace28){_0x11d845[_0xdfdb('0xe')]=0x0;logger['error'](_0xdfdb('0xf'),inspectError(_0x1ace28));});}exports[_0xdfdb('0xc')]=getContactDialerIvr;function countReScheduled(_0x527c05){return cmHopper[_0xdfdb('0x10')](_0x527c05)[_0xdfdb('0xd')](function(_0x2bee3b){logger[_0xdfdb('0xa')](_0xdfdb('0x11'),inspectError(_0x2bee3b));});}exports[_0xdfdb('0x10')]=countReScheduled;function rescheduleContact(_0xf5d903){return cmHopper[_0xdfdb('0x12')](_0xf5d903)['catch'](function(_0x48a66a){logger[_0xdfdb('0xa')]('[rescheduleContact]',inspectError(_0x48a66a));});}exports[_0xdfdb('0x12')]=rescheduleContact;function unlockContact(_0x9f3039,_0x11a56a,_0x40bc8a){return cmHopper[_0xdfdb('0x13')](_0x9f3039,_0x11a56a,_0x40bc8a)[_0xdfdb('0xd')](function(_0x54ff23){logger['error'](_0xdfdb('0x14'),inspectError(_0x54ff23));});}exports[_0xdfdb('0x13')]=unlockContact;function moveContactManagedDialer(_0x2c1070){return cmHopper['moveContactManagedDialer'](_0x2c1070)[_0xdfdb('0xd')](function(_0xb677b1){logger[_0xdfdb('0xa')](_0xdfdb('0x15'),inspectError(_0xb677b1));});}exports[_0xdfdb('0x16')]=moveContactManagedDialer;function checkIsBlackList(_0x2294de){return cmHopperBlack[_0xdfdb('0x17')](_0x2294de)[_0xdfdb('0xd')](function(_0x5b8cb5){logger[_0xdfdb('0xa')](_0xdfdb('0x18'),inspectError(_0x5b8cb5));});}exports[_0xdfdb('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x5cc70b){return cmHopperBlack[_0xdfdb('0x19')](_0x5cc70b)[_0xdfdb('0xd')](function(_0x2c7dd1){logger['error'](_0xdfdb('0x1a'),inspectError(_0x2c7dd1));});}exports[_0xdfdb('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x334cdd,_0x489fd4,_0x2a80c1){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x334cdd,_0x489fd4,_0x2a80c1)[_0xdfdb('0xd')](function(_0x145350){logger[_0xdfdb('0xa')](_0xdfdb('0x1b'),inspectError(_0x145350));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x4c253e,_0x4363d8,_0x956843){return cmHopperAdditionalPhone[_0xdfdb('0x1c')](_0x4c253e,_0x4363d8,_0x956843)[_0xdfdb('0xd')](function(_0x305954){logger['error'](_0xdfdb('0x1d'),inspectError(_0x305954));});}exports[_0xdfdb('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0xdf3a5c){return cmHopperHistory['avgHandleTime'](_0xdf3a5c)[_0xdfdb('0xd')](function(_0x5df454){logger[_0xdfdb('0xa')](_0xdfdb('0x1e'),inspectError(_0x5df454));});}exports[_0xdfdb('0x1f')]=avgHandleTime;function createHistory(_0x513fa0){return cmHopperHistory['createHistory'](_0x513fa0)[_0xdfdb('0xd')](function(_0xc56435){logger[_0xdfdb('0xa')](_0xdfdb('0x20'),inspectError(_0xc56435));});}exports[_0xdfdb('0x21')]=createHistory;