Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
index be1867a..34a40c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4efc=['findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','NOW()','List','lodash','util','moment','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','info','GetCmHopper','debug','stringify','message','error','find','ShowCmHopper','catch','create','body','CreateCmHopper','update','limit','DestroyCmHopper','destroy','transaction','order','LOCK','UPDATE','CmContact','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','GetContactDialer','MoveContactManagedDialer','sequelize','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','describe','keys'];(function(_0x41dba0,_0x270670){var _0x667e80=function(_0x289510){while(--_0x289510){_0x41dba0['push'](_0x41dba0['shift']());}};_0x667e80(++_0x270670);}(_0x4efc,0x1e1));var _0xc4ef=function(_0x300893,_0x33cb05){_0x300893=_0x300893-0x0;var _0x1ffdd3=_0x4efc[_0x300893];return _0x1ffdd3;};'use strict';var _=require(_0xc4ef('0x0'));var util=require(_0xc4ef('0x1'));var moment=require(_0xc4ef('0x2'));var BPromise=require('bluebird');var db=require(_0xc4ef('0x3'))['db'];var logger=require(_0xc4ef('0x4'))(_0xc4ef('0x5'));exports['GetCmHopper']=function(_0x31ccc6){var _0x2a39b3=this;return new Promise(function(_0x12d4e6,_0x1c288b){return db[_0xc4ef('0x6')][_0xc4ef('0x7')]({'raw':_0x31ccc6[_0xc4ef('0x8')]?_0x31ccc6[_0xc4ef('0x8')][_0xc4ef('0x9')]===undefined?!![]:![]:!![],'where':_0x31ccc6[_0xc4ef('0x8')]?_0x31ccc6[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'attributes':_0x31ccc6['options']?_0x31ccc6[_0xc4ef('0x8')][_0xc4ef('0xb')]||null:null,'limit':_0x31ccc6[_0xc4ef('0x8')]?_0x31ccc6[_0xc4ef('0x8')]['limit']||null:null,'include':_0x31ccc6['options']?_0x31ccc6[_0xc4ef('0x8')][_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x31ccc6[_0xc4ef('0x8')][_0xc4ef('0xc')],function(_0x243c2b){return{'model':db[_0x243c2b[_0xc4ef('0xe')]],'as':_0x243c2b['as'],'attributes':_0x243c2b[_0xc4ef('0xb')],'include':_0x243c2b[_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x243c2b[_0xc4ef('0xc')],function(_0x234b85){return{'model':db[_0x234b85[_0xc4ef('0xe')]],'as':_0x234b85['as'],'attributes':_0x234b85[_0xc4ef('0xb')],'include':_0x234b85[_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x234b85[_0xc4ef('0xc')],function(_0x1897b6){return{'model':db[_0x1897b6[_0xc4ef('0xe')]],'as':_0x1897b6['as'],'attributes':_0x1897b6['attributes']};}):[]};}):[]};}):[]:[]})[_0xc4ef('0xf')](function(_0x1513f7){logger[_0xc4ef('0x10')](_0xc4ef('0x11'),_0x31ccc6);logger[_0xc4ef('0x12')](_0xc4ef('0x11'),_0x31ccc6,JSON[_0xc4ef('0x13')](_0x1513f7));_0x12d4e6(_0x1513f7);})['catch'](function(_0x35d65e){logger['error'](_0xc4ef('0x11'),_0x35d65e[_0xc4ef('0x14')],_0x31ccc6);_0x1c288b(_0x2a39b3[_0xc4ef('0x15')](0x1f4,_0x35d65e[_0xc4ef('0x14')]));});});};exports['ShowCmHopper']=function(_0x422753){var _0x266037=this;return new Promise(function(_0x5ec28e,_0xe4880c){return db['CmHopper'][_0xc4ef('0x16')]({'raw':_0x422753[_0xc4ef('0x8')]?_0x422753[_0xc4ef('0x8')][_0xc4ef('0x9')]===undefined?!![]:![]:!![],'where':_0x422753[_0xc4ef('0x8')]?_0x422753[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'attributes':_0x422753[_0xc4ef('0x8')]?_0x422753[_0xc4ef('0x8')]['attributes']||null:null,'include':_0x422753[_0xc4ef('0x8')]?_0x422753[_0xc4ef('0x8')][_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x422753[_0xc4ef('0x8')][_0xc4ef('0xc')],function(_0x2d502c){return{'model':db[_0x2d502c[_0xc4ef('0xe')]],'as':_0x2d502c['as'],'attributes':_0x2d502c['attributes'],'include':_0x2d502c[_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x2d502c[_0xc4ef('0xc')],function(_0x1fcd65){return{'model':db[_0x1fcd65[_0xc4ef('0xe')]],'as':_0x1fcd65['as'],'attributes':_0x1fcd65[_0xc4ef('0xb')],'include':_0x1fcd65[_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x1fcd65[_0xc4ef('0xc')],function(_0x2de5d9){return{'model':db[_0x2de5d9[_0xc4ef('0xe')]],'as':_0x2de5d9['as'],'attributes':_0x2de5d9[_0xc4ef('0xb')]};}):[]};}):[]};}):[]:[]})[_0xc4ef('0xf')](function(_0xd103f8){logger[_0xc4ef('0x10')](_0xc4ef('0x17'),_0x422753);logger[_0xc4ef('0x12')]('ShowCmHopper',_0x422753,JSON[_0xc4ef('0x13')](_0xd103f8));_0x5ec28e(_0xd103f8);})[_0xc4ef('0x18')](function(_0x2307b5){logger['error']('ShowCmHopper',_0x2307b5[_0xc4ef('0x14')],_0x422753);_0xe4880c(_0x266037[_0xc4ef('0x15')](0x1f4,_0x2307b5[_0xc4ef('0x14')]));});});};exports['CreateCmHopper']=function(_0x20bf90){var _0x2f3e4c=this;return new Promise(function(_0x5c30da,_0x34747d){return db[_0xc4ef('0x6')][_0xc4ef('0x19')](_0x20bf90[_0xc4ef('0x1a')],{'raw':_0x20bf90['options']?_0x20bf90[_0xc4ef('0x8')][_0xc4ef('0x9')]===undefined?!![]:![]:!![]})[_0xc4ef('0xf')](function(_0x8a22f4){logger[_0xc4ef('0x10')](_0xc4ef('0x1b'),_0x20bf90);logger[_0xc4ef('0x12')](_0xc4ef('0x1b'),_0x20bf90,JSON[_0xc4ef('0x13')](_0x8a22f4));_0x5c30da(_0x8a22f4);})[_0xc4ef('0x18')](function(_0x5504c9){logger[_0xc4ef('0x15')](_0xc4ef('0x1b'),_0x5504c9[_0xc4ef('0x14')],_0x20bf90);_0x34747d(_0x2f3e4c[_0xc4ef('0x15')](0x1f4,_0x5504c9[_0xc4ef('0x14')]));});});};exports['UpdateCmHopper']=function(_0x146337){var _0x1b3fc9=this;return new Promise(function(_0x31a810,_0x3e34e0){return db[_0xc4ef('0x6')][_0xc4ef('0x1c')](_0x146337['body'],{'raw':_0x146337[_0xc4ef('0x8')]?_0x146337['options'][_0xc4ef('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x146337[_0xc4ef('0x8')]?_0x146337[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'attributes':_0x146337[_0xc4ef('0x8')]?_0x146337['options'][_0xc4ef('0xb')]||null:null,'limit':_0x146337[_0xc4ef('0x8')]?_0x146337[_0xc4ef('0x8')][_0xc4ef('0x1d')]||null:null})['then'](function(_0x3f4831){logger[_0xc4ef('0x10')]('UpdateCmHopper',_0x146337);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xc4ef('0x13')](_0x146337[_0xc4ef('0x8')][_0xc4ef('0xa')]),_0x146337[_0xc4ef('0x1a')]['active']);logger[_0xc4ef('0x12')]('UpdateCmHopper',_0x146337,JSON[_0xc4ef('0x13')](_0x3f4831));_0x31a810(_0x3f4831);})[_0xc4ef('0x18')](function(_0x4ee530){logger['error']('UpdateCmHopper',_0x4ee530[_0xc4ef('0x14')],_0x146337);_0x3e34e0(_0x1b3fc9[_0xc4ef('0x15')](0x1f4,_0x4ee530[_0xc4ef('0x14')]));});});};exports[_0xc4ef('0x1e')]=function(_0x4dd284){var _0x11aa78=this;return new Promise(function(_0x473cb1,_0x43b0ed){return db[_0xc4ef('0x6')][_0xc4ef('0x1f')]({'where':_0x4dd284[_0xc4ef('0x8')]?_0x4dd284[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null})[_0xc4ef('0xf')](function(_0xa1bd59){logger[_0xc4ef('0x10')](_0xc4ef('0x1e'),_0x4dd284);logger['debug']('DestroyCmHopper',_0x4dd284,JSON['stringify'](_0xa1bd59));_0x473cb1(_0xa1bd59);})['catch'](function(_0x2c8453){logger[_0xc4ef('0x15')](_0xc4ef('0x1e'),_0x2c8453[_0xc4ef('0x14')],_0x4dd284);_0x43b0ed(_0x11aa78[_0xc4ef('0x15')](0x1f4,_0x2c8453[_0xc4ef('0x14')]));});});};exports['GetContactDialer']=function(_0x46334e){var _0x1e8318=this;return new Promise(function(_0x2ac7e9,_0x3a1d23){return db['CmContact']['describe']()[_0xc4ef('0xf')](function(_0x54f28b){return db['sequelize'][_0xc4ef('0x20')](function(_0x4a2543){return db[_0xc4ef('0x6')][_0xc4ef('0x7')]({'where':_0x46334e[_0xc4ef('0x8')]?_0x46334e[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'attributes':_0x46334e[_0xc4ef('0x8')]?_0x46334e[_0xc4ef('0x8')][_0xc4ef('0xb')]||null:null,'limit':_0x46334e[_0xc4ef('0x8')]?_0x46334e[_0xc4ef('0x8')][_0xc4ef('0x1d')]||null:null,'order':_0x46334e[_0xc4ef('0x8')]?_0x46334e['options'][_0xc4ef('0x21')]||null:null,'transaction':_0x4a2543,'lock':_0x4a2543[_0xc4ef('0x22')][_0xc4ef('0x23')],'include':[{'model':db[_0xc4ef('0x24')],'as':_0xc4ef('0x25'),'attributes':_['keys'](_0x54f28b)},{'model':db[_0xc4ef('0x26')],'as':_0xc4ef('0x27'),'attributes':['id',_0xc4ef('0x28'),_0xc4ef('0x29')]}]})['then'](function(_0x263d0d){var _0x60e79f=[];var _0x1b8262=[];for(var _0x21e69e=0x0;_0x21e69e<_0x263d0d[_0xc4ef('0x2a')];_0x21e69e+=0x1){var _0x2423fd=_0x263d0d[_0x21e69e][_0xc4ef('0x2b')];if(_0x2423fd===null){_0x60e79f[_0xc4ef('0x2c')](_0x263d0d[_0x21e69e][_0xc4ef('0x1c')](_0x46334e[_0xc4ef('0x1a')],{'transaction':_0x4a2543}));}else if(!_0x1b8262[_0xc4ef('0x2d')](_0x2423fd)){_0x1b8262[_0xc4ef('0x2c')](_0x2423fd);_0x60e79f[_0xc4ef('0x2c')](_0x263d0d[_0x21e69e][_0xc4ef('0x1c')](_0x46334e[_0xc4ef('0x1a')],{'transaction':_0x4a2543}));}}return BPromise[_0xc4ef('0x2e')](_0x60e79f);});})[_0xc4ef('0xf')](function(_0x334ed1){logger['info']('GetContactDialer',_0x46334e);if(_0x334ed1[_0xc4ef('0x2a')]>0x0){logger[_0xc4ef('0x10')](_0xc4ef('0x2f'),_0x334ed1[0x0]['dataValues']['id'],_0x334ed1[0x0][_0xc4ef('0x30')][_0xc4ef('0x31')],_0x334ed1[0x0][_0xc4ef('0x30')][_0xc4ef('0x32')]);}logger[_0xc4ef('0x12')](_0xc4ef('0x33'),_0x46334e,JSON[_0xc4ef('0x13')](_0x334ed1));_0x2ac7e9(_0x334ed1);})[_0xc4ef('0x18')](function(_0x2c4142){logger[_0xc4ef('0x15')]('GetContactDialer',_0x2c4142[_0xc4ef('0x14')],_0x46334e);_0x3a1d23(_0x1e8318['error'](0x1f4,_0x2c4142[_0xc4ef('0x14')]));});});});};exports[_0xc4ef('0x34')]=function(_0x3adc83){var _0x4c6a99=this;return new Promise(function(_0x246d9b,_0x53d935){return db[_0xc4ef('0x35')][_0xc4ef('0x20')](function(_0x57c831){return db[_0xc4ef('0x36')]['create'](_0x3adc83[_0xc4ef('0x1a')],{'raw':_0x3adc83[_0xc4ef('0x8')]?_0x3adc83[_0xc4ef('0x8')][_0xc4ef('0x9')]===undefined?!![]:![]:!![],'transaction':_0x57c831})[_0xc4ef('0xf')](function(){logger[_0xc4ef('0x10')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xc4ef('0x13')](_0x3adc83['options'][_0xc4ef('0xa')]),_0x3adc83[_0xc4ef('0x8')][_0xc4ef('0xa')][_0xc4ef('0x32')]);return db['CmHopper']['destroy']({'where':_0x3adc83[_0xc4ef('0x8')]?_0x3adc83[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'transaction':_0x57c831});});})[_0xc4ef('0xf')](function(_0xaf9100){logger[_0xc4ef('0x10')](_0xc4ef('0x34'),_0x3adc83);logger[_0xc4ef('0x12')](_0xc4ef('0x34'),_0x3adc83,JSON['stringify'](_0xaf9100));_0x246d9b(_0xaf9100);})[_0xc4ef('0x18')](function(_0xe4a1dd){logger[_0xc4ef('0x15')](_0xc4ef('0x34'),_0xe4a1dd['message'],_0x3adc83);_0x53d935(_0x4c6a99[_0xc4ef('0x15')](0x1f4,_0xe4a1dd[_0xc4ef('0x14')]));});});};exports['CountReScheduled']=function(_0x1711bf){var _0x3b79c8=this;return new Promise(function(_0x5dc283,_0x41db1c){return db[_0xc4ef('0x6')][_0xc4ef('0x7')]({'raw':_0x1711bf[_0xc4ef('0x8')]?_0x1711bf[_0xc4ef('0x8')][_0xc4ef('0x9')]===undefined?!![]:![]:!![],'where':_0x1711bf['options']?_0x1711bf['options']['where']||null:null,'attributes':[[db[_0xc4ef('0x35')]['fn'](_0xc4ef('0x37'),db[_0xc4ef('0x35')]['fn']('IF',db['sequelize'][_0xc4ef('0x38')](_0xc4ef('0x39')+util[_0xc4ef('0x3a')]('\x22%s\x22',moment()[_0xc4ef('0x3a')](_0xc4ef('0x3b')))+_0xc4ef('0x3c')))),'contactsRescheduled']]})[_0xc4ef('0xf')](function(_0x8b57ff){logger[_0xc4ef('0x10')](_0xc4ef('0x3d'),_0x1711bf);logger[_0xc4ef('0x12')](_0xc4ef('0x3d'),_0x1711bf,JSON[_0xc4ef('0x13')](_0x8b57ff));_0x5dc283(_0x8b57ff);})[_0xc4ef('0x18')](function(_0x221af2){logger[_0xc4ef('0x15')](_0xc4ef('0x3d'),_0x221af2['message'],_0x1711bf);_0x41db1c(_0x3b79c8[_0xc4ef('0x15')](0x1f4,_0x221af2[_0xc4ef('0x14')]));});});};exports[_0xc4ef('0x3e')]=function(_0x39911c){var _0x444e22=this;return new Promise(function(_0x21e500,_0x5a1c27){return db['CmContact'][_0xc4ef('0x3f')]()[_0xc4ef('0xf')](function(){return db[_0xc4ef('0x35')][_0xc4ef('0x20')](function(_0x2c088d){return db[_0xc4ef('0x6')][_0xc4ef('0x7')]({'where':_0x39911c[_0xc4ef('0x8')]?_0x39911c[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'attributes':_0x39911c['options']?_0x39911c['options']['attributes']||null:null,'limit':0x1,'order':_0x39911c[_0xc4ef('0x8')]?_0x39911c['options']['order']||null:null,'group':db['CmHopper'][_0xc4ef('0x2b')],'transaction':_0x2c088d,'lock':_0x2c088d[_0xc4ef('0x22')][_0xc4ef('0x23')],'include':_0x39911c[_0xc4ef('0x8')]?_0x39911c[_0xc4ef('0x8')][_0xc4ef('0xc')]?_['map'](_0x39911c['options'][_0xc4ef('0xc')],function(_0x228ca3){return{'model':db[_0x228ca3['model']],'as':_0x228ca3['as'],'attributes':_0x228ca3[_0xc4ef('0xb')],'include':_0x228ca3[_0xc4ef('0xc')]?_['map'](_0x228ca3['include'],function(_0x35280c){return{'model':db[_0x35280c[_0xc4ef('0xe')]],'as':_0x35280c['as'],'attributes':_0x35280c['attributes'],'include':_0x35280c[_0xc4ef('0xc')]?_['map'](_0x35280c[_0xc4ef('0xc')],function(_0x19ad66){return{'model':db[_0x19ad66[_0xc4ef('0xe')]],'as':_0x19ad66['as'],'attributes':_0x19ad66[_0xc4ef('0xb')]};}):[]};}):[]};}):[]:[]})[_0xc4ef('0xf')](function(_0x3e102d){var _0x4b0797=[];for(var _0x336e2f=0x0;_0x336e2f<_0x3e102d[_0xc4ef('0x2a')];_0x336e2f+=0x1){_0x4b0797[_0xc4ef('0x2c')](_0x3e102d[_0x336e2f]['update'](_0x39911c[_0xc4ef('0x1a')],{'transaction':_0x2c088d}));}return BPromise[_0xc4ef('0x2e')](_0x4b0797);});})['then'](function(_0x201b72){logger[_0xc4ef('0x10')]('GetContactRecallMe',_0x39911c);logger[_0xc4ef('0x12')]('GetContactRecallMe',_0x39911c,JSON['stringify'](_0x201b72));_0x21e500(_0x201b72);})[_0xc4ef('0x18')](function(_0xb79e9a){logger[_0xc4ef('0x15')](_0xc4ef('0x3e'),_0xb79e9a[_0xc4ef('0x14')],_0x39911c);_0x5a1c27(_0x444e22[_0xc4ef('0x15')](0x1f4,_0xb79e9a[_0xc4ef('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x14ed86){var _0x305ac4=this;return new Promise(function(_0x1575fb,_0x36e519){db[_0xc4ef('0x24')]['describe']()[_0xc4ef('0xf')](function(_0x2ecfd4){return db['CmHopper'][_0xc4ef('0x7')]({'raw':_0x14ed86[_0xc4ef('0x8')]?_0x14ed86['options'][_0xc4ef('0x9')]===undefined?!![]:![]:!![],'where':_0x14ed86[_0xc4ef('0x8')]?_0x14ed86[_0xc4ef('0x8')][_0xc4ef('0xa')]||null:null,'attributes':_0x14ed86['options']?_0x14ed86['options'][_0xc4ef('0xb')]||null:null,'limit':_0x14ed86[_0xc4ef('0x8')]?_0x14ed86[_0xc4ef('0x8')][_0xc4ef('0x1d')]||null:null,'include':_0x14ed86['options']?_0x14ed86['options'][_0xc4ef('0xc')]?_['map'](_0x14ed86['options']['include'],function(_0x25a697){return{'model':db[_0x25a697['model']],'as':_0x25a697['as'],'attributes':_0x25a697['as']===_0xc4ef('0x25')?_[_0xc4ef('0x40')](_0x2ecfd4):_0x25a697['attributes'],'include':_0x25a697[_0xc4ef('0xc')]?_[_0xc4ef('0xd')](_0x25a697[_0xc4ef('0xc')],function(_0x14481c){return{'model':db[_0x14481c[_0xc4ef('0xe')]],'as':_0x14481c['as'],'attributes':_0x14481c[_0xc4ef('0xb')],'include':_0x14481c[_0xc4ef('0xc')]?_['map'](_0x14481c['include'],function(_0xf810c9){return{'model':db[_0xf810c9[_0xc4ef('0xe')]],'as':_0xf810c9['as'],'attributes':_0xf810c9[_0xc4ef('0xb')]};}):[]};}):[]};}):[]:[]})[_0xc4ef('0xf')](function(_0x4ba98c){logger[_0xc4ef('0x10')](_0xc4ef('0x11'),_0x14ed86);logger[_0xc4ef('0x12')](_0xc4ef('0x11'),_0x14ed86,JSON[_0xc4ef('0x13')](_0x4ba98c));_0x1575fb(_0x4ba98c);})[_0xc4ef('0x18')](function(_0xec2ba0){logger[_0xc4ef('0x15')]('GetCmHopper',_0xec2ba0[_0xc4ef('0x14')],_0x14ed86);_0x36e519(_0x305ac4[_0xc4ef('0x15')](0x1f4,_0xec2ba0['message']));});});});};exports['GetContactByPhone']=function(_0x505ba1){var _0x2169c9=this;return new Promise(function(_0x1139b2,_0x2b032e){return db['CmContact'][_0xc4ef('0x41')]({'raw':!![],'where':{'phone':_0x505ba1[_0xc4ef('0x8')][_0xc4ef('0xa')][_0xc4ef('0x42')]},'attributes':['id',_0xc4ef('0x43')],'order':[['id',_0xc4ef('0x44')]]})['then'](function(_0x30a9ad){logger['info'](_0xc4ef('0x45'),_0x505ba1);logger[_0xc4ef('0x12')](_0xc4ef('0x45'),_0x505ba1,JSON[_0xc4ef('0x13')](_0x30a9ad));_0x1139b2(_0x30a9ad);})[_0xc4ef('0x18')](function(_0x658495){logger['error'](_0xc4ef('0x45'),_0x658495[_0xc4ef('0x14')],_0x505ba1);_0x2b032e(_0x2169c9[_0xc4ef('0x15')](0x1f4,_0x658495['message']));});});};exports[_0xc4ef('0x46')]=function(_0x4e4552){var _0x3ffce1=this;return new Promise(function(_0x499849,_0x4b2c24){return db['sequelize'][_0xc4ef('0x20')](function(_0x5d284c){var _0x59d56a=_0x4e4552[_0xc4ef('0x8')]&&_0x4e4552['options'][_0xc4ef('0xa')]?_0x4e4552[_0xc4ef('0x8')]['where']:{};return db[_0xc4ef('0x6')][_0xc4ef('0x1c')](_0x4e4552['body'],{'where':_0x59d56a,'transaction':_0x5d284c})[_0xc4ef('0xf')](function(_0x423f3e){logger['info'](_0xc4ef('0x46'),_0x4e4552);logger[_0xc4ef('0x12')](_0xc4ef('0x46'),_0x4e4552,JSON[_0xc4ef('0x13')](_0x423f3e));_0x499849(_0x423f3e);})[_0xc4ef('0x18')](function(_0x48788d){logger['error'](_0xc4ef('0x46'),_0x48788d['message'],_0x4e4552);_0x4b2c24(_0x3ffce1[_0xc4ef('0x15')](0x1f4,_0x48788d['message']));});});});};exports[_0xc4ef('0x47')]=function(_0x37f459){var _0x4407d9=this;var _0x358f14=_0x37f459['body'][_0xc4ef('0xa')][_0xc4ef('0x48')];var _0x29a38f=_0x37f459[_0xc4ef('0x1a')]['where'][_0xc4ef('0x49')];var _0x3c4fd8=_0x37f459[_0xc4ef('0x1a')]['where'][_0xc4ef('0x4a')];return new Promise(function(_0x459ced,_0x503fab){return db[_0xc4ef('0x6')]['findAll']({'where':{'voiceQueueId':{'$in':_0x358f14},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xc4ef('0x35')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x29a38f+_0xc4ef('0x4b')),'$gt':db[_0xc4ef('0x35')][_0xc4ef('0x38')](_0xc4ef('0x4c'))}},'UserId':{'$in':_0x3c4fd8}},'include':[{'model':db[_0xc4ef('0x24')],'as':_0xc4ef('0x25')},{'model':db[_0xc4ef('0x26')],'as':_0xc4ef('0x27'),'attributes':['id',_0xc4ef('0x28'),'voicePause']},{'model':db['CmList'],'as':_0xc4ef('0x4d')}]})[_0xc4ef('0xf')](function(_0xf113a){if(_0xf113a[_0xc4ef('0x2a')]>0x0){return db[_0xc4ef('0x35')][_0xc4ef('0x20')](function(_0x4d028a){return db[_0xc4ef('0x6')]['update']({'recallmeNotifiedDate':db['sequelize']['literal'](_0xc4ef('0x4c'))},{'where':{'id':{'$in':_['map'](_0xf113a,'id')}},'transaction':_0x4d028a})['then'](function(){_0x459ced(_0xf113a);})[_0xc4ef('0x18')](function(_0x11febc){logger[_0xc4ef('0x15')](_0xc4ef('0x47'),_0x11febc['message'],_0x37f459);_0x503fab(_0x4407d9['error'](0x1f4,_0x11febc['message']));});})[_0xc4ef('0x18')](function(_0x531e27){logger['error'](_0xc4ef('0x47'),_0x531e27['message'],_0x37f459);_0x503fab(_0x4407d9[_0xc4ef('0x15')](0x1f4,_0x531e27[_0xc4ef('0x14')]));});}else{_0x459ced(_0xf113a);}});});};
\ No newline at end of file
+var _0x1983=['../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','where','limit','include','model','attributes','map','then','debug','stringify','catch','error','message','ShowCmHopper','find','raw','create','body','info','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','User','Agent','name','UserId','push','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','voicePause','CmList','List','NOW()','lodash','moment'];(function(_0x4e83a3,_0x1032ce){var _0x58fba3=function(_0x2f099e){while(--_0x2f099e){_0x4e83a3['push'](_0x4e83a3['shift']());}};_0x58fba3(++_0x1032ce);}(_0x1983,0x1f0));var _0x3198=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1983[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x3198('0x0'));var util=require('util');var moment=require(_0x3198('0x1'));var BPromise=require('bluebird');var db=require(_0x3198('0x2'))['db'];var logger=require(_0x3198('0x3'))(_0x3198('0x4'));exports[_0x3198('0x5')]=function(_0x473421){var _0x12c483=this;return new Promise(function(_0x500cbe,_0x1829d1){return db[_0x3198('0x6')]['findAll']({'raw':_0x473421[_0x3198('0x7')]?_0x473421[_0x3198('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x473421[_0x3198('0x7')]?_0x473421[_0x3198('0x7')][_0x3198('0x8')]||null:null,'attributes':_0x473421[_0x3198('0x7')]?_0x473421[_0x3198('0x7')]['attributes']||null:null,'limit':_0x473421['options']?_0x473421[_0x3198('0x7')][_0x3198('0x9')]||null:null,'include':_0x473421[_0x3198('0x7')]?_0x473421[_0x3198('0x7')][_0x3198('0xa')]?_['map'](_0x473421['options'][_0x3198('0xa')],function(_0xc44bce){return{'model':db[_0xc44bce[_0x3198('0xb')]],'as':_0xc44bce['as'],'attributes':_0xc44bce[_0x3198('0xc')],'include':_0xc44bce['include']?_[_0x3198('0xd')](_0xc44bce[_0x3198('0xa')],function(_0x5cd23d){return{'model':db[_0x5cd23d[_0x3198('0xb')]],'as':_0x5cd23d['as'],'attributes':_0x5cd23d[_0x3198('0xc')],'include':_0x5cd23d['include']?_[_0x3198('0xd')](_0x5cd23d['include'],function(_0x5e5859){return{'model':db[_0x5e5859[_0x3198('0xb')]],'as':_0x5e5859['as'],'attributes':_0x5e5859[_0x3198('0xc')]};}):[]};}):[]};}):[]:[]})[_0x3198('0xe')](function(_0x319a2b){logger['info'](_0x3198('0x5'),_0x473421);logger[_0x3198('0xf')](_0x3198('0x5'),_0x473421,JSON[_0x3198('0x10')](_0x319a2b));_0x500cbe(_0x319a2b);})[_0x3198('0x11')](function(_0x3f74f7){logger[_0x3198('0x12')](_0x3198('0x5'),_0x3f74f7[_0x3198('0x13')],_0x473421);_0x1829d1(_0x12c483[_0x3198('0x12')](0x1f4,_0x3f74f7['message']));});});};exports[_0x3198('0x14')]=function(_0x38b62a){var _0x741164=this;return new Promise(function(_0x40c714,_0x4b3de6){return db[_0x3198('0x6')][_0x3198('0x15')]({'raw':_0x38b62a['options']?_0x38b62a[_0x3198('0x7')][_0x3198('0x16')]===undefined?!![]:![]:!![],'where':_0x38b62a[_0x3198('0x7')]?_0x38b62a['options']['where']||null:null,'attributes':_0x38b62a[_0x3198('0x7')]?_0x38b62a[_0x3198('0x7')][_0x3198('0xc')]||null:null,'include':_0x38b62a['options']?_0x38b62a[_0x3198('0x7')][_0x3198('0xa')]?_['map'](_0x38b62a[_0x3198('0x7')][_0x3198('0xa')],function(_0x15dd19){return{'model':db[_0x15dd19['model']],'as':_0x15dd19['as'],'attributes':_0x15dd19[_0x3198('0xc')],'include':_0x15dd19[_0x3198('0xa')]?_[_0x3198('0xd')](_0x15dd19[_0x3198('0xa')],function(_0x48e15e){return{'model':db[_0x48e15e[_0x3198('0xb')]],'as':_0x48e15e['as'],'attributes':_0x48e15e['attributes'],'include':_0x48e15e[_0x3198('0xa')]?_[_0x3198('0xd')](_0x48e15e['include'],function(_0x22db54){return{'model':db[_0x22db54[_0x3198('0xb')]],'as':_0x22db54['as'],'attributes':_0x22db54[_0x3198('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3269e2){logger['info'](_0x3198('0x14'),_0x38b62a);logger[_0x3198('0xf')](_0x3198('0x14'),_0x38b62a,JSON[_0x3198('0x10')](_0x3269e2));_0x40c714(_0x3269e2);})[_0x3198('0x11')](function(_0x9ce88c){logger[_0x3198('0x12')](_0x3198('0x14'),_0x9ce88c[_0x3198('0x13')],_0x38b62a);_0x4b3de6(_0x741164[_0x3198('0x12')](0x1f4,_0x9ce88c[_0x3198('0x13')]));});});};exports['CreateCmHopper']=function(_0x3943cf){var _0x249fc9=this;return new Promise(function(_0x25c05a,_0x5ad085){return db[_0x3198('0x6')][_0x3198('0x17')](_0x3943cf[_0x3198('0x18')],{'raw':_0x3943cf[_0x3198('0x7')]?_0x3943cf[_0x3198('0x7')][_0x3198('0x16')]===undefined?!![]:![]:!![]})[_0x3198('0xe')](function(_0xd3f123){logger[_0x3198('0x19')]('CreateCmHopper',_0x3943cf);logger['debug'](_0x3198('0x1a'),_0x3943cf,JSON['stringify'](_0xd3f123));_0x25c05a(_0xd3f123);})[_0x3198('0x11')](function(_0x49cfaf){logger[_0x3198('0x12')](_0x3198('0x1a'),_0x49cfaf[_0x3198('0x13')],_0x3943cf);_0x5ad085(_0x249fc9[_0x3198('0x12')](0x1f4,_0x49cfaf[_0x3198('0x13')]));});});};exports[_0x3198('0x1b')]=function(_0x210bf2){var _0x530e6b=this;return new Promise(function(_0x1e565f,_0x2717b1){return db[_0x3198('0x6')][_0x3198('0x1c')](_0x210bf2[_0x3198('0x18')],{'raw':_0x210bf2['options']?_0x210bf2['options'][_0x3198('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x210bf2['options']?_0x210bf2[_0x3198('0x7')][_0x3198('0x8')]||null:null,'attributes':_0x210bf2[_0x3198('0x7')]?_0x210bf2['options'][_0x3198('0xc')]||null:null,'limit':_0x210bf2['options']?_0x210bf2[_0x3198('0x7')][_0x3198('0x9')]||null:null})[_0x3198('0xe')](function(_0x1a715e){logger[_0x3198('0x19')](_0x3198('0x1b'),_0x210bf2);logger[_0x3198('0x19')](_0x3198('0x1d'),JSON[_0x3198('0x10')](_0x210bf2[_0x3198('0x7')][_0x3198('0x8')]),_0x210bf2[_0x3198('0x18')][_0x3198('0x1e')]);logger['debug'](_0x3198('0x1b'),_0x210bf2,JSON[_0x3198('0x10')](_0x1a715e));_0x1e565f(_0x1a715e);})['catch'](function(_0x3098a2){logger[_0x3198('0x12')](_0x3198('0x1b'),_0x3098a2[_0x3198('0x13')],_0x210bf2);_0x2717b1(_0x530e6b[_0x3198('0x12')](0x1f4,_0x3098a2['message']));});});};exports[_0x3198('0x1f')]=function(_0x52c428){var _0x364d8f=this;return new Promise(function(_0xb17ad2,_0x559d2a){return db[_0x3198('0x6')][_0x3198('0x20')]({'where':_0x52c428['options']?_0x52c428[_0x3198('0x7')][_0x3198('0x8')]||null:null})['then'](function(_0x1fd066){logger[_0x3198('0x19')](_0x3198('0x1f'),_0x52c428);logger[_0x3198('0xf')](_0x3198('0x1f'),_0x52c428,JSON[_0x3198('0x10')](_0x1fd066));_0xb17ad2(_0x1fd066);})[_0x3198('0x11')](function(_0x486f18){logger[_0x3198('0x12')]('DestroyCmHopper',_0x486f18[_0x3198('0x13')],_0x52c428);_0x559d2a(_0x364d8f[_0x3198('0x12')](0x1f4,_0x486f18['message']));});});};exports['GetContactDialer']=function(_0x4f99be){var _0x23bc7c=this;return new Promise(function(_0x3ddb53,_0x70728d){return db[_0x3198('0x21')][_0x3198('0x22')]()['then'](function(_0x2c2770){return db[_0x3198('0x23')][_0x3198('0x24')](function(_0x19a316){return db[_0x3198('0x6')][_0x3198('0x25')]({'where':_0x4f99be[_0x3198('0x7')]?_0x4f99be[_0x3198('0x7')]['where']||null:null,'attributes':_0x4f99be[_0x3198('0x7')]?_0x4f99be[_0x3198('0x7')][_0x3198('0xc')]||null:null,'limit':_0x4f99be[_0x3198('0x7')]?_0x4f99be[_0x3198('0x7')][_0x3198('0x9')]||null:null,'order':_0x4f99be[_0x3198('0x7')]?_0x4f99be[_0x3198('0x7')][_0x3198('0x26')]||null:null,'transaction':_0x19a316,'lock':_0x19a316[_0x3198('0x27')][_0x3198('0x28')],'include':[{'model':db['CmContact'],'as':_0x3198('0x29'),'attributes':_['keys'](_0x2c2770)},{'model':db[_0x3198('0x2a')],'as':_0x3198('0x2b'),'attributes':['id',_0x3198('0x2c'),'voicePause']}]})['then'](function(_0x37a353){var _0xd69b6b=[];var _0x3a03c6=[];for(var _0x130af1=0x0;_0x130af1<_0x37a353['length'];_0x130af1+=0x1){var _0x502166=_0x37a353[_0x130af1][_0x3198('0x2d')];if(_0x502166===null){_0xd69b6b[_0x3198('0x2e')](_0x37a353[_0x130af1][_0x3198('0x1c')](_0x4f99be[_0x3198('0x18')],{'transaction':_0x19a316}));}else if(!_0x3a03c6[_0x3198('0x2f')](_0x502166)){_0x3a03c6['push'](_0x502166);_0xd69b6b['push'](_0x37a353[_0x130af1][_0x3198('0x1c')](_0x4f99be['body'],{'transaction':_0x19a316}));}}return BPromise[_0x3198('0x30')](_0xd69b6b);});})['then'](function(_0x13d87a){logger[_0x3198('0x19')](_0x3198('0x31'),_0x4f99be);if(_0x13d87a[_0x3198('0x32')]>0x0){logger[_0x3198('0x19')](_0x3198('0x33'),_0x13d87a[0x0][_0x3198('0x34')]['id'],_0x13d87a[0x0][_0x3198('0x34')][_0x3198('0x35')],_0x13d87a[0x0][_0x3198('0x34')]['active']);}logger['debug'](_0x3198('0x31'),_0x4f99be,JSON['stringify'](_0x13d87a));_0x3ddb53(_0x13d87a);})[_0x3198('0x11')](function(_0x3a8c96){logger['error'](_0x3198('0x31'),_0x3a8c96[_0x3198('0x13')],_0x4f99be);_0x70728d(_0x23bc7c[_0x3198('0x12')](0x1f4,_0x3a8c96['message']));});});});};exports['MoveContactManagedDialer']=function(_0x6b3f93){var _0x25f6d6=this;return new Promise(function(_0x422934,_0x410b22){return db['sequelize'][_0x3198('0x24')](function(_0x472459){return db['CmHopperFinal'][_0x3198('0x17')](_0x6b3f93[_0x3198('0x18')],{'raw':_0x6b3f93[_0x3198('0x7')]?_0x6b3f93['options'][_0x3198('0x16')]===undefined?!![]:![]:!![],'transaction':_0x472459})['then'](function(){logger['info'](_0x3198('0x36'),JSON[_0x3198('0x10')](_0x6b3f93[_0x3198('0x7')]['where']),_0x6b3f93[_0x3198('0x7')][_0x3198('0x8')][_0x3198('0x1e')]);return db[_0x3198('0x6')]['destroy']({'where':_0x6b3f93[_0x3198('0x7')]?_0x6b3f93[_0x3198('0x7')][_0x3198('0x8')]||null:null,'transaction':_0x472459});});})[_0x3198('0xe')](function(_0x1930a5){logger[_0x3198('0x19')]('MoveContactManagedDialer',_0x6b3f93);logger[_0x3198('0xf')](_0x3198('0x37'),_0x6b3f93,JSON[_0x3198('0x10')](_0x1930a5));_0x422934(_0x1930a5);})[_0x3198('0x11')](function(_0x552838){logger[_0x3198('0x12')](_0x3198('0x37'),_0x552838['message'],_0x6b3f93);_0x410b22(_0x25f6d6[_0x3198('0x12')](0x1f4,_0x552838[_0x3198('0x13')]));});});};exports['CountReScheduled']=function(_0x4d7fba){var _0x5737d1=this;return new Promise(function(_0x2020a5,_0x1de1e6){return db['CmHopper'][_0x3198('0x25')]({'raw':_0x4d7fba['options']?_0x4d7fba[_0x3198('0x7')][_0x3198('0x16')]===undefined?!![]:![]:!![],'where':_0x4d7fba['options']?_0x4d7fba[_0x3198('0x7')][_0x3198('0x8')]||null:null,'attributes':[[db[_0x3198('0x23')]['fn'](_0x3198('0x38'),db[_0x3198('0x23')]['fn']('IF',db[_0x3198('0x23')][_0x3198('0x39')](_0x3198('0x3a')+util[_0x3198('0x3b')](_0x3198('0x3c'),moment()[_0x3198('0x3b')](_0x3198('0x3d')))+_0x3198('0x3e')))),_0x3198('0x3f')]]})[_0x3198('0xe')](function(_0x1cf642){logger[_0x3198('0x19')](_0x3198('0x40'),_0x4d7fba);logger[_0x3198('0xf')]('CountReScheduled',_0x4d7fba,JSON[_0x3198('0x10')](_0x1cf642));_0x2020a5(_0x1cf642);})[_0x3198('0x11')](function(_0x385f3a){logger[_0x3198('0x12')](_0x3198('0x40'),_0x385f3a[_0x3198('0x13')],_0x4d7fba);_0x1de1e6(_0x5737d1[_0x3198('0x12')](0x1f4,_0x385f3a[_0x3198('0x13')]));});});};exports[_0x3198('0x41')]=function(_0x36492f){var _0x5e86b0=this;return new Promise(function(_0x1aa38f,_0x2630c7){return db[_0x3198('0x21')][_0x3198('0x22')]()[_0x3198('0xe')](function(){return db[_0x3198('0x23')][_0x3198('0x24')](function(_0x533d0d){return db['CmHopper'][_0x3198('0x25')]({'where':_0x36492f['options']?_0x36492f[_0x3198('0x7')][_0x3198('0x8')]||null:null,'attributes':_0x36492f['options']?_0x36492f[_0x3198('0x7')][_0x3198('0xc')]||null:null,'limit':0x1,'order':_0x36492f['options']?_0x36492f['options'][_0x3198('0x26')]||null:null,'group':db[_0x3198('0x6')]['UserId'],'transaction':_0x533d0d,'lock':_0x533d0d[_0x3198('0x27')][_0x3198('0x28')],'include':_0x36492f['options']?_0x36492f[_0x3198('0x7')]['include']?_[_0x3198('0xd')](_0x36492f[_0x3198('0x7')][_0x3198('0xa')],function(_0x391eea){return{'model':db[_0x391eea[_0x3198('0xb')]],'as':_0x391eea['as'],'attributes':_0x391eea[_0x3198('0xc')],'include':_0x391eea['include']?_['map'](_0x391eea['include'],function(_0x514f22){return{'model':db[_0x514f22['model']],'as':_0x514f22['as'],'attributes':_0x514f22['attributes'],'include':_0x514f22[_0x3198('0xa')]?_[_0x3198('0xd')](_0x514f22['include'],function(_0x43e52e){return{'model':db[_0x43e52e[_0x3198('0xb')]],'as':_0x43e52e['as'],'attributes':_0x43e52e[_0x3198('0xc')]};}):[]};}):[]};}):[]:[]})[_0x3198('0xe')](function(_0x7196f4){var _0x1c8d9e=[];for(var _0x43faa6=0x0;_0x43faa6<_0x7196f4[_0x3198('0x32')];_0x43faa6+=0x1){_0x1c8d9e[_0x3198('0x2e')](_0x7196f4[_0x43faa6][_0x3198('0x1c')](_0x36492f[_0x3198('0x18')],{'transaction':_0x533d0d}));}return BPromise[_0x3198('0x30')](_0x1c8d9e);});})[_0x3198('0xe')](function(_0xceb8cf){logger['info'](_0x3198('0x41'),_0x36492f);logger[_0x3198('0xf')](_0x3198('0x41'),_0x36492f,JSON[_0x3198('0x10')](_0xceb8cf));_0x1aa38f(_0xceb8cf);})[_0x3198('0x11')](function(_0x3030a6){logger['error']('GetContactRecallMe',_0x3030a6[_0x3198('0x13')],_0x36492f);_0x2630c7(_0x5e86b0[_0x3198('0x12')](0x1f4,_0x3030a6[_0x3198('0x13')]));});});});};exports[_0x3198('0x42')]=function(_0x1f88b1){var _0x33d8eb=this;return new Promise(function(_0x4eb3fe,_0x100645){db[_0x3198('0x21')]['describe']()[_0x3198('0xe')](function(_0x4fa261){return db[_0x3198('0x6')][_0x3198('0x25')]({'raw':_0x1f88b1[_0x3198('0x7')]?_0x1f88b1[_0x3198('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x1f88b1[_0x3198('0x7')]?_0x1f88b1[_0x3198('0x7')][_0x3198('0x8')]||null:null,'attributes':_0x1f88b1[_0x3198('0x7')]?_0x1f88b1[_0x3198('0x7')][_0x3198('0xc')]||null:null,'limit':_0x1f88b1[_0x3198('0x7')]?_0x1f88b1['options']['limit']||null:null,'include':_0x1f88b1['options']?_0x1f88b1[_0x3198('0x7')][_0x3198('0xa')]?_['map'](_0x1f88b1[_0x3198('0x7')][_0x3198('0xa')],function(_0x489f7a){return{'model':db[_0x489f7a[_0x3198('0xb')]],'as':_0x489f7a['as'],'attributes':_0x489f7a['as']===_0x3198('0x29')?_[_0x3198('0x43')](_0x4fa261):_0x489f7a[_0x3198('0xc')],'include':_0x489f7a['include']?_[_0x3198('0xd')](_0x489f7a[_0x3198('0xa')],function(_0x17db53){return{'model':db[_0x17db53[_0x3198('0xb')]],'as':_0x17db53['as'],'attributes':_0x17db53[_0x3198('0xc')],'include':_0x17db53[_0x3198('0xa')]?_[_0x3198('0xd')](_0x17db53[_0x3198('0xa')],function(_0x46a9b7){return{'model':db[_0x46a9b7['model']],'as':_0x46a9b7['as'],'attributes':_0x46a9b7[_0x3198('0xc')]};}):[]};}):[]};}):[]:[]})[_0x3198('0xe')](function(_0x23d331){logger[_0x3198('0x19')](_0x3198('0x5'),_0x1f88b1);logger[_0x3198('0xf')](_0x3198('0x5'),_0x1f88b1,JSON['stringify'](_0x23d331));_0x4eb3fe(_0x23d331);})[_0x3198('0x11')](function(_0x3a18e1){logger[_0x3198('0x12')](_0x3198('0x5'),_0x3a18e1['message'],_0x1f88b1);_0x100645(_0x33d8eb[_0x3198('0x12')](0x1f4,_0x3a18e1['message']));});});});};exports[_0x3198('0x44')]=function(_0x53ab96){var _0x165544=this;return new Promise(function(_0x57223c,_0x359d0d){return db[_0x3198('0x21')][_0x3198('0x45')]({'raw':!![],'where':{'phone':_0x53ab96[_0x3198('0x7')][_0x3198('0x8')][_0x3198('0x46')]},'attributes':['id',_0x3198('0x47')],'order':[['id',_0x3198('0x48')]]})[_0x3198('0xe')](function(_0x3e50de){logger['info'](_0x3198('0x49'),_0x53ab96);logger['debug'](_0x3198('0x49'),_0x53ab96,JSON[_0x3198('0x10')](_0x3e50de));_0x57223c(_0x3e50de);})[_0x3198('0x11')](function(_0x4411e9){logger[_0x3198('0x12')](_0x3198('0x49'),_0x4411e9['message'],_0x53ab96);_0x359d0d(_0x165544[_0x3198('0x12')](0x1f4,_0x4411e9[_0x3198('0x13')]));});});};exports[_0x3198('0x4a')]=function(_0x3c75e3){var _0x5e7db2=this;return new Promise(function(_0x1a6b87,_0xbf7231){return db[_0x3198('0x23')][_0x3198('0x24')](function(_0x72a653){var _0x2a84cf=_0x3c75e3[_0x3198('0x7')]&&_0x3c75e3[_0x3198('0x7')][_0x3198('0x8')]?_0x3c75e3[_0x3198('0x7')]['where']:{};return db['CmHopper'][_0x3198('0x1c')](_0x3c75e3['body'],{'where':_0x2a84cf,'transaction':_0x72a653})[_0x3198('0xe')](function(_0x6af38){logger['info'](_0x3198('0x4a'),_0x3c75e3);logger[_0x3198('0xf')](_0x3198('0x4a'),_0x3c75e3,JSON[_0x3198('0x10')](_0x6af38));_0x1a6b87(_0x6af38);})[_0x3198('0x11')](function(_0x4685ce){logger['error']('ResetActiveCalls',_0x4685ce[_0x3198('0x13')],_0x3c75e3);_0xbf7231(_0x5e7db2[_0x3198('0x12')](0x1f4,_0x4685ce[_0x3198('0x13')]));});});});};exports[_0x3198('0x4b')]=function(_0x31ea06){var _0x394f7b=this;var _0x200675=_0x31ea06[_0x3198('0x18')][_0x3198('0x8')][_0x3198('0x4c')];var _0x59f9c7=_0x31ea06[_0x3198('0x18')][_0x3198('0x8')]['interval'];var _0x48fa6f=_0x31ea06[_0x3198('0x18')][_0x3198('0x8')][_0x3198('0x4d')];return new Promise(function(_0xa37ef,_0x30e3d6){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x200675},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x3198('0x23')][_0x3198('0x39')](_0x3198('0x4e')+_0x59f9c7+'\x20MINUTE'),'$gt':db[_0x3198('0x23')]['literal']('NOW()')}},'UserId':{'$in':_0x48fa6f}},'include':[{'model':db[_0x3198('0x21')],'as':_0x3198('0x29')},{'model':db['User'],'as':_0x3198('0x2b'),'attributes':['id',_0x3198('0x2c'),_0x3198('0x4f')]},{'model':db[_0x3198('0x50')],'as':_0x3198('0x51')}]})[_0x3198('0xe')](function(_0x2e9557){if(_0x2e9557[_0x3198('0x32')]>0x0){return db[_0x3198('0x23')][_0x3198('0x24')](function(_0x242629){return db[_0x3198('0x6')][_0x3198('0x1c')]({'recallmeNotifiedDate':db[_0x3198('0x23')][_0x3198('0x39')](_0x3198('0x52'))},{'where':{'id':{'$in':_['map'](_0x2e9557,'id')}},'transaction':_0x242629})[_0x3198('0xe')](function(){_0xa37ef(_0x2e9557);})[_0x3198('0x11')](function(_0x4a48ae){logger[_0x3198('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x4a48ae[_0x3198('0x13')],_0x31ea06);_0x30e3d6(_0x394f7b[_0x3198('0x12')](0x1f4,_0x4a48ae[_0x3198('0x13')]));});})['catch'](function(_0x13d865){logger['error'](_0x3198('0x4b'),_0x13d865[_0x3198('0x13')],_0x31ea06);_0x30e3d6(_0x394f7b['error'](0x1f4,_0x13d865['message']));});}else{_0xa37ef(_0x2e9557);}});});};
\ No newline at end of file