Built motion from commit 3c2ce842.|2.6.31
[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 _0x66a9=['UserId','countReScheduled','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','exten','holdtime','assigned','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerHistory'];(function(_0x3add24,_0x55ce02){var _0x418713=function(_0xa915fa){while(--_0xa915fa){_0x3add24['push'](_0x3add24['shift']());}};_0x418713(++_0x55ce02);}(_0x66a9,0x85));var _0x966a=function(_0x22730b,_0x3aafcd){_0x22730b=_0x22730b-0x0;var _0x20af64=_0x66a9[_0x22730b];return _0x20af64;};'use strict';var util=require(_0x966a('0x0'));var BPromise=require(_0x966a('0x1'));var logger=require('../../../config/logger')(_0x966a('0x2'));var cmHopper=require(_0x966a('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x966a('0x4'));var agentReportPreview=require(_0x966a('0x5'));var voiceQueueReport=require(_0x966a('0x6'));function loggerCatch(_0x1e123d){return function(_0x967d6b){logger[_0x966a('0x7')](_0x1e123d,util[_0x966a('0x8')](_0x967d6b,{'showHidden':![],'depth':null}));};}function create(_0x3919a4){return cmHopperHistory[_0x966a('0x9')](_0x3919a4)['catch'](loggerCatch(_0x966a('0xa')));}function createAgent(_0x2cc9c6){return BPromise[_0x966a('0xb')]()[_0x966a('0xc')](agentReportPreview[_0x966a('0x9')](_0x2cc9c6))[_0x966a('0xd')](loggerCatch(_0x966a('0xa')));}function moveContact(_0x1cf6ea){return cmHopper[_0x966a('0xe')](_0x1cf6ea,!![])[_0x966a('0xd')](loggerCatch(_0x966a('0xf')));}exports[_0x966a('0x10')]=function(_0x9cffb5){return cmHopperBlack[_0x966a('0x10')](_0x9cffb5)['catch'](loggerCatch(_0x966a('0x11')));};exports[_0x966a('0x12')]=function(_0x10555b){return BPromise['resolve']()['then'](cmHopper[_0x966a('0x12')](_0x10555b))[_0x966a('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x966a('0x9')]=function(_0x625a9d,_0x2e62e2){create(_0x625a9d)[_0x966a('0xd')](loggerCatch(_0x2e62e2));moveContact(_0x625a9d)[_0x966a('0xd')](loggerCatch(_0x2e62e2));};exports['createAgentHistory']=function(_0x2833b2,_0x3bd8e2){createAgent(_0x2833b2)[_0x966a('0xd')](loggerCatch(_0x3bd8e2));};exports[_0x966a('0x13')]=function(_0x2ae06f,_0x27d761){create(_0x2ae06f)[_0x966a('0xd')](loggerCatch(_0x27d761));};exports['createCustomerFinal']=function(_0x5caf80,_0x147be8){moveContact(_0x5caf80)[_0x966a('0xd')](loggerCatch(_0x147be8));};exports['rescheduleContact']=function(_0xb6b75a,_0x37f922,_0x5c12ae){if(_0x37f922){_0xb6b75a[_0x966a('0x14')]=null;}if(_0x5c12ae){_0xb6b75a['active']=![];}return cmHopper['rescheduleContact'](_0xb6b75a)[_0x966a('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x4db3cb){return cmHopper[_0x966a('0x15')](_0x4db3cb)[_0x966a('0xd')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x576390){return cmHopper['unlockContact']({'UserId':null},_0x576390,0x1)['catch'](loggerCatch(_0x966a('0x16')));};exports[_0x966a('0x17')]=function(_0x11dd0a){return cmHopper[_0x966a('0x18')]({'active':![]},_0x11dd0a,0x1)[_0x966a('0xd')](loggerCatch(_0x966a('0x19')));};exports[_0x966a('0x1a')]=function(_0x3b5c39){var _0x206771={};_0x206771[_0x966a('0x1b')]=_0x3b5c39[_0x966a('0x1b')];_0x206771[_0x966a('0x1c')]=_0x3b5c39['uniqueid'];_0x206771['calleridnum']=_0x3b5c39['calleridnum'];_0x206771[_0x966a('0x1d')]=_0x3b5c39[_0x966a('0x1d')];_0x206771[_0x966a('0x1e')]=_0x3b5c39[_0x966a('0x1e')];_0x206771[_0x966a('0x1f')]=_0x3b5c39[_0x966a('0x20')];_0x206771[_0x966a('0x21')]=_0x3b5c39[_0x966a('0x20')];_0x206771[_0x966a('0x22')]=0x1;_0x206771[_0x966a('0x23')]=_0x3b5c39[_0x966a('0x24')];_0x206771['connectedlinename']=_0x3b5c39['membername'];_0x206771[_0x966a('0x25')]=_0x966a('0x26');_0x206771[_0x966a('0x27')]='xcally-motion-preview';_0x206771[_0x966a('0x28')]=0x0;_0x206771[_0x966a('0x29')]=0x1;_0x206771['lastAssignedTo']=_0x3b5c39[_0x966a('0x2a')];_0x206771[_0x966a('0x2b')]=_0x966a('0x2c');return BPromise['resolve']()[_0x966a('0xc')](voiceQueueReport[_0x966a('0x2d')](_0x206771))[_0x966a('0xd')](loggerCatch(_0x966a('0x2e')));};exports[_0x966a('0x2f')]=function(_0x8ebf51,_0x120fd9){return BPromise[_0x966a('0xb')]()[_0x966a('0xc')](cmHopper['getContactRecallMe'](_0x8ebf51,_0x120fd9))[_0x966a('0xd')](loggerCatch(_0x966a('0x30')));};exports['rescheduleContactInQueue']=function(_0x561f47){return cmHopper[_0x966a('0x31')](_0x561f47,!![],!![])[_0x966a('0xd')](loggerCatch(_0x966a('0x32')));};