Built motion from commit (unavailable).|2.5.14
[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 _0x5162=['countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20'];(function(_0x34496c,_0x460b9e){var _0x405812=function(_0x1c615d){while(--_0x1c615d){_0x34496c['push'](_0x34496c['shift']());}};_0x405812(++_0x460b9e);}(_0x5162,0x103));var _0x2516=function(_0x3d1187,_0x2a8e79){_0x3d1187=_0x3d1187-0x0;var _0x3ceb4d=_0x5162[_0x3d1187];return _0x3ceb4d;};'use strict';var util=require(_0x2516('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require('lodash');var cmHopper=require(_0x2516('0x1'));var cmHopperFinal=require(_0x2516('0x2'));var cmHopperHistory=require(_0x2516('0x3'));var cmHopperBlack=require(_0x2516('0x4'));var voiceQueueRt=require(_0x2516('0x5'));var agentReportPreview=require(_0x2516('0x6'));var voiceQueueReport=require(_0x2516('0x7'));function loggerCatch(_0x5b71b5){return function(_0x48f411){logger['error'](_0x5b71b5,util[_0x2516('0x8')](_0x48f411,{'showHidden':![],'depth':null}));};}function create(_0xba4b36){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](cmHopperHistory[_0x2516('0xb')](_0xba4b36))[_0x2516('0xc')](loggerCatch(_0x2516('0xd')));}function createAgent(_0x590875){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](agentReportPreview[_0x2516('0xb')](_0x590875))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4ba807){return BPromise['resolve']()[_0x2516('0xa')](cmHopper[_0x2516('0xe')](_0x4ba807,!![]))[_0x2516('0xc')](loggerCatch(_0x2516('0xf')));}exports['checkIsBlackList']=function(_0x33496b){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](cmHopperBlack[_0x2516('0x10')](_0x33496b))[_0x2516('0xc')](loggerCatch(_0x2516('0x11')));};exports[_0x2516('0x12')]=function(_0x2edb47){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](cmHopper[_0x2516('0x12')](_0x2edb47))[_0x2516('0xc')](loggerCatch(_0x2516('0x13')));};exports[_0x2516('0xb')]=function(_0x3543d,_0x5623be){create(_0x3543d)[_0x2516('0xc')](loggerCatch(_0x5623be));moveContact(_0x3543d)[_0x2516('0xc')](loggerCatch(_0x5623be));};exports[_0x2516('0x14')]=function(_0x564d05,_0x1979d7){createAgent(_0x564d05)['catch'](loggerCatch(_0x1979d7));};exports['createCustomerHistory']=function(_0x31a817,_0x3583cf){create(_0x31a817)[_0x2516('0xc')](loggerCatch(_0x3583cf));};exports[_0x2516('0x15')]=function(_0x198b93,_0x42ba50){moveContact(_0x198b93)[_0x2516('0xc')](loggerCatch(_0x42ba50));};exports[_0x2516('0x16')]=function(_0x248c5a,_0x37485b,_0x39ba5b){if(_0x37485b){_0x248c5a[_0x2516('0x17')]=null;}if(_0x39ba5b){_0x248c5a[_0x2516('0x18')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x2516('0x16')](_0x248c5a))[_0x2516('0xc')](loggerCatch(_0x2516('0x19')));};exports[_0x2516('0x1a')]=function(_0x3ffb6d){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](cmHopper[_0x2516('0x1a')](_0x3ffb6d))['catch'](loggerCatch(_0x2516('0x1b')));};exports[_0x2516('0x1c')]=function(_0x774b60){return BPromise[_0x2516('0x9')]()['then'](cmHopper[_0x2516('0x1c')]({'UserId':null},_0x774b60,0x1))[_0x2516('0xc')](loggerCatch(_0x2516('0x1d')));};exports[_0x2516('0x1e')]=function(_0xd84b29){return BPromise['resolve']()[_0x2516('0xa')](cmHopper[_0x2516('0x1c')]({'active':![]},_0xd84b29,0x1))[_0x2516('0xc')](loggerCatch(_0x2516('0x1f')));};exports[_0x2516('0x20')]=function(_0x285e67){var _0x556f01={};_0x556f01[_0x2516('0x21')]=_0x285e67[_0x2516('0x21')];_0x556f01['uniqueid']=_0x285e67[_0x2516('0x22')];_0x556f01[_0x2516('0x23')]=_0x285e67[_0x2516('0x23')];_0x556f01[_0x2516('0x24')]=_0x285e67[_0x2516('0x24')];_0x556f01[_0x2516('0x25')]=_0x285e67[_0x2516('0x25')];_0x556f01[_0x2516('0x26')]=_0x285e67[_0x2516('0x27')];_0x556f01[_0x2516('0x28')]=_0x285e67[_0x2516('0x27')];_0x556f01[_0x2516('0x29')]=0x1;_0x556f01[_0x2516('0x2a')]=_0x285e67[_0x2516('0x2b')];_0x556f01[_0x2516('0x2c')]=_0x285e67['membername'];_0x556f01[_0x2516('0x2d')]='from-sip';_0x556f01[_0x2516('0x2e')]='xcally-motion-preview';_0x556f01[_0x2516('0x2f')]=0x0;_0x556f01['assigned']=0x1;_0x556f01[_0x2516('0x30')]=_0x285e67[_0x2516('0x31')];_0x556f01[_0x2516('0x32')]=_0x2516('0x33');return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](voiceQueueReport[_0x2516('0x34')](_0x556f01))[_0x2516('0xc')](loggerCatch(_0x2516('0x35')));};exports['getContactRecallMe']=function(_0x2965e6,_0x4578c7){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](cmHopper['getContactRecallMe'](_0x2965e6,_0x4578c7))['catch'](loggerCatch(_0x2516('0x36')));};exports[_0x2516('0x37')]=function(_0x2b0a76){return BPromise[_0x2516('0x9')]()[_0x2516('0xa')](cmHopper[_0x2516('0x16')](_0x2b0a76,!![],!![]))[_0x2516('0xc')](loggerCatch(_0x2516('0x38')));};