Built motion from commit 449495f6.|2.6.27
[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 _0x1215=['getContactPreview','createAgentHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','../rpc/cmHopperHistory','../rpc/voiceQueueReport','catch','[createHistory]\x20','resolve','then','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x11df0b,_0x6b1e97){var _0x1def2c=function(_0x288949){while(--_0x288949){_0x11df0b['push'](_0x11df0b['shift']());}};_0x1def2c(++_0x6b1e97);}(_0x1215,0x192));var _0x5121=function(_0x4815a6,_0x29ef5e){_0x4815a6=_0x4815a6-0x0;var _0x309740=_0x1215[_0x4815a6];return _0x309740;};'use strict';var util=require(_0x5121('0x0'));var BPromise=require('bluebird');var logger=require(_0x5121('0x1'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x5121('0x2'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5121('0x3'));function loggerCatch(_0x172161){return function(_0xfce083){logger['error'](_0x172161,util['inspect'](_0xfce083,{'showHidden':![],'depth':null}));};}function create(_0x38de03){return cmHopperHistory['createHistory'](_0x38de03)[_0x5121('0x4')](loggerCatch(_0x5121('0x5')));}function createAgent(_0x2e85d9){return BPromise[_0x5121('0x6')]()[_0x5121('0x7')](agentReportPreview[_0x5121('0x8')](_0x2e85d9))[_0x5121('0x4')](loggerCatch(_0x5121('0x5')));}function moveContact(_0x39fed4){return cmHopper['moveContactManagedDialer'](_0x39fed4,!![])[_0x5121('0x4')](loggerCatch(_0x5121('0x9')));}exports[_0x5121('0xa')]=function(_0x5dbea3){return cmHopperBlack[_0x5121('0xa')](_0x5dbea3)[_0x5121('0x4')](loggerCatch(_0x5121('0xb')));};exports['getContactPreview']=function(_0x2273e2){return BPromise['resolve']()[_0x5121('0x7')](cmHopper[_0x5121('0xc')](_0x2273e2))[_0x5121('0x4')](loggerCatch('[getContactPreview]\x20'));};exports[_0x5121('0x8')]=function(_0x58b1a1,_0x3189c4){create(_0x58b1a1)[_0x5121('0x4')](loggerCatch(_0x3189c4));moveContact(_0x58b1a1)[_0x5121('0x4')](loggerCatch(_0x3189c4));};exports[_0x5121('0xd')]=function(_0x14d1ee,_0x406b1b){createAgent(_0x14d1ee)[_0x5121('0x4')](loggerCatch(_0x406b1b));};exports['createCustomerHistory']=function(_0x48d731,_0x8a6118){create(_0x48d731)[_0x5121('0x4')](loggerCatch(_0x8a6118));};exports['createCustomerFinal']=function(_0x33a4c9,_0xdaacc4){moveContact(_0x33a4c9)[_0x5121('0x4')](loggerCatch(_0xdaacc4));};exports[_0x5121('0xe')]=function(_0xa226e2,_0xf4a2fe,_0x5f3ead){if(_0xf4a2fe){_0xa226e2[_0x5121('0xf')]=null;}if(_0x5f3ead){_0xa226e2['active']=![];}return cmHopper[_0x5121('0xe')](_0xa226e2)[_0x5121('0x4')](loggerCatch(_0x5121('0x10')));};exports[_0x5121('0x11')]=function(_0x514660){return cmHopper[_0x5121('0x11')](_0x514660)[_0x5121('0x4')](loggerCatch(_0x5121('0x12')));};exports[_0x5121('0x13')]=function(_0x13d601){return cmHopper[_0x5121('0x13')]({'UserId':null},_0x13d601,0x1)[_0x5121('0x4')](loggerCatch(_0x5121('0x14')));};exports[_0x5121('0x15')]=function(_0x5457a7){return cmHopper[_0x5121('0x13')]({'active':![]},_0x5457a7,0x1)[_0x5121('0x4')](loggerCatch(_0x5121('0x16')));};exports[_0x5121('0x17')]=function(_0x519058){var _0x13741b={};_0x13741b[_0x5121('0x18')]=_0x519058['type'];_0x13741b[_0x5121('0x19')]=_0x519058[_0x5121('0x19')];_0x13741b['calleridnum']=_0x519058['calleridnum'];_0x13741b[_0x5121('0x1a')]=_0x519058['calleridname'];_0x13741b['queue']=_0x519058[_0x5121('0x1b')];_0x13741b[_0x5121('0x1c')]=_0x519058[_0x5121('0x1d')];_0x13741b['queuecallerleaveAt']=_0x519058['answertime'];_0x13741b[_0x5121('0x1e')]=0x1;_0x13741b[_0x5121('0x1f')]=_0x519058[_0x5121('0x20')];_0x13741b[_0x5121('0x21')]=_0x519058[_0x5121('0x22')];_0x13741b['context']=_0x5121('0x23');_0x13741b['exten']=_0x5121('0x24');_0x13741b[_0x5121('0x25')]=0x0;_0x13741b[_0x5121('0x26')]=0x1;_0x13741b[_0x5121('0x27')]=_0x519058[_0x5121('0x22')];_0x13741b['queuecallerexitreason']=_0x5121('0x28');return BPromise[_0x5121('0x6')]()[_0x5121('0x7')](voiceQueueReport[_0x5121('0x29')](_0x13741b))[_0x5121('0x4')](loggerCatch(_0x5121('0x2a')));};exports[_0x5121('0x2b')]=function(_0x18e22e,_0x54f152){return BPromise[_0x5121('0x6')]()[_0x5121('0x7')](cmHopper[_0x5121('0x2b')](_0x18e22e,_0x54f152))[_0x5121('0x4')](loggerCatch(_0x5121('0x2c')));};exports[_0x5121('0x2d')]=function(_0x1a4a3d){return cmHopper[_0x5121('0xe')](_0x1a4a3d,!![],!![])[_0x5121('0x4')](loggerCatch('[rescheduleContactInQueue]\x20'));};