Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
index 9b22612..ac305e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa914=['GetContactDialer','describe','findAll','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','order','GetCmHopperPreview','limit','GetContactByPhone','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','where','attributes','include','model','map','then','debug','stringify','catch','error','message','ShowCmHopper','find','raw','info','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xa914,0x83));var _0x4a91=function(_0x366145,_0xed43b){_0x366145=_0x366145-0x0;var _0x358077=_0xa914[_0x366145];return _0x358077;};'use strict';var _=require('lodash');var util=require(_0x4a91('0x0'));var moment=require(_0x4a91('0x1'));var BPromise=require(_0x4a91('0x2'));var db=require(_0x4a91('0x3'))['db'];var logger=require(_0x4a91('0x4'))(_0x4a91('0x5'));exports[_0x4a91('0x6')]=function(_0x221f5c){var _0x1449af=this;return new Promise(function(_0x506584,_0x55b408){return db[_0x4a91('0x7')]['findAll']({'raw':_0x221f5c[_0x4a91('0x8')]?_0x221f5c['options']['raw']===undefined?!![]:![]:!![],'where':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'limit':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')]['limit']||null:null,'include':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')][_0x4a91('0xb')]?_['map'](_0x221f5c[_0x4a91('0x8')]['include'],function(_0x53d17d){return{'model':db[_0x53d17d[_0x4a91('0xc')]],'as':_0x53d17d['as'],'attributes':_0x53d17d[_0x4a91('0xa')],'include':_0x53d17d[_0x4a91('0xb')]?_['map'](_0x53d17d['include'],function(_0x4838a5){return{'model':db[_0x4838a5[_0x4a91('0xc')]],'as':_0x4838a5['as'],'attributes':_0x4838a5['attributes'],'include':_0x4838a5[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x4838a5[_0x4a91('0xb')],function(_0x4bc140){return{'model':db[_0x4bc140[_0x4a91('0xc')]],'as':_0x4bc140['as'],'attributes':_0x4bc140[_0x4a91('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x294c4c){logger['info'](_0x4a91('0x6'),_0x221f5c);logger[_0x4a91('0xf')](_0x4a91('0x6'),_0x221f5c,JSON[_0x4a91('0x10')](_0x294c4c));_0x506584(_0x294c4c);})[_0x4a91('0x11')](function(_0x874f50){logger[_0x4a91('0x12')](_0x4a91('0x6'),_0x874f50['message'],_0x221f5c);_0x55b408(_0x1449af[_0x4a91('0x12')](0x1f4,_0x874f50[_0x4a91('0x13')]));});});};exports[_0x4a91('0x14')]=function(_0x6d9a08){var _0x25aa9f=this;return new Promise(function(_0x5c9351,_0x481d68){return db['CmHopper'][_0x4a91('0x15')]({'raw':_0x6d9a08[_0x4a91('0x8')]?_0x6d9a08[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![],'where':_0x6d9a08['options']?_0x6d9a08[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x6d9a08[_0x4a91('0x8')]?_0x6d9a08[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'include':_0x6d9a08[_0x4a91('0x8')]?_0x6d9a08['options'][_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x6d9a08['options']['include'],function(_0x483f75){return{'model':db[_0x483f75['model']],'as':_0x483f75['as'],'attributes':_0x483f75['attributes'],'include':_0x483f75[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x483f75[_0x4a91('0xb')],function(_0x2e5a40){return{'model':db[_0x2e5a40[_0x4a91('0xc')]],'as':_0x2e5a40['as'],'attributes':_0x2e5a40[_0x4a91('0xa')],'include':_0x2e5a40[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x2e5a40[_0x4a91('0xb')],function(_0x178e1d){return{'model':db[_0x178e1d[_0x4a91('0xc')]],'as':_0x178e1d['as'],'attributes':_0x178e1d[_0x4a91('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x563e22){logger[_0x4a91('0x17')](_0x4a91('0x14'),_0x6d9a08);logger[_0x4a91('0xf')](_0x4a91('0x14'),_0x6d9a08,JSON['stringify'](_0x563e22));_0x5c9351(_0x563e22);})['catch'](function(_0x6470f6){logger['error'](_0x4a91('0x14'),_0x6470f6[_0x4a91('0x13')],_0x6d9a08);_0x481d68(_0x25aa9f['error'](0x1f4,_0x6470f6[_0x4a91('0x13')]));});});};exports[_0x4a91('0x18')]=function(_0x526518){var _0x4a1035=this;return new Promise(function(_0x41d173,_0x25bd25){return db['CmHopper'][_0x4a91('0x19')](_0x526518[_0x4a91('0x1a')],{'raw':_0x526518[_0x4a91('0x8')]?_0x526518[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![]})[_0x4a91('0xe')](function(_0x28212f){logger[_0x4a91('0x17')](_0x4a91('0x18'),_0x526518);logger[_0x4a91('0xf')]('CreateCmHopper',_0x526518,JSON['stringify'](_0x28212f));_0x41d173(_0x28212f);})[_0x4a91('0x11')](function(_0x3a2ccb){logger[_0x4a91('0x12')](_0x4a91('0x18'),_0x3a2ccb[_0x4a91('0x13')],_0x526518);_0x25bd25(_0x4a1035['error'](0x1f4,_0x3a2ccb[_0x4a91('0x13')]));});});};exports[_0x4a91('0x1b')]=function(_0x33cfc1){var _0x2dc576=this;return new Promise(function(_0x421b41,_0x413380){return db[_0x4a91('0x7')][_0x4a91('0x1c')](_0x33cfc1['body'],{'raw':_0x33cfc1['options']?_0x33cfc1[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33cfc1[_0x4a91('0x8')]?_0x33cfc1[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x33cfc1['options']?_0x33cfc1[_0x4a91('0x8')]['attributes']||null:null,'limit':_0x33cfc1[_0x4a91('0x8')]?_0x33cfc1[_0x4a91('0x8')]['limit']||null:null})[_0x4a91('0xe')](function(_0x340d50){logger['info'](_0x4a91('0x1b'),_0x33cfc1);logger[_0x4a91('0x17')](_0x4a91('0x1d'),JSON[_0x4a91('0x10')](_0x33cfc1[_0x4a91('0x8')][_0x4a91('0x9')]),_0x33cfc1[_0x4a91('0x1a')][_0x4a91('0x1e')]);logger[_0x4a91('0xf')]('UpdateCmHopper',_0x33cfc1,JSON[_0x4a91('0x10')](_0x340d50));_0x421b41(_0x340d50);})['catch'](function(_0x4b6351){logger[_0x4a91('0x12')](_0x4a91('0x1b'),_0x4b6351[_0x4a91('0x13')],_0x33cfc1);_0x413380(_0x2dc576[_0x4a91('0x12')](0x1f4,_0x4b6351[_0x4a91('0x13')]));});});};exports[_0x4a91('0x1f')]=function(_0x2db916){var _0x26e189=this;return new Promise(function(_0x5285cc,_0x1c854f){return db[_0x4a91('0x7')][_0x4a91('0x20')]({'where':_0x2db916[_0x4a91('0x8')]?_0x2db916[_0x4a91('0x8')][_0x4a91('0x9')]||null:null})[_0x4a91('0xe')](function(_0x131a01){logger[_0x4a91('0x17')](_0x4a91('0x1f'),_0x2db916);logger[_0x4a91('0xf')](_0x4a91('0x1f'),_0x2db916,JSON[_0x4a91('0x10')](_0x131a01));_0x5285cc(_0x131a01);})[_0x4a91('0x11')](function(_0x2f62b4){logger[_0x4a91('0x12')](_0x4a91('0x1f'),_0x2f62b4[_0x4a91('0x13')],_0x2db916);_0x1c854f(_0x26e189[_0x4a91('0x12')](0x1f4,_0x2f62b4[_0x4a91('0x13')]));});});};exports[_0x4a91('0x21')]=function(_0x318310){var _0x5b7853=this;return new Promise(function(_0x5766c7,_0x563b79){return db['CmContact'][_0x4a91('0x22')]()[_0x4a91('0xe')](function(_0xaca0d3){return db['sequelize']['transaction'](function(_0x3d6dab){return db['CmHopper'][_0x4a91('0x23')]({'where':_0x318310[_0x4a91('0x8')]?_0x318310[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x318310[_0x4a91('0x8')]?_0x318310['options']['attributes']||null:null,'limit':_0x318310['options']?_0x318310[_0x4a91('0x8')]['limit']||null:null,'order':_0x318310['options']?_0x318310[_0x4a91('0x8')]['order']||null:null,'transaction':_0x3d6dab,'lock':_0x3d6dab[_0x4a91('0x24')][_0x4a91('0x25')],'include':[{'model':db[_0x4a91('0x26')],'as':_0x4a91('0x27'),'attributes':_[_0x4a91('0x28')](_0xaca0d3)},{'model':db[_0x4a91('0x29')],'as':_0x4a91('0x2a'),'attributes':['id',_0x4a91('0x2b'),_0x4a91('0x2c')]}]})[_0x4a91('0xe')](function(_0x5e2437){var _0x4aa25f=[];var _0x450667=[];for(var _0x2e3ad8=0x0;_0x2e3ad8<_0x5e2437[_0x4a91('0x2d')];_0x2e3ad8+=0x1){var _0x37bd6e=_0x5e2437[_0x2e3ad8][_0x4a91('0x2e')];if(_0x37bd6e===null){_0x4aa25f[_0x4a91('0x2f')](_0x5e2437[_0x2e3ad8][_0x4a91('0x1c')](_0x318310[_0x4a91('0x1a')],{'transaction':_0x3d6dab}));}else if(!_0x450667[_0x4a91('0x30')](_0x37bd6e)){_0x450667['push'](_0x37bd6e);_0x4aa25f['push'](_0x5e2437[_0x2e3ad8][_0x4a91('0x1c')](_0x318310[_0x4a91('0x1a')],{'transaction':_0x3d6dab}));}}return BPromise[_0x4a91('0x31')](_0x4aa25f);});})['then'](function(_0x54f54f){logger[_0x4a91('0x17')](_0x4a91('0x21'),_0x318310);if(_0x54f54f['length']>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x54f54f[0x0][_0x4a91('0x32')]['id'],_0x54f54f[0x0][_0x4a91('0x32')][_0x4a91('0x33')],_0x54f54f[0x0]['dataValues'][_0x4a91('0x1e')]);}logger['debug']('GetContactDialer',_0x318310,JSON[_0x4a91('0x10')](_0x54f54f));_0x5766c7(_0x54f54f);})[_0x4a91('0x11')](function(_0x434af0){logger[_0x4a91('0x12')](_0x4a91('0x21'),_0x434af0['message'],_0x318310);_0x563b79(_0x5b7853[_0x4a91('0x12')](0x1f4,_0x434af0[_0x4a91('0x13')]));});});});};exports[_0x4a91('0x34')]=function(_0x19186d){var _0xe818d2=this;return new Promise(function(_0x5aa774,_0x536b3d){return db[_0x4a91('0x35')][_0x4a91('0x36')](function(_0x31d714){return db[_0x4a91('0x37')][_0x4a91('0x19')](_0x19186d[_0x4a91('0x1a')],{'raw':_0x19186d[_0x4a91('0x8')]?_0x19186d[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![],'transaction':_0x31d714})[_0x4a91('0xe')](function(){logger[_0x4a91('0x17')](_0x4a91('0x38'),JSON[_0x4a91('0x10')](_0x19186d[_0x4a91('0x8')]['where']),_0x19186d[_0x4a91('0x8')]['where']['active']);return db[_0x4a91('0x7')][_0x4a91('0x20')]({'where':_0x19186d[_0x4a91('0x8')]?_0x19186d[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'transaction':_0x31d714});});})[_0x4a91('0xe')](function(_0x56f835){logger[_0x4a91('0x17')](_0x4a91('0x34'),_0x19186d);logger[_0x4a91('0xf')]('MoveContactManagedDialer',_0x19186d,JSON[_0x4a91('0x10')](_0x56f835));_0x5aa774(_0x56f835);})[_0x4a91('0x11')](function(_0x505bdd){logger[_0x4a91('0x12')](_0x4a91('0x34'),_0x505bdd[_0x4a91('0x13')],_0x19186d);_0x536b3d(_0xe818d2[_0x4a91('0x12')](0x1f4,_0x505bdd[_0x4a91('0x13')]));});});};exports[_0x4a91('0x39')]=function(_0x5a8800){var _0x4b7692=this;return new Promise(function(_0x463d90,_0x26a7b8){return db[_0x4a91('0x7')][_0x4a91('0x23')]({'raw':_0x5a8800['options']?_0x5a8800[_0x4a91('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5a8800['options']?_0x5a8800['options'][_0x4a91('0x9')]||null:null,'attributes':[[db[_0x4a91('0x35')]['fn'](_0x4a91('0x3a'),db[_0x4a91('0x35')]['fn']('IF',db[_0x4a91('0x35')]['literal'](_0x4a91('0x3b')+util[_0x4a91('0x3c')](_0x4a91('0x3d'),moment()[_0x4a91('0x3c')](_0x4a91('0x3e')))+_0x4a91('0x3f')))),'contactsRescheduled']]})[_0x4a91('0xe')](function(_0xb82c8f){logger[_0x4a91('0x17')](_0x4a91('0x39'),_0x5a8800);logger[_0x4a91('0xf')](_0x4a91('0x39'),_0x5a8800,JSON[_0x4a91('0x10')](_0xb82c8f));_0x463d90(_0xb82c8f);})['catch'](function(_0x3c6f66){logger[_0x4a91('0x12')](_0x4a91('0x39'),_0x3c6f66[_0x4a91('0x13')],_0x5a8800);_0x26a7b8(_0x4b7692[_0x4a91('0x12')](0x1f4,_0x3c6f66[_0x4a91('0x13')]));});});};exports[_0x4a91('0x40')]=function(_0x5b9577){var _0x551661=this;return new Promise(function(_0x1da89b,_0x15e186){return db[_0x4a91('0x26')][_0x4a91('0x22')]()[_0x4a91('0xe')](function(){return db[_0x4a91('0x35')][_0x4a91('0x36')](function(_0x25a742){return db['CmHopper']['findAll']({'where':_0x5b9577[_0x4a91('0x8')]?_0x5b9577['options'][_0x4a91('0x9')]||null:null,'attributes':_0x5b9577[_0x4a91('0x8')]?_0x5b9577[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'limit':0x1,'order':_0x5b9577[_0x4a91('0x8')]?_0x5b9577[_0x4a91('0x8')][_0x4a91('0x41')]||null:null,'group':db[_0x4a91('0x7')][_0x4a91('0x2e')],'transaction':_0x25a742,'lock':_0x25a742[_0x4a91('0x24')][_0x4a91('0x25')],'include':_0x5b9577['options']?_0x5b9577[_0x4a91('0x8')][_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x5b9577[_0x4a91('0x8')][_0x4a91('0xb')],function(_0x248070){return{'model':db[_0x248070[_0x4a91('0xc')]],'as':_0x248070['as'],'attributes':_0x248070[_0x4a91('0xa')],'include':_0x248070['include']?_[_0x4a91('0xd')](_0x248070[_0x4a91('0xb')],function(_0x462cd6){return{'model':db[_0x462cd6[_0x4a91('0xc')]],'as':_0x462cd6['as'],'attributes':_0x462cd6[_0x4a91('0xa')],'include':_0x462cd6[_0x4a91('0xb')]?_['map'](_0x462cd6[_0x4a91('0xb')],function(_0xb88dd5){return{'model':db[_0xb88dd5[_0x4a91('0xc')]],'as':_0xb88dd5['as'],'attributes':_0xb88dd5[_0x4a91('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x53f198){var _0x371e45=[];for(var _0x31720d=0x0;_0x31720d<_0x53f198[_0x4a91('0x2d')];_0x31720d+=0x1){_0x371e45['push'](_0x53f198[_0x31720d][_0x4a91('0x1c')](_0x5b9577[_0x4a91('0x1a')],{'transaction':_0x25a742}));}return BPromise['all'](_0x371e45);});})[_0x4a91('0xe')](function(_0x3a92ce){logger[_0x4a91('0x17')](_0x4a91('0x40'),_0x5b9577);logger['debug'](_0x4a91('0x40'),_0x5b9577,JSON[_0x4a91('0x10')](_0x3a92ce));_0x1da89b(_0x3a92ce);})[_0x4a91('0x11')](function(_0x3601f7){logger[_0x4a91('0x12')](_0x4a91('0x40'),_0x3601f7[_0x4a91('0x13')],_0x5b9577);_0x15e186(_0x551661['error'](0x1f4,_0x3601f7[_0x4a91('0x13')]));});});});};exports[_0x4a91('0x42')]=function(_0x3b34ae){var _0x52c19=this;return new Promise(function(_0x126f97,_0x25c87b){db[_0x4a91('0x26')][_0x4a91('0x22')]()[_0x4a91('0xe')](function(_0x175df7){return db[_0x4a91('0x7')]['findAll']({'raw':_0x3b34ae[_0x4a91('0x8')]?_0x3b34ae[_0x4a91('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3b34ae['options']?_0x3b34ae['options'][_0x4a91('0x9')]||null:null,'attributes':_0x3b34ae['options']?_0x3b34ae[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'limit':_0x3b34ae[_0x4a91('0x8')]?_0x3b34ae[_0x4a91('0x8')][_0x4a91('0x43')]||null:null,'include':_0x3b34ae[_0x4a91('0x8')]?_0x3b34ae[_0x4a91('0x8')][_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x3b34ae[_0x4a91('0x8')]['include'],function(_0x59bce9){return{'model':db[_0x59bce9[_0x4a91('0xc')]],'as':_0x59bce9['as'],'attributes':_0x59bce9['as']===_0x4a91('0x27')?_[_0x4a91('0x28')](_0x175df7):_0x59bce9[_0x4a91('0xa')],'include':_0x59bce9[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x59bce9[_0x4a91('0xb')],function(_0x556d1b){return{'model':db[_0x556d1b[_0x4a91('0xc')]],'as':_0x556d1b['as'],'attributes':_0x556d1b[_0x4a91('0xa')],'include':_0x556d1b['include']?_[_0x4a91('0xd')](_0x556d1b[_0x4a91('0xb')],function(_0xae3d91){return{'model':db[_0xae3d91[_0x4a91('0xc')]],'as':_0xae3d91['as'],'attributes':_0xae3d91['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x4cd9fd){logger[_0x4a91('0x17')](_0x4a91('0x6'),_0x3b34ae);logger['debug'](_0x4a91('0x6'),_0x3b34ae,JSON['stringify'](_0x4cd9fd));_0x126f97(_0x4cd9fd);})[_0x4a91('0x11')](function(_0xa51a69){logger['error'](_0x4a91('0x6'),_0xa51a69[_0x4a91('0x13')],_0x3b34ae);_0x25c87b(_0x52c19[_0x4a91('0x12')](0x1f4,_0xa51a69[_0x4a91('0x13')]));});});});};exports[_0x4a91('0x44')]=function(_0x64dc2a){var _0x4aabdc=this;return new Promise(function(_0x53eac5,_0xb00c7a){return db[_0x4a91('0x26')]['findOne']({'raw':!![],'where':{'phone':_0x64dc2a[_0x4a91('0x8')][_0x4a91('0x9')][_0x4a91('0x45')]},'attributes':['id',_0x4a91('0x46')],'order':[['id','DESC']]})['then'](function(_0x3e83fb){logger[_0x4a91('0x17')](_0x4a91('0x47'),_0x64dc2a);logger[_0x4a91('0xf')]('getContactByPhone',_0x64dc2a,JSON[_0x4a91('0x10')](_0x3e83fb));_0x53eac5(_0x3e83fb);})[_0x4a91('0x11')](function(_0x4f942b){logger[_0x4a91('0x12')]('getContactByPhone',_0x4f942b[_0x4a91('0x13')],_0x64dc2a);_0xb00c7a(_0x4aabdc[_0x4a91('0x12')](0x1f4,_0x4f942b['message']));});});};exports[_0x4a91('0x48')]=function(_0x41ea97){var _0x30326b=this;return new Promise(function(_0x3b2138,_0x2e34c0){return db[_0x4a91('0x35')]['transaction'](function(_0x4c8ca2){var _0x4643e2=_0x41ea97[_0x4a91('0x8')]&&_0x41ea97[_0x4a91('0x8')][_0x4a91('0x9')]?_0x41ea97[_0x4a91('0x8')][_0x4a91('0x9')]:{};return db[_0x4a91('0x7')][_0x4a91('0x1c')](_0x41ea97[_0x4a91('0x1a')],{'where':_0x4643e2,'transaction':_0x4c8ca2})[_0x4a91('0xe')](function(_0x4b03c5){logger[_0x4a91('0x17')]('ResetActiveCalls',_0x41ea97);logger[_0x4a91('0xf')](_0x4a91('0x48'),_0x41ea97,JSON[_0x4a91('0x10')](_0x4b03c5));_0x3b2138(_0x4b03c5);})['catch'](function(_0x7802a6){logger[_0x4a91('0x12')]('ResetActiveCalls',_0x7802a6[_0x4a91('0x13')],_0x41ea97);_0x2e34c0(_0x30326b[_0x4a91('0x12')](0x1f4,_0x7802a6[_0x4a91('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x356f4c){var _0x16c414=this;var _0x49a464=_0x356f4c[_0x4a91('0x1a')][_0x4a91('0x9')][_0x4a91('0x49')];var _0x24b98d=_0x356f4c[_0x4a91('0x1a')][_0x4a91('0x9')]['interval'];var _0x49c746=_0x356f4c['body'][_0x4a91('0x9')][_0x4a91('0x4a')];return new Promise(function(_0x5bdb4b,_0x2f8f61){return db[_0x4a91('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x49a464},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4a91('0x35')][_0x4a91('0x4b')](_0x4a91('0x4c')+_0x24b98d+_0x4a91('0x4d')),'$gt':db[_0x4a91('0x35')][_0x4a91('0x4b')]('NOW()')}},'UserId':{'$in':_0x49c746}},'include':[{'model':db['CmContact'],'as':_0x4a91('0x27')},{'model':db['User'],'as':_0x4a91('0x2a'),'attributes':['id',_0x4a91('0x2b'),_0x4a91('0x2c')]},{'model':db[_0x4a91('0x4e')],'as':_0x4a91('0x4f')}]})[_0x4a91('0xe')](function(_0x19970f){if(_0x19970f[_0x4a91('0x2d')]>0x0){return db[_0x4a91('0x35')][_0x4a91('0x36')](function(_0x234a0d){return db[_0x4a91('0x7')][_0x4a91('0x1c')]({'recallmeNotifiedDate':db[_0x4a91('0x35')][_0x4a91('0x4b')](_0x4a91('0x50'))},{'where':{'id':{'$in':_[_0x4a91('0xd')](_0x19970f,'id')}},'transaction':_0x234a0d})[_0x4a91('0xe')](function(){_0x5bdb4b(_0x19970f);})['catch'](function(_0x504335){logger[_0x4a91('0x12')](_0x4a91('0x51'),_0x504335[_0x4a91('0x13')],_0x356f4c);_0x2f8f61(_0x16c414[_0x4a91('0x12')](0x1f4,_0x504335[_0x4a91('0x13')]));});})[_0x4a91('0x11')](function(_0x5d2190){logger[_0x4a91('0x12')](_0x4a91('0x51'),_0x5d2190[_0x4a91('0x13')],_0x356f4c);_0x2f8f61(_0x16c414[_0x4a91('0x12')](0x1f4,_0x5d2190[_0x4a91('0x13')]));});}else{_0x5bdb4b(_0x19970f);}});});};
\ No newline at end of file
+var _0xecaf=['include','model','map','then','info','debug','stringify','error','message','ShowCmHopper','find','catch','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','length','UserId','includes','push','GetContactDialer','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','all','GetCmHopperPreview','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','\x20MINUTE','NOW()','User','CmList','List','util','moment','bluebird','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit'];(function(_0x3319a2,_0x44cc26){var _0x103aeb=function(_0x513d6d){while(--_0x513d6d){_0x3319a2['push'](_0x3319a2['shift']());}};_0x103aeb(++_0x44cc26);}(_0xecaf,0x127));var _0xfeca=function(_0x2f36ab,_0x3be90a){_0x2f36ab=_0x2f36ab-0x0;var _0x5e81de=_0xecaf[_0x2f36ab];return _0x5e81de;};'use strict';var _=require('lodash');var util=require(_0xfeca('0x0'));var moment=require(_0xfeca('0x1'));var BPromise=require(_0xfeca('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xfeca('0x3'))(_0xfeca('0x4'));exports[_0xfeca('0x5')]=function(_0x3d2b93){var _0x4c3289=this;return new Promise(function(_0x197ff4,_0x29b9b6){return db[_0xfeca('0x6')][_0xfeca('0x7')]({'raw':_0x3d2b93[_0xfeca('0x8')]?_0x3d2b93[_0xfeca('0x8')][_0xfeca('0x9')]===undefined?!![]:![]:!![],'where':_0x3d2b93[_0xfeca('0x8')]?_0x3d2b93[_0xfeca('0x8')][_0xfeca('0xa')]||null:null,'attributes':_0x3d2b93['options']?_0x3d2b93[_0xfeca('0x8')][_0xfeca('0xb')]||null:null,'limit':_0x3d2b93[_0xfeca('0x8')]?_0x3d2b93['options'][_0xfeca('0xc')]||null:null,'include':_0x3d2b93[_0xfeca('0x8')]?_0x3d2b93[_0xfeca('0x8')][_0xfeca('0xd')]?_['map'](_0x3d2b93[_0xfeca('0x8')][_0xfeca('0xd')],function(_0x9811db){return{'model':db[_0x9811db[_0xfeca('0xe')]],'as':_0x9811db['as'],'attributes':_0x9811db[_0xfeca('0xb')],'include':_0x9811db['include']?_[_0xfeca('0xf')](_0x9811db[_0xfeca('0xd')],function(_0x79193a){return{'model':db[_0x79193a[_0xfeca('0xe')]],'as':_0x79193a['as'],'attributes':_0x79193a['attributes'],'include':_0x79193a[_0xfeca('0xd')]?_['map'](_0x79193a['include'],function(_0x3b7b80){return{'model':db[_0x3b7b80[_0xfeca('0xe')]],'as':_0x3b7b80['as'],'attributes':_0x3b7b80[_0xfeca('0xb')]};}):[]};}):[]};}):[]:[]})[_0xfeca('0x10')](function(_0x4119c1){logger[_0xfeca('0x11')]('GetCmHopper',_0x3d2b93);logger[_0xfeca('0x12')](_0xfeca('0x5'),_0x3d2b93,JSON[_0xfeca('0x13')](_0x4119c1));_0x197ff4(_0x4119c1);})['catch'](function(_0x5791c1){logger[_0xfeca('0x14')]('GetCmHopper',_0x5791c1[_0xfeca('0x15')],_0x3d2b93);_0x29b9b6(_0x4c3289['error'](0x1f4,_0x5791c1['message']));});});};exports[_0xfeca('0x16')]=function(_0x1586c4){var _0x5534bf=this;return new Promise(function(_0x2c7e0c,_0x4c14b2){return db[_0xfeca('0x6')][_0xfeca('0x17')]({'raw':_0x1586c4[_0xfeca('0x8')]?_0x1586c4['options'][_0xfeca('0x9')]===undefined?!![]:![]:!![],'where':_0x1586c4['options']?_0x1586c4[_0xfeca('0x8')]['where']||null:null,'attributes':_0x1586c4[_0xfeca('0x8')]?_0x1586c4['options'][_0xfeca('0xb')]||null:null,'include':_0x1586c4[_0xfeca('0x8')]?_0x1586c4[_0xfeca('0x8')][_0xfeca('0xd')]?_['map'](_0x1586c4[_0xfeca('0x8')][_0xfeca('0xd')],function(_0x124df0){return{'model':db[_0x124df0['model']],'as':_0x124df0['as'],'attributes':_0x124df0['attributes'],'include':_0x124df0[_0xfeca('0xd')]?_[_0xfeca('0xf')](_0x124df0['include'],function(_0x537505){return{'model':db[_0x537505[_0xfeca('0xe')]],'as':_0x537505['as'],'attributes':_0x537505[_0xfeca('0xb')],'include':_0x537505['include']?_[_0xfeca('0xf')](_0x537505[_0xfeca('0xd')],function(_0x23da6c){return{'model':db[_0x23da6c[_0xfeca('0xe')]],'as':_0x23da6c['as'],'attributes':_0x23da6c[_0xfeca('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37cca){logger[_0xfeca('0x11')](_0xfeca('0x16'),_0x1586c4);logger[_0xfeca('0x12')](_0xfeca('0x16'),_0x1586c4,JSON[_0xfeca('0x13')](_0x37cca));_0x2c7e0c(_0x37cca);})[_0xfeca('0x18')](function(_0x10d592){logger[_0xfeca('0x14')]('ShowCmHopper',_0x10d592['message'],_0x1586c4);_0x4c14b2(_0x5534bf['error'](0x1f4,_0x10d592['message']));});});};exports['CreateCmHopper']=function(_0x1e322e){var _0x72c812=this;return new Promise(function(_0x340161,_0x5ddbf){return db[_0xfeca('0x6')][_0xfeca('0x19')](_0x1e322e[_0xfeca('0x1a')],{'raw':_0x1e322e[_0xfeca('0x8')]?_0x1e322e['options'][_0xfeca('0x9')]===undefined?!![]:![]:!![]})[_0xfeca('0x10')](function(_0x284e1e){logger[_0xfeca('0x11')]('CreateCmHopper',_0x1e322e);logger[_0xfeca('0x12')](_0xfeca('0x1b'),_0x1e322e,JSON['stringify'](_0x284e1e));_0x340161(_0x284e1e);})['catch'](function(_0x464956){logger[_0xfeca('0x14')](_0xfeca('0x1b'),_0x464956[_0xfeca('0x15')],_0x1e322e);_0x5ddbf(_0x72c812[_0xfeca('0x14')](0x1f4,_0x464956[_0xfeca('0x15')]));});});};exports[_0xfeca('0x1c')]=function(_0xa2b1e3){var _0x22481e=this;return new Promise(function(_0x46023c,_0x1845ac){return db[_0xfeca('0x6')][_0xfeca('0x1d')](_0xa2b1e3[_0xfeca('0x1a')],{'raw':_0xa2b1e3['options']?_0xa2b1e3['options'][_0xfeca('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa2b1e3[_0xfeca('0x8')]?_0xa2b1e3['options']['where']||null:null,'attributes':_0xa2b1e3[_0xfeca('0x8')]?_0xa2b1e3[_0xfeca('0x8')][_0xfeca('0xb')]||null:null,'limit':_0xa2b1e3['options']?_0xa2b1e3[_0xfeca('0x8')][_0xfeca('0xc')]||null:null})[_0xfeca('0x10')](function(_0x30490d){logger[_0xfeca('0x11')](_0xfeca('0x1c'),_0xa2b1e3);logger[_0xfeca('0x11')](_0xfeca('0x1e'),JSON['stringify'](_0xa2b1e3[_0xfeca('0x8')]['where']),_0xa2b1e3['body'][_0xfeca('0x1f')]);logger[_0xfeca('0x12')](_0xfeca('0x1c'),_0xa2b1e3,JSON[_0xfeca('0x13')](_0x30490d));_0x46023c(_0x30490d);})[_0xfeca('0x18')](function(_0x38a3bb){logger[_0xfeca('0x14')]('UpdateCmHopper',_0x38a3bb[_0xfeca('0x15')],_0xa2b1e3);_0x1845ac(_0x22481e['error'](0x1f4,_0x38a3bb[_0xfeca('0x15')]));});});};exports[_0xfeca('0x20')]=function(_0x2ed4af){var _0x40a992=this;return new Promise(function(_0x571deb,_0x4de7b4){return db['CmHopper'][_0xfeca('0x21')]({'where':_0x2ed4af[_0xfeca('0x8')]?_0x2ed4af[_0xfeca('0x8')][_0xfeca('0xa')]||null:null})[_0xfeca('0x10')](function(_0x34d2c8){logger[_0xfeca('0x11')](_0xfeca('0x20'),_0x2ed4af);logger[_0xfeca('0x12')](_0xfeca('0x20'),_0x2ed4af,JSON[_0xfeca('0x13')](_0x34d2c8));_0x571deb(_0x34d2c8);})[_0xfeca('0x18')](function(_0x1cb03b){logger[_0xfeca('0x14')](_0xfeca('0x20'),_0x1cb03b[_0xfeca('0x15')],_0x2ed4af);_0x4de7b4(_0x40a992[_0xfeca('0x14')](0x1f4,_0x1cb03b[_0xfeca('0x15')]));});});};exports['GetContactDialer']=function(_0x2084fc){var _0x3561eb=this;return new Promise(function(_0x3d5f3a,_0x4dcd9c){return db[_0xfeca('0x22')][_0xfeca('0x23')]()['then'](function(_0x212400){return db[_0xfeca('0x24')][_0xfeca('0x25')](function(_0x5a20b8){return db['CmHopper']['findAll']({'where':_0x2084fc['options']?_0x2084fc[_0xfeca('0x8')][_0xfeca('0xa')]||null:null,'attributes':_0x2084fc[_0xfeca('0x8')]?_0x2084fc[_0xfeca('0x8')]['attributes']||null:null,'limit':_0x2084fc[_0xfeca('0x8')]?_0x2084fc['options'][_0xfeca('0xc')]||null:null,'order':_0x2084fc['options']?_0x2084fc[_0xfeca('0x8')][_0xfeca('0x26')]||null:null,'transaction':_0x5a20b8,'lock':_0x5a20b8[_0xfeca('0x27')][_0xfeca('0x28')],'include':[{'model':db[_0xfeca('0x22')],'as':_0xfeca('0x29'),'attributes':_[_0xfeca('0x2a')](_0x212400)},{'model':db['User'],'as':_0xfeca('0x2b'),'attributes':['id',_0xfeca('0x2c'),_0xfeca('0x2d')]}]})['then'](function(_0x117ef5){var _0x18baa0=[];var _0x1eddd8=[];for(var _0x575b76=0x0;_0x575b76<_0x117ef5[_0xfeca('0x2e')];_0x575b76+=0x1){var _0x15d599=_0x117ef5[_0x575b76][_0xfeca('0x2f')];if(_0x15d599===null){_0x18baa0['push'](_0x117ef5[_0x575b76][_0xfeca('0x1d')](_0x2084fc[_0xfeca('0x1a')],{'transaction':_0x5a20b8}));}else if(!_0x1eddd8[_0xfeca('0x30')](_0x15d599)){_0x1eddd8[_0xfeca('0x31')](_0x15d599);_0x18baa0[_0xfeca('0x31')](_0x117ef5[_0x575b76][_0xfeca('0x1d')](_0x2084fc['body'],{'transaction':_0x5a20b8}));}}return BPromise['all'](_0x18baa0);});})['then'](function(_0x44b620){logger[_0xfeca('0x11')](_0xfeca('0x32'),_0x2084fc);if(_0x44b620['length']>0x0){logger[_0xfeca('0x11')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x44b620[0x0][_0xfeca('0x33')]['id'],_0x44b620[0x0]['dataValues'][_0xfeca('0x34')],_0x44b620[0x0]['dataValues'][_0xfeca('0x1f')]);}logger[_0xfeca('0x12')]('GetContactDialer',_0x2084fc,JSON['stringify'](_0x44b620));_0x3d5f3a(_0x44b620);})[_0xfeca('0x18')](function(_0x1cf472){logger[_0xfeca('0x14')](_0xfeca('0x32'),_0x1cf472['message'],_0x2084fc);_0x4dcd9c(_0x3561eb[_0xfeca('0x14')](0x1f4,_0x1cf472[_0xfeca('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x36a4c5){var _0xc35ca1=this;return new Promise(function(_0x7e94f0,_0x122b2f){return db[_0xfeca('0x24')][_0xfeca('0x25')](function(_0x314cbf){return db[_0xfeca('0x35')][_0xfeca('0x19')](_0x36a4c5[_0xfeca('0x1a')],{'raw':_0x36a4c5['options']?_0x36a4c5['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x314cbf})['then'](function(){logger['info'](_0xfeca('0x36'),JSON[_0xfeca('0x13')](_0x36a4c5[_0xfeca('0x8')]['where']),_0x36a4c5[_0xfeca('0x8')][_0xfeca('0xa')][_0xfeca('0x1f')]);return db['CmHopper'][_0xfeca('0x21')]({'where':_0x36a4c5[_0xfeca('0x8')]?_0x36a4c5[_0xfeca('0x8')][_0xfeca('0xa')]||null:null,'transaction':_0x314cbf});});})[_0xfeca('0x10')](function(_0x68f5ce){logger[_0xfeca('0x11')](_0xfeca('0x37'),_0x36a4c5);logger[_0xfeca('0x12')]('MoveContactManagedDialer',_0x36a4c5,JSON[_0xfeca('0x13')](_0x68f5ce));_0x7e94f0(_0x68f5ce);})[_0xfeca('0x18')](function(_0x21ed36){logger[_0xfeca('0x14')]('MoveContactManagedDialer',_0x21ed36[_0xfeca('0x15')],_0x36a4c5);_0x122b2f(_0xc35ca1[_0xfeca('0x14')](0x1f4,_0x21ed36['message']));});});};exports[_0xfeca('0x38')]=function(_0x394e9c){var _0x58432d=this;return new Promise(function(_0x459f1f,_0x3bff02){return db['CmHopper'][_0xfeca('0x7')]({'raw':_0x394e9c[_0xfeca('0x8')]?_0x394e9c[_0xfeca('0x8')][_0xfeca('0x9')]===undefined?!![]:![]:!![],'where':_0x394e9c[_0xfeca('0x8')]?_0x394e9c[_0xfeca('0x8')][_0xfeca('0xa')]||null:null,'attributes':[[db[_0xfeca('0x24')]['fn']('COUNT',db[_0xfeca('0x24')]['fn']('IF',db[_0xfeca('0x24')][_0xfeca('0x39')](_0xfeca('0x3a')+util['format']('\x22%s\x22',moment()['format'](_0xfeca('0x3b')))+_0xfeca('0x3c')))),'contactsRescheduled']]})[_0xfeca('0x10')](function(_0x1f668c){logger[_0xfeca('0x11')](_0xfeca('0x38'),_0x394e9c);logger[_0xfeca('0x12')](_0xfeca('0x38'),_0x394e9c,JSON[_0xfeca('0x13')](_0x1f668c));_0x459f1f(_0x1f668c);})[_0xfeca('0x18')](function(_0x57ba6c){logger['error'](_0xfeca('0x38'),_0x57ba6c['message'],_0x394e9c);_0x3bff02(_0x58432d[_0xfeca('0x14')](0x1f4,_0x57ba6c['message']));});});};exports[_0xfeca('0x3d')]=function(_0x4db382){var _0x27b6b1=this;return new Promise(function(_0x5a4e23,_0x5264cc){return db['CmContact'][_0xfeca('0x23')]()[_0xfeca('0x10')](function(){return db[_0xfeca('0x24')][_0xfeca('0x25')](function(_0xfca809){return db[_0xfeca('0x6')][_0xfeca('0x7')]({'where':_0x4db382[_0xfeca('0x8')]?_0x4db382[_0xfeca('0x8')][_0xfeca('0xa')]||null:null,'attributes':_0x4db382['options']?_0x4db382['options'][_0xfeca('0xb')]||null:null,'limit':0x1,'order':_0x4db382['options']?_0x4db382[_0xfeca('0x8')][_0xfeca('0x26')]||null:null,'group':db[_0xfeca('0x6')]['UserId'],'transaction':_0xfca809,'lock':_0xfca809[_0xfeca('0x27')][_0xfeca('0x28')],'include':_0x4db382[_0xfeca('0x8')]?_0x4db382[_0xfeca('0x8')][_0xfeca('0xd')]?_['map'](_0x4db382[_0xfeca('0x8')]['include'],function(_0x5a7c6){return{'model':db[_0x5a7c6['model']],'as':_0x5a7c6['as'],'attributes':_0x5a7c6[_0xfeca('0xb')],'include':_0x5a7c6['include']?_[_0xfeca('0xf')](_0x5a7c6['include'],function(_0x5bef51){return{'model':db[_0x5bef51[_0xfeca('0xe')]],'as':_0x5bef51['as'],'attributes':_0x5bef51[_0xfeca('0xb')],'include':_0x5bef51[_0xfeca('0xd')]?_[_0xfeca('0xf')](_0x5bef51[_0xfeca('0xd')],function(_0x4bab3e){return{'model':db[_0x4bab3e[_0xfeca('0xe')]],'as':_0x4bab3e['as'],'attributes':_0x4bab3e[_0xfeca('0xb')]};}):[]};}):[]};}):[]:[]})[_0xfeca('0x10')](function(_0x373a1f){var _0x36ddb6=[];for(var _0xbee236=0x0;_0xbee236<_0x373a1f[_0xfeca('0x2e')];_0xbee236+=0x1){_0x36ddb6[_0xfeca('0x31')](_0x373a1f[_0xbee236][_0xfeca('0x1d')](_0x4db382[_0xfeca('0x1a')],{'transaction':_0xfca809}));}return BPromise[_0xfeca('0x3e')](_0x36ddb6);});})['then'](function(_0x1299cb){logger['info'](_0xfeca('0x3d'),_0x4db382);logger[_0xfeca('0x12')](_0xfeca('0x3d'),_0x4db382,JSON[_0xfeca('0x13')](_0x1299cb));_0x5a4e23(_0x1299cb);})[_0xfeca('0x18')](function(_0x435b48){logger[_0xfeca('0x14')](_0xfeca('0x3d'),_0x435b48[_0xfeca('0x15')],_0x4db382);_0x5264cc(_0x27b6b1[_0xfeca('0x14')](0x1f4,_0x435b48['message']));});});});};exports[_0xfeca('0x3f')]=function(_0x471dec){var _0x317f01=this;return new Promise(function(_0x3106fb,_0x3a0352){db[_0xfeca('0x22')][_0xfeca('0x23')]()['then'](function(_0x14b6b9){return db[_0xfeca('0x6')]['findAll']({'raw':_0x471dec[_0xfeca('0x8')]?_0x471dec[_0xfeca('0x8')][_0xfeca('0x9')]===undefined?!![]:![]:!![],'where':_0x471dec[_0xfeca('0x8')]?_0x471dec[_0xfeca('0x8')][_0xfeca('0xa')]||null:null,'attributes':_0x471dec['options']?_0x471dec[_0xfeca('0x8')]['attributes']||null:null,'limit':_0x471dec[_0xfeca('0x8')]?_0x471dec[_0xfeca('0x8')]['limit']||null:null,'include':_0x471dec[_0xfeca('0x8')]?_0x471dec['options'][_0xfeca('0xd')]?_[_0xfeca('0xf')](_0x471dec[_0xfeca('0x8')][_0xfeca('0xd')],function(_0x10b9ff){return{'model':db[_0x10b9ff[_0xfeca('0xe')]],'as':_0x10b9ff['as'],'attributes':_0x10b9ff['as']===_0xfeca('0x29')?_[_0xfeca('0x2a')](_0x14b6b9):_0x10b9ff[_0xfeca('0xb')],'include':_0x10b9ff[_0xfeca('0xd')]?_['map'](_0x10b9ff[_0xfeca('0xd')],function(_0x52dc75){return{'model':db[_0x52dc75[_0xfeca('0xe')]],'as':_0x52dc75['as'],'attributes':_0x52dc75['attributes'],'include':_0x52dc75[_0xfeca('0xd')]?_[_0xfeca('0xf')](_0x52dc75['include'],function(_0x4872f8){return{'model':db[_0x4872f8[_0xfeca('0xe')]],'as':_0x4872f8['as'],'attributes':_0x4872f8[_0xfeca('0xb')]};}):[]};}):[]};}):[]:[]})[_0xfeca('0x10')](function(_0x56aa46){logger[_0xfeca('0x11')](_0xfeca('0x5'),_0x471dec);logger['debug'](_0xfeca('0x5'),_0x471dec,JSON[_0xfeca('0x13')](_0x56aa46));_0x3106fb(_0x56aa46);})['catch'](function(_0x25f72d){logger[_0xfeca('0x14')](_0xfeca('0x5'),_0x25f72d[_0xfeca('0x15')],_0x471dec);_0x3a0352(_0x317f01[_0xfeca('0x14')](0x1f4,_0x25f72d[_0xfeca('0x15')]));});});});};exports['GetContactByPhone']=function(_0x431a96){var _0x514fe9=this;return new Promise(function(_0x3aac6d,_0x20e967){return db['CmContact'][_0xfeca('0x40')]({'raw':!![],'where':{'phone':_0x431a96['options']['where'][_0xfeca('0x41')]},'attributes':['id','dialTimezone'],'order':[['id',_0xfeca('0x42')]]})[_0xfeca('0x10')](function(_0x73189b){logger[_0xfeca('0x11')](_0xfeca('0x43'),_0x431a96);logger['debug'](_0xfeca('0x43'),_0x431a96,JSON[_0xfeca('0x13')](_0x73189b));_0x3aac6d(_0x73189b);})['catch'](function(_0x3b27a8){logger[_0xfeca('0x14')](_0xfeca('0x43'),_0x3b27a8[_0xfeca('0x15')],_0x431a96);_0x20e967(_0x514fe9[_0xfeca('0x14')](0x1f4,_0x3b27a8[_0xfeca('0x15')]));});});};exports[_0xfeca('0x44')]=function(_0x588dab){var _0x365062=this;return new Promise(function(_0x46413b,_0x51e2e6){return db[_0xfeca('0x24')][_0xfeca('0x25')](function(_0x1e8bff){var _0x444eee=_0x588dab[_0xfeca('0x8')]&&_0x588dab[_0xfeca('0x8')]['where']?_0x588dab[_0xfeca('0x8')][_0xfeca('0xa')]:{};return db[_0xfeca('0x6')][_0xfeca('0x1d')](_0x588dab[_0xfeca('0x1a')],{'where':_0x444eee,'transaction':_0x1e8bff})[_0xfeca('0x10')](function(_0x50936c){logger[_0xfeca('0x11')](_0xfeca('0x44'),_0x588dab);logger[_0xfeca('0x12')](_0xfeca('0x44'),_0x588dab,JSON[_0xfeca('0x13')](_0x50936c));_0x46413b(_0x50936c);})[_0xfeca('0x18')](function(_0x543b6c){logger[_0xfeca('0x14')](_0xfeca('0x44'),_0x543b6c[_0xfeca('0x15')],_0x588dab);_0x51e2e6(_0x365062['error'](0x1f4,_0x543b6c[_0xfeca('0x15')]));});});});};exports[_0xfeca('0x45')]=function(_0x16f842){var _0x5de7b4=this;var _0x229e75=_0x16f842['body']['where'][_0xfeca('0x46')];var _0x4102d8=_0x16f842[_0xfeca('0x1a')][_0xfeca('0xa')]['interval'];var _0x4a076d=_0x16f842[_0xfeca('0x1a')][_0xfeca('0xa')][_0xfeca('0x47')];return new Promise(function(_0x328758,_0x37b82d){return db['CmHopper'][_0xfeca('0x7')]({'where':{'voiceQueueId':{'$in':_0x229e75},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xfeca('0x24')][_0xfeca('0x39')]('NOW()\x20+\x20INTERVAL\x20'+_0x4102d8+_0xfeca('0x48')),'$gt':db[_0xfeca('0x24')]['literal'](_0xfeca('0x49'))}},'UserId':{'$in':_0x4a076d}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0xfeca('0x4a')],'as':_0xfeca('0x2b'),'attributes':['id',_0xfeca('0x2c'),_0xfeca('0x2d')]},{'model':db[_0xfeca('0x4b')],'as':_0xfeca('0x4c')}]})[_0xfeca('0x10')](function(_0x4b1101){if(_0x4b1101[_0xfeca('0x2e')]>0x0){return db[_0xfeca('0x24')][_0xfeca('0x25')](function(_0x4cf0ed){return db['CmHopper'][_0xfeca('0x1d')]({'recallmeNotifiedDate':db['sequelize'][_0xfeca('0x39')]('NOW()')},{'where':{'id':{'$in':_[_0xfeca('0xf')](_0x4b1101,'id')}},'transaction':_0x4cf0ed})[_0xfeca('0x10')](function(){_0x328758(_0x4b1101);})[_0xfeca('0x18')](function(_0x535317){logger[_0xfeca('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x535317[_0xfeca('0x15')],_0x16f842);_0x37b82d(_0x5de7b4['error'](0x1f4,_0x535317[_0xfeca('0x15')]));});})[_0xfeca('0x18')](function(_0x3d5ad3){logger[_0xfeca('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x3d5ad3[_0xfeca('0x15')],_0x16f842);_0x37b82d(_0x5de7b4[_0xfeca('0x14')](0x1f4,_0x3d5ad3[_0xfeca('0x15')]));});}else{_0x328758(_0x4b1101);}});});};
\ No newline at end of file