Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / services / ami / rpc / cmHopper.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 _0xc99e=['GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','MoveContactManagedDialer','CampaignId','countReScheduled','CountReScheduled','getContactPreview','User','Agent','name','VoiceQueue','unlockContact','UpdateCmHopper','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','getContacts','Request','CmContact','Contact','getCmHopper','updateContacts','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','destroyContact','DestroyCmHopper'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc99e,0x6e));var _0xec99=function(_0x163163,_0x467df1){_0x163163=_0x163163-0x0;var _0x4be8c=_0xc99e[_0x163163];return _0x4be8c;};'use strict';var client=require(_0xec99('0x0'));var moment=require(_0xec99('0x1'));exports[_0xec99('0x2')]=function(_0x1d5800,_0x22b65c){return function(){return client[_0xec99('0x3')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x1d5800},'include':[{'model':_0xec99('0x4'),'as':_0xec99('0x5')}],'limit':_0x22b65c,'raw':![]},'log':_0xec99('0x6')});};};exports[_0xec99('0x7')]=function(_0x1b5c37,_0x39821d,_0x451dd4){return function(){return client[_0xec99('0x3')]('UpdateCmHopper',{'body':_0x1b5c37,'options':{'where':{'VoiceQueueId':_0x39821d,'scheduledat':{'$lte':moment()[_0xec99('0x8')](_0xec99('0x9'))}},'limit':_0x451dd4},'log':'UpdateCmHopper'});};};exports[_0xec99('0xa')]=function(_0xc0a747){return client['Request']('UpdateCmHopper',{'body':_0xc0a747,'options':{'where':{'ContactId':_0xc0a747[_0xec99('0xb')],'ListId':_0xc0a747[_0xec99('0xc')],'VoiceQueueId':_0xc0a747[_0xec99('0xd')],'CampaignId':_0xc0a747['CampaignId']}},'log':_0xec99('0xa')});};exports[_0xec99('0xe')]=function(_0x1853d7,_0x33e223,_0x45947c){return function(){return client[_0xec99('0x3')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x1853d7,'ListId':_0x33e223,'ContactId':_0x45947c}},'log':_0xec99('0xf')});};};exports['getContactDialer']=function(_0xe1a114,_0x53d44e,_0x2c7cc9,_0x57bf4c){return client['Request'](_0xec99('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xe1a114,'active':![],'scheduledat':{'$lte':moment()['format'](_0xec99('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x53d44e}}]},'order':[[_0xec99('0x11'),_0xec99('0x12')],[_0xec99('0x13'),_0x57bf4c],['id',_0xec99('0x14')]],'raw':!![],'limit':_0x2c7cc9},'log':_0xec99('0x10')});};exports[_0xec99('0x15')]=function(_0x4e03db,_0x304db7,_0x52d9a7){return client[_0xec99('0x3')](_0xec99('0x10'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4e03db,'active':![],'scheduledat':{'$lte':moment()[_0xec99('0x8')](_0xec99('0x9'))}},'include':[{'model':'CmContact','as':'Contact'}],'order':[['priority',_0xec99('0x12')],[_0xec99('0x13'),_0x52d9a7],['id',_0xec99('0x14')]],'raw':!![],'limit':_0x304db7},'log':_0xec99('0x16')});};exports[_0xec99('0x17')]=function(_0x1edaf9,_0x1644a8){_0x1edaf9['campaign']=_0x1edaf9['queue'];return client[_0xec99('0x3')](_0xec99('0x18'),{'body':_0x1edaf9,'options':{'where':{'ContactId':_0x1edaf9['ContactId'],'ListId':_0x1edaf9[_0xec99('0xc')],'VoiceQueueId':_0x1edaf9[_0xec99('0xd')],'CampaignId':_0x1edaf9[_0xec99('0x19')],'active':_0x1644a8?undefined:!![]}},'log':_0xec99('0x18')});};exports[_0xec99('0x1a')]=function(_0x3c2e16){return client[_0xec99('0x3')](_0xec99('0x1b'),{'options':{'where':{'VoiceQueueId':_0x3c2e16['id']?_0x3c2e16['id']||null:null}},'log':_0xec99('0x1a')});};exports[_0xec99('0x1c')]=function(_0x5c374e){return function(){return client[_0xec99('0x3')]('GetCmHopperPreview',{'options':{'where':{'id':_0x5c374e},'include':[{'model':'CmContact','as':'Contact'},{'model':_0xec99('0x1d'),'as':_0xec99('0x1e'),'attributes':['id',_0xec99('0x1f')]},{'model':_0xec99('0x20'),'as':'Queue','attributes':['id',_0xec99('0x1f')]}],'raw':!![]},'log':_0xec99('0x6')});};};exports[_0xec99('0x21')]=function(_0x40bdcc,_0x3c62eb,_0x8b0181){return client[_0xec99('0x3')](_0xec99('0x22'),{'body':_0x40bdcc,'options':{'where':{'id':_0x3c62eb},'limit':_0x8b0181},'log':_0xec99('0x22')});};exports[_0xec99('0x23')]=function(_0x153bde,_0x575ab4){return function(){return client[_0xec99('0x3')](_0xec99('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x153bde,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0xec99('0x9'))},'UserId':{'$in':_0x575ab4}},'order':[[_0xec99('0x11'),_0xec99('0x12')],['scheduledat',_0xec99('0x12')],['id',_0xec99('0x14')]],'include':[{'model':_0xec99('0x4'),'as':_0xec99('0x5')},{'model':_0xec99('0x1d'),'as':_0xec99('0x1e'),'attributes':['id','name',_0xec99('0x25')]}],'group':_0xec99('0x26'),'raw':!![]},'log':_0xec99('0x10')});};};exports['resetActiveCalls']=function(_0x49acae,_0x545450){return client[_0xec99('0x3')]('ResetActiveCalls',{'body':_0x49acae,'options':_0x545450||{},'log':_0xec99('0x27')});};exports[_0xec99('0x28')]=function(_0x65e062,_0x15ccf3,_0x3b350d){return function(){return client['Request'](_0xec99('0x29'),{'body':{'where':{'voiceQueueIds':_0x65e062,'interval':_0x15ccf3,'availableAgentsIds':_0x3b350d}},'log':_0xec99('0x28')});};};