Built motion from commit b0a9a629.|2.6.33
[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 _0x1adb=['rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x407da1,_0x4e44d3){var _0x448f97=function(_0x375739){while(--_0x375739){_0x407da1['push'](_0x407da1['shift']());}};_0x448f97(++_0x4e44d3);}(_0x1adb,0xca));var _0xb1ad=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1adb[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xb1ad('0x0'));var BPromise=require(_0xb1ad('0x1'));var logger=require(_0xb1ad('0x2'))(_0xb1ad('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb1ad('0x4'));var cmHopperBlack=require(_0xb1ad('0x5'));var agentReportPreview=require(_0xb1ad('0x6'));var voiceQueueReport=require(_0xb1ad('0x7'));function loggerCatch(_0x2b5305){return function(_0x4d8533){logger['error'](_0x2b5305,util[_0xb1ad('0x8')](_0x4d8533,{'showHidden':![],'depth':null}));};}function create(_0x36675a){return cmHopperHistory[_0xb1ad('0x9')](_0x36675a)[_0xb1ad('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x572e65){return BPromise[_0xb1ad('0xb')]()['then'](agentReportPreview['createHistory'](_0x572e65))[_0xb1ad('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x222be1){return cmHopper['moveContactManagedDialer'](_0x222be1,!![])[_0xb1ad('0xa')](loggerCatch(_0xb1ad('0xc')));}exports[_0xb1ad('0xd')]=function(_0xe09e7b){return cmHopperBlack[_0xb1ad('0xd')](_0xe09e7b)[_0xb1ad('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xb1ad('0xe')]=function(_0x6f4ac5){return BPromise[_0xb1ad('0xb')]()[_0xb1ad('0xf')](cmHopper[_0xb1ad('0xe')](_0x6f4ac5))[_0xb1ad('0xa')](loggerCatch(_0xb1ad('0x10')));};exports['createHistory']=function(_0x2f084e,_0x25080a){create(_0x2f084e)[_0xb1ad('0xa')](loggerCatch(_0x25080a));moveContact(_0x2f084e)[_0xb1ad('0xa')](loggerCatch(_0x25080a));};exports[_0xb1ad('0x11')]=function(_0x5ad7e7,_0x3f7653){createAgent(_0x5ad7e7)['catch'](loggerCatch(_0x3f7653));};exports[_0xb1ad('0x12')]=function(_0x37e9f3,_0x1d1c00){create(_0x37e9f3)['catch'](loggerCatch(_0x1d1c00));};exports[_0xb1ad('0x13')]=function(_0x3d4868,_0x19b8aa){moveContact(_0x3d4868)[_0xb1ad('0xa')](loggerCatch(_0x19b8aa));};exports['rescheduleContact']=function(_0x386196,_0x4464de,_0x21b115){if(_0x4464de){_0x386196[_0xb1ad('0x14')]=null;}if(_0x21b115){_0x386196['active']=![];}return cmHopper['rescheduleContact'](_0x386196)['catch'](loggerCatch(_0xb1ad('0x15')));};exports[_0xb1ad('0x16')]=function(_0x35ddd7){return cmHopper[_0xb1ad('0x16')](_0x35ddd7)[_0xb1ad('0xa')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x3d64db){return cmHopper[_0xb1ad('0x17')]({'UserId':null},_0x3d64db,0x1)[_0xb1ad('0xa')](loggerCatch(_0xb1ad('0x18')));};exports[_0xb1ad('0x19')]=function(_0x304598){return cmHopper[_0xb1ad('0x17')]({'active':![]},_0x304598,0x1)[_0xb1ad('0xa')](loggerCatch(_0xb1ad('0x1a')));};exports[_0xb1ad('0x1b')]=function(_0x140dd3){var _0x4e5134={};_0x4e5134[_0xb1ad('0x1c')]=_0x140dd3['type'];_0x4e5134[_0xb1ad('0x1d')]=_0x140dd3[_0xb1ad('0x1d')];_0x4e5134[_0xb1ad('0x1e')]=_0x140dd3[_0xb1ad('0x1e')];_0x4e5134[_0xb1ad('0x1f')]=_0x140dd3['calleridname'];_0x4e5134['queue']=_0x140dd3[_0xb1ad('0x20')];_0x4e5134[_0xb1ad('0x21')]=_0x140dd3[_0xb1ad('0x22')];_0x4e5134['queuecallerleaveAt']=_0x140dd3['answertime'];_0x4e5134['queuecallercomplete']=0x1;_0x4e5134[_0xb1ad('0x23')]=_0x140dd3[_0xb1ad('0x24')];_0x4e5134['connectedlinename']=_0x140dd3[_0xb1ad('0x25')];_0x4e5134[_0xb1ad('0x26')]=_0xb1ad('0x27');_0x4e5134[_0xb1ad('0x28')]=_0xb1ad('0x29');_0x4e5134['holdtime']=0x0;_0x4e5134['assigned']=0x1;_0x4e5134[_0xb1ad('0x2a')]=_0x140dd3['membername'];_0x4e5134[_0xb1ad('0x2b')]='COMPLETED';return BPromise[_0xb1ad('0xb')]()[_0xb1ad('0xf')](voiceQueueReport[_0xb1ad('0x2c')](_0x4e5134))[_0xb1ad('0xa')](loggerCatch(_0xb1ad('0x2d')));};exports[_0xb1ad('0x2e')]=function(_0x335dda,_0x58b160){return BPromise[_0xb1ad('0xb')]()[_0xb1ad('0xf')](cmHopper['getContactRecallMe'](_0x335dda,_0x58b160))[_0xb1ad('0xa')](loggerCatch(_0xb1ad('0x2f')));};exports['rescheduleContactInQueue']=function(_0x4b5ce9){return cmHopper[_0xb1ad('0x30')](_0x4b5ce9,!![],!![])['catch'](loggerCatch(_0xb1ad('0x31')));};