Built motion from commit 497d3d92.|2.5.43
[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 _0x11d0=['calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','then','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid'];(function(_0x16f9a2,_0x4b6ea1){var _0x42efc6=function(_0x10cf4b){while(--_0x10cf4b){_0x16f9a2['push'](_0x16f9a2['shift']());}};_0x42efc6(++_0x4b6ea1);}(_0x11d0,0x1ad));var _0x011d=function(_0xb53865,_0x396fd4){_0xb53865=_0xb53865-0x0;var _0x524d54=_0x11d0[_0xb53865];return _0x524d54;};'use strict';var util=require(_0x011d('0x0'));var BPromise=require('bluebird');var logger=require(_0x011d('0x1'))(_0x011d('0x2'));var _=require('lodash');var cmHopper=require(_0x011d('0x3'));var cmHopperFinal=require(_0x011d('0x4'));var cmHopperHistory=require(_0x011d('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x011d('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x011d('0x7'));function loggerCatch(_0x2a4daf){return function(_0x5378a1){logger[_0x011d('0x8')](_0x2a4daf,util[_0x011d('0x9')](_0x5378a1,{'showHidden':![],'depth':null}));};}function create(_0x38ba35){return BPromise['resolve']()[_0x011d('0xa')](cmHopperHistory[_0x011d('0xb')](_0x38ba35))['catch'](loggerCatch(_0x011d('0xc')));}function createAgent(_0xe5263b){return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](agentReportPreview[_0x011d('0xb')](_0xe5263b))[_0x011d('0xe')](loggerCatch(_0x011d('0xc')));}function moveContact(_0x4bd4e2){return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](cmHopper[_0x011d('0xf')](_0x4bd4e2,!![]))[_0x011d('0xe')](loggerCatch(_0x011d('0x10')));}exports['checkIsBlackList']=function(_0x2f6b27){return BPromise[_0x011d('0xd')]()['then'](cmHopperBlack[_0x011d('0x11')](_0x2f6b27))['catch'](loggerCatch(_0x011d('0x12')));};exports['getContactPreview']=function(_0x39dc80){return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](cmHopper[_0x011d('0x13')](_0x39dc80))[_0x011d('0xe')](loggerCatch(_0x011d('0x14')));};exports[_0x011d('0xb')]=function(_0x3f7849,_0x2566cd){create(_0x3f7849)[_0x011d('0xe')](loggerCatch(_0x2566cd));moveContact(_0x3f7849)[_0x011d('0xe')](loggerCatch(_0x2566cd));};exports[_0x011d('0x15')]=function(_0x2ee016,_0x391936){createAgent(_0x2ee016)[_0x011d('0xe')](loggerCatch(_0x391936));};exports[_0x011d('0x16')]=function(_0x1af4b0,_0x574590){create(_0x1af4b0)[_0x011d('0xe')](loggerCatch(_0x574590));};exports[_0x011d('0x17')]=function(_0x1eeef8,_0x1f58d2){moveContact(_0x1eeef8)['catch'](loggerCatch(_0x1f58d2));};exports[_0x011d('0x18')]=function(_0x326830,_0x50b257,_0x46da53){if(_0x50b257){_0x326830['UserId']=null;}if(_0x46da53){_0x326830[_0x011d('0x19')]=![];}return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](cmHopper[_0x011d('0x18')](_0x326830))[_0x011d('0xe')](loggerCatch(_0x011d('0x1a')));};exports['countReScheduled']=function(_0x1c002b){return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](cmHopper[_0x011d('0x1b')](_0x1c002b))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x011d('0x1c')]=function(_0x5cac32){return BPromise[_0x011d('0xd')]()['then'](cmHopper[_0x011d('0x1c')]({'UserId':null},_0x5cac32,0x1))[_0x011d('0xe')](loggerCatch(_0x011d('0x1d')));};exports[_0x011d('0x1e')]=function(_0x3076de){return BPromise[_0x011d('0xd')]()['then'](cmHopper[_0x011d('0x1c')]({'active':![]},_0x3076de,0x1))[_0x011d('0xe')](loggerCatch(_0x011d('0x1f')));};exports[_0x011d('0x20')]=function(_0x4e266f){var _0x5169db={};_0x5169db['type']=_0x4e266f[_0x011d('0x21')];_0x5169db[_0x011d('0x22')]=_0x4e266f[_0x011d('0x22')];_0x5169db[_0x011d('0x23')]=_0x4e266f['calleridnum'];_0x5169db[_0x011d('0x24')]=_0x4e266f['calleridname'];_0x5169db[_0x011d('0x25')]=_0x4e266f[_0x011d('0x25')];_0x5169db[_0x011d('0x26')]=_0x4e266f['answertime'];_0x5169db[_0x011d('0x27')]=_0x4e266f[_0x011d('0x28')];_0x5169db[_0x011d('0x29')]=0x1;_0x5169db['queuecallercompleteAt']=_0x4e266f[_0x011d('0x2a')];_0x5169db[_0x011d('0x2b')]=_0x4e266f[_0x011d('0x2c')];_0x5169db[_0x011d('0x2d')]=_0x011d('0x2e');_0x5169db[_0x011d('0x2f')]='xcally-motion-preview';_0x5169db['holdtime']=0x0;_0x5169db[_0x011d('0x30')]=0x1;_0x5169db[_0x011d('0x31')]=_0x4e266f['membername'];_0x5169db[_0x011d('0x32')]=_0x011d('0x33');return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](voiceQueueReport[_0x011d('0x34')](_0x5169db))[_0x011d('0xe')](loggerCatch(_0x011d('0x35')));};exports['getContactRecallMe']=function(_0x5a03c3,_0x54aced){return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](cmHopper[_0x011d('0x36')](_0x5a03c3,_0x54aced))[_0x011d('0xe')](loggerCatch(_0x011d('0x37')));};exports[_0x011d('0x38')]=function(_0x49f056){return BPromise[_0x011d('0xd')]()[_0x011d('0xa')](cmHopper[_0x011d('0x18')](_0x49f056,!![],!![]))[_0x011d('0xe')](loggerCatch(_0x011d('0x39')));};