Built motion from commit e02f907f.|2.6.14
[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 _0x0bd3=['[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','[createHistory]\x20','resolve','then','createHistory','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bd3,0x1d1));var _0x30bd=function(_0x3f670b,_0x10f414){_0x3f670b=_0x3f670b-0x0;var _0x1c0978=_0x0bd3[_0x3f670b];return _0x1c0978;};'use strict';var util=require(_0x30bd('0x0'));var BPromise=require(_0x30bd('0x1'));var logger=require(_0x30bd('0x2'))(_0x30bd('0x3'));var cmHopper=require(_0x30bd('0x4'));var cmHopperHistory=require(_0x30bd('0x5'));var cmHopperBlack=require(_0x30bd('0x6'));var agentReportPreview=require(_0x30bd('0x7'));var voiceQueueReport=require(_0x30bd('0x8'));function loggerCatch(_0x5419e2){return function(_0xc3d6de){logger[_0x30bd('0x9')](_0x5419e2,util[_0x30bd('0xa')](_0xc3d6de,{'showHidden':![],'depth':null}));};}function create(_0x1caf03){return cmHopperHistory['createHistory'](_0x1caf03)['catch'](loggerCatch(_0x30bd('0xb')));}function createAgent(_0x5b852e){return BPromise[_0x30bd('0xc')]()[_0x30bd('0xd')](agentReportPreview[_0x30bd('0xe')](_0x5b852e))[_0x30bd('0xf')](loggerCatch(_0x30bd('0xb')));}function moveContact(_0x20d34a){return cmHopper[_0x30bd('0x10')](_0x20d34a,!![])[_0x30bd('0xf')](loggerCatch(_0x30bd('0x11')));}exports['checkIsBlackList']=function(_0x5b6bd7){return cmHopperBlack['checkIsBlackList'](_0x5b6bd7)['catch'](loggerCatch(_0x30bd('0x12')));};exports[_0x30bd('0x13')]=function(_0x304b6f){return BPromise[_0x30bd('0xc')]()[_0x30bd('0xd')](cmHopper[_0x30bd('0x13')](_0x304b6f))[_0x30bd('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0x30bd('0xe')]=function(_0x19964d,_0x2989af){create(_0x19964d)[_0x30bd('0xf')](loggerCatch(_0x2989af));moveContact(_0x19964d)['catch'](loggerCatch(_0x2989af));};exports[_0x30bd('0x14')]=function(_0x474dcd,_0x433fbc){createAgent(_0x474dcd)[_0x30bd('0xf')](loggerCatch(_0x433fbc));};exports[_0x30bd('0x15')]=function(_0x2aaa12,_0x140dcf){create(_0x2aaa12)[_0x30bd('0xf')](loggerCatch(_0x140dcf));};exports[_0x30bd('0x16')]=function(_0x48a81e,_0x5a185d){moveContact(_0x48a81e)[_0x30bd('0xf')](loggerCatch(_0x5a185d));};exports[_0x30bd('0x17')]=function(_0x26a326,_0x1ee7e6,_0x593794){if(_0x1ee7e6){_0x26a326[_0x30bd('0x18')]=null;}if(_0x593794){_0x26a326['active']=![];}return cmHopper[_0x30bd('0x17')](_0x26a326)[_0x30bd('0xf')](loggerCatch(_0x30bd('0x19')));};exports[_0x30bd('0x1a')]=function(_0x5587da){return cmHopper[_0x30bd('0x1a')](_0x5587da)['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x30bd('0x1b')]=function(_0x1efaa1){return cmHopper[_0x30bd('0x1b')]({'UserId':null},_0x1efaa1,0x1)[_0x30bd('0xf')](loggerCatch(_0x30bd('0x1c')));};exports[_0x30bd('0x1d')]=function(_0x4bcc81){return cmHopper[_0x30bd('0x1b')]({'active':![]},_0x4bcc81,0x1)[_0x30bd('0xf')](loggerCatch(_0x30bd('0x1e')));};exports[_0x30bd('0x1f')]=function(_0x4625e1){var _0x243af7={};_0x243af7[_0x30bd('0x20')]=_0x4625e1[_0x30bd('0x20')];_0x243af7[_0x30bd('0x21')]=_0x4625e1['uniqueid'];_0x243af7[_0x30bd('0x22')]=_0x4625e1['calleridnum'];_0x243af7[_0x30bd('0x23')]=_0x4625e1[_0x30bd('0x23')];_0x243af7['queue']=_0x4625e1[_0x30bd('0x24')];_0x243af7['queuecallerjoinAt']=_0x4625e1[_0x30bd('0x25')];_0x243af7[_0x30bd('0x26')]=_0x4625e1[_0x30bd('0x25')];_0x243af7[_0x30bd('0x27')]=0x1;_0x243af7['queuecallercompleteAt']=_0x4625e1[_0x30bd('0x28')];_0x243af7[_0x30bd('0x29')]=_0x4625e1[_0x30bd('0x2a')];_0x243af7[_0x30bd('0x2b')]=_0x30bd('0x2c');_0x243af7[_0x30bd('0x2d')]=_0x30bd('0x2e');_0x243af7[_0x30bd('0x2f')]=0x0;_0x243af7[_0x30bd('0x30')]=0x1;_0x243af7[_0x30bd('0x31')]=_0x4625e1[_0x30bd('0x2a')];_0x243af7['queuecallerexitreason']=_0x30bd('0x32');return BPromise['resolve']()['then'](voiceQueueReport[_0x30bd('0x33')](_0x243af7))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x30bd('0x34')]=function(_0x30bc5c,_0x5e21ea){return BPromise['resolve']()[_0x30bd('0xd')](cmHopper[_0x30bd('0x34')](_0x30bc5c,_0x5e21ea))['catch'](loggerCatch(_0x30bd('0x35')));};exports['rescheduleContactInQueue']=function(_0x2a3b8e){return cmHopper[_0x30bd('0x17')](_0x2a3b8e,!![],!![])[_0x30bd('0xf')](loggerCatch(_0x30bd('0x36')));};