00fd255c65d3d68d4c01565ffa7b5d9cefc44df2
[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 _0xc118=['rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperBlack','../rpc/agentReportPreview','inspect','createHistory','catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue'];(function(_0x4e3608,_0x893af){var _0x4830e0=function(_0x3db506){while(--_0x3db506){_0x4e3608['push'](_0x4e3608['shift']());}};_0x4830e0(++_0x893af);}(_0xc118,0xca));var _0x8c11=function(_0x19ad99,_0x11c398){_0x19ad99=_0x19ad99-0x0;var _0x459689=_0xc118[_0x19ad99];return _0x459689;};'use strict';var util=require(_0x8c11('0x0'));var BPromise=require(_0x8c11('0x1'));var logger=require(_0x8c11('0x2'))(_0x8c11('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x8c11('0x4'));var agentReportPreview=require(_0x8c11('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x37120d){return function(_0x2fb468){logger['error'](_0x37120d,util[_0x8c11('0x6')](_0x2fb468,{'showHidden':![],'depth':null}));};}function create(_0x111e06){return cmHopperHistory[_0x8c11('0x7')](_0x111e06)[_0x8c11('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x769e2){return BPromise[_0x8c11('0x9')]()[_0x8c11('0xa')](agentReportPreview['createHistory'](_0x769e2))['catch'](loggerCatch(_0x8c11('0xb')));}function moveContact(_0x3b1df9){return cmHopper[_0x8c11('0xc')](_0x3b1df9,!![])['catch'](loggerCatch(_0x8c11('0xd')));}exports[_0x8c11('0xe')]=function(_0x4a6c7d){return cmHopperBlack['checkIsBlackList'](_0x4a6c7d)[_0x8c11('0x8')](loggerCatch(_0x8c11('0xf')));};exports[_0x8c11('0x10')]=function(_0x53d4af){return BPromise[_0x8c11('0x9')]()[_0x8c11('0xa')](cmHopper['getContactPreview'](_0x53d4af))[_0x8c11('0x8')](loggerCatch(_0x8c11('0x11')));};exports['createHistory']=function(_0x3a73b2,_0x310246){create(_0x3a73b2)[_0x8c11('0x8')](loggerCatch(_0x310246));moveContact(_0x3a73b2)[_0x8c11('0x8')](loggerCatch(_0x310246));};exports[_0x8c11('0x12')]=function(_0xb6f654,_0x391a8c){createAgent(_0xb6f654)[_0x8c11('0x8')](loggerCatch(_0x391a8c));};exports['createCustomerHistory']=function(_0x46a9f0,_0x276405){create(_0x46a9f0)['catch'](loggerCatch(_0x276405));};exports['createCustomerFinal']=function(_0x9aad63,_0x15fd53){moveContact(_0x9aad63)[_0x8c11('0x8')](loggerCatch(_0x15fd53));};exports['rescheduleContact']=function(_0x409897,_0x56581e,_0x208b1b){if(_0x56581e){_0x409897[_0x8c11('0x13')]=null;}if(_0x208b1b){_0x409897[_0x8c11('0x14')]=![];}return cmHopper['rescheduleContact'](_0x409897)[_0x8c11('0x8')](loggerCatch(_0x8c11('0x15')));};exports[_0x8c11('0x16')]=function(_0x2f0e05){return cmHopper[_0x8c11('0x16')](_0x2f0e05)[_0x8c11('0x8')](loggerCatch(_0x8c11('0x17')));};exports[_0x8c11('0x18')]=function(_0x4e82f8){return cmHopper[_0x8c11('0x18')]({'UserId':null},_0x4e82f8,0x1)[_0x8c11('0x8')](loggerCatch(_0x8c11('0x19')));};exports['disableContact']=function(_0x5df348){return cmHopper[_0x8c11('0x18')]({'active':![]},_0x5df348,0x1)['catch'](loggerCatch(_0x8c11('0x1a')));};exports[_0x8c11('0x1b')]=function(_0x5c2830){var _0x39d30e={};_0x39d30e[_0x8c11('0x1c')]=_0x5c2830[_0x8c11('0x1c')];_0x39d30e[_0x8c11('0x1d')]=_0x5c2830[_0x8c11('0x1d')];_0x39d30e['calleridnum']=_0x5c2830['calleridnum'];_0x39d30e['calleridname']=_0x5c2830['calleridname'];_0x39d30e[_0x8c11('0x1e')]=_0x5c2830[_0x8c11('0x1e')];_0x39d30e[_0x8c11('0x1f')]=_0x5c2830['answertime'];_0x39d30e['queuecallerleaveAt']=_0x5c2830['answertime'];_0x39d30e[_0x8c11('0x20')]=0x1;_0x39d30e[_0x8c11('0x21')]=_0x5c2830[_0x8c11('0x22')];_0x39d30e[_0x8c11('0x23')]=_0x5c2830[_0x8c11('0x24')];_0x39d30e['context']=_0x8c11('0x25');_0x39d30e[_0x8c11('0x26')]=_0x8c11('0x27');_0x39d30e['holdtime']=0x0;_0x39d30e[_0x8c11('0x28')]=0x1;_0x39d30e[_0x8c11('0x29')]=_0x5c2830['membername'];_0x39d30e[_0x8c11('0x2a')]=_0x8c11('0x2b');return BPromise['resolve']()[_0x8c11('0xa')](voiceQueueReport[_0x8c11('0x2c')](_0x39d30e))[_0x8c11('0x8')](loggerCatch(_0x8c11('0x2d')));};exports[_0x8c11('0x2e')]=function(_0x29a6db,_0x1ec264){return BPromise[_0x8c11('0x9')]()['then'](cmHopper[_0x8c11('0x2e')](_0x29a6db,_0x1ec264))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x8c11('0x2f')]=function(_0x328084){return cmHopper[_0x8c11('0x30')](_0x328084,!![],!![])[_0x8c11('0x8')](loggerCatch(_0x8c11('0x31')));};