cb5ea30d277edf1edc4cb0ed26045cccac385ee6
[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 _0x1969=['queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo'];(function(_0x3ffeb2,_0xb5c645){var _0x4cecb6=function(_0x5744d3){while(--_0x5744d3){_0x3ffeb2['push'](_0x3ffeb2['shift']());}};_0x4cecb6(++_0xb5c645);}(_0x1969,0x13d));var _0x9196=function(_0x2829f8,_0x3de32d){_0x2829f8=_0x2829f8-0x0;var _0x54e75a=_0x1969[_0x2829f8];return _0x54e75a;};'use strict';var util=require('util');var BPromise=require(_0x9196('0x0'));var logger=require(_0x9196('0x1'))(_0x9196('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x9196('0x3'));var cmHopperBlack=require(_0x9196('0x4'));var agentReportPreview=require(_0x9196('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x793baf){return function(_0xc9e22c){logger[_0x9196('0x6')](_0x793baf,util[_0x9196('0x7')](_0xc9e22c,{'showHidden':![],'depth':null}));};}function create(_0x4cdd37){return cmHopperHistory[_0x9196('0x8')](_0x4cdd37)['catch'](loggerCatch(_0x9196('0x9')));}function createAgent(_0x287248){return BPromise[_0x9196('0xa')]()[_0x9196('0xb')](agentReportPreview[_0x9196('0x8')](_0x287248))[_0x9196('0xc')](loggerCatch(_0x9196('0x9')));}function moveContact(_0x2126dc){return cmHopper['moveContactManagedDialer'](_0x2126dc,!![])[_0x9196('0xc')](loggerCatch(_0x9196('0xd')));}exports[_0x9196('0xe')]=function(_0x302f10){return cmHopperBlack[_0x9196('0xe')](_0x302f10)['catch'](loggerCatch(_0x9196('0xf')));};exports[_0x9196('0x10')]=function(_0x59c40){return BPromise[_0x9196('0xa')]()[_0x9196('0xb')](cmHopper[_0x9196('0x10')](_0x59c40))[_0x9196('0xc')](loggerCatch(_0x9196('0x11')));};exports['createHistory']=function(_0x130f8d,_0xab8e79){create(_0x130f8d)[_0x9196('0xc')](loggerCatch(_0xab8e79));moveContact(_0x130f8d)[_0x9196('0xc')](loggerCatch(_0xab8e79));};exports[_0x9196('0x12')]=function(_0x1dd50f,_0x13f891){createAgent(_0x1dd50f)[_0x9196('0xc')](loggerCatch(_0x13f891));};exports[_0x9196('0x13')]=function(_0x847cdd,_0x25a011){create(_0x847cdd)['catch'](loggerCatch(_0x25a011));};exports['createCustomerFinal']=function(_0x4a7e78,_0x3edd45){moveContact(_0x4a7e78)[_0x9196('0xc')](loggerCatch(_0x3edd45));};exports['rescheduleContact']=function(_0x705906,_0x1a6c5b,_0x2d0902){if(_0x1a6c5b){_0x705906[_0x9196('0x14')]=null;}if(_0x2d0902){_0x705906[_0x9196('0x15')]=![];}return cmHopper[_0x9196('0x16')](_0x705906)[_0x9196('0xc')](loggerCatch(_0x9196('0x17')));};exports[_0x9196('0x18')]=function(_0xf4eb3b){return cmHopper[_0x9196('0x18')](_0xf4eb3b)[_0x9196('0xc')](loggerCatch(_0x9196('0x19')));};exports['unlockContact']=function(_0x55613b){return cmHopper[_0x9196('0x1a')]({'UserId':null},_0x55613b,0x1)[_0x9196('0xc')](loggerCatch(_0x9196('0x1b')));};exports[_0x9196('0x1c')]=function(_0xe609e){return cmHopper[_0x9196('0x1a')]({'active':![]},_0xe609e,0x1)[_0x9196('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x9196('0x1d')]=function(_0x11abd1){var _0x375313={};_0x375313['type']=_0x11abd1['type'];_0x375313['uniqueid']=_0x11abd1[_0x9196('0x1e')];_0x375313[_0x9196('0x1f')]=_0x11abd1[_0x9196('0x1f')];_0x375313[_0x9196('0x20')]=_0x11abd1[_0x9196('0x20')];_0x375313[_0x9196('0x21')]=_0x11abd1[_0x9196('0x21')];_0x375313[_0x9196('0x22')]=_0x11abd1[_0x9196('0x23')];_0x375313[_0x9196('0x24')]=_0x11abd1['answertime'];_0x375313[_0x9196('0x25')]=0x1;_0x375313[_0x9196('0x26')]=_0x11abd1['endtime'];_0x375313[_0x9196('0x27')]=_0x11abd1[_0x9196('0x28')];_0x375313[_0x9196('0x29')]='from-sip';_0x375313[_0x9196('0x2a')]=_0x9196('0x2b');_0x375313[_0x9196('0x2c')]=0x0;_0x375313[_0x9196('0x2d')]=0x1;_0x375313[_0x9196('0x2e')]=_0x11abd1[_0x9196('0x28')];_0x375313[_0x9196('0x2f')]='COMPLETED';return BPromise[_0x9196('0xa')]()[_0x9196('0xb')](voiceQueueReport[_0x9196('0x30')](_0x375313))['catch'](loggerCatch(_0x9196('0x31')));};exports['getContactRecallMe']=function(_0x4f7704,_0x5dde79){return BPromise['resolve']()[_0x9196('0xb')](cmHopper[_0x9196('0x32')](_0x4f7704,_0x5dde79))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x10d24b){return cmHopper[_0x9196('0x16')](_0x10d24b,!![],!![])[_0x9196('0xc')](loggerCatch(_0x9196('0x33')));};