Built motion from commit 355702c8.|2.5.41
[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 _0x674e=['preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','[createHistory]\x20','createHistory','catch','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x674e,0xe2));var _0xe674=function(_0x4462cb,_0x34e8bb){_0x4462cb=_0x4462cb-0x0;var _0x47af61=_0x674e[_0x4462cb];return _0x47af61;};'use strict';var util=require(_0xe674('0x0'));var BPromise=require('bluebird');var logger=require(_0xe674('0x1'))(_0xe674('0x2'));var _=require(_0xe674('0x3'));var cmHopper=require(_0xe674('0x4'));var cmHopperFinal=require(_0xe674('0x5'));var cmHopperHistory=require(_0xe674('0x6'));var cmHopperBlack=require(_0xe674('0x7'));var voiceQueueRt=require(_0xe674('0x8'));var agentReportPreview=require(_0xe674('0x9'));var voiceQueueReport=require(_0xe674('0xa'));function loggerCatch(_0x232e4f){return function(_0x8954e4){logger[_0xe674('0xb')](_0x232e4f,util['inspect'](_0x8954e4,{'showHidden':![],'depth':null}));};}function create(_0x2a5c7f){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopperHistory['createHistory'](_0x2a5c7f))['catch'](loggerCatch(_0xe674('0xe')));}function createAgent(_0x462d6e){return BPromise[_0xe674('0xc')]()['then'](agentReportPreview[_0xe674('0xf')](_0x462d6e))[_0xe674('0x10')](loggerCatch(_0xe674('0xe')));}function moveContact(_0x43cf95){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopper['moveContactManagedDialer'](_0x43cf95,!![]))[_0xe674('0x10')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x2a4b25){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopperBlack[_0xe674('0x11')](_0x2a4b25))[_0xe674('0x10')](loggerCatch(_0xe674('0x12')));};exports['getContactPreview']=function(_0x2027c5){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopper[_0xe674('0x13')](_0x2027c5))[_0xe674('0x10')](loggerCatch(_0xe674('0x14')));};exports[_0xe674('0xf')]=function(_0x431152,_0x9d683e){create(_0x431152)[_0xe674('0x10')](loggerCatch(_0x9d683e));moveContact(_0x431152)['catch'](loggerCatch(_0x9d683e));};exports[_0xe674('0x15')]=function(_0x1b09a1,_0x43f4b4){createAgent(_0x1b09a1)[_0xe674('0x10')](loggerCatch(_0x43f4b4));};exports[_0xe674('0x16')]=function(_0x518abf,_0x2b90cb){create(_0x518abf)[_0xe674('0x10')](loggerCatch(_0x2b90cb));};exports[_0xe674('0x17')]=function(_0x4529aa,_0x2cd994){moveContact(_0x4529aa)[_0xe674('0x10')](loggerCatch(_0x2cd994));};exports[_0xe674('0x18')]=function(_0x454d2d,_0x3ec7c5,_0x56f39d){if(_0x3ec7c5){_0x454d2d[_0xe674('0x19')]=null;}if(_0x56f39d){_0x454d2d[_0xe674('0x1a')]=![];}return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopper['rescheduleContact'](_0x454d2d))[_0xe674('0x10')](loggerCatch(_0xe674('0x1b')));};exports[_0xe674('0x1c')]=function(_0x31d599){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopper[_0xe674('0x1c')](_0x31d599))[_0xe674('0x10')](loggerCatch(_0xe674('0x1d')));};exports[_0xe674('0x1e')]=function(_0x299343){return BPromise['resolve']()[_0xe674('0xd')](cmHopper[_0xe674('0x1e')]({'UserId':null},_0x299343,0x1))['catch'](loggerCatch(_0xe674('0x1f')));};exports['disableContact']=function(_0x2c5702){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopper[_0xe674('0x1e')]({'active':![]},_0x2c5702,0x1))[_0xe674('0x10')](loggerCatch(_0xe674('0x20')));};exports['crateCustomerReportQueue']=function(_0x83a3c2){var _0x11ff76={};_0x11ff76[_0xe674('0x21')]=_0x83a3c2[_0xe674('0x21')];_0x11ff76[_0xe674('0x22')]=_0x83a3c2[_0xe674('0x22')];_0x11ff76[_0xe674('0x23')]=_0x83a3c2[_0xe674('0x23')];_0x11ff76[_0xe674('0x24')]=_0x83a3c2['calleridname'];_0x11ff76[_0xe674('0x25')]=_0x83a3c2[_0xe674('0x25')];_0x11ff76[_0xe674('0x26')]=_0x83a3c2['answertime'];_0x11ff76[_0xe674('0x27')]=_0x83a3c2[_0xe674('0x28')];_0x11ff76[_0xe674('0x29')]=0x1;_0x11ff76[_0xe674('0x2a')]=_0x83a3c2[_0xe674('0x2b')];_0x11ff76['connectedlinename']=_0x83a3c2[_0xe674('0x2c')];_0x11ff76['context']=_0xe674('0x2d');_0x11ff76[_0xe674('0x2e')]='xcally-motion-preview';_0x11ff76[_0xe674('0x2f')]=0x0;_0x11ff76[_0xe674('0x30')]=0x1;_0x11ff76[_0xe674('0x31')]=_0x83a3c2[_0xe674('0x2c')];_0x11ff76[_0xe674('0x32')]=_0xe674('0x33');return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](voiceQueueReport[_0xe674('0x34')](_0x11ff76))[_0xe674('0x10')](loggerCatch(_0xe674('0x35')));};exports[_0xe674('0x36')]=function(_0x5baece,_0x48d4c4){return BPromise['resolve']()[_0xe674('0xd')](cmHopper['getContactRecallMe'](_0x5baece,_0x48d4c4))[_0xe674('0x10')](loggerCatch(_0xe674('0x37')));};exports[_0xe674('0x38')]=function(_0x28f0d5){return BPromise[_0xe674('0xc')]()[_0xe674('0xd')](cmHopper[_0xe674('0x18')](_0x28f0d5,!![],!![]))[_0xe674('0x10')](loggerCatch('[rescheduleContactInQueue]\x20'));};