Built motion from commit 13c3002c.|2.6.9
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
index 6a41f95..efafd79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f6b=['CreateCmHopper','create','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','User','name','voicePause','includes','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','GetCmHopperPreview','keys','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','then','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','info','result','GetCmHopper','CmHopper','options','raw','where','attributes','include','map','model','catch','ShowCmHopper','find'];(function(_0x4fcf10,_0x2db1c9){var _0x474d90=function(_0x2997b7){while(--_0x2997b7){_0x4fcf10['push'](_0x4fcf10['shift']());}};_0x474d90(++_0x2db1c9);}(_0x8f6b,0x146));var _0xb8f6=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x8f6b[_0x32d457];return _0x338386;};'use strict';var _=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var moment=require(_0xb8f6('0x2'));var BPromise=require('bluebird');var db=require(_0xb8f6('0x3'))['db'];var logger=require(_0xb8f6('0x4'))('rpc');var jayson=require(_0xb8f6('0x5'));var client=jayson[_0xb8f6('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x333054,_0x53902e,_0x332ce0){return new BPromise(function(_0x4c73ad,_0x207add){return client['request'](_0x333054,_0x332ce0)[_0xb8f6('0x7')](function(_0x11b65b){logger['info']('CmHopper,\x20%s,\x20%s',_0x53902e,_0xb8f6('0x8'));logger[_0xb8f6('0x9')](_0xb8f6('0xa'),_0x53902e,_0xb8f6('0x8'),JSON[_0xb8f6('0xb')](_0x11b65b));if(_0x11b65b[_0xb8f6('0xc')]){if(_0x11b65b[_0xb8f6('0xc')][_0xb8f6('0xd')]===0x1f4){logger[_0xb8f6('0xc')](_0xb8f6('0xe'),_0x53902e,_0x11b65b[_0xb8f6('0xc')][_0xb8f6('0xf')]);return _0x207add(_0x11b65b['error'][_0xb8f6('0xf')]);}logger[_0xb8f6('0xc')]('CmHopper,\x20%s,\x20%s',_0x53902e,_0x11b65b[_0xb8f6('0xc')][_0xb8f6('0xf')]);return _0x4c73ad(_0x11b65b[_0xb8f6('0xc')]['message']);}else{logger[_0xb8f6('0x10')]('CmHopper,\x20%s,\x20%s',_0x53902e,_0xb8f6('0x8'));_0x4c73ad(_0x11b65b[_0xb8f6('0x11')]['message']);}})['catch'](function(_0x1fa122){logger[_0xb8f6('0xc')](_0xb8f6('0xe'),_0x53902e,_0x1fa122);_0x207add(_0x1fa122);});});}exports[_0xb8f6('0x12')]=function(_0x293f0c){var _0x465dc8=this;return new Promise(function(_0x2e998b,_0x30c2b3){return db[_0xb8f6('0x13')]['findAll']({'raw':_0x293f0c['options']?_0x293f0c[_0xb8f6('0x14')][_0xb8f6('0x15')]===undefined?!![]:![]:!![],'where':_0x293f0c[_0xb8f6('0x14')]?_0x293f0c[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null,'attributes':_0x293f0c['options']?_0x293f0c[_0xb8f6('0x14')][_0xb8f6('0x17')]||null:null,'limit':_0x293f0c[_0xb8f6('0x14')]?_0x293f0c[_0xb8f6('0x14')]['limit']||null:null,'include':_0x293f0c[_0xb8f6('0x14')]?_0x293f0c[_0xb8f6('0x14')][_0xb8f6('0x18')]?_[_0xb8f6('0x19')](_0x293f0c[_0xb8f6('0x14')][_0xb8f6('0x18')],function(_0x3805d7){return{'model':db[_0x3805d7[_0xb8f6('0x1a')]],'as':_0x3805d7['as'],'attributes':_0x3805d7['attributes'],'include':_0x3805d7[_0xb8f6('0x18')]?_[_0xb8f6('0x19')](_0x3805d7[_0xb8f6('0x18')],function(_0x15e0cb){return{'model':db[_0x15e0cb['model']],'as':_0x15e0cb['as'],'attributes':_0x15e0cb[_0xb8f6('0x17')],'include':_0x15e0cb[_0xb8f6('0x18')]?_['map'](_0x15e0cb[_0xb8f6('0x18')],function(_0x4ee750){return{'model':db[_0x4ee750[_0xb8f6('0x1a')]],'as':_0x4ee750['as'],'attributes':_0x4ee750[_0xb8f6('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb8f6('0x7')](function(_0x1b0f80){logger['info'](_0xb8f6('0x12'),_0x293f0c);logger[_0xb8f6('0x9')](_0xb8f6('0x12'),_0x293f0c,JSON['stringify'](_0x1b0f80));_0x2e998b(_0x1b0f80);})[_0xb8f6('0x1b')](function(_0x2c0600){logger[_0xb8f6('0xc')](_0xb8f6('0x12'),_0x2c0600[_0xb8f6('0xf')],_0x293f0c);_0x30c2b3(_0x465dc8['error'](0x1f4,_0x2c0600['message']));});});};exports[_0xb8f6('0x1c')]=function(_0x5bde35){var _0x2f98ff=this;return new Promise(function(_0x515864,_0x37de1c){return db[_0xb8f6('0x13')][_0xb8f6('0x1d')]({'raw':_0x5bde35[_0xb8f6('0x14')]?_0x5bde35[_0xb8f6('0x14')][_0xb8f6('0x15')]===undefined?!![]:![]:!![],'where':_0x5bde35[_0xb8f6('0x14')]?_0x5bde35[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null,'attributes':_0x5bde35['options']?_0x5bde35[_0xb8f6('0x14')][_0xb8f6('0x17')]||null:null,'include':_0x5bde35[_0xb8f6('0x14')]?_0x5bde35[_0xb8f6('0x14')]['include']?_[_0xb8f6('0x19')](_0x5bde35['options'][_0xb8f6('0x18')],function(_0x2b067c){return{'model':db[_0x2b067c[_0xb8f6('0x1a')]],'as':_0x2b067c['as'],'attributes':_0x2b067c[_0xb8f6('0x17')],'include':_0x2b067c['include']?_[_0xb8f6('0x19')](_0x2b067c['include'],function(_0x3b268b){return{'model':db[_0x3b268b['model']],'as':_0x3b268b['as'],'attributes':_0x3b268b[_0xb8f6('0x17')],'include':_0x3b268b['include']?_[_0xb8f6('0x19')](_0x3b268b[_0xb8f6('0x18')],function(_0x44a6b7){return{'model':db[_0x44a6b7['model']],'as':_0x44a6b7['as'],'attributes':_0x44a6b7[_0xb8f6('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x216fd4){logger[_0xb8f6('0x10')]('ShowCmHopper',_0x5bde35);logger[_0xb8f6('0x9')](_0xb8f6('0x1c'),_0x5bde35,JSON['stringify'](_0x216fd4));_0x515864(_0x216fd4);})[_0xb8f6('0x1b')](function(_0x2fb5b3){logger['error']('ShowCmHopper',_0x2fb5b3[_0xb8f6('0xf')],_0x5bde35);_0x37de1c(_0x2f98ff[_0xb8f6('0xc')](0x1f4,_0x2fb5b3[_0xb8f6('0xf')]));});});};exports[_0xb8f6('0x1e')]=function(_0x38f728){var _0x1b0adb=this;return new Promise(function(_0x5294b9,_0x372a05){return db[_0xb8f6('0x13')][_0xb8f6('0x1f')](_0x38f728[_0xb8f6('0x20')],{'raw':_0x38f728[_0xb8f6('0x14')]?_0x38f728[_0xb8f6('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xb8f6('0x7')](function(_0xeffe48){logger['info'](_0xb8f6('0x1e'),_0x38f728);logger[_0xb8f6('0x9')](_0xb8f6('0x1e'),_0x38f728,JSON[_0xb8f6('0xb')](_0xeffe48));_0x5294b9(_0xeffe48);})[_0xb8f6('0x1b')](function(_0x49cc3d){logger['error'](_0xb8f6('0x1e'),_0x49cc3d['message'],_0x38f728);_0x372a05(_0x1b0adb[_0xb8f6('0xc')](0x1f4,_0x49cc3d[_0xb8f6('0xf')]));});});};exports[_0xb8f6('0x21')]=function(_0x4b2265){var _0x9a01cc=this;return new Promise(function(_0x3790cd,_0x1130cb){return db[_0xb8f6('0x13')][_0xb8f6('0x22')](_0x4b2265[_0xb8f6('0x20')],{'raw':_0x4b2265['options']?_0x4b2265[_0xb8f6('0x14')][_0xb8f6('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b2265[_0xb8f6('0x14')]?_0x4b2265[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null,'attributes':_0x4b2265[_0xb8f6('0x14')]?_0x4b2265[_0xb8f6('0x14')]['attributes']||null:null,'limit':_0x4b2265[_0xb8f6('0x14')]?_0x4b2265[_0xb8f6('0x14')][_0xb8f6('0x23')]||null:null})[_0xb8f6('0x7')](function(_0x12c82f){logger[_0xb8f6('0x10')](_0xb8f6('0x21'),_0x4b2265);logger['info'](_0xb8f6('0x24'),JSON[_0xb8f6('0xb')](_0x4b2265[_0xb8f6('0x14')][_0xb8f6('0x16')]),_0x4b2265[_0xb8f6('0x20')][_0xb8f6('0x25')]);logger['debug'](_0xb8f6('0x21'),_0x4b2265,JSON['stringify'](_0x12c82f));_0x3790cd(_0x12c82f);})[_0xb8f6('0x1b')](function(_0xe31130){logger[_0xb8f6('0xc')](_0xb8f6('0x21'),_0xe31130[_0xb8f6('0xf')],_0x4b2265);_0x1130cb(_0x9a01cc[_0xb8f6('0xc')](0x1f4,_0xe31130['message']));});});};exports[_0xb8f6('0x26')]=function(_0xddeebe){var _0x532930=this;return new Promise(function(_0x1995fc,_0x52f8a0){return db['CmHopper']['destroy']({'where':_0xddeebe[_0xb8f6('0x14')]?_0xddeebe[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null})[_0xb8f6('0x7')](function(_0x55fb97){logger[_0xb8f6('0x10')](_0xb8f6('0x26'),_0xddeebe);logger[_0xb8f6('0x9')](_0xb8f6('0x26'),_0xddeebe,JSON[_0xb8f6('0xb')](_0x55fb97));_0x1995fc(_0x55fb97);})[_0xb8f6('0x1b')](function(_0x24ed61){logger['error']('DestroyCmHopper',_0x24ed61[_0xb8f6('0xf')],_0xddeebe);_0x52f8a0(_0x532930[_0xb8f6('0xc')](0x1f4,_0x24ed61[_0xb8f6('0xf')]));});});};exports[_0xb8f6('0x27')]=function(_0x23fea2){var _0xa7cdca=this;return new Promise(function(_0x8f77b3,_0x33f87e){return db[_0xb8f6('0x28')][_0xb8f6('0x29')]()[_0xb8f6('0x7')](function(_0x5f3060){return db[_0xb8f6('0x2a')]['transaction'](function(_0x17b711){return db['CmHopper'][_0xb8f6('0x2b')]({'where':_0x23fea2['options']?_0x23fea2[_0xb8f6('0x14')]['where']||null:null,'attributes':_0x23fea2['options']?_0x23fea2[_0xb8f6('0x14')]['attributes']||null:null,'limit':_0x23fea2['options']?_0x23fea2[_0xb8f6('0x14')][_0xb8f6('0x23')]||null:null,'order':_0x23fea2['options']?_0x23fea2[_0xb8f6('0x14')][_0xb8f6('0x2c')]||null:null,'transaction':_0x17b711,'lock':_0x17b711[_0xb8f6('0x2d')][_0xb8f6('0x2e')],'include':[{'model':db[_0xb8f6('0x28')],'as':_0xb8f6('0x2f'),'attributes':_['keys'](_0x5f3060)},{'model':db[_0xb8f6('0x30')],'as':'Agent','attributes':['id',_0xb8f6('0x31'),_0xb8f6('0x32')]}]})[_0xb8f6('0x7')](function(_0x4babe4){var _0x59cb80=[];var _0x1d7dc8=[];for(var _0x83fc49=0x0;_0x83fc49<_0x4babe4['length'];_0x83fc49+=0x1){var _0x416bd6=_0x4babe4[_0x83fc49]['UserId'];if(_0x416bd6===null){_0x59cb80['push'](_0x4babe4[_0x83fc49]['update'](_0x23fea2[_0xb8f6('0x20')],{'transaction':_0x17b711}));}else if(!_0x1d7dc8[_0xb8f6('0x33')](_0x416bd6)){_0x1d7dc8['push'](_0x416bd6);_0x59cb80[_0xb8f6('0x34')](_0x4babe4[_0x83fc49][_0xb8f6('0x22')](_0x23fea2[_0xb8f6('0x20')],{'transaction':_0x17b711}));}}return BPromise[_0xb8f6('0x35')](_0x59cb80);});})[_0xb8f6('0x7')](function(_0x25e32d){logger[_0xb8f6('0x10')](_0xb8f6('0x27'),_0x23fea2);if(_0x25e32d[_0xb8f6('0x36')]>0x0){logger[_0xb8f6('0x10')](_0xb8f6('0x37'),_0x25e32d[0x0][_0xb8f6('0x38')]['id'],_0x25e32d[0x0][_0xb8f6('0x38')][_0xb8f6('0x39')],_0x25e32d[0x0][_0xb8f6('0x38')][_0xb8f6('0x25')]);}logger[_0xb8f6('0x9')](_0xb8f6('0x27'),_0x23fea2,JSON[_0xb8f6('0xb')](_0x25e32d));_0x8f77b3(_0x25e32d);})[_0xb8f6('0x1b')](function(_0x4a0626){logger[_0xb8f6('0xc')]('GetContactDialer',_0x4a0626[_0xb8f6('0xf')],_0x23fea2);_0x33f87e(_0xa7cdca[_0xb8f6('0xc')](0x1f4,_0x4a0626[_0xb8f6('0xf')]));});});});};exports[_0xb8f6('0x3a')]=function(_0x418c73){var _0x132c89=this;return new Promise(function(_0x2d319c,_0xb7013b){return db['sequelize'][_0xb8f6('0x3b')](function(_0x1ca718){return db[_0xb8f6('0x3c')][_0xb8f6('0x1f')](_0x418c73[_0xb8f6('0x20')],{'raw':_0x418c73[_0xb8f6('0x14')]?_0x418c73[_0xb8f6('0x14')][_0xb8f6('0x15')]===undefined?!![]:![]:!![],'transaction':_0x1ca718})['then'](function(){logger[_0xb8f6('0x10')](_0xb8f6('0x3d'),JSON[_0xb8f6('0xb')](_0x418c73[_0xb8f6('0x14')]['where']),_0x418c73[_0xb8f6('0x14')][_0xb8f6('0x16')][_0xb8f6('0x25')]);return db[_0xb8f6('0x13')][_0xb8f6('0x3e')]({'where':_0x418c73[_0xb8f6('0x14')]?_0x418c73[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null,'transaction':_0x1ca718});});})[_0xb8f6('0x7')](function(_0x4327e1){logger[_0xb8f6('0x10')](_0xb8f6('0x3a'),_0x418c73);logger[_0xb8f6('0x9')]('MoveContactManagedDialer',_0x418c73,JSON[_0xb8f6('0xb')](_0x4327e1));_0x2d319c(_0x4327e1);})['catch'](function(_0x3da374){logger[_0xb8f6('0xc')](_0xb8f6('0x3a'),_0x3da374['message'],_0x418c73);_0xb7013b(_0x132c89[_0xb8f6('0xc')](0x1f4,_0x3da374[_0xb8f6('0xf')]));});});};exports[_0xb8f6('0x3f')]=function(_0x55db8e){var _0x2ca616=this;return new Promise(function(_0x5889fe,_0x5f0642){return db[_0xb8f6('0x13')][_0xb8f6('0x2b')]({'raw':_0x55db8e[_0xb8f6('0x14')]?_0x55db8e['options'][_0xb8f6('0x15')]===undefined?!![]:![]:!![],'where':_0x55db8e[_0xb8f6('0x14')]?_0x55db8e[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb8f6('0x2a')][_0xb8f6('0x40')](_0xb8f6('0x41')+util[_0xb8f6('0x42')](_0xb8f6('0x43'),moment()['format'](_0xb8f6('0x44')))+_0xb8f6('0x45')))),_0xb8f6('0x46')]]})[_0xb8f6('0x7')](function(_0x15afb2){logger[_0xb8f6('0x10')](_0xb8f6('0x3f'),_0x55db8e);logger[_0xb8f6('0x9')](_0xb8f6('0x3f'),_0x55db8e,JSON[_0xb8f6('0xb')](_0x15afb2));_0x5889fe(_0x15afb2);})[_0xb8f6('0x1b')](function(_0x498928){logger[_0xb8f6('0xc')]('CountReScheduled',_0x498928['message'],_0x55db8e);_0x5f0642(_0x2ca616[_0xb8f6('0xc')](0x1f4,_0x498928[_0xb8f6('0xf')]));});});};exports[_0xb8f6('0x47')]=function(_0xde4c6b){var _0x4de256=this;return new Promise(function(_0x452aa7,_0xdce9a1){return db[_0xb8f6('0x28')][_0xb8f6('0x29')]()[_0xb8f6('0x7')](function(_0x454ca0){return db[_0xb8f6('0x2a')][_0xb8f6('0x3b')](function(_0x2536e9){return db[_0xb8f6('0x13')]['findAll']({'where':_0xde4c6b[_0xb8f6('0x14')]?_0xde4c6b[_0xb8f6('0x14')][_0xb8f6('0x16')]||null:null,'attributes':_0xde4c6b[_0xb8f6('0x14')]?_0xde4c6b[_0xb8f6('0x14')][_0xb8f6('0x17')]||null:null,'limit':0x1,'order':_0xde4c6b[_0xb8f6('0x14')]?_0xde4c6b[_0xb8f6('0x14')][_0xb8f6('0x2c')]||null:null,'group':db[_0xb8f6('0x13')][_0xb8f6('0x48')],'transaction':_0x2536e9,'lock':_0x2536e9[_0xb8f6('0x2d')][_0xb8f6('0x2e')],'include':_0xde4c6b['options']?_0xde4c6b[_0xb8f6('0x14')]['include']?_[_0xb8f6('0x19')](_0xde4c6b[_0xb8f6('0x14')][_0xb8f6('0x18')],function(_0x939302){return{'model':db[_0x939302[_0xb8f6('0x1a')]],'as':_0x939302['as'],'attributes':_0x939302['attributes'],'include':_0x939302[_0xb8f6('0x18')]?_[_0xb8f6('0x19')](_0x939302[_0xb8f6('0x18')],function(_0x24746e){return{'model':db[_0x24746e[_0xb8f6('0x1a')]],'as':_0x24746e['as'],'attributes':_0x24746e[_0xb8f6('0x17')],'include':_0x24746e[_0xb8f6('0x18')]?_['map'](_0x24746e[_0xb8f6('0x18')],function(_0x568cdd){return{'model':db[_0x568cdd['model']],'as':_0x568cdd['as'],'attributes':_0x568cdd[_0xb8f6('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb8f6('0x7')](function(_0x1ab36c){var _0x7dfc93=[];for(var _0x4e334f=0x0;_0x4e334f<_0x1ab36c[_0xb8f6('0x36')];_0x4e334f+=0x1){_0x7dfc93[_0xb8f6('0x34')](_0x1ab36c[_0x4e334f]['update'](_0xde4c6b['body'],{'transaction':_0x2536e9}));}return BPromise[_0xb8f6('0x35')](_0x7dfc93);});})[_0xb8f6('0x7')](function(_0x5386f9){logger[_0xb8f6('0x10')](_0xb8f6('0x47'),_0xde4c6b);logger[_0xb8f6('0x9')](_0xb8f6('0x47'),_0xde4c6b,JSON[_0xb8f6('0xb')](_0x5386f9));_0x452aa7(_0x5386f9);})[_0xb8f6('0x1b')](function(_0x406a5b){logger['error'](_0xb8f6('0x47'),_0x406a5b['message'],_0xde4c6b);_0xdce9a1(_0x4de256[_0xb8f6('0xc')](0x1f4,_0x406a5b[_0xb8f6('0xf')]));});});});};exports[_0xb8f6('0x49')]=function(_0x52a487){var _0xc3be17=this;return new Promise(function(_0x3f561a,_0x72fcd0){db[_0xb8f6('0x28')][_0xb8f6('0x29')]()[_0xb8f6('0x7')](function(_0x4bca36){return db['CmHopper']['findAll']({'raw':_0x52a487[_0xb8f6('0x14')]?_0x52a487[_0xb8f6('0x14')][_0xb8f6('0x15')]===undefined?!![]:![]:!![],'where':_0x52a487[_0xb8f6('0x14')]?_0x52a487['options'][_0xb8f6('0x16')]||null:null,'attributes':_0x52a487[_0xb8f6('0x14')]?_0x52a487['options']['attributes']||null:null,'limit':_0x52a487[_0xb8f6('0x14')]?_0x52a487[_0xb8f6('0x14')][_0xb8f6('0x23')]||null:null,'include':_0x52a487[_0xb8f6('0x14')]?_0x52a487[_0xb8f6('0x14')][_0xb8f6('0x18')]?_['map'](_0x52a487['options']['include'],function(_0x16fd75){return{'model':db[_0x16fd75[_0xb8f6('0x1a')]],'as':_0x16fd75['as'],'attributes':_0x16fd75['as']==='Contact'?_[_0xb8f6('0x4a')](_0x4bca36):_0x16fd75['attributes'],'include':_0x16fd75['include']?_[_0xb8f6('0x19')](_0x16fd75['include'],function(_0x3afe2b){return{'model':db[_0x3afe2b['model']],'as':_0x3afe2b['as'],'attributes':_0x3afe2b[_0xb8f6('0x17')],'include':_0x3afe2b[_0xb8f6('0x18')]?_[_0xb8f6('0x19')](_0x3afe2b[_0xb8f6('0x18')],function(_0x104abf){return{'model':db[_0x104abf['model']],'as':_0x104abf['as'],'attributes':_0x104abf[_0xb8f6('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb8f6('0x7')](function(_0x2538fc){logger[_0xb8f6('0x10')](_0xb8f6('0x12'),_0x52a487);logger[_0xb8f6('0x9')](_0xb8f6('0x12'),_0x52a487,JSON['stringify'](_0x2538fc));_0x3f561a(_0x2538fc);})[_0xb8f6('0x1b')](function(_0x5da832){logger[_0xb8f6('0xc')](_0xb8f6('0x12'),_0x5da832[_0xb8f6('0xf')],_0x52a487);_0x72fcd0(_0xc3be17[_0xb8f6('0xc')](0x1f4,_0x5da832['message']));});});});};exports[_0xb8f6('0x4b')]=function(_0x3e5f4d){var _0x229ab8=this;return new Promise(function(_0x3aa8b6,_0x4d78d4){return db[_0xb8f6('0x28')][_0xb8f6('0x4c')]({'raw':!![],'where':{'phone':_0x3e5f4d[_0xb8f6('0x14')][_0xb8f6('0x16')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xb8f6('0x4d')]]})[_0xb8f6('0x7')](function(_0x21fb63){logger[_0xb8f6('0x10')](_0xb8f6('0x4e'),_0x3e5f4d);logger['debug']('getContactByPhone',_0x3e5f4d,JSON[_0xb8f6('0xb')](_0x21fb63));_0x3aa8b6(_0x21fb63);})[_0xb8f6('0x1b')](function(_0x1c6e6c){logger[_0xb8f6('0xc')]('getContactByPhone',_0x1c6e6c['message'],_0x3e5f4d);_0x4d78d4(_0x229ab8[_0xb8f6('0xc')](0x1f4,_0x1c6e6c[_0xb8f6('0xf')]));});});};exports[_0xb8f6('0x4f')]=function(_0xaf4748){var _0x1cbba0=this;return new Promise(function(_0x302a90,_0x29394a){return db[_0xb8f6('0x2a')][_0xb8f6('0x3b')](function(_0x36ad59){return db['CmHopper'][_0xb8f6('0x22')](_0xaf4748[_0xb8f6('0x20')],{'where':{},'transaction':_0x36ad59})[_0xb8f6('0x7')](function(_0x129672){logger['info'](_0xb8f6('0x4f'),_0xaf4748);logger['debug'](_0xb8f6('0x4f'),_0xaf4748,JSON[_0xb8f6('0xb')](_0x129672));_0x302a90(_0x129672);})['catch'](function(_0x7df127){logger[_0xb8f6('0xc')](_0xb8f6('0x4f'),_0x7df127[_0xb8f6('0xf')],_0xaf4748);_0x29394a(_0x1cbba0[_0xb8f6('0xc')](0x1f4,_0x7df127[_0xb8f6('0xf')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0xe45bb5){var _0x5755fd=this;var _0x29c65a=_0xe45bb5[_0xb8f6('0x20')][_0xb8f6('0x16')][_0xb8f6('0x50')];var _0x5af16a=_0xe45bb5['body'][_0xb8f6('0x16')][_0xb8f6('0x51')];var _0x5b7811=_0xe45bb5[_0xb8f6('0x20')][_0xb8f6('0x16')][_0xb8f6('0x52')];return new Promise(function(_0x57ae8c,_0x38d0dc){return db[_0xb8f6('0x13')]['findAll']({'where':{'voiceQueueId':{'$in':_0x29c65a},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb8f6('0x2a')][_0xb8f6('0x40')](_0xb8f6('0x53')+_0x5af16a+_0xb8f6('0x54')),'$gt':db['sequelize']['literal'](_0xb8f6('0x55'))}},'UserId':{'$in':_0x5b7811}},'include':[{'model':db['CmContact'],'as':_0xb8f6('0x2f')},{'model':db[_0xb8f6('0x30')],'as':_0xb8f6('0x56'),'attributes':['id',_0xb8f6('0x31'),'voicePause']},{'model':db['CmList'],'as':_0xb8f6('0x57')}]})[_0xb8f6('0x7')](function(_0x3b7909){if(_0x3b7909[_0xb8f6('0x36')]>0x0){return db['sequelize']['transaction'](function(_0x43a52d){return db[_0xb8f6('0x13')][_0xb8f6('0x22')]({'recallmeNotifiedDate':db['sequelize'][_0xb8f6('0x40')](_0xb8f6('0x55'))},{'where':{'id':{'$in':_[_0xb8f6('0x19')](_0x3b7909,'id')}},'transaction':_0x43a52d})['then'](function(){_0x57ae8c(_0x3b7909);})[_0xb8f6('0x1b')](function(_0x1b3e33){logger[_0xb8f6('0xc')]('CmHopperHandlePreviewRecallNotifications',_0x1b3e33[_0xb8f6('0xf')],_0xe45bb5);_0x38d0dc(_0x5755fd[_0xb8f6('0xc')](0x1f4,_0x1b3e33[_0xb8f6('0xf')]));});})[_0xb8f6('0x1b')](function(_0x69fd20){logger[_0xb8f6('0xc')](_0xb8f6('0x58'),_0x69fd20[_0xb8f6('0xf')],_0xe45bb5);_0x38d0dc(_0x5755fd[_0xb8f6('0xc')](0x1f4,_0x69fd20[_0xb8f6('0xf')]));});}else{_0x57ae8c(_0x3b7909);}});});};
\ No newline at end of file
+var _0x3308=['MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','Contact','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','include','model','map','then','info','debug','GetCmHopper','catch','error','message','ShowCmHopper','find','stringify','CreateCmHopper','create','body','UpdateCmHopper','update','limit','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','keys','User','Agent','name','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId'];(function(_0x33c5f1,_0x3c4d18){var _0x12d426=function(_0xf751a1){while(--_0xf751a1){_0x33c5f1['push'](_0x33c5f1['shift']());}};_0x12d426(++_0x3c4d18);}(_0x3308,0x160));var _0x8330=function(_0x439d3f,_0x6ce1b3){_0x439d3f=_0x439d3f-0x0;var _0xd2bc5c=_0x3308[_0x439d3f];return _0xd2bc5c;};'use strict';var _=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var moment=require(_0x8330('0x2'));var BPromise=require(_0x8330('0x3'));var db=require(_0x8330('0x4'))['db'];var logger=require(_0x8330('0x5'))(_0x8330('0x6'));exports['GetCmHopper']=function(_0x588dc3){var _0x310717=this;return new Promise(function(_0x4c25d7,_0x8fbaf4){return db[_0x8330('0x7')][_0x8330('0x8')]({'raw':_0x588dc3['options']?_0x588dc3[_0x8330('0x9')][_0x8330('0xa')]===undefined?!![]:![]:!![],'where':_0x588dc3[_0x8330('0x9')]?_0x588dc3[_0x8330('0x9')][_0x8330('0xb')]||null:null,'attributes':_0x588dc3[_0x8330('0x9')]?_0x588dc3['options'][_0x8330('0xc')]||null:null,'limit':_0x588dc3[_0x8330('0x9')]?_0x588dc3[_0x8330('0x9')]['limit']||null:null,'include':_0x588dc3['options']?_0x588dc3['options']['include']?_['map'](_0x588dc3['options'][_0x8330('0xd')],function(_0x55db5c){return{'model':db[_0x55db5c[_0x8330('0xe')]],'as':_0x55db5c['as'],'attributes':_0x55db5c[_0x8330('0xc')],'include':_0x55db5c[_0x8330('0xd')]?_[_0x8330('0xf')](_0x55db5c[_0x8330('0xd')],function(_0x4ee58b){return{'model':db[_0x4ee58b[_0x8330('0xe')]],'as':_0x4ee58b['as'],'attributes':_0x4ee58b['attributes'],'include':_0x4ee58b[_0x8330('0xd')]?_[_0x8330('0xf')](_0x4ee58b[_0x8330('0xd')],function(_0x962a55){return{'model':db[_0x962a55[_0x8330('0xe')]],'as':_0x962a55['as'],'attributes':_0x962a55[_0x8330('0xc')]};}):[]};}):[]};}):[]:[]})[_0x8330('0x10')](function(_0x1f230a){logger[_0x8330('0x11')]('GetCmHopper',_0x588dc3);logger[_0x8330('0x12')](_0x8330('0x13'),_0x588dc3,JSON['stringify'](_0x1f230a));_0x4c25d7(_0x1f230a);})[_0x8330('0x14')](function(_0x3c9e7b){logger[_0x8330('0x15')]('GetCmHopper',_0x3c9e7b[_0x8330('0x16')],_0x588dc3);_0x8fbaf4(_0x310717['error'](0x1f4,_0x3c9e7b[_0x8330('0x16')]));});});};exports[_0x8330('0x17')]=function(_0x3e8c0e){var _0x16a208=this;return new Promise(function(_0x57a7f6,_0x31efc9){return db['CmHopper'][_0x8330('0x18')]({'raw':_0x3e8c0e['options']?_0x3e8c0e[_0x8330('0x9')][_0x8330('0xa')]===undefined?!![]:![]:!![],'where':_0x3e8c0e[_0x8330('0x9')]?_0x3e8c0e[_0x8330('0x9')][_0x8330('0xb')]||null:null,'attributes':_0x3e8c0e[_0x8330('0x9')]?_0x3e8c0e[_0x8330('0x9')][_0x8330('0xc')]||null:null,'include':_0x3e8c0e[_0x8330('0x9')]?_0x3e8c0e[_0x8330('0x9')][_0x8330('0xd')]?_['map'](_0x3e8c0e['options']['include'],function(_0x23a439){return{'model':db[_0x23a439[_0x8330('0xe')]],'as':_0x23a439['as'],'attributes':_0x23a439[_0x8330('0xc')],'include':_0x23a439[_0x8330('0xd')]?_[_0x8330('0xf')](_0x23a439[_0x8330('0xd')],function(_0x19465b){return{'model':db[_0x19465b['model']],'as':_0x19465b['as'],'attributes':_0x19465b[_0x8330('0xc')],'include':_0x19465b[_0x8330('0xd')]?_['map'](_0x19465b[_0x8330('0xd')],function(_0x449198){return{'model':db[_0x449198[_0x8330('0xe')]],'as':_0x449198['as'],'attributes':_0x449198[_0x8330('0xc')]};}):[]};}):[]};}):[]:[]})[_0x8330('0x10')](function(_0x5297af){logger[_0x8330('0x11')]('ShowCmHopper',_0x3e8c0e);logger[_0x8330('0x12')](_0x8330('0x17'),_0x3e8c0e,JSON[_0x8330('0x19')](_0x5297af));_0x57a7f6(_0x5297af);})['catch'](function(_0x3af04f){logger[_0x8330('0x15')]('ShowCmHopper',_0x3af04f[_0x8330('0x16')],_0x3e8c0e);_0x31efc9(_0x16a208['error'](0x1f4,_0x3af04f[_0x8330('0x16')]));});});};exports[_0x8330('0x1a')]=function(_0x1189cf){var _0x41a2a7=this;return new Promise(function(_0xcb775f,_0x333dab){return db[_0x8330('0x7')][_0x8330('0x1b')](_0x1189cf[_0x8330('0x1c')],{'raw':_0x1189cf[_0x8330('0x9')]?_0x1189cf[_0x8330('0x9')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1a78d6){logger['info'](_0x8330('0x1a'),_0x1189cf);logger['debug']('CreateCmHopper',_0x1189cf,JSON[_0x8330('0x19')](_0x1a78d6));_0xcb775f(_0x1a78d6);})[_0x8330('0x14')](function(_0x27c8f6){logger[_0x8330('0x15')]('CreateCmHopper',_0x27c8f6[_0x8330('0x16')],_0x1189cf);_0x333dab(_0x41a2a7['error'](0x1f4,_0x27c8f6[_0x8330('0x16')]));});});};exports[_0x8330('0x1d')]=function(_0x1291df){var _0xa21176=this;return new Promise(function(_0x23a18e,_0x3a5521){return db['CmHopper'][_0x8330('0x1e')](_0x1291df[_0x8330('0x1c')],{'raw':_0x1291df[_0x8330('0x9')]?_0x1291df[_0x8330('0x9')][_0x8330('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1291df[_0x8330('0x9')]?_0x1291df[_0x8330('0x9')][_0x8330('0xb')]||null:null,'attributes':_0x1291df['options']?_0x1291df['options'][_0x8330('0xc')]||null:null,'limit':_0x1291df[_0x8330('0x9')]?_0x1291df[_0x8330('0x9')][_0x8330('0x1f')]||null:null})[_0x8330('0x10')](function(_0x22c228){logger[_0x8330('0x11')](_0x8330('0x1d'),_0x1291df);logger[_0x8330('0x11')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8330('0x19')](_0x1291df[_0x8330('0x9')][_0x8330('0xb')]),_0x1291df[_0x8330('0x1c')][_0x8330('0x20')]);logger[_0x8330('0x12')](_0x8330('0x1d'),_0x1291df,JSON[_0x8330('0x19')](_0x22c228));_0x23a18e(_0x22c228);})[_0x8330('0x14')](function(_0xdc529a){logger[_0x8330('0x15')](_0x8330('0x1d'),_0xdc529a[_0x8330('0x16')],_0x1291df);_0x3a5521(_0xa21176[_0x8330('0x15')](0x1f4,_0xdc529a[_0x8330('0x16')]));});});};exports[_0x8330('0x21')]=function(_0x55e1de){var _0x2e06fb=this;return new Promise(function(_0x41fb20,_0x115af2){return db[_0x8330('0x7')]['destroy']({'where':_0x55e1de[_0x8330('0x9')]?_0x55e1de[_0x8330('0x9')][_0x8330('0xb')]||null:null})[_0x8330('0x10')](function(_0x4fa1d1){logger[_0x8330('0x11')]('DestroyCmHopper',_0x55e1de);logger['debug'](_0x8330('0x21'),_0x55e1de,JSON['stringify'](_0x4fa1d1));_0x41fb20(_0x4fa1d1);})['catch'](function(_0x58c0e5){logger[_0x8330('0x15')](_0x8330('0x21'),_0x58c0e5[_0x8330('0x16')],_0x55e1de);_0x115af2(_0x2e06fb[_0x8330('0x15')](0x1f4,_0x58c0e5[_0x8330('0x16')]));});});};exports[_0x8330('0x22')]=function(_0x56fdbb){var _0x1e1c07=this;return new Promise(function(_0x21e3a1,_0x5d3933){return db[_0x8330('0x23')][_0x8330('0x24')]()[_0x8330('0x10')](function(_0x36c11b){return db[_0x8330('0x25')][_0x8330('0x26')](function(_0x439749){return db[_0x8330('0x7')][_0x8330('0x8')]({'where':_0x56fdbb[_0x8330('0x9')]?_0x56fdbb[_0x8330('0x9')][_0x8330('0xb')]||null:null,'attributes':_0x56fdbb['options']?_0x56fdbb[_0x8330('0x9')][_0x8330('0xc')]||null:null,'limit':_0x56fdbb[_0x8330('0x9')]?_0x56fdbb[_0x8330('0x9')][_0x8330('0x1f')]||null:null,'order':_0x56fdbb['options']?_0x56fdbb[_0x8330('0x9')][_0x8330('0x27')]||null:null,'transaction':_0x439749,'lock':_0x439749[_0x8330('0x28')]['UPDATE'],'include':[{'model':db[_0x8330('0x23')],'as':'Contact','attributes':_[_0x8330('0x29')](_0x36c11b)},{'model':db[_0x8330('0x2a')],'as':_0x8330('0x2b'),'attributes':['id',_0x8330('0x2c'),'voicePause']}]})[_0x8330('0x10')](function(_0x19d6f8){var _0x46f57c=[];var _0x3762b7=[];for(var _0x4e2058=0x0;_0x4e2058<_0x19d6f8[_0x8330('0x2d')];_0x4e2058+=0x1){var _0x266cb3=_0x19d6f8[_0x4e2058][_0x8330('0x2e')];if(_0x266cb3===null){_0x46f57c['push'](_0x19d6f8[_0x4e2058][_0x8330('0x1e')](_0x56fdbb['body'],{'transaction':_0x439749}));}else if(!_0x3762b7[_0x8330('0x2f')](_0x266cb3)){_0x3762b7[_0x8330('0x30')](_0x266cb3);_0x46f57c[_0x8330('0x30')](_0x19d6f8[_0x4e2058]['update'](_0x56fdbb[_0x8330('0x1c')],{'transaction':_0x439749}));}}return BPromise[_0x8330('0x31')](_0x46f57c);});})[_0x8330('0x10')](function(_0x2a3e84){logger[_0x8330('0x11')]('GetContactDialer',_0x56fdbb);if(_0x2a3e84[_0x8330('0x2d')]>0x0){logger[_0x8330('0x11')](_0x8330('0x32'),_0x2a3e84[0x0][_0x8330('0x33')]['id'],_0x2a3e84[0x0][_0x8330('0x33')][_0x8330('0x34')],_0x2a3e84[0x0][_0x8330('0x33')][_0x8330('0x20')]);}logger[_0x8330('0x12')](_0x8330('0x22'),_0x56fdbb,JSON[_0x8330('0x19')](_0x2a3e84));_0x21e3a1(_0x2a3e84);})[_0x8330('0x14')](function(_0x44bd06){logger['error'](_0x8330('0x22'),_0x44bd06['message'],_0x56fdbb);_0x5d3933(_0x1e1c07['error'](0x1f4,_0x44bd06[_0x8330('0x16')]));});});});};exports[_0x8330('0x35')]=function(_0x432cb6){var _0x4461fd=this;return new Promise(function(_0x4c8895,_0x3cc25d){return db[_0x8330('0x25')][_0x8330('0x26')](function(_0x4f6fff){return db[_0x8330('0x36')][_0x8330('0x1b')](_0x432cb6[_0x8330('0x1c')],{'raw':_0x432cb6['options']?_0x432cb6['options'][_0x8330('0xa')]===undefined?!![]:![]:!![],'transaction':_0x4f6fff})[_0x8330('0x10')](function(){logger[_0x8330('0x11')](_0x8330('0x37'),JSON[_0x8330('0x19')](_0x432cb6[_0x8330('0x9')][_0x8330('0xb')]),_0x432cb6[_0x8330('0x9')][_0x8330('0xb')][_0x8330('0x20')]);return db['CmHopper'][_0x8330('0x38')]({'where':_0x432cb6['options']?_0x432cb6['options'][_0x8330('0xb')]||null:null,'transaction':_0x4f6fff});});})['then'](function(_0x864763){logger['info'](_0x8330('0x35'),_0x432cb6);logger[_0x8330('0x12')](_0x8330('0x35'),_0x432cb6,JSON[_0x8330('0x19')](_0x864763));_0x4c8895(_0x864763);})['catch'](function(_0x235b6a){logger[_0x8330('0x15')]('MoveContactManagedDialer',_0x235b6a[_0x8330('0x16')],_0x432cb6);_0x3cc25d(_0x4461fd['error'](0x1f4,_0x235b6a[_0x8330('0x16')]));});});};exports[_0x8330('0x39')]=function(_0x1920cd){var _0x1455cd=this;return new Promise(function(_0x1f003c,_0x169666){return db['CmHopper'][_0x8330('0x8')]({'raw':_0x1920cd[_0x8330('0x9')]?_0x1920cd[_0x8330('0x9')][_0x8330('0xa')]===undefined?!![]:![]:!![],'where':_0x1920cd['options']?_0x1920cd['options'][_0x8330('0xb')]||null:null,'attributes':[[db[_0x8330('0x25')]['fn'](_0x8330('0x3a'),db[_0x8330('0x25')]['fn']('IF',db[_0x8330('0x25')]['literal']('`scheduledat`\x20>=\x20'+util[_0x8330('0x3b')]('\x22%s\x22',moment()[_0x8330('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x8330('0x3c')))),_0x8330('0x3d')]]})[_0x8330('0x10')](function(_0x44818a){logger[_0x8330('0x11')](_0x8330('0x39'),_0x1920cd);logger['debug'](_0x8330('0x39'),_0x1920cd,JSON[_0x8330('0x19')](_0x44818a));_0x1f003c(_0x44818a);})[_0x8330('0x14')](function(_0x5811ac){logger[_0x8330('0x15')](_0x8330('0x39'),_0x5811ac['message'],_0x1920cd);_0x169666(_0x1455cd[_0x8330('0x15')](0x1f4,_0x5811ac['message']));});});};exports[_0x8330('0x3e')]=function(_0x4066a9){var _0x317247=this;return new Promise(function(_0x3bc3c3,_0x28cf66){return db[_0x8330('0x23')]['describe']()[_0x8330('0x10')](function(){return db['sequelize'][_0x8330('0x26')](function(_0x219b86){return db['CmHopper'][_0x8330('0x8')]({'where':_0x4066a9[_0x8330('0x9')]?_0x4066a9[_0x8330('0x9')]['where']||null:null,'attributes':_0x4066a9[_0x8330('0x9')]?_0x4066a9[_0x8330('0x9')][_0x8330('0xc')]||null:null,'limit':0x1,'order':_0x4066a9[_0x8330('0x9')]?_0x4066a9['options'][_0x8330('0x27')]||null:null,'group':db[_0x8330('0x7')][_0x8330('0x2e')],'transaction':_0x219b86,'lock':_0x219b86['LOCK'][_0x8330('0x3f')],'include':_0x4066a9['options']?_0x4066a9[_0x8330('0x9')][_0x8330('0xd')]?_[_0x8330('0xf')](_0x4066a9[_0x8330('0x9')][_0x8330('0xd')],function(_0x29d9ab){return{'model':db[_0x29d9ab[_0x8330('0xe')]],'as':_0x29d9ab['as'],'attributes':_0x29d9ab[_0x8330('0xc')],'include':_0x29d9ab[_0x8330('0xd')]?_[_0x8330('0xf')](_0x29d9ab[_0x8330('0xd')],function(_0x50f834){return{'model':db[_0x50f834['model']],'as':_0x50f834['as'],'attributes':_0x50f834['attributes'],'include':_0x50f834[_0x8330('0xd')]?_[_0x8330('0xf')](_0x50f834[_0x8330('0xd')],function(_0x564091){return{'model':db[_0x564091[_0x8330('0xe')]],'as':_0x564091['as'],'attributes':_0x564091[_0x8330('0xc')]};}):[]};}):[]};}):[]:[]})[_0x8330('0x10')](function(_0x54abc3){var _0x5a0bb5=[];for(var _0x5358ac=0x0;_0x5358ac<_0x54abc3[_0x8330('0x2d')];_0x5358ac+=0x1){_0x5a0bb5[_0x8330('0x30')](_0x54abc3[_0x5358ac][_0x8330('0x1e')](_0x4066a9[_0x8330('0x1c')],{'transaction':_0x219b86}));}return BPromise[_0x8330('0x31')](_0x5a0bb5);});})[_0x8330('0x10')](function(_0xe5da9f){logger[_0x8330('0x11')](_0x8330('0x3e'),_0x4066a9);logger['debug'](_0x8330('0x3e'),_0x4066a9,JSON['stringify'](_0xe5da9f));_0x3bc3c3(_0xe5da9f);})[_0x8330('0x14')](function(_0x5bcb0f){logger[_0x8330('0x15')](_0x8330('0x3e'),_0x5bcb0f[_0x8330('0x16')],_0x4066a9);_0x28cf66(_0x317247[_0x8330('0x15')](0x1f4,_0x5bcb0f[_0x8330('0x16')]));});});});};exports[_0x8330('0x40')]=function(_0x548e86){var _0xf58aba=this;return new Promise(function(_0x5546c0,_0x20d6d3){db[_0x8330('0x23')][_0x8330('0x24')]()['then'](function(_0x32a7da){return db['CmHopper'][_0x8330('0x8')]({'raw':_0x548e86[_0x8330('0x9')]?_0x548e86['options']['raw']===undefined?!![]:![]:!![],'where':_0x548e86[_0x8330('0x9')]?_0x548e86[_0x8330('0x9')][_0x8330('0xb')]||null:null,'attributes':_0x548e86[_0x8330('0x9')]?_0x548e86['options'][_0x8330('0xc')]||null:null,'limit':_0x548e86[_0x8330('0x9')]?_0x548e86['options'][_0x8330('0x1f')]||null:null,'include':_0x548e86[_0x8330('0x9')]?_0x548e86[_0x8330('0x9')]['include']?_[_0x8330('0xf')](_0x548e86[_0x8330('0x9')][_0x8330('0xd')],function(_0x4d0bbc){return{'model':db[_0x4d0bbc[_0x8330('0xe')]],'as':_0x4d0bbc['as'],'attributes':_0x4d0bbc['as']===_0x8330('0x41')?_[_0x8330('0x29')](_0x32a7da):_0x4d0bbc[_0x8330('0xc')],'include':_0x4d0bbc[_0x8330('0xd')]?_['map'](_0x4d0bbc['include'],function(_0x52a8e1){return{'model':db[_0x52a8e1['model']],'as':_0x52a8e1['as'],'attributes':_0x52a8e1[_0x8330('0xc')],'include':_0x52a8e1[_0x8330('0xd')]?_['map'](_0x52a8e1[_0x8330('0xd')],function(_0x422111){return{'model':db[_0x422111[_0x8330('0xe')]],'as':_0x422111['as'],'attributes':_0x422111['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed515){logger[_0x8330('0x11')](_0x8330('0x13'),_0x548e86);logger[_0x8330('0x12')](_0x8330('0x13'),_0x548e86,JSON[_0x8330('0x19')](_0x1ed515));_0x5546c0(_0x1ed515);})['catch'](function(_0x22cf60){logger[_0x8330('0x15')](_0x8330('0x13'),_0x22cf60[_0x8330('0x16')],_0x548e86);_0x20d6d3(_0xf58aba[_0x8330('0x15')](0x1f4,_0x22cf60[_0x8330('0x16')]));});});});};exports[_0x8330('0x42')]=function(_0x437fcc){var _0x5bfead=this;return new Promise(function(_0x49a74e,_0x5639be){return db[_0x8330('0x23')]['findOne']({'raw':!![],'where':{'phone':_0x437fcc[_0x8330('0x9')][_0x8330('0xb')][_0x8330('0x43')]},'attributes':['id',_0x8330('0x44')],'order':[['id',_0x8330('0x45')]]})[_0x8330('0x10')](function(_0xbe2c2b){logger['info'](_0x8330('0x46'),_0x437fcc);logger[_0x8330('0x12')](_0x8330('0x46'),_0x437fcc,JSON['stringify'](_0xbe2c2b));_0x49a74e(_0xbe2c2b);})[_0x8330('0x14')](function(_0x1fcbbc){logger[_0x8330('0x15')](_0x8330('0x46'),_0x1fcbbc[_0x8330('0x16')],_0x437fcc);_0x5639be(_0x5bfead[_0x8330('0x15')](0x1f4,_0x1fcbbc['message']));});});};exports[_0x8330('0x47')]=function(_0x23ab95){var _0x58e0c4=this;return new Promise(function(_0x2c611a,_0x11545a){return db[_0x8330('0x25')]['transaction'](function(_0x43f833){var _0x3f1053=_0x23ab95[_0x8330('0x9')]&&_0x23ab95[_0x8330('0x9')][_0x8330('0xb')]?_0x23ab95[_0x8330('0x9')][_0x8330('0xb')]:{};return db[_0x8330('0x7')]['update'](_0x23ab95[_0x8330('0x1c')],{'where':_0x3f1053,'transaction':_0x43f833})['then'](function(_0x12d22f){logger[_0x8330('0x11')](_0x8330('0x47'),_0x23ab95);logger[_0x8330('0x12')]('ResetActiveCalls',_0x23ab95,JSON['stringify'](_0x12d22f));_0x2c611a(_0x12d22f);})[_0x8330('0x14')](function(_0x256d80){logger['error'](_0x8330('0x47'),_0x256d80[_0x8330('0x16')],_0x23ab95);_0x11545a(_0x58e0c4[_0x8330('0x15')](0x1f4,_0x256d80[_0x8330('0x16')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x2781ae){var _0x3ca5d6=this;var _0xfd434d=_0x2781ae[_0x8330('0x1c')][_0x8330('0xb')][_0x8330('0x48')];var _0x58a0af=_0x2781ae[_0x8330('0x1c')][_0x8330('0xb')]['interval'];var _0x5812af=_0x2781ae[_0x8330('0x1c')][_0x8330('0xb')][_0x8330('0x49')];return new Promise(function(_0x530490,_0xaadcdc){return db[_0x8330('0x7')][_0x8330('0x8')]({'where':{'voiceQueueId':{'$in':_0xfd434d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8330('0x25')][_0x8330('0x4a')](_0x8330('0x4b')+_0x58a0af+_0x8330('0x4c')),'$gt':db['sequelize']['literal'](_0x8330('0x4d'))}},'UserId':{'$in':_0x5812af}},'include':[{'model':db['CmContact'],'as':_0x8330('0x41')},{'model':db[_0x8330('0x2a')],'as':'Agent','attributes':['id',_0x8330('0x2c'),'voicePause']},{'model':db[_0x8330('0x4e')],'as':_0x8330('0x4f')}]})['then'](function(_0x4aeec4){if(_0x4aeec4[_0x8330('0x2d')]>0x0){return db[_0x8330('0x25')][_0x8330('0x26')](function(_0x23ece8){return db[_0x8330('0x7')][_0x8330('0x1e')]({'recallmeNotifiedDate':db[_0x8330('0x25')][_0x8330('0x4a')](_0x8330('0x4d'))},{'where':{'id':{'$in':_[_0x8330('0xf')](_0x4aeec4,'id')}},'transaction':_0x23ece8})['then'](function(){_0x530490(_0x4aeec4);})['catch'](function(_0x2a4355){logger[_0x8330('0x15')](_0x8330('0x50'),_0x2a4355[_0x8330('0x16')],_0x2781ae);_0xaadcdc(_0x3ca5d6[_0x8330('0x15')](0x1f4,_0x2a4355['message']));});})[_0x8330('0x14')](function(_0x4904eb){logger[_0x8330('0x15')](_0x8330('0x50'),_0x4904eb[_0x8330('0x16')],_0x2781ae);_0xaadcdc(_0x3ca5d6[_0x8330('0x15')](0x1f4,_0x4904eb['message']));});}else{_0x530490(_0x4aeec4);}});});};
\ No newline at end of file