69039d346dea6cfe2f610ffd671dea8f6f0902fc
[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 _0x7c35=['[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x7c35,0x110));var _0x57c3=function(_0x3ba17f,_0x257893){_0x3ba17f=_0x3ba17f-0x0;var _0x418691=_0x7c35[_0x3ba17f];return _0x418691;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x57c3('0x0'))(_0x57c3('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x57c3('0x2'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x57c3('0x3'));var voiceQueueReport=require(_0x57c3('0x4'));function loggerCatch(_0x2beba6){return function(_0x3e6d84){logger[_0x57c3('0x5')](_0x2beba6,util['inspect'](_0x3e6d84,{'showHidden':![],'depth':null}));};}function create(_0x55015c){return cmHopperHistory[_0x57c3('0x6')](_0x55015c)[_0x57c3('0x7')](loggerCatch(_0x57c3('0x8')));}function createAgent(_0x31bfc4){return BPromise['resolve']()[_0x57c3('0x9')](agentReportPreview['createHistory'](_0x31bfc4))['catch'](loggerCatch(_0x57c3('0x8')));}function moveContact(_0x51a4b3){return cmHopper[_0x57c3('0xa')](_0x51a4b3,!![])['catch'](loggerCatch(_0x57c3('0xb')));}exports[_0x57c3('0xc')]=function(_0x4ef46e){return cmHopperBlack[_0x57c3('0xc')](_0x4ef46e)[_0x57c3('0x7')](loggerCatch(_0x57c3('0xd')));};exports[_0x57c3('0xe')]=function(_0x183580){return BPromise[_0x57c3('0xf')]()[_0x57c3('0x9')](cmHopper['getContactPreview'](_0x183580))[_0x57c3('0x7')](loggerCatch(_0x57c3('0x10')));};exports[_0x57c3('0x6')]=function(_0x29b1ce,_0x5f3b99){create(_0x29b1ce)[_0x57c3('0x7')](loggerCatch(_0x5f3b99));moveContact(_0x29b1ce)[_0x57c3('0x7')](loggerCatch(_0x5f3b99));};exports[_0x57c3('0x11')]=function(_0xe48972,_0x578f4e){createAgent(_0xe48972)['catch'](loggerCatch(_0x578f4e));};exports[_0x57c3('0x12')]=function(_0x720d3e,_0xee1b34){create(_0x720d3e)[_0x57c3('0x7')](loggerCatch(_0xee1b34));};exports[_0x57c3('0x13')]=function(_0x272870,_0x1773a7){moveContact(_0x272870)[_0x57c3('0x7')](loggerCatch(_0x1773a7));};exports[_0x57c3('0x14')]=function(_0x2926e5,_0x5631d1,_0x3f5b82){if(_0x5631d1){_0x2926e5['UserId']=null;}if(_0x3f5b82){_0x2926e5[_0x57c3('0x15')]=![];}return cmHopper[_0x57c3('0x14')](_0x2926e5)['catch'](loggerCatch(_0x57c3('0x16')));};exports['countReScheduled']=function(_0x3bd9fb){return cmHopper[_0x57c3('0x17')](_0x3bd9fb)['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x57c3('0x18')]=function(_0x3b7e3c){return cmHopper[_0x57c3('0x18')]({'UserId':null},_0x3b7e3c,0x1)[_0x57c3('0x7')](loggerCatch(_0x57c3('0x19')));};exports[_0x57c3('0x1a')]=function(_0x3922aa){return cmHopper[_0x57c3('0x18')]({'active':![]},_0x3922aa,0x1)[_0x57c3('0x7')](loggerCatch(_0x57c3('0x1b')));};exports[_0x57c3('0x1c')]=function(_0x534866){var _0x37ae79={};_0x37ae79[_0x57c3('0x1d')]=_0x534866[_0x57c3('0x1d')];_0x37ae79[_0x57c3('0x1e')]=_0x534866[_0x57c3('0x1e')];_0x37ae79[_0x57c3('0x1f')]=_0x534866[_0x57c3('0x1f')];_0x37ae79[_0x57c3('0x20')]=_0x534866[_0x57c3('0x20')];_0x37ae79[_0x57c3('0x21')]=_0x534866[_0x57c3('0x21')];_0x37ae79[_0x57c3('0x22')]=_0x534866[_0x57c3('0x23')];_0x37ae79[_0x57c3('0x24')]=_0x534866[_0x57c3('0x23')];_0x37ae79['queuecallercomplete']=0x1;_0x37ae79[_0x57c3('0x25')]=_0x534866[_0x57c3('0x26')];_0x37ae79[_0x57c3('0x27')]=_0x534866[_0x57c3('0x28')];_0x37ae79[_0x57c3('0x29')]=_0x57c3('0x2a');_0x37ae79[_0x57c3('0x2b')]=_0x57c3('0x2c');_0x37ae79[_0x57c3('0x2d')]=0x0;_0x37ae79[_0x57c3('0x2e')]=0x1;_0x37ae79[_0x57c3('0x2f')]=_0x534866['membername'];_0x37ae79[_0x57c3('0x30')]=_0x57c3('0x31');return BPromise[_0x57c3('0xf')]()[_0x57c3('0x9')](voiceQueueReport[_0x57c3('0x32')](_0x37ae79))[_0x57c3('0x7')](loggerCatch(_0x57c3('0x33')));};exports[_0x57c3('0x34')]=function(_0x16ee14,_0x1b2f71){return BPromise[_0x57c3('0xf')]()[_0x57c3('0x9')](cmHopper['getContactRecallMe'](_0x16ee14,_0x1b2f71))[_0x57c3('0x7')](loggerCatch(_0x57c3('0x35')));};exports[_0x57c3('0x36')]=function(_0xdc252c){return cmHopper['rescheduleContact'](_0xdc252c,!![],!![])['catch'](loggerCatch(_0x57c3('0x37')));};