dccf86886dcddc72082d3e0c6ca128611c1aa6d4
[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 _0xb3dd=['rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','from-sip','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','getContactRecallMe','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal'];(function(_0x4f88db,_0x3082bf){var _0xca5f6=function(_0x5e4bc8){while(--_0x5e4bc8){_0x4f88db['push'](_0x4f88db['shift']());}};_0xca5f6(++_0x3082bf);}(_0xb3dd,0x1aa));var _0xdb3d=function(_0x21791a,_0x4f8808){_0x21791a=_0x21791a-0x0;var _0x153f8e=_0xb3dd[_0x21791a];return _0x153f8e;};'use strict';var util=require(_0xdb3d('0x0'));var BPromise=require(_0xdb3d('0x1'));var logger=require(_0xdb3d('0x2'))(_0xdb3d('0x3'));var cmHopper=require(_0xdb3d('0x4'));var cmHopperHistory=require(_0xdb3d('0x5'));var cmHopperBlack=require(_0xdb3d('0x6'));var agentReportPreview=require(_0xdb3d('0x7'));var voiceQueueReport=require(_0xdb3d('0x8'));function loggerCatch(_0x304ed7){return function(_0x5ea8fe){logger[_0xdb3d('0x9')](_0x304ed7,util[_0xdb3d('0xa')](_0x5ea8fe,{'showHidden':![],'depth':null}));};}function create(_0xa3ea49){return cmHopperHistory[_0xdb3d('0xb')](_0xa3ea49)[_0xdb3d('0xc')](loggerCatch(_0xdb3d('0xd')));}function createAgent(_0x5bac53){return BPromise[_0xdb3d('0xe')]()[_0xdb3d('0xf')](agentReportPreview[_0xdb3d('0xb')](_0x5bac53))['catch'](loggerCatch(_0xdb3d('0xd')));}function moveContact(_0x38bdc0){return cmHopper[_0xdb3d('0x10')](_0x38bdc0,!![])[_0xdb3d('0xc')](loggerCatch(_0xdb3d('0x11')));}exports[_0xdb3d('0x12')]=function(_0x2f87e9){return cmHopperBlack[_0xdb3d('0x12')](_0x2f87e9)[_0xdb3d('0xc')](loggerCatch(_0xdb3d('0x13')));};exports[_0xdb3d('0x14')]=function(_0x4b2c06){return BPromise[_0xdb3d('0xe')]()[_0xdb3d('0xf')](cmHopper[_0xdb3d('0x14')](_0x4b2c06))[_0xdb3d('0xc')](loggerCatch(_0xdb3d('0x15')));};exports[_0xdb3d('0xb')]=function(_0x3b43f9,_0x133f00){create(_0x3b43f9)[_0xdb3d('0xc')](loggerCatch(_0x133f00));moveContact(_0x3b43f9)['catch'](loggerCatch(_0x133f00));};exports[_0xdb3d('0x16')]=function(_0x1d21ea,_0x85ffe7){createAgent(_0x1d21ea)['catch'](loggerCatch(_0x85ffe7));};exports['createCustomerHistory']=function(_0x9cd68b,_0x2a7fe3){create(_0x9cd68b)[_0xdb3d('0xc')](loggerCatch(_0x2a7fe3));};exports[_0xdb3d('0x17')]=function(_0x5495a3,_0x196fbb){moveContact(_0x5495a3)[_0xdb3d('0xc')](loggerCatch(_0x196fbb));};exports[_0xdb3d('0x18')]=function(_0x452841,_0x5a4ec7,_0x1bf9cf){if(_0x5a4ec7){_0x452841[_0xdb3d('0x19')]=null;}if(_0x1bf9cf){_0x452841['active']=![];}return cmHopper[_0xdb3d('0x18')](_0x452841)[_0xdb3d('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xdb3d('0x1a')]=function(_0x514bb2){return cmHopper[_0xdb3d('0x1a')](_0x514bb2)[_0xdb3d('0xc')](loggerCatch(_0xdb3d('0x1b')));};exports[_0xdb3d('0x1c')]=function(_0x596099){return cmHopper['unlockContact']({'UserId':null},_0x596099,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0xdb3d('0x1d')]=function(_0x38faed){return cmHopper[_0xdb3d('0x1c')]({'active':![]},_0x38faed,0x1)[_0xdb3d('0xc')](loggerCatch(_0xdb3d('0x1e')));};exports[_0xdb3d('0x1f')]=function(_0xafe197){var _0x123d77={};_0x123d77[_0xdb3d('0x20')]=_0xafe197[_0xdb3d('0x20')];_0x123d77['uniqueid']=_0xafe197[_0xdb3d('0x21')];_0x123d77['calleridnum']=_0xafe197[_0xdb3d('0x22')];_0x123d77['calleridname']=_0xafe197[_0xdb3d('0x23')];_0x123d77['queue']=_0xafe197[_0xdb3d('0x24')];_0x123d77[_0xdb3d('0x25')]=_0xafe197[_0xdb3d('0x26')];_0x123d77['queuecallerleaveAt']=_0xafe197[_0xdb3d('0x26')];_0x123d77[_0xdb3d('0x27')]=0x1;_0x123d77[_0xdb3d('0x28')]=_0xafe197['endtime'];_0x123d77[_0xdb3d('0x29')]=_0xafe197['membername'];_0x123d77[_0xdb3d('0x2a')]=_0xdb3d('0x2b');_0x123d77['exten']='xcally-motion-preview';_0x123d77[_0xdb3d('0x2c')]=0x0;_0x123d77['assigned']=0x1;_0x123d77[_0xdb3d('0x2d')]=_0xafe197[_0xdb3d('0x2e')];_0x123d77[_0xdb3d('0x2f')]=_0xdb3d('0x30');return BPromise['resolve']()[_0xdb3d('0xf')](voiceQueueReport['create'](_0x123d77))[_0xdb3d('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xdb3d('0x31')]=function(_0x452ad0,_0x30c319){return BPromise[_0xdb3d('0xe')]()[_0xdb3d('0xf')](cmHopper[_0xdb3d('0x31')](_0x452ad0,_0x30c319))[_0xdb3d('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0xccae65){return cmHopper[_0xdb3d('0x18')](_0xccae65,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));};