Built motion from commit 52c8a02d.|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 _0x0424=['../../rpc/cmHopperBlack','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialerIvr]','getContactDialerIvr','[countReScheduled]','countReScheduled','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone'];(function(_0x55e741,_0x495f69){var _0x3aabbe=function(_0x4b1cdb){while(--_0x4b1cdb){_0x55e741['push'](_0x55e741['shift']());}};_0x3aabbe(++_0x495f69);}(_0x0424,0x159));var _0x4042=function(_0x2027f5,_0x5a68c1){_0x2027f5=_0x2027f5-0x0;var _0x346d21=_0x0424[_0x2027f5];return _0x346d21;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x4042('0x0'));var cmHopper=require(_0x4042('0x1'));var cmHopperAdditionalPhone=require(_0x4042('0x2'));var cmHopperBlack=require(_0x4042('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x3cd879){return util['inspect'](_0x3cd879,{'showHidden':![],'depth':null});}function getContactDialer(_0x491eae,_0x20d8df,_0x24fdfd){return cmHopper[_0x4042('0x4')](_0x491eae['id'],_0x20d8df,_0x24fdfd,_0x491eae[_0x4042('0x5')])[_0x4042('0x6')](function(_0xa5310f){_0x491eae[_0x4042('0x7')]=0x0;logger['error']('[getContactDialer]',inspectError(_0xa5310f));});}exports[_0x4042('0x4')]=getContactDialer;function getContactDialerIvr(_0x117143,_0x103e4a){return cmHopper['getContactDialerIvr'](_0x117143['id'],_0x103e4a,_0x117143[_0x4042('0x5')])[_0x4042('0x6')](function(_0x2376a4){_0x117143[_0x4042('0x7')]=0x0;logger[_0x4042('0x8')](_0x4042('0x9'),inspectError(_0x2376a4));});}exports[_0x4042('0xa')]=getContactDialerIvr;function countReScheduled(_0x3b5a73){return cmHopper['countReScheduled'](_0x3b5a73)[_0x4042('0x6')](function(_0x357838){logger['error'](_0x4042('0xb'),inspectError(_0x357838));});}exports[_0x4042('0xc')]=countReScheduled;function rescheduleContact(_0x3e876b){return cmHopper[_0x4042('0xd')](_0x3e876b)[_0x4042('0x6')](function(_0x1ff3ca){logger[_0x4042('0x8')]('[rescheduleContact]',inspectError(_0x1ff3ca));});}exports[_0x4042('0xd')]=rescheduleContact;function unlockContact(_0x291e5c,_0x50206f,_0x28087d){return cmHopper[_0x4042('0xe')](_0x291e5c,_0x50206f,_0x28087d)[_0x4042('0x6')](function(_0x1c3328){logger[_0x4042('0x8')](_0x4042('0xf'),inspectError(_0x1c3328));});}exports[_0x4042('0xe')]=unlockContact;function moveContactManagedDialer(_0x10cb93){return cmHopper[_0x4042('0x10')](_0x10cb93)['catch'](function(_0xe5c1ec){logger['error'](_0x4042('0x11'),inspectError(_0xe5c1ec));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0xca9ca6){return cmHopperBlack[_0x4042('0x12')](_0xca9ca6)[_0x4042('0x6')](function(_0x2cd5ca){logger['error'](_0x4042('0x13'),inspectError(_0x2cd5ca));});}exports[_0x4042('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x14d36c){return cmHopperBlack[_0x4042('0x14')](_0x14d36c)['catch'](function(_0x42b518){logger[_0x4042('0x8')](_0x4042('0x15'),inspectError(_0x42b518));});}exports[_0x4042('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x352631,_0x548093,_0x1f9d4a){return cmHopperAdditionalPhone[_0x4042('0x16')](_0x352631,_0x548093,_0x1f9d4a)['catch'](function(_0x1daee8){logger['error'](_0x4042('0x17'),inspectError(_0x1daee8));});}exports[_0x4042('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x3f5a64,_0x5d5c6d,_0x461c5e){return cmHopperAdditionalPhone[_0x4042('0x18')](_0x3f5a64,_0x5d5c6d,_0x461c5e)[_0x4042('0x6')](function(_0xbdadc8){logger[_0x4042('0x8')]('[swapAdditionalPhone]',inspectError(_0xbdadc8));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1d8d48){return cmHopperHistory[_0x4042('0x19')](_0x1d8d48)[_0x4042('0x6')](function(_0x3e5c02){logger[_0x4042('0x8')](_0x4042('0x1a'),inspectError(_0x3e5c02));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x33733b){return cmHopperHistory[_0x4042('0x1b')](_0x33733b)['catch'](function(_0xae26c2){logger[_0x4042('0x8')](_0x4042('0x1c'),inspectError(_0xae26c2));});}exports['createHistory']=createHistory;