Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
index 038717b..6e7222c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d7=['findAll','options','raw','where','attributes','limit','include','model','map','info','debug','message','error','ShowCmHopper','CmHopper','find','then','catch','create','body','CreateCmHopper','stringify','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','keys','User','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','CountReScheduled','format','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','Contact','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Agent','lodash','util','bluebird','../../mysqldb','rpc','GetCmHopper'];(function(_0x46e369,_0x5b73ec){var _0x58fbba=function(_0x13bde2){while(--_0x13bde2){_0x46e369['push'](_0x46e369['shift']());}};_0x58fbba(++_0x5b73ec);}(_0x92d7,0x12a));var _0x792d=function(_0x16a1d5,_0x885088){_0x16a1d5=_0x16a1d5-0x0;var _0x2f0f26=_0x92d7[_0x16a1d5];return _0x2f0f26;};'use strict';var _=require(_0x792d('0x0'));var util=require(_0x792d('0x1'));var moment=require('moment');var BPromise=require(_0x792d('0x2'));var db=require(_0x792d('0x3'))['db'];var logger=require('../../config/logger')(_0x792d('0x4'));exports[_0x792d('0x5')]=function(_0x41b2e8){var _0xaa7a37=this;return new Promise(function(_0x1b6910,_0x13b8af){return db['CmHopper'][_0x792d('0x6')]({'raw':_0x41b2e8[_0x792d('0x7')]?_0x41b2e8['options'][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x41b2e8[_0x792d('0x7')]?_0x41b2e8[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':_0x41b2e8[_0x792d('0x7')]?_0x41b2e8[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':_0x41b2e8['options']?_0x41b2e8[_0x792d('0x7')][_0x792d('0xb')]||null:null,'include':_0x41b2e8['options']?_0x41b2e8[_0x792d('0x7')][_0x792d('0xc')]?_['map'](_0x41b2e8['options'][_0x792d('0xc')],function(_0x33f5e2){return{'model':db[_0x33f5e2[_0x792d('0xd')]],'as':_0x33f5e2['as'],'attributes':_0x33f5e2[_0x792d('0xa')],'include':_0x33f5e2['include']?_[_0x792d('0xe')](_0x33f5e2['include'],function(_0x196bd8){return{'model':db[_0x196bd8[_0x792d('0xd')]],'as':_0x196bd8['as'],'attributes':_0x196bd8[_0x792d('0xa')],'include':_0x196bd8[_0x792d('0xc')]?_[_0x792d('0xe')](_0x196bd8[_0x792d('0xc')],function(_0x5c4ce6){return{'model':db[_0x5c4ce6[_0x792d('0xd')]],'as':_0x5c4ce6['as'],'attributes':_0x5c4ce6[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x206be5){logger[_0x792d('0xf')](_0x792d('0x5'),_0x41b2e8);logger[_0x792d('0x10')](_0x792d('0x5'),_0x41b2e8,JSON['stringify'](_0x206be5));_0x1b6910(_0x206be5);})['catch'](function(_0x4a0d42){logger['error'](_0x792d('0x5'),_0x4a0d42[_0x792d('0x11')],_0x41b2e8);_0x13b8af(_0xaa7a37[_0x792d('0x12')](0x1f4,_0x4a0d42['message']));});});};exports[_0x792d('0x13')]=function(_0x43de90){var _0x413161=this;return new Promise(function(_0x26529f,_0x25317d){return db[_0x792d('0x14')][_0x792d('0x15')]({'raw':_0x43de90[_0x792d('0x7')]?_0x43de90[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x43de90['options']?_0x43de90['options'][_0x792d('0x9')]||null:null,'attributes':_0x43de90['options']?_0x43de90[_0x792d('0x7')][_0x792d('0xa')]||null:null,'include':_0x43de90[_0x792d('0x7')]?_0x43de90[_0x792d('0x7')][_0x792d('0xc')]?_[_0x792d('0xe')](_0x43de90[_0x792d('0x7')][_0x792d('0xc')],function(_0x10c6b3){return{'model':db[_0x10c6b3[_0x792d('0xd')]],'as':_0x10c6b3['as'],'attributes':_0x10c6b3[_0x792d('0xa')],'include':_0x10c6b3['include']?_['map'](_0x10c6b3[_0x792d('0xc')],function(_0x1011f9){return{'model':db[_0x1011f9[_0x792d('0xd')]],'as':_0x1011f9['as'],'attributes':_0x1011f9[_0x792d('0xa')],'include':_0x1011f9[_0x792d('0xc')]?_['map'](_0x1011f9['include'],function(_0xe70291){return{'model':db[_0xe70291['model']],'as':_0xe70291['as'],'attributes':_0xe70291[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x792d('0x16')](function(_0x1ef07b){logger[_0x792d('0xf')]('ShowCmHopper',_0x43de90);logger['debug'](_0x792d('0x13'),_0x43de90,JSON['stringify'](_0x1ef07b));_0x26529f(_0x1ef07b);})[_0x792d('0x17')](function(_0x3c3b09){logger[_0x792d('0x12')](_0x792d('0x13'),_0x3c3b09[_0x792d('0x11')],_0x43de90);_0x25317d(_0x413161['error'](0x1f4,_0x3c3b09['message']));});});};exports['CreateCmHopper']=function(_0x414dd3){var _0x127cc1=this;return new Promise(function(_0x1c4818,_0x5a1ed4){return db[_0x792d('0x14')][_0x792d('0x18')](_0x414dd3[_0x792d('0x19')],{'raw':_0x414dd3[_0x792d('0x7')]?_0x414dd3['options']['raw']===undefined?!![]:![]:!![]})[_0x792d('0x16')](function(_0xdcd18a){logger[_0x792d('0xf')](_0x792d('0x1a'),_0x414dd3);logger[_0x792d('0x10')](_0x792d('0x1a'),_0x414dd3,JSON[_0x792d('0x1b')](_0xdcd18a));_0x1c4818(_0xdcd18a);})[_0x792d('0x17')](function(_0x3831c6){logger[_0x792d('0x12')](_0x792d('0x1a'),_0x3831c6[_0x792d('0x11')],_0x414dd3);_0x5a1ed4(_0x127cc1['error'](0x1f4,_0x3831c6['message']));});});};exports[_0x792d('0x1c')]=function(_0x2110ea){var _0xa83355=this;return new Promise(function(_0x314716,_0x16410b){return db[_0x792d('0x14')][_0x792d('0x1d')](_0x2110ea[_0x792d('0x19')],{'raw':_0x2110ea[_0x792d('0x7')]?_0x2110ea[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2110ea['options']?_0x2110ea[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':_0x2110ea[_0x792d('0x7')]?_0x2110ea[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':_0x2110ea[_0x792d('0x7')]?_0x2110ea[_0x792d('0x7')][_0x792d('0xb')]||null:null})[_0x792d('0x16')](function(_0x2f3674){logger[_0x792d('0xf')]('UpdateCmHopper',_0x2110ea);logger[_0x792d('0xf')](_0x792d('0x1e'),JSON['stringify'](_0x2110ea['options'][_0x792d('0x9')]),_0x2110ea['body']['active']);logger[_0x792d('0x10')]('UpdateCmHopper',_0x2110ea,JSON[_0x792d('0x1b')](_0x2f3674));_0x314716(_0x2f3674);})['catch'](function(_0x20ea85){logger[_0x792d('0x12')]('UpdateCmHopper',_0x20ea85[_0x792d('0x11')],_0x2110ea);_0x16410b(_0xa83355[_0x792d('0x12')](0x1f4,_0x20ea85[_0x792d('0x11')]));});});};exports[_0x792d('0x1f')]=function(_0x52b076){var _0x218af4=this;return new Promise(function(_0x1bc0ec,_0x2902dc){return db[_0x792d('0x14')]['destroy']({'where':_0x52b076['options']?_0x52b076['options'][_0x792d('0x9')]||null:null})[_0x792d('0x16')](function(_0x34ef98){logger[_0x792d('0xf')](_0x792d('0x1f'),_0x52b076);logger[_0x792d('0x10')](_0x792d('0x1f'),_0x52b076,JSON[_0x792d('0x1b')](_0x34ef98));_0x1bc0ec(_0x34ef98);})[_0x792d('0x17')](function(_0x44df3d){logger[_0x792d('0x12')](_0x792d('0x1f'),_0x44df3d[_0x792d('0x11')],_0x52b076);_0x2902dc(_0x218af4[_0x792d('0x12')](0x1f4,_0x44df3d[_0x792d('0x11')]));});});};exports[_0x792d('0x20')]=function(_0x233fa6){var _0x5ed0e4=this;return new Promise(function(_0xacc1e7,_0x14b87b){return db['CmContact'][_0x792d('0x21')]()[_0x792d('0x16')](function(_0x281734){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x1ed320){return db[_0x792d('0x14')][_0x792d('0x6')]({'where':_0x233fa6[_0x792d('0x7')]?_0x233fa6['options'][_0x792d('0x9')]||null:null,'attributes':_0x233fa6[_0x792d('0x7')]?_0x233fa6[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':_0x233fa6[_0x792d('0x7')]?_0x233fa6[_0x792d('0x7')][_0x792d('0xb')]||null:null,'order':_0x233fa6[_0x792d('0x7')]?_0x233fa6[_0x792d('0x7')][_0x792d('0x24')]||null:null,'transaction':_0x1ed320,'lock':_0x1ed320[_0x792d('0x25')][_0x792d('0x26')],'include':[{'model':db[_0x792d('0x27')],'as':'Contact','attributes':_[_0x792d('0x28')](_0x281734)},{'model':db[_0x792d('0x29')],'as':'Agent','attributes':['id',_0x792d('0x2a'),_0x792d('0x2b')]}]})['then'](function(_0x484f8b){var _0x2b2b61=[];var _0x3e7948=[];for(var _0x35f256=0x0;_0x35f256<_0x484f8b[_0x792d('0x2c')];_0x35f256+=0x1){var _0x5d5498=_0x484f8b[_0x35f256][_0x792d('0x2d')];if(_0x5d5498===null){_0x2b2b61[_0x792d('0x2e')](_0x484f8b[_0x35f256]['update'](_0x233fa6[_0x792d('0x19')],{'transaction':_0x1ed320}));}else if(!_0x3e7948[_0x792d('0x2f')](_0x5d5498)){_0x3e7948['push'](_0x5d5498);_0x2b2b61[_0x792d('0x2e')](_0x484f8b[_0x35f256]['update'](_0x233fa6['body'],{'transaction':_0x1ed320}));}}return BPromise[_0x792d('0x30')](_0x2b2b61);});})[_0x792d('0x16')](function(_0x3b70e3){logger[_0x792d('0xf')]('GetContactDialer',_0x233fa6);if(_0x3b70e3[_0x792d('0x2c')]>0x0){logger[_0x792d('0xf')](_0x792d('0x31'),_0x3b70e3[0x0]['dataValues']['id'],_0x3b70e3[0x0][_0x792d('0x32')]['ContactId'],_0x3b70e3[0x0]['dataValues']['active']);}logger[_0x792d('0x10')](_0x792d('0x20'),_0x233fa6,JSON[_0x792d('0x1b')](_0x3b70e3));_0xacc1e7(_0x3b70e3);})['catch'](function(_0x1075c2){logger['error'](_0x792d('0x20'),_0x1075c2[_0x792d('0x11')],_0x233fa6);_0x14b87b(_0x5ed0e4[_0x792d('0x12')](0x1f4,_0x1075c2['message']));});});});};exports[_0x792d('0x33')]=function(_0x4e1bb1){var _0x406b43=this;return new Promise(function(_0x43b52f,_0x3e0988){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x3ab2b4){return db[_0x792d('0x34')][_0x792d('0x18')](_0x4e1bb1[_0x792d('0x19')],{'raw':_0x4e1bb1['options']?_0x4e1bb1[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'transaction':_0x3ab2b4})['then'](function(){logger['info'](_0x792d('0x35'),JSON[_0x792d('0x1b')](_0x4e1bb1[_0x792d('0x7')]['where']),_0x4e1bb1['options'][_0x792d('0x9')][_0x792d('0x36')]);return db[_0x792d('0x14')][_0x792d('0x37')]({'where':_0x4e1bb1[_0x792d('0x7')]?_0x4e1bb1[_0x792d('0x7')]['where']||null:null,'transaction':_0x3ab2b4});});})[_0x792d('0x16')](function(_0x25ec64){logger[_0x792d('0xf')](_0x792d('0x33'),_0x4e1bb1);logger[_0x792d('0x10')](_0x792d('0x33'),_0x4e1bb1,JSON['stringify'](_0x25ec64));_0x43b52f(_0x25ec64);})[_0x792d('0x17')](function(_0x407095){logger[_0x792d('0x12')](_0x792d('0x33'),_0x407095['message'],_0x4e1bb1);_0x3e0988(_0x406b43[_0x792d('0x12')](0x1f4,_0x407095['message']));});});};exports[_0x792d('0x38')]=function(_0x553679){var _0x56e4ce=this;return new Promise(function(_0x526ec8,_0x184245){return db[_0x792d('0x14')][_0x792d('0x6')]({'raw':_0x553679['options']?_0x553679[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x553679[_0x792d('0x7')]?_0x553679[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x792d('0x22')]['fn']('IF',db[_0x792d('0x22')]['literal']('`scheduledat`\x20>=\x20'+util[_0x792d('0x39')]('\x22%s\x22',moment()[_0x792d('0x39')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x792d('0x3a')))),'contactsRescheduled']]})[_0x792d('0x16')](function(_0x143465){logger[_0x792d('0xf')](_0x792d('0x38'),_0x553679);logger[_0x792d('0x10')](_0x792d('0x38'),_0x553679,JSON[_0x792d('0x1b')](_0x143465));_0x526ec8(_0x143465);})[_0x792d('0x17')](function(_0x45480c){logger[_0x792d('0x12')](_0x792d('0x38'),_0x45480c['message'],_0x553679);_0x184245(_0x56e4ce[_0x792d('0x12')](0x1f4,_0x45480c[_0x792d('0x11')]));});});};exports[_0x792d('0x3b')]=function(_0x19ce0c){var _0x1063b6=this;return new Promise(function(_0x3ffff2,_0x2238d7){return db[_0x792d('0x27')][_0x792d('0x21')]()[_0x792d('0x16')](function(){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x50a394){return db[_0x792d('0x14')]['findAll']({'where':_0x19ce0c[_0x792d('0x7')]?_0x19ce0c[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':_0x19ce0c[_0x792d('0x7')]?_0x19ce0c[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':0x1,'order':_0x19ce0c['options']?_0x19ce0c[_0x792d('0x7')][_0x792d('0x24')]||null:null,'group':db[_0x792d('0x14')][_0x792d('0x2d')],'transaction':_0x50a394,'lock':_0x50a394[_0x792d('0x25')][_0x792d('0x26')],'include':_0x19ce0c[_0x792d('0x7')]?_0x19ce0c[_0x792d('0x7')]['include']?_[_0x792d('0xe')](_0x19ce0c[_0x792d('0x7')]['include'],function(_0x3e634a){return{'model':db[_0x3e634a['model']],'as':_0x3e634a['as'],'attributes':_0x3e634a[_0x792d('0xa')],'include':_0x3e634a[_0x792d('0xc')]?_[_0x792d('0xe')](_0x3e634a[_0x792d('0xc')],function(_0x3fe55b){return{'model':db[_0x3fe55b[_0x792d('0xd')]],'as':_0x3fe55b['as'],'attributes':_0x3fe55b['attributes'],'include':_0x3fe55b[_0x792d('0xc')]?_['map'](_0x3fe55b['include'],function(_0xf070d){return{'model':db[_0xf070d[_0x792d('0xd')]],'as':_0xf070d['as'],'attributes':_0xf070d[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x792d('0x16')](function(_0x195047){var _0x386e1a=[];for(var _0x159e46=0x0;_0x159e46<_0x195047[_0x792d('0x2c')];_0x159e46+=0x1){_0x386e1a[_0x792d('0x2e')](_0x195047[_0x159e46]['update'](_0x19ce0c[_0x792d('0x19')],{'transaction':_0x50a394}));}return BPromise[_0x792d('0x30')](_0x386e1a);});})[_0x792d('0x16')](function(_0x10bbf8){logger[_0x792d('0xf')](_0x792d('0x3b'),_0x19ce0c);logger['debug'](_0x792d('0x3b'),_0x19ce0c,JSON[_0x792d('0x1b')](_0x10bbf8));_0x3ffff2(_0x10bbf8);})[_0x792d('0x17')](function(_0x5ec648){logger['error']('GetContactRecallMe',_0x5ec648[_0x792d('0x11')],_0x19ce0c);_0x2238d7(_0x1063b6[_0x792d('0x12')](0x1f4,_0x5ec648[_0x792d('0x11')]));});});});};exports[_0x792d('0x3c')]=function(_0x178bf4){var _0x1e22d8=this;return new Promise(function(_0x189e5f,_0x26a8c3){db['CmContact']['describe']()[_0x792d('0x16')](function(_0xe3493e){return db[_0x792d('0x14')][_0x792d('0x6')]({'raw':_0x178bf4[_0x792d('0x7')]?_0x178bf4[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x178bf4['options']?_0x178bf4[_0x792d('0x7')]['where']||null:null,'attributes':_0x178bf4[_0x792d('0x7')]?_0x178bf4['options']['attributes']||null:null,'limit':_0x178bf4['options']?_0x178bf4[_0x792d('0x7')]['limit']||null:null,'include':_0x178bf4[_0x792d('0x7')]?_0x178bf4['options']['include']?_[_0x792d('0xe')](_0x178bf4['options'][_0x792d('0xc')],function(_0x3f733a){return{'model':db[_0x3f733a[_0x792d('0xd')]],'as':_0x3f733a['as'],'attributes':_0x3f733a['as']===_0x792d('0x3d')?_['keys'](_0xe3493e):_0x3f733a[_0x792d('0xa')],'include':_0x3f733a['include']?_['map'](_0x3f733a[_0x792d('0xc')],function(_0x5eda51){return{'model':db[_0x5eda51[_0x792d('0xd')]],'as':_0x5eda51['as'],'attributes':_0x5eda51[_0x792d('0xa')],'include':_0x5eda51[_0x792d('0xc')]?_[_0x792d('0xe')](_0x5eda51[_0x792d('0xc')],function(_0x6352c7){return{'model':db[_0x6352c7[_0x792d('0xd')]],'as':_0x6352c7['as'],'attributes':_0x6352c7[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x792d('0x16')](function(_0x49498e){logger[_0x792d('0xf')](_0x792d('0x5'),_0x178bf4);logger[_0x792d('0x10')](_0x792d('0x5'),_0x178bf4,JSON[_0x792d('0x1b')](_0x49498e));_0x189e5f(_0x49498e);})[_0x792d('0x17')](function(_0x4fe9ce){logger['error'](_0x792d('0x5'),_0x4fe9ce[_0x792d('0x11')],_0x178bf4);_0x26a8c3(_0x1e22d8[_0x792d('0x12')](0x1f4,_0x4fe9ce[_0x792d('0x11')]));});});});};exports['GetContactByPhone']=function(_0x372c8d){var _0x53e03e=this;return new Promise(function(_0xb6fc20,_0x15040c){return db[_0x792d('0x27')][_0x792d('0x3e')]({'raw':!![],'where':{'phone':_0x372c8d[_0x792d('0x7')][_0x792d('0x9')][_0x792d('0x3f')]},'attributes':['id',_0x792d('0x40')],'order':[['id',_0x792d('0x41')]]})[_0x792d('0x16')](function(_0x184b96){logger['info']('getContactByPhone',_0x372c8d);logger[_0x792d('0x10')](_0x792d('0x42'),_0x372c8d,JSON['stringify'](_0x184b96));_0xb6fc20(_0x184b96);})['catch'](function(_0x2b9432){logger['error'](_0x792d('0x42'),_0x2b9432[_0x792d('0x11')],_0x372c8d);_0x15040c(_0x53e03e[_0x792d('0x12')](0x1f4,_0x2b9432['message']));});});};exports['ResetActiveCalls']=function(_0x44a24e){var _0x199e1d=this;return new Promise(function(_0x3eb3b5,_0x2ae679){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x4a5102){var _0x388de8=_0x44a24e[_0x792d('0x7')]&&_0x44a24e[_0x792d('0x7')][_0x792d('0x9')]?_0x44a24e['options'][_0x792d('0x9')]:{};return db['CmHopper'][_0x792d('0x1d')](_0x44a24e[_0x792d('0x19')],{'where':_0x388de8,'transaction':_0x4a5102})[_0x792d('0x16')](function(_0x36fd06){logger[_0x792d('0xf')](_0x792d('0x43'),_0x44a24e);logger[_0x792d('0x10')](_0x792d('0x43'),_0x44a24e,JSON[_0x792d('0x1b')](_0x36fd06));_0x3eb3b5(_0x36fd06);})[_0x792d('0x17')](function(_0x5dbc24){logger[_0x792d('0x12')](_0x792d('0x43'),_0x5dbc24[_0x792d('0x11')],_0x44a24e);_0x2ae679(_0x199e1d[_0x792d('0x12')](0x1f4,_0x5dbc24['message']));});});});};exports[_0x792d('0x44')]=function(_0xc060d){var _0x147c56=this;var _0x4a18ca=_0xc060d[_0x792d('0x19')][_0x792d('0x9')][_0x792d('0x45')];var _0x21b0dc=_0xc060d[_0x792d('0x19')]['where'][_0x792d('0x46')];var _0x2277f6=_0xc060d['body']['where'][_0x792d('0x47')];return new Promise(function(_0x2d6641,_0x1a5111){return db[_0x792d('0x14')]['findAll']({'where':{'voiceQueueId':{'$in':_0x4a18ca},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x792d('0x22')][_0x792d('0x48')](_0x792d('0x49')+_0x21b0dc+_0x792d('0x4a')),'$gt':db[_0x792d('0x22')]['literal']('NOW()')}},'UserId':{'$in':_0x2277f6}},'include':[{'model':db[_0x792d('0x27')],'as':_0x792d('0x3d')},{'model':db[_0x792d('0x29')],'as':_0x792d('0x4b'),'attributes':['id','name','voicePause']},{'model':db['CmList'],'as':'List'}]})[_0x792d('0x16')](function(_0x2ff85a){if(_0x2ff85a['length']>0x0){return db['sequelize'][_0x792d('0x23')](function(_0x342930){return db[_0x792d('0x14')][_0x792d('0x1d')]({'recallmeNotifiedDate':db['sequelize'][_0x792d('0x48')]('NOW()')},{'where':{'id':{'$in':_[_0x792d('0xe')](_0x2ff85a,'id')}},'transaction':_0x342930})[_0x792d('0x16')](function(){_0x2d6641(_0x2ff85a);})[_0x792d('0x17')](function(_0x3671f0){logger[_0x792d('0x12')](_0x792d('0x44'),_0x3671f0[_0x792d('0x11')],_0xc060d);_0x1a5111(_0x147c56[_0x792d('0x12')](0x1f4,_0x3671f0[_0x792d('0x11')]));});})['catch'](function(_0x599437){logger[_0x792d('0x12')](_0x792d('0x44'),_0x599437[_0x792d('0x11')],_0xc060d);_0x1a5111(_0x147c56['error'](0x1f4,_0x599437[_0x792d('0x11')]));});}else{_0x2d6641(_0x2ff85a);}});});};
\ No newline at end of file
+var _0x2567=['CmList','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','User','Agent','name','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','describe','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause'];(function(_0x2bfc17,_0x1c5126){var _0x25d51c=function(_0x5f103a){while(--_0x5f103a){_0x2bfc17['push'](_0x2bfc17['shift']());}};_0x25d51c(++_0x1c5126);}(_0x2567,0x14a));var _0x7256=function(_0x324a49,_0x205ed5){_0x324a49=_0x324a49-0x0;var _0x43307b=_0x2567[_0x324a49];return _0x43307b;};'use strict';var _=require(_0x7256('0x0'));var util=require(_0x7256('0x1'));var moment=require(_0x7256('0x2'));var BPromise=require(_0x7256('0x3'));var db=require(_0x7256('0x4'))['db'];var logger=require(_0x7256('0x5'))(_0x7256('0x6'));exports[_0x7256('0x7')]=function(_0x13255f){var _0x35afdb=this;return new Promise(function(_0x3e55d6,_0x1f8086){return db[_0x7256('0x8')][_0x7256('0x9')]({'raw':_0x13255f[_0x7256('0xa')]?_0x13255f['options'][_0x7256('0xb')]===undefined?!![]:![]:!![],'where':_0x13255f[_0x7256('0xa')]?_0x13255f['options'][_0x7256('0xc')]||null:null,'attributes':_0x13255f[_0x7256('0xa')]?_0x13255f[_0x7256('0xa')][_0x7256('0xd')]||null:null,'limit':_0x13255f[_0x7256('0xa')]?_0x13255f[_0x7256('0xa')][_0x7256('0xe')]||null:null,'include':_0x13255f[_0x7256('0xa')]?_0x13255f[_0x7256('0xa')][_0x7256('0xf')]?_[_0x7256('0x10')](_0x13255f[_0x7256('0xa')][_0x7256('0xf')],function(_0xf27c31){return{'model':db[_0xf27c31['model']],'as':_0xf27c31['as'],'attributes':_0xf27c31['attributes'],'include':_0xf27c31[_0x7256('0xf')]?_[_0x7256('0x10')](_0xf27c31[_0x7256('0xf')],function(_0x21eb0f){return{'model':db[_0x21eb0f['model']],'as':_0x21eb0f['as'],'attributes':_0x21eb0f[_0x7256('0xd')],'include':_0x21eb0f[_0x7256('0xf')]?_['map'](_0x21eb0f[_0x7256('0xf')],function(_0x64cfb4){return{'model':db[_0x64cfb4[_0x7256('0x11')]],'as':_0x64cfb4['as'],'attributes':_0x64cfb4[_0x7256('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0x5c6081){logger[_0x7256('0x13')](_0x7256('0x7'),_0x13255f);logger[_0x7256('0x14')](_0x7256('0x7'),_0x13255f,JSON[_0x7256('0x15')](_0x5c6081));_0x3e55d6(_0x5c6081);})[_0x7256('0x16')](function(_0x13277a){logger[_0x7256('0x17')](_0x7256('0x7'),_0x13277a[_0x7256('0x18')],_0x13255f);_0x1f8086(_0x35afdb[_0x7256('0x17')](0x1f4,_0x13277a[_0x7256('0x18')]));});});};exports[_0x7256('0x19')]=function(_0x4a6916){var _0x3e9f3d=this;return new Promise(function(_0x2bddef,_0x46c337){return db[_0x7256('0x8')][_0x7256('0x1a')]({'raw':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![],'where':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xc')]||null:null,'attributes':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xd')]||null:null,'include':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xf')]?_['map'](_0x4a6916[_0x7256('0xa')][_0x7256('0xf')],function(_0xae0874){return{'model':db[_0xae0874[_0x7256('0x11')]],'as':_0xae0874['as'],'attributes':_0xae0874[_0x7256('0xd')],'include':_0xae0874[_0x7256('0xf')]?_[_0x7256('0x10')](_0xae0874['include'],function(_0x47f78d){return{'model':db[_0x47f78d[_0x7256('0x11')]],'as':_0x47f78d['as'],'attributes':_0x47f78d[_0x7256('0xd')],'include':_0x47f78d[_0x7256('0xf')]?_[_0x7256('0x10')](_0x47f78d['include'],function(_0x35070a){return{'model':db[_0x35070a['model']],'as':_0x35070a['as'],'attributes':_0x35070a[_0x7256('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0x5a6659){logger[_0x7256('0x13')](_0x7256('0x19'),_0x4a6916);logger[_0x7256('0x14')](_0x7256('0x19'),_0x4a6916,JSON[_0x7256('0x15')](_0x5a6659));_0x2bddef(_0x5a6659);})[_0x7256('0x16')](function(_0x3c7c6b){logger[_0x7256('0x17')](_0x7256('0x19'),_0x3c7c6b[_0x7256('0x18')],_0x4a6916);_0x46c337(_0x3e9f3d['error'](0x1f4,_0x3c7c6b[_0x7256('0x18')]));});});};exports[_0x7256('0x1b')]=function(_0x4209d0){var _0x3eb620=this;return new Promise(function(_0x4bd27d,_0x3d75a8){return db[_0x7256('0x8')][_0x7256('0x1c')](_0x4209d0['body'],{'raw':_0x4209d0[_0x7256('0xa')]?_0x4209d0[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![]})[_0x7256('0x12')](function(_0x25fd41){logger[_0x7256('0x13')]('CreateCmHopper',_0x4209d0);logger[_0x7256('0x14')](_0x7256('0x1b'),_0x4209d0,JSON[_0x7256('0x15')](_0x25fd41));_0x4bd27d(_0x25fd41);})[_0x7256('0x16')](function(_0x1a425c){logger[_0x7256('0x17')](_0x7256('0x1b'),_0x1a425c['message'],_0x4209d0);_0x3d75a8(_0x3eb620[_0x7256('0x17')](0x1f4,_0x1a425c[_0x7256('0x18')]));});});};exports[_0x7256('0x1d')]=function(_0x327582){var _0x205a37=this;return new Promise(function(_0xdf18e5,_0xa00550){return db[_0x7256('0x8')]['update'](_0x327582[_0x7256('0x1e')],{'raw':_0x327582[_0x7256('0xa')]?_0x327582[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x327582[_0x7256('0xa')]?_0x327582['options'][_0x7256('0xc')]||null:null,'attributes':_0x327582[_0x7256('0xa')]?_0x327582[_0x7256('0xa')]['attributes']||null:null,'limit':_0x327582[_0x7256('0xa')]?_0x327582[_0x7256('0xa')][_0x7256('0xe')]||null:null})[_0x7256('0x12')](function(_0x19ab65){logger[_0x7256('0x13')]('UpdateCmHopper',_0x327582);logger[_0x7256('0x13')](_0x7256('0x1f'),JSON['stringify'](_0x327582[_0x7256('0xa')][_0x7256('0xc')]),_0x327582['body'][_0x7256('0x20')]);logger['debug']('UpdateCmHopper',_0x327582,JSON[_0x7256('0x15')](_0x19ab65));_0xdf18e5(_0x19ab65);})[_0x7256('0x16')](function(_0x47949d){logger['error'](_0x7256('0x1d'),_0x47949d[_0x7256('0x18')],_0x327582);_0xa00550(_0x205a37[_0x7256('0x17')](0x1f4,_0x47949d['message']));});});};exports[_0x7256('0x21')]=function(_0x3bded0){var _0x201a03=this;return new Promise(function(_0x4cdf3d,_0x164ebe){return db[_0x7256('0x8')][_0x7256('0x22')]({'where':_0x3bded0[_0x7256('0xa')]?_0x3bded0[_0x7256('0xa')]['where']||null:null})['then'](function(_0x2f6aec){logger[_0x7256('0x13')](_0x7256('0x21'),_0x3bded0);logger[_0x7256('0x14')](_0x7256('0x21'),_0x3bded0,JSON['stringify'](_0x2f6aec));_0x4cdf3d(_0x2f6aec);})[_0x7256('0x16')](function(_0x91e05c){logger[_0x7256('0x17')](_0x7256('0x21'),_0x91e05c[_0x7256('0x18')],_0x3bded0);_0x164ebe(_0x201a03['error'](0x1f4,_0x91e05c[_0x7256('0x18')]));});});};exports[_0x7256('0x23')]=function(_0x7f8086){var _0x4a4b80=this;return new Promise(function(_0x487381,_0x6b69fa){return db[_0x7256('0x24')]['describe']()[_0x7256('0x12')](function(_0x394071){return db[_0x7256('0x25')][_0x7256('0x26')](function(_0x1bf702){return db[_0x7256('0x8')][_0x7256('0x9')]({'where':_0x7f8086[_0x7256('0xa')]?_0x7f8086[_0x7256('0xa')]['where']||null:null,'attributes':_0x7f8086[_0x7256('0xa')]?_0x7f8086['options'][_0x7256('0xd')]||null:null,'limit':_0x7f8086['options']?_0x7f8086[_0x7256('0xa')][_0x7256('0xe')]||null:null,'order':_0x7f8086[_0x7256('0xa')]?_0x7f8086[_0x7256('0xa')][_0x7256('0x27')]||null:null,'transaction':_0x1bf702,'lock':_0x1bf702[_0x7256('0x28')][_0x7256('0x29')],'include':[{'model':db['CmContact'],'as':_0x7256('0x2a'),'attributes':_['keys'](_0x394071)},{'model':db[_0x7256('0x2b')],'as':_0x7256('0x2c'),'attributes':['id',_0x7256('0x2d'),'voicePause']}]})[_0x7256('0x12')](function(_0x52281b){var _0x1dd65b=[];var _0x258eb2=[];for(var _0x25143b=0x0;_0x25143b<_0x52281b[_0x7256('0x2e')];_0x25143b+=0x1){var _0x348113=_0x52281b[_0x25143b][_0x7256('0x2f')];if(_0x348113===null){_0x1dd65b[_0x7256('0x30')](_0x52281b[_0x25143b][_0x7256('0x31')](_0x7f8086['body'],{'transaction':_0x1bf702}));}else if(!_0x258eb2[_0x7256('0x32')](_0x348113)){_0x258eb2[_0x7256('0x30')](_0x348113);_0x1dd65b[_0x7256('0x30')](_0x52281b[_0x25143b]['update'](_0x7f8086[_0x7256('0x1e')],{'transaction':_0x1bf702}));}}return BPromise[_0x7256('0x33')](_0x1dd65b);});})['then'](function(_0x1b0718){logger[_0x7256('0x13')](_0x7256('0x23'),_0x7f8086);if(_0x1b0718[_0x7256('0x2e')]>0x0){logger[_0x7256('0x13')](_0x7256('0x34'),_0x1b0718[0x0][_0x7256('0x35')]['id'],_0x1b0718[0x0][_0x7256('0x35')]['ContactId'],_0x1b0718[0x0][_0x7256('0x35')][_0x7256('0x20')]);}logger['debug']('GetContactDialer',_0x7f8086,JSON[_0x7256('0x15')](_0x1b0718));_0x487381(_0x1b0718);})[_0x7256('0x16')](function(_0x564ef6){logger[_0x7256('0x17')](_0x7256('0x23'),_0x564ef6[_0x7256('0x18')],_0x7f8086);_0x6b69fa(_0x4a4b80['error'](0x1f4,_0x564ef6[_0x7256('0x18')]));});});});};exports[_0x7256('0x36')]=function(_0x298d71){var _0x875862=this;return new Promise(function(_0x5d5a04,_0x59e19e){return db[_0x7256('0x25')]['transaction'](function(_0x4d7f61){return db[_0x7256('0x37')]['create'](_0x298d71[_0x7256('0x1e')],{'raw':_0x298d71[_0x7256('0xa')]?_0x298d71[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![],'transaction':_0x4d7f61})[_0x7256('0x12')](function(){logger['info'](_0x7256('0x38'),JSON[_0x7256('0x15')](_0x298d71[_0x7256('0xa')][_0x7256('0xc')]),_0x298d71[_0x7256('0xa')]['where'][_0x7256('0x20')]);return db[_0x7256('0x8')][_0x7256('0x22')]({'where':_0x298d71['options']?_0x298d71[_0x7256('0xa')][_0x7256('0xc')]||null:null,'transaction':_0x4d7f61});});})['then'](function(_0x52ce3a){logger[_0x7256('0x13')](_0x7256('0x36'),_0x298d71);logger[_0x7256('0x14')](_0x7256('0x36'),_0x298d71,JSON[_0x7256('0x15')](_0x52ce3a));_0x5d5a04(_0x52ce3a);})[_0x7256('0x16')](function(_0x56b687){logger[_0x7256('0x17')](_0x7256('0x36'),_0x56b687['message'],_0x298d71);_0x59e19e(_0x875862[_0x7256('0x17')](0x1f4,_0x56b687[_0x7256('0x18')]));});});};exports[_0x7256('0x39')]=function(_0x40cbbe){var _0x1dde99=this;return new Promise(function(_0xc91ab1,_0x49ecbc){return db[_0x7256('0x8')][_0x7256('0x9')]({'raw':_0x40cbbe['options']?_0x40cbbe[_0x7256('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x40cbbe['options']?_0x40cbbe[_0x7256('0xa')][_0x7256('0xc')]||null:null,'attributes':[[db[_0x7256('0x25')]['fn'](_0x7256('0x3a'),db[_0x7256('0x25')]['fn']('IF',db[_0x7256('0x25')][_0x7256('0x3b')](_0x7256('0x3c')+util[_0x7256('0x3d')]('\x22%s\x22',moment()[_0x7256('0x3d')](_0x7256('0x3e')))+_0x7256('0x3f')))),_0x7256('0x40')]]})[_0x7256('0x12')](function(_0x59aeca){logger[_0x7256('0x13')](_0x7256('0x39'),_0x40cbbe);logger[_0x7256('0x14')]('CountReScheduled',_0x40cbbe,JSON['stringify'](_0x59aeca));_0xc91ab1(_0x59aeca);})[_0x7256('0x16')](function(_0x32976f){logger[_0x7256('0x17')](_0x7256('0x39'),_0x32976f['message'],_0x40cbbe);_0x49ecbc(_0x1dde99[_0x7256('0x17')](0x1f4,_0x32976f[_0x7256('0x18')]));});});};exports['GetContactRecallMe']=function(_0xcc0df1){var _0x2db158=this;return new Promise(function(_0x4a441e,_0xe9f20c){return db['CmContact'][_0x7256('0x41')]()['then'](function(){return db[_0x7256('0x25')][_0x7256('0x26')](function(_0x52ff9e){return db[_0x7256('0x8')][_0x7256('0x9')]({'where':_0xcc0df1[_0x7256('0xa')]?_0xcc0df1[_0x7256('0xa')][_0x7256('0xc')]||null:null,'attributes':_0xcc0df1[_0x7256('0xa')]?_0xcc0df1[_0x7256('0xa')][_0x7256('0xd')]||null:null,'limit':0x1,'order':_0xcc0df1[_0x7256('0xa')]?_0xcc0df1['options'][_0x7256('0x27')]||null:null,'group':db[_0x7256('0x8')][_0x7256('0x2f')],'transaction':_0x52ff9e,'lock':_0x52ff9e[_0x7256('0x28')]['UPDATE'],'include':_0xcc0df1['options']?_0xcc0df1['options']['include']?_[_0x7256('0x10')](_0xcc0df1[_0x7256('0xa')][_0x7256('0xf')],function(_0x242302){return{'model':db[_0x242302[_0x7256('0x11')]],'as':_0x242302['as'],'attributes':_0x242302[_0x7256('0xd')],'include':_0x242302[_0x7256('0xf')]?_[_0x7256('0x10')](_0x242302['include'],function(_0xdcb751){return{'model':db[_0xdcb751['model']],'as':_0xdcb751['as'],'attributes':_0xdcb751[_0x7256('0xd')],'include':_0xdcb751['include']?_[_0x7256('0x10')](_0xdcb751[_0x7256('0xf')],function(_0x4bcb6f){return{'model':db[_0x4bcb6f[_0x7256('0x11')]],'as':_0x4bcb6f['as'],'attributes':_0x4bcb6f[_0x7256('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0x193e80){var _0x40dcff=[];for(var _0x2ccb5e=0x0;_0x2ccb5e<_0x193e80['length'];_0x2ccb5e+=0x1){_0x40dcff[_0x7256('0x30')](_0x193e80[_0x2ccb5e][_0x7256('0x31')](_0xcc0df1['body'],{'transaction':_0x52ff9e}));}return BPromise[_0x7256('0x33')](_0x40dcff);});})['then'](function(_0x37affb){logger[_0x7256('0x13')](_0x7256('0x42'),_0xcc0df1);logger[_0x7256('0x14')](_0x7256('0x42'),_0xcc0df1,JSON[_0x7256('0x15')](_0x37affb));_0x4a441e(_0x37affb);})[_0x7256('0x16')](function(_0x262527){logger['error'](_0x7256('0x42'),_0x262527[_0x7256('0x18')],_0xcc0df1);_0xe9f20c(_0x2db158[_0x7256('0x17')](0x1f4,_0x262527[_0x7256('0x18')]));});});});};exports[_0x7256('0x43')]=function(_0x3e550b){var _0x53ed45=this;return new Promise(function(_0x14018d,_0x58f596){db['CmContact'][_0x7256('0x41')]()[_0x7256('0x12')](function(_0x5ae2dc){return db[_0x7256('0x8')][_0x7256('0x9')]({'raw':_0x3e550b[_0x7256('0xa')]?_0x3e550b['options'][_0x7256('0xb')]===undefined?!![]:![]:!![],'where':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')]['where']||null:null,'attributes':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')]['attributes']||null:null,'limit':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')][_0x7256('0xe')]||null:null,'include':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')][_0x7256('0xf')]?_[_0x7256('0x10')](_0x3e550b['options']['include'],function(_0x8b72bc){return{'model':db[_0x8b72bc[_0x7256('0x11')]],'as':_0x8b72bc['as'],'attributes':_0x8b72bc['as']===_0x7256('0x2a')?_[_0x7256('0x44')](_0x5ae2dc):_0x8b72bc[_0x7256('0xd')],'include':_0x8b72bc[_0x7256('0xf')]?_['map'](_0x8b72bc[_0x7256('0xf')],function(_0xedf33b){return{'model':db[_0xedf33b[_0x7256('0x11')]],'as':_0xedf33b['as'],'attributes':_0xedf33b[_0x7256('0xd')],'include':_0xedf33b[_0x7256('0xf')]?_[_0x7256('0x10')](_0xedf33b['include'],function(_0x36c5d3){return{'model':db[_0x36c5d3[_0x7256('0x11')]],'as':_0x36c5d3['as'],'attributes':_0x36c5d3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0xae19fc){logger[_0x7256('0x13')](_0x7256('0x7'),_0x3e550b);logger[_0x7256('0x14')](_0x7256('0x7'),_0x3e550b,JSON[_0x7256('0x15')](_0xae19fc));_0x14018d(_0xae19fc);})[_0x7256('0x16')](function(_0x48d6a9){logger['error'](_0x7256('0x7'),_0x48d6a9['message'],_0x3e550b);_0x58f596(_0x53ed45[_0x7256('0x17')](0x1f4,_0x48d6a9[_0x7256('0x18')]));});});});};exports[_0x7256('0x45')]=function(_0x8b5ab0){var _0x5d1c40=this;return new Promise(function(_0xb5dac5,_0x2e7a88){return db[_0x7256('0x24')][_0x7256('0x46')]({'raw':!![],'where':{'phone':_0x8b5ab0['options'][_0x7256('0xc')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0x7256('0x47')]]})['then'](function(_0x18e1ce){logger[_0x7256('0x13')](_0x7256('0x48'),_0x8b5ab0);logger[_0x7256('0x14')]('getContactByPhone',_0x8b5ab0,JSON[_0x7256('0x15')](_0x18e1ce));_0xb5dac5(_0x18e1ce);})[_0x7256('0x16')](function(_0x123605){logger[_0x7256('0x17')](_0x7256('0x48'),_0x123605[_0x7256('0x18')],_0x8b5ab0);_0x2e7a88(_0x5d1c40[_0x7256('0x17')](0x1f4,_0x123605[_0x7256('0x18')]));});});};exports['ResetActiveCalls']=function(_0x4c31b3){var _0x159bd8=this;return new Promise(function(_0x289b2f,_0x23ed38){return db['sequelize']['transaction'](function(_0xc0083f){var _0x31f4dc=_0x4c31b3['options']&&_0x4c31b3[_0x7256('0xa')][_0x7256('0xc')]?_0x4c31b3['options'][_0x7256('0xc')]:{};return db[_0x7256('0x8')][_0x7256('0x31')](_0x4c31b3[_0x7256('0x1e')],{'where':_0x31f4dc,'transaction':_0xc0083f})[_0x7256('0x12')](function(_0x3248cd){logger[_0x7256('0x13')](_0x7256('0x49'),_0x4c31b3);logger['debug'](_0x7256('0x49'),_0x4c31b3,JSON['stringify'](_0x3248cd));_0x289b2f(_0x3248cd);})[_0x7256('0x16')](function(_0x454abe){logger[_0x7256('0x17')](_0x7256('0x49'),_0x454abe['message'],_0x4c31b3);_0x23ed38(_0x159bd8[_0x7256('0x17')](0x1f4,_0x454abe[_0x7256('0x18')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x134175){var _0x21715d=this;var _0x57a117=_0x134175[_0x7256('0x1e')][_0x7256('0xc')]['voiceQueueIds'];var _0x2a17fd=_0x134175[_0x7256('0x1e')][_0x7256('0xc')][_0x7256('0x4a')];var _0x4b6c88=_0x134175['body']['where'][_0x7256('0x4b')];return new Promise(function(_0x17dcb1,_0x1d7063){return db[_0x7256('0x8')][_0x7256('0x9')]({'where':{'voiceQueueId':{'$in':_0x57a117},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7256('0x25')][_0x7256('0x3b')](_0x7256('0x4c')+_0x2a17fd+_0x7256('0x4d')),'$gt':db[_0x7256('0x25')][_0x7256('0x3b')](_0x7256('0x4e'))}},'UserId':{'$in':_0x4b6c88}},'include':[{'model':db[_0x7256('0x24')],'as':_0x7256('0x2a')},{'model':db[_0x7256('0x2b')],'as':_0x7256('0x2c'),'attributes':['id','name',_0x7256('0x4f')]},{'model':db[_0x7256('0x50')],'as':'List'}]})[_0x7256('0x12')](function(_0x4edad6){if(_0x4edad6[_0x7256('0x2e')]>0x0){return db[_0x7256('0x25')]['transaction'](function(_0x7a4f32){return db[_0x7256('0x8')][_0x7256('0x31')]({'recallmeNotifiedDate':db[_0x7256('0x25')][_0x7256('0x3b')]('NOW()')},{'where':{'id':{'$in':_['map'](_0x4edad6,'id')}},'transaction':_0x7a4f32})[_0x7256('0x12')](function(){_0x17dcb1(_0x4edad6);})['catch'](function(_0x436bb5){logger[_0x7256('0x17')](_0x7256('0x51'),_0x436bb5[_0x7256('0x18')],_0x134175);_0x1d7063(_0x21715d['error'](0x1f4,_0x436bb5['message']));});})[_0x7256('0x16')](function(_0x153012){logger[_0x7256('0x17')](_0x7256('0x51'),_0x153012[_0x7256('0x18')],_0x134175);_0x1d7063(_0x21715d['error'](0x1f4,_0x153012[_0x7256('0x18')]));});}else{_0x17dcb1(_0x4edad6);}});});};
\ No newline at end of file