Built motion from commit fd055180.|2.6.30
[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 _0x2087=['Agent','name','VoiceQueue','Queue','getCmHopper','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','getContacts','Request','GetCmHopper','CmContact','Contact','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','CountReScheduled','countReScheduled','getContactPreview','GetCmHopperPreview','User'];(function(_0x141d2e,_0x4d5885){var _0x535b21=function(_0x4554cd){while(--_0x4554cd){_0x141d2e['push'](_0x141d2e['shift']());}};_0x535b21(++_0x4d5885);}(_0x2087,0xf3));var _0x7208=function(_0x3b5e9f,_0x11a60b){_0x3b5e9f=_0x3b5e9f-0x0;var _0x3a6998=_0x2087[_0x3b5e9f];return _0x3a6998;};'use strict';var client=require(_0x7208('0x0'));var moment=require(_0x7208('0x1'));exports[_0x7208('0x2')]=function(_0x1773d0,_0x5eea11){return function(){return client[_0x7208('0x3')](_0x7208('0x4'),{'options':{'where':{'VoiceQueueId':_0x1773d0},'include':[{'model':_0x7208('0x5'),'as':_0x7208('0x6')}],'limit':_0x5eea11,'raw':![]},'log':'getCmHopper'});};};exports['updateContacts']=function(_0x232693,_0x5cc93f,_0x3c7d9d){return function(){return client['Request'](_0x7208('0x7'),{'body':_0x232693,'options':{'where':{'VoiceQueueId':_0x5cc93f,'scheduledat':{'$lte':moment()[_0x7208('0x8')](_0x7208('0x9'))}},'limit':_0x3c7d9d},'log':_0x7208('0x7')});};};exports[_0x7208('0xa')]=function(_0x25b01b){return client[_0x7208('0x3')]('UpdateCmHopper',{'body':_0x25b01b,'options':{'where':{'ContactId':_0x25b01b[_0x7208('0xb')],'ListId':_0x25b01b[_0x7208('0xc')],'VoiceQueueId':_0x25b01b[_0x7208('0xd')],'CampaignId':_0x25b01b[_0x7208('0xe')]}},'log':_0x7208('0xa')});};exports[_0x7208('0xf')]=function(_0x5b30f8,_0x330d9f,_0x26de84){return function(){return client[_0x7208('0x3')](_0x7208('0x10'),{'options':{'where':{'VoiceQueueId':_0x5b30f8,'ListId':_0x330d9f,'ContactId':_0x26de84}},'log':_0x7208('0x10')});};};exports[_0x7208('0x11')]=function(_0x4e59c1,_0xde3407,_0x415e8e,_0x234927){return client[_0x7208('0x3')](_0x7208('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4e59c1,'active':![],'scheduledat':{'$lte':moment()[_0x7208('0x8')](_0x7208('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0xde3407}}]},'order':[[_0x7208('0x13'),_0x7208('0x14')],[_0x7208('0x15'),_0x234927],['id',_0x7208('0x16')]],'raw':!![],'limit':_0x415e8e},'log':'GetContactDialer'});};exports['getContactDialerIvr']=function(_0x5a7b8d,_0x476598,_0x5b22d6){return client[_0x7208('0x3')](_0x7208('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x5a7b8d,'active':![],'scheduledat':{'$lte':moment()['format'](_0x7208('0x9'))}},'include':[{'model':_0x7208('0x5'),'as':_0x7208('0x6')}],'order':[[_0x7208('0x13'),_0x7208('0x14')],[_0x7208('0x15'),_0x5b22d6],['id',_0x7208('0x16')]],'raw':!![],'limit':_0x476598},'log':_0x7208('0x17')});};exports[_0x7208('0x18')]=function(_0x41cd3a,_0x3c17db){_0x41cd3a[_0x7208('0x19')]=_0x41cd3a[_0x7208('0x1a')];return client[_0x7208('0x3')](_0x7208('0x1b'),{'body':_0x41cd3a,'options':{'where':{'ContactId':_0x41cd3a['ContactId'],'ListId':_0x41cd3a['ListId'],'VoiceQueueId':_0x41cd3a[_0x7208('0xd')],'CampaignId':_0x41cd3a[_0x7208('0xe')],'active':_0x3c17db?undefined:!![]}},'log':_0x7208('0x1b')});};exports['countReScheduled']=function(_0x1b95dc){return client[_0x7208('0x3')](_0x7208('0x1c'),{'options':{'where':{'VoiceQueueId':_0x1b95dc['id']?_0x1b95dc['id']||null:null}},'log':_0x7208('0x1d')});};exports[_0x7208('0x1e')]=function(_0x245ee8){return function(){return client[_0x7208('0x3')](_0x7208('0x1f'),{'options':{'where':{'id':_0x245ee8},'include':[{'model':_0x7208('0x5'),'as':_0x7208('0x6')},{'model':_0x7208('0x20'),'as':_0x7208('0x21'),'attributes':['id',_0x7208('0x22')]},{'model':_0x7208('0x23'),'as':_0x7208('0x24'),'attributes':['id',_0x7208('0x22')]}],'raw':!![]},'log':_0x7208('0x25')});};};exports[_0x7208('0x26')]=function(_0x1416a4,_0x51bec2,_0x1c8c3f){return client['Request']('UpdateCmHopper',{'body':_0x1416a4,'options':{'where':{'id':_0x51bec2},'limit':_0x1c8c3f},'log':_0x7208('0x7')});};exports[_0x7208('0x27')]=function(_0x480ce3,_0x21f63d){return function(){return client[_0x7208('0x3')](_0x7208('0x28'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x480ce3,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x7208('0x8')](_0x7208('0x9'))},'UserId':{'$in':_0x21f63d}},'order':[[_0x7208('0x13'),_0x7208('0x14')],['scheduledat',_0x7208('0x14')],['id',_0x7208('0x16')]],'include':[{'model':_0x7208('0x5'),'as':'Contact'},{'model':'User','as':_0x7208('0x21'),'attributes':['id',_0x7208('0x22'),_0x7208('0x29')]}],'group':_0x7208('0x2a'),'raw':!![]},'log':_0x7208('0x12')});};};exports[_0x7208('0x2b')]=function(_0x212a67,_0x5b7da4){return client['Request']('ResetActiveCalls',{'body':_0x212a67,'options':_0x5b7da4||{},'log':_0x7208('0x2c')});};exports[_0x7208('0x2d')]=function(_0xb6da62,_0x31432e,_0x3d449e){return function(){return client[_0x7208('0x3')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0xb6da62,'interval':_0x31432e,'availableAgentsIds':_0x3d449e}},'log':_0x7208('0x2d')});};};