Built motion from commit 6a92c2cd.|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 _0x5fab=['[rescheduleContact]','rescheduleContact','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','temp','error','catch','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]'];(function(_0x4763f7,_0x7c6950){var _0x5d419e=function(_0x593f4b){while(--_0x593f4b){_0x4763f7['push'](_0x4763f7['shift']());}};_0x5d419e(++_0x7c6950);}(_0x5fab,0x177));var _0xb5fa=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x5fab[_0x2a8c21];return _0x5f3061;};'use strict';var util=require(_0xb5fa('0x0'));var logger=require(_0xb5fa('0x1'))('dialer');var cmHopper=require(_0xb5fa('0x2'));var cmHopperAdditionalPhone=require(_0xb5fa('0x3'));var cmHopperBlack=require(_0xb5fa('0x4'));var cmHopperHistory=require(_0xb5fa('0x5'));function inspectError(_0x67e8e8){return util[_0xb5fa('0x6')](_0x67e8e8,{'showHidden':![],'depth':null});}function getContactDialer(_0x29390a,_0x4341d3,_0x10361d){return cmHopper[_0xb5fa('0x7')](_0x29390a['id'],_0x4341d3,_0x10361d,_0x29390a['dialOrderByScheduledAt'])['catch'](function(_0x2e3804){_0x29390a[_0xb5fa('0x8')]=0x0;logger[_0xb5fa('0x9')]('[getContactDialer]',inspectError(_0x2e3804));});}exports[_0xb5fa('0x7')]=getContactDialer;function getContactDialerIvr(_0x38d9a3,_0x2cf4a5){return cmHopper['getContactDialerIvr'](_0x38d9a3['id'],_0x2cf4a5,_0x38d9a3['dialOrderByScheduledAt'])[_0xb5fa('0xa')](function(_0x23d124){_0x38d9a3[_0xb5fa('0x8')]=0x0;logger[_0xb5fa('0x9')](_0xb5fa('0xb'),inspectError(_0x23d124));});}exports[_0xb5fa('0xc')]=getContactDialerIvr;function countReScheduled(_0x65c6b6){return cmHopper[_0xb5fa('0xd')](_0x65c6b6)[_0xb5fa('0xa')](function(_0x4d3576){logger[_0xb5fa('0x9')](_0xb5fa('0xe'),inspectError(_0x4d3576));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x116849){return cmHopper['rescheduleContact'](_0x116849)[_0xb5fa('0xa')](function(_0x3fc372){logger[_0xb5fa('0x9')](_0xb5fa('0xf'),inspectError(_0x3fc372));});}exports[_0xb5fa('0x10')]=rescheduleContact;function unlockContact(_0x5371cf,_0x567f31,_0x38e964){return cmHopper[_0xb5fa('0x11')](_0x5371cf,_0x567f31,_0x38e964)[_0xb5fa('0xa')](function(_0x27c8f7){logger['error']('[unlockContact]',inspectError(_0x27c8f7));});}exports[_0xb5fa('0x11')]=unlockContact;function moveContactManagedDialer(_0x1f7f05){return cmHopper[_0xb5fa('0x12')](_0x1f7f05)[_0xb5fa('0xa')](function(_0x324ba5){logger[_0xb5fa('0x9')](_0xb5fa('0x13'),inspectError(_0x324ba5));});}exports[_0xb5fa('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0xc14dc4){return cmHopperBlack[_0xb5fa('0x14')](_0xc14dc4)[_0xb5fa('0xa')](function(_0x1f5064){logger['error'](_0xb5fa('0x15'),inspectError(_0x1f5064));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x37ae06){return cmHopperBlack['checkIsBlackListIvr'](_0x37ae06)[_0xb5fa('0xa')](function(_0x43c09f){logger['error'](_0xb5fa('0x16'),inspectError(_0x43c09f));});}exports[_0xb5fa('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x283a56,_0x47f71a,_0x32a85c){return cmHopperAdditionalPhone[_0xb5fa('0x18')](_0x283a56,_0x47f71a,_0x32a85c)[_0xb5fa('0xa')](function(_0x542348){logger[_0xb5fa('0x9')]('[verifyAdditionalPhone]',inspectError(_0x542348));});}exports[_0xb5fa('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x264591,_0x11053a,_0x543edf){return cmHopperAdditionalPhone[_0xb5fa('0x19')](_0x264591,_0x11053a,_0x543edf)[_0xb5fa('0xa')](function(_0x6a455c){logger[_0xb5fa('0x9')]('[swapAdditionalPhone]',inspectError(_0x6a455c));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x5bdf11){return cmHopperHistory['avgHandleTime'](_0x5bdf11)[_0xb5fa('0xa')](function(_0x460b54){logger[_0xb5fa('0x9')](_0xb5fa('0x1a'),inspectError(_0x460b54));});}exports[_0xb5fa('0x1b')]=avgHandleTime;function createHistory(_0x3506a4){return cmHopperHistory[_0xb5fa('0x1c')](_0x3506a4)[_0xb5fa('0xa')](function(_0x409af9){logger[_0xb5fa('0x9')](_0xb5fa('0x1d'),inspectError(_0x409af9));});}exports[_0xb5fa('0x1c')]=createHistory;