Built motion from commit 42801a18.|2.6.28
[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 _0xc961=['[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','resolve','then'];(function(_0x598b6d,_0x24b0e5){var _0x132bbf=function(_0x299844){while(--_0x299844){_0x598b6d['push'](_0x598b6d['shift']());}};_0x132bbf(++_0x24b0e5);}(_0xc961,0x12b));var _0x1c96=function(_0x118d39,_0x43be87){_0x118d39=_0x118d39-0x0;var _0x47958b=_0xc961[_0x118d39];return _0x47958b;};'use strict';var util=require(_0x1c96('0x0'));var BPromise=require(_0x1c96('0x1'));var logger=require(_0x1c96('0x2'))('preview');var cmHopper=require(_0x1c96('0x3'));var cmHopperHistory=require(_0x1c96('0x4'));var cmHopperBlack=require(_0x1c96('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x1c96('0x6'));function loggerCatch(_0x3627d8){return function(_0x183ce5){logger[_0x1c96('0x7')](_0x3627d8,util[_0x1c96('0x8')](_0x183ce5,{'showHidden':![],'depth':null}));};}function create(_0x235250){return cmHopperHistory[_0x1c96('0x9')](_0x235250)[_0x1c96('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x8f4a37){return BPromise[_0x1c96('0xb')]()[_0x1c96('0xc')](agentReportPreview[_0x1c96('0x9')](_0x8f4a37))['catch'](loggerCatch(_0x1c96('0xd')));}function moveContact(_0x52dded){return cmHopper[_0x1c96('0xe')](_0x52dded,!![])[_0x1c96('0xa')](loggerCatch(_0x1c96('0xf')));}exports[_0x1c96('0x10')]=function(_0xe9ecbf){return cmHopperBlack[_0x1c96('0x10')](_0xe9ecbf)['catch'](loggerCatch(_0x1c96('0x11')));};exports[_0x1c96('0x12')]=function(_0x53d21c){return BPromise['resolve']()[_0x1c96('0xc')](cmHopper[_0x1c96('0x12')](_0x53d21c))[_0x1c96('0xa')](loggerCatch('[getContactPreview]\x20'));};exports[_0x1c96('0x9')]=function(_0x25c488,_0x1d4ac3){create(_0x25c488)[_0x1c96('0xa')](loggerCatch(_0x1d4ac3));moveContact(_0x25c488)[_0x1c96('0xa')](loggerCatch(_0x1d4ac3));};exports['createAgentHistory']=function(_0x1bc9ed,_0x46950a){createAgent(_0x1bc9ed)[_0x1c96('0xa')](loggerCatch(_0x46950a));};exports['createCustomerHistory']=function(_0x287149,_0x6f1b22){create(_0x287149)[_0x1c96('0xa')](loggerCatch(_0x6f1b22));};exports[_0x1c96('0x13')]=function(_0x299f98,_0x57f8a4){moveContact(_0x299f98)[_0x1c96('0xa')](loggerCatch(_0x57f8a4));};exports[_0x1c96('0x14')]=function(_0x45f556,_0x56dac3,_0x497e5e){if(_0x56dac3){_0x45f556[_0x1c96('0x15')]=null;}if(_0x497e5e){_0x45f556[_0x1c96('0x16')]=![];}return cmHopper['rescheduleContact'](_0x45f556)[_0x1c96('0xa')](loggerCatch(_0x1c96('0x17')));};exports[_0x1c96('0x18')]=function(_0x3e6bcf){return cmHopper[_0x1c96('0x18')](_0x3e6bcf)['catch'](loggerCatch(_0x1c96('0x19')));};exports['unlockContact']=function(_0x32ac2d){return cmHopper[_0x1c96('0x1a')]({'UserId':null},_0x32ac2d,0x1)[_0x1c96('0xa')](loggerCatch(_0x1c96('0x1b')));};exports[_0x1c96('0x1c')]=function(_0x41e976){return cmHopper[_0x1c96('0x1a')]({'active':![]},_0x41e976,0x1)['catch'](loggerCatch(_0x1c96('0x1d')));};exports[_0x1c96('0x1e')]=function(_0x1139d7){var _0x4385f8={};_0x4385f8[_0x1c96('0x1f')]=_0x1139d7[_0x1c96('0x1f')];_0x4385f8[_0x1c96('0x20')]=_0x1139d7[_0x1c96('0x20')];_0x4385f8[_0x1c96('0x21')]=_0x1139d7[_0x1c96('0x21')];_0x4385f8[_0x1c96('0x22')]=_0x1139d7[_0x1c96('0x22')];_0x4385f8['queue']=_0x1139d7[_0x1c96('0x23')];_0x4385f8[_0x1c96('0x24')]=_0x1139d7[_0x1c96('0x25')];_0x4385f8[_0x1c96('0x26')]=_0x1139d7[_0x1c96('0x25')];_0x4385f8[_0x1c96('0x27')]=0x1;_0x4385f8[_0x1c96('0x28')]=_0x1139d7['endtime'];_0x4385f8['connectedlinename']=_0x1139d7['membername'];_0x4385f8[_0x1c96('0x29')]=_0x1c96('0x2a');_0x4385f8[_0x1c96('0x2b')]=_0x1c96('0x2c');_0x4385f8[_0x1c96('0x2d')]=0x0;_0x4385f8['assigned']=0x1;_0x4385f8[_0x1c96('0x2e')]=_0x1139d7['membername'];_0x4385f8[_0x1c96('0x2f')]=_0x1c96('0x30');return BPromise['resolve']()['then'](voiceQueueReport[_0x1c96('0x31')](_0x4385f8))[_0x1c96('0xa')](loggerCatch(_0x1c96('0x32')));};exports[_0x1c96('0x33')]=function(_0x579593,_0x2989d5){return BPromise[_0x1c96('0xb')]()['then'](cmHopper[_0x1c96('0x33')](_0x579593,_0x2989d5))[_0x1c96('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x4178a7){return cmHopper[_0x1c96('0x14')](_0x4178a7,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));};