b9ebf1bd1b2e3219f2b0d8d707c10ec03cd50016
[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 _0x84e7=['calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','from-sip','exten','holdtime','lastAssignedTo','membername','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x84e7,0x122));var _0x784e=function(_0x260e58,_0x19e80e){_0x260e58=_0x260e58-0x0;var _0x37d024=_0x84e7[_0x260e58];return _0x37d024;};'use strict';var util=require('util');var BPromise=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('preview');var _=require(_0x784e('0x2'));var cmHopper=require(_0x784e('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x784e('0x4'));var cmHopperBlack=require(_0x784e('0x5'));var voiceQueueRt=require(_0x784e('0x6'));var agentReportPreview=require(_0x784e('0x7'));var voiceQueueReport=require(_0x784e('0x8'));function loggerCatch(_0x133296){return function(_0x48ed22){logger[_0x784e('0x9')](_0x133296,util['inspect'](_0x48ed22,{'showHidden':![],'depth':null}));};}function create(_0xfaa170){return BPromise[_0x784e('0xa')]()['then'](cmHopperHistory[_0x784e('0xb')](_0xfaa170))[_0x784e('0xc')](loggerCatch(_0x784e('0xd')));}function createAgent(_0x3ddd55){return BPromise['resolve']()['then'](agentReportPreview[_0x784e('0xb')](_0x3ddd55))[_0x784e('0xc')](loggerCatch(_0x784e('0xd')));}function moveContact(_0x2fd1b5){return BPromise['resolve']()[_0x784e('0xe')](cmHopper[_0x784e('0xf')](_0x2fd1b5,!![]))[_0x784e('0xc')](loggerCatch(_0x784e('0x10')));}exports[_0x784e('0x11')]=function(_0x208d24){return BPromise['resolve']()[_0x784e('0xe')](cmHopperBlack['checkIsBlackList'](_0x208d24))[_0x784e('0xc')](loggerCatch(_0x784e('0x12')));};exports[_0x784e('0x13')]=function(_0x21e844){return BPromise[_0x784e('0xa')]()[_0x784e('0xe')](cmHopper[_0x784e('0x13')](_0x21e844))[_0x784e('0xc')](loggerCatch(_0x784e('0x14')));};exports['createHistory']=function(_0x519059,_0x112ba1){create(_0x519059)[_0x784e('0xc')](loggerCatch(_0x112ba1));moveContact(_0x519059)[_0x784e('0xc')](loggerCatch(_0x112ba1));};exports[_0x784e('0x15')]=function(_0x3ac83,_0x19072b){createAgent(_0x3ac83)[_0x784e('0xc')](loggerCatch(_0x19072b));};exports['createCustomerHistory']=function(_0x2524d0,_0x285ddd){create(_0x2524d0)[_0x784e('0xc')](loggerCatch(_0x285ddd));};exports[_0x784e('0x16')]=function(_0x440cd6,_0x42f894){moveContact(_0x440cd6)[_0x784e('0xc')](loggerCatch(_0x42f894));};exports['rescheduleContact']=function(_0x5add8f,_0x12aacb,_0x52bc9d){if(_0x12aacb){_0x5add8f[_0x784e('0x17')]=null;}if(_0x52bc9d){_0x5add8f[_0x784e('0x18')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x784e('0x19')](_0x5add8f))[_0x784e('0xc')](loggerCatch(_0x784e('0x1a')));};exports[_0x784e('0x1b')]=function(_0x51f452){return BPromise['resolve']()['then'](cmHopper[_0x784e('0x1b')](_0x51f452))[_0x784e('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x784e('0x1c')]=function(_0x5e809a){return BPromise[_0x784e('0xa')]()['then'](cmHopper[_0x784e('0x1c')]({'UserId':null},_0x5e809a,0x1))[_0x784e('0xc')](loggerCatch(_0x784e('0x1d')));};exports[_0x784e('0x1e')]=function(_0x5cb14f){return BPromise[_0x784e('0xa')]()[_0x784e('0xe')](cmHopper[_0x784e('0x1c')]({'active':![]},_0x5cb14f,0x1))[_0x784e('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x784e('0x1f')]=function(_0xa3603f){var _0x5f3da2={};_0x5f3da2['type']=_0xa3603f[_0x784e('0x20')];_0x5f3da2[_0x784e('0x21')]=_0xa3603f[_0x784e('0x21')];_0x5f3da2[_0x784e('0x22')]=_0xa3603f[_0x784e('0x22')];_0x5f3da2[_0x784e('0x23')]=_0xa3603f[_0x784e('0x23')];_0x5f3da2[_0x784e('0x24')]=_0xa3603f[_0x784e('0x24')];_0x5f3da2[_0x784e('0x25')]=_0xa3603f[_0x784e('0x26')];_0x5f3da2[_0x784e('0x27')]=_0xa3603f[_0x784e('0x26')];_0x5f3da2[_0x784e('0x28')]=0x1;_0x5f3da2[_0x784e('0x29')]=_0xa3603f['endtime'];_0x5f3da2[_0x784e('0x2a')]=_0xa3603f['membername'];_0x5f3da2[_0x784e('0x2b')]=_0x784e('0x2c');_0x5f3da2[_0x784e('0x2d')]='xcally-motion-preview';_0x5f3da2[_0x784e('0x2e')]=0x0;_0x5f3da2['assigned']=0x1;_0x5f3da2[_0x784e('0x2f')]=_0xa3603f[_0x784e('0x30')];_0x5f3da2['queuecallerexitreason']=_0x784e('0x31');return BPromise[_0x784e('0xa')]()['then'](voiceQueueReport['create'](_0x5f3da2))[_0x784e('0xc')](loggerCatch(_0x784e('0x32')));};exports[_0x784e('0x33')]=function(_0x4724af,_0x33b2a6){return BPromise['resolve']()[_0x784e('0xe')](cmHopper[_0x784e('0x33')](_0x4724af,_0x33b2a6))['catch'](loggerCatch(_0x784e('0x34')));};exports['rescheduleContactInQueue']=function(_0x4adb1f){return BPromise['resolve']()[_0x784e('0xe')](cmHopper[_0x784e('0x19')](_0x4adb1f,!![],!![]))['catch'](loggerCatch(_0x784e('0x35')));};