Built motion from commit 6f14c8ba.|2.6.29
[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 _0xaa3f=['countReScheduled','rescheduleContact','[rescheduleContact]','[unlockContact]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]'];(function(_0x555a56,_0x27872f){var _0x5ee4d8=function(_0x3e4833){while(--_0x3e4833){_0x555a56['push'](_0x555a56['shift']());}};_0x5ee4d8(++_0x27872f);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x5374c9,_0x5239e8){_0x5374c9=_0x5374c9-0x0;var _0x1f4e5e=_0xaa3f[_0x5374c9];return _0x1f4e5e;};'use strict';var util=require(_0xfaa3('0x0'));var logger=require(_0xfaa3('0x1'))(_0xfaa3('0x2'));var cmHopper=require(_0xfaa3('0x3'));var cmHopperAdditionalPhone=require(_0xfaa3('0x4'));var cmHopperBlack=require(_0xfaa3('0x5'));var cmHopperHistory=require(_0xfaa3('0x6'));function inspectError(_0x2b1aaf){return util[_0xfaa3('0x7')](_0x2b1aaf,{'showHidden':![],'depth':null});}function getContactDialer(_0x5123a3,_0x513eea,_0x2ac57f){return cmHopper['getContactDialer'](_0x5123a3['id'],_0x513eea,_0x2ac57f,_0x5123a3[_0xfaa3('0x8')])[_0xfaa3('0x9')](function(_0x352958){_0x5123a3[_0xfaa3('0xa')]=0x0;logger[_0xfaa3('0xb')](_0xfaa3('0xc'),inspectError(_0x352958));});}exports[_0xfaa3('0xd')]=getContactDialer;function getContactDialerIvr(_0x54fb06,_0x37bcd5){return cmHopper[_0xfaa3('0xe')](_0x54fb06['id'],_0x37bcd5,_0x54fb06['dialOrderByScheduledAt'])['catch'](function(_0x44d88e){_0x54fb06[_0xfaa3('0xa')]=0x0;logger[_0xfaa3('0xb')](_0xfaa3('0xf'),inspectError(_0x44d88e));});}exports[_0xfaa3('0xe')]=getContactDialerIvr;function countReScheduled(_0x32866b){return cmHopper['countReScheduled'](_0x32866b)[_0xfaa3('0x9')](function(_0x5be067){logger[_0xfaa3('0xb')](_0xfaa3('0x10'),inspectError(_0x5be067));});}exports[_0xfaa3('0x11')]=countReScheduled;function rescheduleContact(_0x58f71b){return cmHopper[_0xfaa3('0x12')](_0x58f71b)['catch'](function(_0xdf7551){logger[_0xfaa3('0xb')](_0xfaa3('0x13'),inspectError(_0xdf7551));});}exports[_0xfaa3('0x12')]=rescheduleContact;function unlockContact(_0x1243ed,_0x40831f,_0x4da250){return cmHopper['unlockContact'](_0x1243ed,_0x40831f,_0x4da250)[_0xfaa3('0x9')](function(_0xe1a082){logger[_0xfaa3('0xb')](_0xfaa3('0x14'),inspectError(_0xe1a082));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x5dd38c){return cmHopper['moveContactManagedDialer'](_0x5dd38c)['catch'](function(_0x499148){logger[_0xfaa3('0xb')]('[moveContactManagedDialer]',inspectError(_0x499148));});}exports[_0xfaa3('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x42846e){return cmHopperBlack[_0xfaa3('0x16')](_0x42846e)[_0xfaa3('0x9')](function(_0x1c32dd){logger[_0xfaa3('0xb')](_0xfaa3('0x17'),inspectError(_0x1c32dd));});}exports[_0xfaa3('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x220c9e){return cmHopperBlack[_0xfaa3('0x18')](_0x220c9e)['catch'](function(_0x434c8b){logger[_0xfaa3('0xb')](_0xfaa3('0x19'),inspectError(_0x434c8b));});}exports[_0xfaa3('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x50dc4a,_0x1f7324,_0x2d4087){return cmHopperAdditionalPhone[_0xfaa3('0x1a')](_0x50dc4a,_0x1f7324,_0x2d4087)[_0xfaa3('0x9')](function(_0x16a3e3){logger[_0xfaa3('0xb')](_0xfaa3('0x1b'),inspectError(_0x16a3e3));});}exports[_0xfaa3('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x5d6cdd,_0xe075fc,_0x2a1ace){return cmHopperAdditionalPhone[_0xfaa3('0x1c')](_0x5d6cdd,_0xe075fc,_0x2a1ace)[_0xfaa3('0x9')](function(_0x31c5cd){logger[_0xfaa3('0xb')](_0xfaa3('0x1d'),inspectError(_0x31c5cd));});}exports[_0xfaa3('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0xd67c17){return cmHopperHistory[_0xfaa3('0x1e')](_0xd67c17)[_0xfaa3('0x9')](function(_0x7df1f3){logger[_0xfaa3('0xb')](_0xfaa3('0x1f'),inspectError(_0x7df1f3));});}exports[_0xfaa3('0x1e')]=avgHandleTime;function createHistory(_0x5b84cd){return cmHopperHistory[_0xfaa3('0x20')](_0x5b84cd)[_0xfaa3('0x9')](function(_0xc2e71){logger['error'](_0xfaa3('0x21'),inspectError(_0xc2e71));});}exports['createHistory']=createHistory;