4ffcf405e3afce706bc0495e082bebeb95444d60
[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 _0x81c6=['swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','getContactDialer','catch','[getContactDialer]','dialOrderByScheduledAt','temp','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]'];(function(_0xd03bbc,_0x53111c){var _0x252e8f=function(_0x554ca1){while(--_0x554ca1){_0xd03bbc['push'](_0xd03bbc['shift']());}};_0x252e8f(++_0x53111c);}(_0x81c6,0x1d5));var _0x681c=function(_0x534deb,_0x21de0c){_0x534deb=_0x534deb-0x0;var _0x1b3238=_0x81c6[_0x534deb];return _0x1b3238;};'use strict';var util=require('util');var logger=require(_0x681c('0x0'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x681c('0x1'));var cmHopperHistory=require(_0x681c('0x2'));function inspectError(_0x7a556b){return util['inspect'](_0x7a556b,{'showHidden':![],'depth':null});}function getContactDialer(_0x44c18e,_0x2aff9d,_0x1f2032){return cmHopper[_0x681c('0x3')](_0x44c18e['id'],_0x2aff9d,_0x1f2032,_0x44c18e['dialOrderByScheduledAt'])[_0x681c('0x4')](function(_0xdc57a5){_0x44c18e['temp']=0x0;logger['error'](_0x681c('0x5'),inspectError(_0xdc57a5));});}exports[_0x681c('0x3')]=getContactDialer;function getContactDialerIvr(_0x7f090a,_0x5de78e){return cmHopper['getContactDialerIvr'](_0x7f090a['id'],_0x5de78e,_0x7f090a[_0x681c('0x6')])['catch'](function(_0x82b6ad){_0x7f090a[_0x681c('0x7')]=0x0;logger[_0x681c('0x8')](_0x681c('0x9'),inspectError(_0x82b6ad));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x49729c){return cmHopper[_0x681c('0xa')](_0x49729c)[_0x681c('0x4')](function(_0x2d379b){logger['error'](_0x681c('0xb'),inspectError(_0x2d379b));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x3cf828){return cmHopper['rescheduleContact'](_0x3cf828)[_0x681c('0x4')](function(_0x27c3a2){logger[_0x681c('0x8')](_0x681c('0xc'),inspectError(_0x27c3a2));});}exports[_0x681c('0xd')]=rescheduleContact;function unlockContact(_0x2bc3fb,_0x50a4ec,_0x2b0939){return cmHopper[_0x681c('0xe')](_0x2bc3fb,_0x50a4ec,_0x2b0939)[_0x681c('0x4')](function(_0x5eb8){logger[_0x681c('0x8')](_0x681c('0xf'),inspectError(_0x5eb8));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0xf3c042){return cmHopper[_0x681c('0x10')](_0xf3c042)[_0x681c('0x4')](function(_0x42304f){logger['error'](_0x681c('0x11'),inspectError(_0x42304f));});}exports[_0x681c('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x54d27f){return cmHopperBlack[_0x681c('0x12')](_0x54d27f)['catch'](function(_0x46cafc){logger[_0x681c('0x8')](_0x681c('0x13'),inspectError(_0x46cafc));});}exports[_0x681c('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x4169b9){return cmHopperBlack['checkIsBlackListIvr'](_0x4169b9)['catch'](function(_0x57772d){logger[_0x681c('0x8')](_0x681c('0x14'),inspectError(_0x57772d));});}exports[_0x681c('0x15')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27b8a0,_0x2ec29f,_0x29f3fa){return cmHopperAdditionalPhone[_0x681c('0x16')](_0x27b8a0,_0x2ec29f,_0x29f3fa)[_0x681c('0x4')](function(_0x1b3d2b){logger[_0x681c('0x8')](_0x681c('0x17'),inspectError(_0x1b3d2b));});}exports[_0x681c('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x13de03,_0x218410,_0x3237ed){return cmHopperAdditionalPhone[_0x681c('0x18')](_0x13de03,_0x218410,_0x3237ed)['catch'](function(_0x11063b){logger['error'](_0x681c('0x19'),inspectError(_0x11063b));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x583499){return cmHopperHistory[_0x681c('0x1a')](_0x583499)[_0x681c('0x4')](function(_0x17e8f3){logger[_0x681c('0x8')]('[avgHandleTime]',inspectError(_0x17e8f3));});}exports[_0x681c('0x1a')]=avgHandleTime;function createHistory(_0x39fca3){return cmHopperHistory[_0x681c('0x1b')](_0x39fca3)[_0x681c('0x4')](function(_0x147cda){logger[_0x681c('0x8')](_0x681c('0x1c'),inspectError(_0x147cda));});}exports['createHistory']=createHistory;