Built motion from commit (unavailable).|2.5.4
[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 _0x0bde=['calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid'];(function(_0xfb0d47,_0x362462){var _0x3ac6ab=function(_0x1d07d9){while(--_0x1d07d9){_0xfb0d47['push'](_0xfb0d47['shift']());}};_0x3ac6ab(++_0x362462);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var BPromise=require(_0xe0bd('0x0'));var logger=require('../../../config/logger')(_0xe0bd('0x1'));var _=require(_0xe0bd('0x2'));var cmHopper=require(_0xe0bd('0x3'));var cmHopperFinal=require(_0xe0bd('0x4'));var cmHopperHistory=require(_0xe0bd('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xe0bd('0x6'));var agentReportPreview=require(_0xe0bd('0x7'));var voiceQueueReport=require(_0xe0bd('0x8'));function loggerCatch(_0x3b712a){return function(_0x22bfd1){logger[_0xe0bd('0x9')](_0x3b712a,util[_0xe0bd('0xa')](_0x22bfd1,{'showHidden':![],'depth':null}));};}function create(_0x491dc7){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](cmHopperHistory[_0xe0bd('0xd')](_0x491dc7))[_0xe0bd('0xe')](loggerCatch(_0xe0bd('0xf')));}function createAgent(_0x3c47c4){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](agentReportPreview['createHistory'](_0x3c47c4))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x44ffa9){return BPromise['resolve']()['then'](cmHopper[_0xe0bd('0x10')](_0x44ffa9,!![]))[_0xe0bd('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xe0bd('0x11')]=function(_0x5272ca){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](cmHopperBlack[_0xe0bd('0x11')](_0x5272ca))[_0xe0bd('0xe')](loggerCatch(_0xe0bd('0x12')));};exports[_0xe0bd('0x13')]=function(_0x342a68){return BPromise[_0xe0bd('0xb')]()['then'](cmHopper['getContactPreview'](_0x342a68))['catch'](loggerCatch(_0xe0bd('0x14')));};exports[_0xe0bd('0xd')]=function(_0x2cd832,_0x379ea2){create(_0x2cd832)[_0xe0bd('0xe')](loggerCatch(_0x379ea2));moveContact(_0x2cd832)['catch'](loggerCatch(_0x379ea2));};exports['createAgentHistory']=function(_0x1becc8,_0x4ac920){createAgent(_0x1becc8)[_0xe0bd('0xe')](loggerCatch(_0x4ac920));};exports[_0xe0bd('0x15')]=function(_0xec158d,_0x20157b){create(_0xec158d)['catch'](loggerCatch(_0x20157b));};exports[_0xe0bd('0x16')]=function(_0xe1d808,_0x2b9f93){moveContact(_0xe1d808)['catch'](loggerCatch(_0x2b9f93));};exports[_0xe0bd('0x17')]=function(_0x25f595,_0x453175,_0x532584){if(_0x453175){_0x25f595[_0xe0bd('0x18')]=null;}if(_0x532584){_0x25f595[_0xe0bd('0x19')]=![];}return BPromise[_0xe0bd('0xb')]()['then'](cmHopper[_0xe0bd('0x17')](_0x25f595))['catch'](loggerCatch(_0xe0bd('0x1a')));};exports[_0xe0bd('0x1b')]=function(_0x4bcd48){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](cmHopper[_0xe0bd('0x1b')](_0x4bcd48))[_0xe0bd('0xe')](loggerCatch(_0xe0bd('0x1c')));};exports[_0xe0bd('0x1d')]=function(_0x2096a2){return BPromise[_0xe0bd('0xb')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x2096a2,0x1))[_0xe0bd('0xe')](loggerCatch(_0xe0bd('0x1e')));};exports['disableContact']=function(_0x4e8f11){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](cmHopper[_0xe0bd('0x1d')]({'active':![]},_0x4e8f11,0x1))[_0xe0bd('0xe')](loggerCatch('[activeContact]\x20'));};exports[_0xe0bd('0x1f')]=function(_0x4ef39b){var _0x9146fe={};_0x9146fe[_0xe0bd('0x20')]=_0x4ef39b[_0xe0bd('0x20')];_0x9146fe[_0xe0bd('0x21')]=_0x4ef39b[_0xe0bd('0x21')];_0x9146fe[_0xe0bd('0x22')]=_0x4ef39b[_0xe0bd('0x22')];_0x9146fe[_0xe0bd('0x23')]=_0x4ef39b[_0xe0bd('0x23')];_0x9146fe[_0xe0bd('0x24')]=_0x4ef39b[_0xe0bd('0x24')];_0x9146fe[_0xe0bd('0x25')]=_0x4ef39b[_0xe0bd('0x26')];_0x9146fe['queuecallerleaveAt']=_0x4ef39b[_0xe0bd('0x26')];_0x9146fe[_0xe0bd('0x27')]=0x1;_0x9146fe[_0xe0bd('0x28')]=_0x4ef39b[_0xe0bd('0x29')];_0x9146fe[_0xe0bd('0x2a')]=_0x4ef39b[_0xe0bd('0x2b')];_0x9146fe['context']='from-sip';_0x9146fe[_0xe0bd('0x2c')]=_0xe0bd('0x2d');_0x9146fe[_0xe0bd('0x2e')]=0x0;_0x9146fe[_0xe0bd('0x2f')]=0x1;_0x9146fe[_0xe0bd('0x30')]=_0x4ef39b[_0xe0bd('0x2b')];_0x9146fe[_0xe0bd('0x31')]='COMPLETED';return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](voiceQueueReport[_0xe0bd('0x32')](_0x9146fe))[_0xe0bd('0xe')](loggerCatch(_0xe0bd('0x33')));};exports[_0xe0bd('0x34')]=function(_0x543c59,_0xd82ced){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](cmHopper[_0xe0bd('0x34')](_0x543c59,_0xd82ced))[_0xe0bd('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x46e58d){return BPromise[_0xe0bd('0xb')]()[_0xe0bd('0xc')](cmHopper['rescheduleContact'](_0x46e58d,!![],!![]))[_0xe0bd('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));};