8ff6083baa0bd3e03de55552083b83af1bbe43e0
[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 _0x5fd1=['[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact'];(function(_0x35c768,_0x47803a){var _0x4491a2=function(_0x4ebcc2){while(--_0x4ebcc2){_0x35c768['push'](_0x35c768['shift']());}};_0x4491a2(++_0x47803a);}(_0x5fd1,0x155));var _0x15fd=function(_0x23879e,_0x9c0082){_0x23879e=_0x23879e-0x0;var _0x39c4fa=_0x5fd1[_0x23879e];return _0x39c4fa;};'use strict';var util=require(_0x15fd('0x0'));var BPromise=require('bluebird');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var _=require(_0x15fd('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x15fd('0x4'));var cmHopperBlack=require(_0x15fd('0x5'));var voiceQueueRt=require(_0x15fd('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x15fd('0x7'));function loggerCatch(_0x386441){return function(_0x18450c){logger[_0x15fd('0x8')](_0x386441,util[_0x15fd('0x9')](_0x18450c,{'showHidden':![],'depth':null}));};}function create(_0x534e63){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopperHistory[_0x15fd('0xc')](_0x534e63))['catch'](loggerCatch(_0x15fd('0xd')));}function createAgent(_0x5c9c63){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](agentReportPreview['createHistory'](_0x5c9c63))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3dd2af){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0xe')](_0x3dd2af,!![]))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x10')));}exports[_0x15fd('0x11')]=function(_0x2660db){return BPromise[_0x15fd('0xa')]()['then'](cmHopperBlack['checkIsBlackList'](_0x2660db))['catch'](loggerCatch(_0x15fd('0x12')));};exports[_0x15fd('0x13')]=function(_0x624e9b){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x13')](_0x624e9b))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x14')));};exports['createHistory']=function(_0x4c7080,_0x25f139){create(_0x4c7080)['catch'](loggerCatch(_0x25f139));moveContact(_0x4c7080)[_0x15fd('0xf')](loggerCatch(_0x25f139));};exports['createAgentHistory']=function(_0x917fe4,_0x318f47){createAgent(_0x917fe4)[_0x15fd('0xf')](loggerCatch(_0x318f47));};exports['createCustomerHistory']=function(_0x367c36,_0x2ad0de){create(_0x367c36)[_0x15fd('0xf')](loggerCatch(_0x2ad0de));};exports[_0x15fd('0x15')]=function(_0x2fb919,_0x36a90e){moveContact(_0x2fb919)[_0x15fd('0xf')](loggerCatch(_0x36a90e));};exports[_0x15fd('0x16')]=function(_0x1b8b9f,_0x1eab55,_0x3ff307){if(_0x1eab55){_0x1b8b9f['UserId']=null;}if(_0x3ff307){_0x1b8b9f['active']=![];}return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x16')](_0x1b8b9f))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x17')));};exports[_0x15fd('0x18')]=function(_0x2073da){return BPromise['resolve']()[_0x15fd('0xb')](cmHopper[_0x15fd('0x18')](_0x2073da))[_0x15fd('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0x15fd('0x19')]=function(_0x49062f){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x19')]({'UserId':null},_0x49062f,0x1))['catch'](loggerCatch(_0x15fd('0x1a')));};exports[_0x15fd('0x1b')]=function(_0x24c541){return BPromise['resolve']()[_0x15fd('0xb')](cmHopper['unlockContact']({'active':![]},_0x24c541,0x1))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x1c')));};exports[_0x15fd('0x1d')]=function(_0x27d2c4){var _0x233ed3={};_0x233ed3[_0x15fd('0x1e')]=_0x27d2c4[_0x15fd('0x1e')];_0x233ed3[_0x15fd('0x1f')]=_0x27d2c4[_0x15fd('0x1f')];_0x233ed3[_0x15fd('0x20')]=_0x27d2c4[_0x15fd('0x20')];_0x233ed3['calleridname']=_0x27d2c4[_0x15fd('0x21')];_0x233ed3[_0x15fd('0x22')]=_0x27d2c4['queue'];_0x233ed3[_0x15fd('0x23')]=_0x27d2c4[_0x15fd('0x24')];_0x233ed3['queuecallerleaveAt']=_0x27d2c4[_0x15fd('0x24')];_0x233ed3[_0x15fd('0x25')]=0x1;_0x233ed3['queuecallercompleteAt']=_0x27d2c4[_0x15fd('0x26')];_0x233ed3[_0x15fd('0x27')]=_0x27d2c4[_0x15fd('0x28')];_0x233ed3[_0x15fd('0x29')]=_0x15fd('0x2a');_0x233ed3[_0x15fd('0x2b')]='xcally-motion-preview';_0x233ed3[_0x15fd('0x2c')]=0x0;_0x233ed3[_0x15fd('0x2d')]=0x1;_0x233ed3[_0x15fd('0x2e')]=_0x27d2c4[_0x15fd('0x28')];_0x233ed3['queuecallerexitreason']=_0x15fd('0x2f');return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](voiceQueueReport[_0x15fd('0x30')](_0x233ed3))[_0x15fd('0xf')](loggerCatch(_0x15fd('0x31')));};exports['getContactRecallMe']=function(_0x3b80a6,_0xaae2d0){return BPromise['resolve']()[_0x15fd('0xb')](cmHopper[_0x15fd('0x32')](_0x3b80a6,_0xaae2d0))[_0x15fd('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x15fd('0x33')]=function(_0x309851){return BPromise[_0x15fd('0xa')]()[_0x15fd('0xb')](cmHopper[_0x15fd('0x16')](_0x309851,!![],!![]))[_0x15fd('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));};