c9d8b303d20138c29b05023c838a5ccbe52c4ed0
[motion2.git] / server / services / ami / preview / rpcDb.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 _0x6781=['createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','preview','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','then'];(function(_0x59aac9,_0x5d9a2c){var _0x2f6639=function(_0x135c09){while(--_0x135c09){_0x59aac9['push'](_0x59aac9['shift']());}};_0x2f6639(++_0x5d9a2c);}(_0x6781,0xe7));var _0x1678=function(_0x2d1cb3,_0x53c0b0){_0x2d1cb3=_0x2d1cb3-0x0;var _0x31c8a6=_0x6781[_0x2d1cb3];return _0x31c8a6;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x1678('0x0'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1678('0x1'));var agentReportPreview=require(_0x1678('0x2'));var voiceQueueReport=require(_0x1678('0x3'));function loggerCatch(_0x5591b8){return function(_0x4f8258){logger['error'](_0x5591b8,util[_0x1678('0x4')](_0x4f8258,{'showHidden':![],'depth':null}));};}function create(_0x2c1095){return cmHopperHistory[_0x1678('0x5')](_0x2c1095)['catch'](loggerCatch(_0x1678('0x6')));}function createAgent(_0x41436e){return BPromise['resolve']()['then'](agentReportPreview[_0x1678('0x5')](_0x41436e))[_0x1678('0x7')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3a4469){return cmHopper['moveContactManagedDialer'](_0x3a4469,!![])[_0x1678('0x7')](loggerCatch(_0x1678('0x8')));}exports[_0x1678('0x9')]=function(_0x224bd5){return cmHopperBlack[_0x1678('0x9')](_0x224bd5)[_0x1678('0x7')](loggerCatch(_0x1678('0xa')));};exports[_0x1678('0xb')]=function(_0x19875e){return BPromise[_0x1678('0xc')]()[_0x1678('0xd')](cmHopper[_0x1678('0xb')](_0x19875e))[_0x1678('0x7')](loggerCatch('[getContactPreview]\x20'));};exports[_0x1678('0x5')]=function(_0x4349e2,_0x4f546a){create(_0x4349e2)['catch'](loggerCatch(_0x4f546a));moveContact(_0x4349e2)[_0x1678('0x7')](loggerCatch(_0x4f546a));};exports[_0x1678('0xe')]=function(_0x15f1a6,_0x1f8134){createAgent(_0x15f1a6)['catch'](loggerCatch(_0x1f8134));};exports[_0x1678('0xf')]=function(_0x3b9125,_0x51aa92){create(_0x3b9125)[_0x1678('0x7')](loggerCatch(_0x51aa92));};exports[_0x1678('0x10')]=function(_0x10b9a5,_0x2bf2f3){moveContact(_0x10b9a5)[_0x1678('0x7')](loggerCatch(_0x2bf2f3));};exports[_0x1678('0x11')]=function(_0x2a54fe,_0x5071e4,_0x9f7841){if(_0x5071e4){_0x2a54fe[_0x1678('0x12')]=null;}if(_0x9f7841){_0x2a54fe[_0x1678('0x13')]=![];}return cmHopper['rescheduleContact'](_0x2a54fe)[_0x1678('0x7')](loggerCatch(_0x1678('0x14')));};exports['countReScheduled']=function(_0x3081d1){return cmHopper[_0x1678('0x15')](_0x3081d1)[_0x1678('0x7')](loggerCatch(_0x1678('0x16')));};exports[_0x1678('0x17')]=function(_0x2b444d){return cmHopper[_0x1678('0x17')]({'UserId':null},_0x2b444d,0x1)[_0x1678('0x7')](loggerCatch(_0x1678('0x18')));};exports[_0x1678('0x19')]=function(_0x41b268){return cmHopper['unlockContact']({'active':![]},_0x41b268,0x1)[_0x1678('0x7')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x45f8c9){var _0x379dd4={};_0x379dd4[_0x1678('0x1a')]=_0x45f8c9[_0x1678('0x1a')];_0x379dd4[_0x1678('0x1b')]=_0x45f8c9[_0x1678('0x1b')];_0x379dd4['calleridnum']=_0x45f8c9[_0x1678('0x1c')];_0x379dd4[_0x1678('0x1d')]=_0x45f8c9[_0x1678('0x1d')];_0x379dd4[_0x1678('0x1e')]=_0x45f8c9[_0x1678('0x1e')];_0x379dd4['queuecallerjoinAt']=_0x45f8c9[_0x1678('0x1f')];_0x379dd4[_0x1678('0x20')]=_0x45f8c9[_0x1678('0x1f')];_0x379dd4['queuecallercomplete']=0x1;_0x379dd4['queuecallercompleteAt']=_0x45f8c9[_0x1678('0x21')];_0x379dd4[_0x1678('0x22')]=_0x45f8c9[_0x1678('0x23')];_0x379dd4[_0x1678('0x24')]=_0x1678('0x25');_0x379dd4[_0x1678('0x26')]='xcally-motion-preview';_0x379dd4[_0x1678('0x27')]=0x0;_0x379dd4[_0x1678('0x28')]=0x1;_0x379dd4[_0x1678('0x29')]=_0x45f8c9[_0x1678('0x23')];_0x379dd4[_0x1678('0x2a')]=_0x1678('0x2b');return BPromise[_0x1678('0xc')]()[_0x1678('0xd')](voiceQueueReport[_0x1678('0x2c')](_0x379dd4))[_0x1678('0x7')](loggerCatch(_0x1678('0x2d')));};exports[_0x1678('0x2e')]=function(_0x94ef0b,_0x167e3d){return BPromise[_0x1678('0xc')]()[_0x1678('0xd')](cmHopper[_0x1678('0x2e')](_0x94ef0b,_0x167e3d))[_0x1678('0x7')](loggerCatch(_0x1678('0x2f')));};exports['rescheduleContactInQueue']=function(_0x22502c){return cmHopper['rescheduleContact'](_0x22502c,!![],!![])[_0x1678('0x7')](loggerCatch(_0x1678('0x30')));};