Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.rpc.js
index c50d49d..386d69a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x649d=['VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','CmHopperAdditionalPhone','waitTime','duration','scheduledat','add','isNil','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch'];(function(_0x2aac37,_0x8bbcf6){var _0x27ac09=function(_0x16bb57){while(--_0x16bb57){_0x2aac37['push'](_0x2aac37['shift']());}};_0x27ac09(++_0x8bbcf6);}(_0x649d,0xc7));var _0xd649=function(_0x1c1bf2,_0x270319){_0x1c1bf2=_0x1c1bf2-0x0;var _0x21b809=_0x649d[_0x1c1bf2];return _0x21b809;};'use strict';var _=require(_0xd649('0x0'));var util=require('util');var moment=require(_0xd649('0x1'));var BPromise=require(_0xd649('0x2'));var rs=require(_0xd649('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd649('0x4'))['db'];var utils=require(_0xd649('0x5'));var logger=require(_0xd649('0x6'))(_0xd649('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd649('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45c5e1,_0x85dda7,_0x97380){return new BPromise(function(_0x1b81e7,_0x2cd1fd){return client[_0xd649('0x9')](_0x45c5e1,_0x97380)[_0xd649('0xa')](function(_0x35441b){logger[_0xd649('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x85dda7,_0xd649('0xc'));logger[_0xd649('0xd')](_0xd649('0xe'),_0x85dda7,'request\x20sent',JSON[_0xd649('0xf')](_0x35441b));if(_0x35441b[_0xd649('0x10')]){if(_0x35441b[_0xd649('0x10')][_0xd649('0x11')]===0x1f4){logger[_0xd649('0x10')](_0xd649('0x12'),_0x85dda7,_0x35441b[_0xd649('0x10')][_0xd649('0x13')]);return _0x2cd1fd(_0x35441b[_0xd649('0x10')]['message']);}logger['error'](_0xd649('0x12'),_0x85dda7,_0x35441b[_0xd649('0x10')][_0xd649('0x13')]);return _0x1b81e7(_0x35441b[_0xd649('0x10')]['message']);}else{logger[_0xd649('0xb')](_0xd649('0x12'),_0x85dda7,_0xd649('0xc'));_0x1b81e7(_0x35441b['result'][_0xd649('0x13')]);}})[_0xd649('0x14')](function(_0xbfc9b6){logger[_0xd649('0x10')](_0xd649('0x12'),_0x85dda7,_0xbfc9b6);_0x2cd1fd(_0xbfc9b6);});});}exports[_0xd649('0x15')]=function(_0x1e67aa){var _0x4f9993=this;return new Promise(function(_0x529c79,_0x3cf75c){return db[_0xd649('0x16')][_0xd649('0x17')]({'raw':!![],'where':{'ContactId':_0x1e67aa[_0xd649('0x18')][_0xd649('0x19')],'ListId':_0x1e67aa[_0xd649('0x18')][_0xd649('0x1a')],'VoiceQueueId':_0x1e67aa[_0xd649('0x18')][_0xd649('0x1b')]===undefined?null:_0x1e67aa[_0xd649('0x18')]['VoiceQueueId'],'CampaignId':_0x1e67aa[_0xd649('0x18')][_0xd649('0x1c')]===undefined?null:_0x1e67aa['body'][_0xd649('0x1c')]}})['then'](function(_0x30d98c){if(_0x30d98c!=null){return db['CmHopperAdditionalPhone'][_0xd649('0x17')]({'raw':!![],'where':{'CmHopperId':_0x30d98c['id'],'OrderBy':{'$gt':_0x30d98c[_0xd649('0x1d')]}},'order':[['OrderBy',_0xd649('0x1e')]]})[_0xd649('0xa')](function(_0x21a856){var _0xfc61ca=0x0;if(_0x21a856){if(_0x21a856[_0xd649('0x1f')]+_0x21a856[_0xd649('0x20')]+_0x21a856[_0xd649('0x21')]+_0x21a856[_0xd649('0x22')]+_0x21a856[_0xd649('0x23')]+_0x21a856[_0xd649('0x24')]+_0x21a856[_0xd649('0x25')]+_0x21a856[_0xd649('0x26')]<_0x1e67aa[_0xd649('0x27')]['dialGlobalMaxRetry'])_0xfc61ca=0x1;_0x529c79({'additional':_0xfc61ca});}else{return db[_0xd649('0x28')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x30d98c['id']},'order':[['OrderBy','ASC']]})[_0xd649('0xa')](function(_0x19fd76){var _0xeba77b=0x0;if(_0x19fd76){if(_0x19fd76['countbusyretry']+_0x19fd76[_0xd649('0x20')]+_0x19fd76[_0xd649('0x21')]+_0x19fd76[_0xd649('0x22')]+_0x19fd76['countdropretry']+_0x19fd76[_0xd649('0x24')]+_0x19fd76[_0xd649('0x25')]+_0x19fd76[_0xd649('0x26')]<_0x1e67aa[_0xd649('0x27')]['dialGlobalMaxRetry'])_0xeba77b=0x1;_0x529c79({'additional':_0xeba77b});}else{_0x529c79({'additional':0x0});}})[_0xd649('0x14')](function(_0x561a06){logger[_0xd649('0x10')]('VerifyAdditionalPhones',_0x561a06[_0xd649('0x13')]);_0x3cf75c(_0x4f9993[_0xd649('0x10')](0x1f4,_0x561a06[_0xd649('0x13')]));});}})[_0xd649('0x14')](function(_0x32f26e){logger[_0xd649('0x10')]('VerifyAdditionalPhones',_0x32f26e[_0xd649('0x13')]);_0x3cf75c(_0x4f9993[_0xd649('0x10')](0x1f4,_0x32f26e[_0xd649('0x13')]));});}else _0x529c79({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x20b4a9){var _0x359733=this;return new Promise(function(_0x599db8,_0x51c866){return db[_0xd649('0x16')][_0xd649('0x17')]({'raw':!![],'where':{'ContactId':_0x20b4a9[_0xd649('0x18')][_0xd649('0x19')],'ListId':_0x20b4a9[_0xd649('0x18')]['ListId'],'VoiceQueueId':_0x20b4a9[_0xd649('0x18')]['VoiceQueueId']===undefined?null:_0x20b4a9[_0xd649('0x18')][_0xd649('0x1b')],'CampaignId':_0x20b4a9['body'][_0xd649('0x1c')]===undefined?null:_0x20b4a9[_0xd649('0x18')][_0xd649('0x1c')]}})[_0xd649('0xa')](function(_0x297910){if(_0x297910!=null){return db['CmHopperAdditionalPhone'][_0xd649('0x17')]({'raw':!![],'where':{'CmHopperId':_0x297910['id'],'OrderBy':{'$gte':_0x297910['OrderBy']}},'order':[['OrderBy',_0xd649('0x1e')]]})[_0xd649('0xa')](function(_0x3f8dd3){if(_0x3f8dd3)return activateAdditionalPhone(_0x297910,_0x20b4a9[_0xd649('0x18')],_0x3f8dd3,_0x20b4a9['duration'],_0x20b4a9[_0xd649('0x29')])[_0xd649('0xa')](function(_0x5b4530){_0x599db8(_0x5b4530);});else{return db[_0xd649('0x28')][_0xd649('0x17')]({'raw':!![],'where':{'CmHopperId':_0x297910['id']},'order':[['OrderBy',_0xd649('0x1e')]]})[_0xd649('0xa')](function(_0x118cce){if(_0x118cce)return activateAdditionalPhone(_0x297910,_0x20b4a9[_0xd649('0x18')],_0x118cce,_0x20b4a9[_0xd649('0x2a')],_0x20b4a9[_0xd649('0x29')])['then'](function(_0x4a9cbf){_0x599db8(_0x4a9cbf);});else{_0x599db8({'id':_0x297910['id'],'phone':''});}})[_0xd649('0x14')](function(_0x195358){logger[_0xd649('0x10')]('VerifyAdditionalPhones',_0x195358[_0xd649('0x13')]);_0x51c866(_0x359733[_0xd649('0x10')](0x1f4,_0x195358[_0xd649('0x13')]));});}})[_0xd649('0x14')](function(_0x100ac5){logger[_0xd649('0x10')](_0xd649('0x15'),_0x100ac5[_0xd649('0x13')]);_0x51c866(_0x359733[_0xd649('0x10')](0x1f4,_0x100ac5[_0xd649('0x13')]));});}else _0x599db8(0x1);});});};function activateAdditionalPhone(_0x237135,_0x145b61,_0x20a63d,_0x3f6d92,_0xec4487){return new Promise(function(_0x344153,_0x3d2adc){var _0x8e2c4f;if(_['isNil'](_0x20a63d[_0xd649('0x2b')])){_0x20a63d[_0xd649('0x2b')]=moment();}if(moment()>moment(_0x20a63d['scheduledat'])){_0x8e2c4f=moment()[_0xd649('0x2c')](_0xec4487||0x3,'minutes');}else{if(_0x20a63d['OrderBy']==0x0){_0x8e2c4f=moment(_0x20a63d[_0xd649('0x2b')]);}else{_0x8e2c4f=moment()[_0xd649('0x2c')](_0xec4487||0x3,'minutes');}}if(_[_0xd649('0x2d')](_0x8e2c4f)){_0x8e2c4f=moment()[_0xd649('0x2c')](_0xec4487||0x3,_0xd649('0x2e'));}var _0xf91a18={'phone':_0x237135[_0xd649('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x237135[_0xd649('0x1d')])?0x0:_0x237135[_0xd649('0x1d')],'scheduledat':moment()[_0xd649('0x2c')](_0x3f6d92||0x1,_0xd649('0x2e')),'countbusyretry':_0x145b61['countbusyretry'],'countcongestionretry':_0x145b61[_0xd649('0x20')],'countnoanswerretry':_0x145b61['countnoanswerretry'],'countnosuchnumberretry':_0x145b61[_0xd649('0x22')],'countdropretry':_0x145b61['countdropretry'],'countabandonedretry':_0x145b61[_0xd649('0x24')],'countmachineretry':_0x145b61[_0xd649('0x25')],'countagentrejectretry':_0x145b61['countagentrejectretry'],'createdAt':_0x145b61[_0xd649('0x30')],'updatedAt':_0x145b61[_0xd649('0x31')]};var _0x70d7e4={'CmHopperId':_0x237135['id'],'phone':_0x20a63d['phone'],'active':0x0,'OrderBy':_[_0xd649('0x2d')](_0x20a63d[_0xd649('0x1d')])?0x0:_0x20a63d[_0xd649('0x1d')],'scheduledat':_0x8e2c4f,'countbusyretry':_0x20a63d[_0xd649('0x1f')],'countcongestionretry':_0x20a63d[_0xd649('0x20')],'countnoanswerretry':_0x20a63d[_0xd649('0x21')],'countnosuchnumberretry':_0x20a63d[_0xd649('0x22')],'countdropretry':_0x20a63d['countdropretry'],'countabandonedretry':_0x20a63d[_0xd649('0x24')],'countmachineretry':_0x20a63d[_0xd649('0x25')],'countagentrejectretry':_0x20a63d[_0xd649('0x26')],'createdAt':_0x20a63d[_0xd649('0x30')],'updatedAt':_0x20a63d[_0xd649('0x31')]};return db[_0xd649('0x32')][_0xd649('0x33')](function(_0x583106){return db[_0xd649('0x28')][_0xd649('0x34')](_0xf91a18,{'where':{'id':_0x20a63d['id']}},{'transaction':_0x583106})['then'](function(){return db['CmHopper'][_0xd649('0x34')](_0x70d7e4,{'where':{'id':_0x237135['id']}},{'transaction':_0x583106});});})[_0xd649('0xa')](function(_0x121ce6){_0x344153({'id':_0x237135['id'],'phone':_0x20a63d[_0xd649('0x2f')]});})[_0xd649('0x14')](function(_0x4ebae7){logger[_0xd649('0x10')]('activateAdditionalPhone',_0x4ebae7[_0xd649('0x13')]);_0x3d2adc({'error':_0x4ebae7[_0xd649('0x13')]});});});}exports[_0xd649('0x35')]=function(_0x34cbde){var _0x19e894=this;return new Promise(function(_0x3510a7,_0x3f1b67){return db[_0xd649('0x16')][_0xd649('0x34')](_0x34cbde[_0xd649('0x18')][_0xd649('0x36')],{'where':{'id':_0x34cbde[_0xd649('0x18')]['id']}})[_0xd649('0xa')](function(_0x35849a){_0x3510a7(_0x35849a);})['catch'](function(_0xea4ed9){logger[_0xd649('0x10')](_0xd649('0x35'),_0xea4ed9[_0xd649('0x13')]);_0x3f1b67(_0x19e894[_0xd649('0x10')](0x1f4,_0xea4ed9[_0xd649('0x13')]));});});};
\ No newline at end of file
+var _0x240f=['entity','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','CmHopperAdditionalPhone','countdropretry','countagentrejectretry'];(function(_0x458b06,_0x12f681){var _0x5e0eb3=function(_0x1cbec0){while(--_0x1cbec0){_0x458b06['push'](_0x458b06['shift']());}};_0x5e0eb3(++_0x12f681);}(_0x240f,0x1ad));var _0xf240=function(_0x278dde,_0x22456d){_0x278dde=_0x278dde-0x0;var _0x24c1ab=_0x240f[_0x278dde];return _0x24c1ab;};'use strict';var _=require('lodash');var util=require(_0xf240('0x0'));var moment=require(_0xf240('0x1'));var BPromise=require(_0xf240('0x2'));var rs=require(_0xf240('0x3'));var fs=require('fs');var Redis=require(_0xf240('0x4'));var db=require(_0xf240('0x5'))['db'];var utils=require(_0xf240('0x6'));var logger=require(_0xf240('0x7'))(_0xf240('0x8'));var config=require(_0xf240('0x9'));var jayson=require(_0xf240('0xa'));var client=jayson[_0xf240('0xb')][_0xf240('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ecfc3,_0x36ba90,_0x3d6d22){return new BPromise(function(_0x21d1bb,_0x1f4772){return client[_0xf240('0xd')](_0x1ecfc3,_0x3d6d22)[_0xf240('0xe')](function(_0x1af42a){logger[_0xf240('0xf')](_0xf240('0x10'),_0x36ba90,'request\x20sent');logger[_0xf240('0x11')](_0xf240('0x12'),_0x36ba90,_0xf240('0x13'),JSON[_0xf240('0x14')](_0x1af42a));if(_0x1af42a['error']){if(_0x1af42a[_0xf240('0x15')]['code']===0x1f4){logger[_0xf240('0x15')](_0xf240('0x10'),_0x36ba90,_0x1af42a[_0xf240('0x15')][_0xf240('0x16')]);return _0x1f4772(_0x1af42a[_0xf240('0x15')][_0xf240('0x16')]);}logger[_0xf240('0x15')](_0xf240('0x10'),_0x36ba90,_0x1af42a[_0xf240('0x15')][_0xf240('0x16')]);return _0x21d1bb(_0x1af42a[_0xf240('0x15')]['message']);}else{logger[_0xf240('0xf')](_0xf240('0x10'),_0x36ba90,_0xf240('0x13'));_0x21d1bb(_0x1af42a[_0xf240('0x17')]['message']);}})[_0xf240('0x18')](function(_0xc1a47c){logger[_0xf240('0x15')](_0xf240('0x10'),_0x36ba90,_0xc1a47c);_0x1f4772(_0xc1a47c);});});}exports['VerifyAdditionalPhones']=function(_0x5ead2b){var _0xa6301a=this;return new Promise(function(_0xd2ee7,_0x1e971a){return db[_0xf240('0x19')][_0xf240('0x1a')]({'raw':!![],'where':{'ContactId':_0x5ead2b[_0xf240('0x1b')][_0xf240('0x1c')],'ListId':_0x5ead2b[_0xf240('0x1b')][_0xf240('0x1d')],'VoiceQueueId':_0x5ead2b[_0xf240('0x1b')][_0xf240('0x1e')]===undefined?null:_0x5ead2b[_0xf240('0x1b')]['VoiceQueueId'],'CampaignId':_0x5ead2b['body'][_0xf240('0x1f')]===undefined?null:_0x5ead2b['body'][_0xf240('0x1f')]}})[_0xf240('0xe')](function(_0x3b7824){if(_0x3b7824!=null){return db['CmHopperAdditionalPhone'][_0xf240('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x3b7824['id'],'OrderBy':{'$gt':_0x3b7824[_0xf240('0x20')]}},'order':[[_0xf240('0x20'),_0xf240('0x21')]]})[_0xf240('0xe')](function(_0x1bce31){var _0x213fea=0x0;if(_0x1bce31){if(_0x1bce31[_0xf240('0x22')]+_0x1bce31[_0xf240('0x23')]+_0x1bce31[_0xf240('0x24')]+_0x1bce31[_0xf240('0x25')]+_0x1bce31['countdropretry']+_0x1bce31[_0xf240('0x26')]+_0x1bce31[_0xf240('0x27')]+_0x1bce31['countagentrejectretry']<_0x5ead2b['entity']['dialGlobalMaxRetry'])_0x213fea=0x1;_0xd2ee7({'additional':_0x213fea});}else{return db[_0xf240('0x28')][_0xf240('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x3b7824['id']},'order':[[_0xf240('0x20'),_0xf240('0x21')]]})[_0xf240('0xe')](function(_0x150ee4){var _0x19605c=0x0;if(_0x150ee4){if(_0x150ee4[_0xf240('0x22')]+_0x150ee4[_0xf240('0x23')]+_0x150ee4[_0xf240('0x24')]+_0x150ee4['countnosuchnumberretry']+_0x150ee4[_0xf240('0x29')]+_0x150ee4['countabandonedretry']+_0x150ee4['countmachineretry']+_0x150ee4[_0xf240('0x2a')]<_0x5ead2b[_0xf240('0x2b')][_0xf240('0x2c')])_0x19605c=0x1;_0xd2ee7({'additional':_0x19605c});}else{_0xd2ee7({'additional':0x0});}})[_0xf240('0x18')](function(_0x448fc2){logger[_0xf240('0x15')]('VerifyAdditionalPhones',_0x448fc2[_0xf240('0x16')]);_0x1e971a(_0xa6301a[_0xf240('0x15')](0x1f4,_0x448fc2['message']));});}})[_0xf240('0x18')](function(_0x56cb17){logger[_0xf240('0x15')](_0xf240('0x2d'),_0x56cb17['message']);_0x1e971a(_0xa6301a[_0xf240('0x15')](0x1f4,_0x56cb17[_0xf240('0x16')]));});}else _0xd2ee7({'additional':0x0});});});};exports[_0xf240('0x2e')]=function(_0x177d03){var _0x52b7a2=this;return new Promise(function(_0x39a4a9,_0x11c28d){return db[_0xf240('0x19')][_0xf240('0x1a')]({'raw':!![],'where':{'ContactId':_0x177d03[_0xf240('0x1b')][_0xf240('0x1c')],'ListId':_0x177d03['body'][_0xf240('0x1d')],'VoiceQueueId':_0x177d03['body'][_0xf240('0x1e')]===undefined?null:_0x177d03[_0xf240('0x1b')][_0xf240('0x1e')],'CampaignId':_0x177d03['body']['CampaignId']===undefined?null:_0x177d03['body'][_0xf240('0x1f')]}})[_0xf240('0xe')](function(_0x16b383){if(_0x16b383!=null){return db[_0xf240('0x28')][_0xf240('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x16b383['id'],'OrderBy':{'$gte':_0x16b383[_0xf240('0x20')]}},'order':[['OrderBy',_0xf240('0x21')]]})[_0xf240('0xe')](function(_0x1fc035){if(_0x1fc035)return activateAdditionalPhone(_0x16b383,_0x177d03['body'],_0x1fc035,_0x177d03[_0xf240('0x2f')],_0x177d03[_0xf240('0x30')])[_0xf240('0xe')](function(_0x2e18eb){_0x39a4a9(_0x2e18eb);});else{return db[_0xf240('0x28')][_0xf240('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x16b383['id']},'order':[[_0xf240('0x20'),_0xf240('0x21')]]})[_0xf240('0xe')](function(_0x2bf4ff){if(_0x2bf4ff)return activateAdditionalPhone(_0x16b383,_0x177d03[_0xf240('0x1b')],_0x2bf4ff,_0x177d03['duration'],_0x177d03[_0xf240('0x30')])[_0xf240('0xe')](function(_0x16a78f){_0x39a4a9(_0x16a78f);});else{_0x39a4a9({'id':_0x16b383['id'],'phone':''});}})['catch'](function(_0x32bdf9){logger[_0xf240('0x15')](_0xf240('0x2d'),_0x32bdf9[_0xf240('0x16')]);_0x11c28d(_0x52b7a2[_0xf240('0x15')](0x1f4,_0x32bdf9[_0xf240('0x16')]));});}})['catch'](function(_0x5b7006){logger['error'](_0xf240('0x2d'),_0x5b7006['message']);_0x11c28d(_0x52b7a2[_0xf240('0x15')](0x1f4,_0x5b7006[_0xf240('0x16')]));});}else _0x39a4a9(0x1);});});};function activateAdditionalPhone(_0x36fee0,_0x59d224,_0x411c52,_0x343c06,_0x189f85){return new Promise(function(_0x3b9509,_0x11e7b4){var _0x45ea2a;if(_[_0xf240('0x31')](_0x411c52[_0xf240('0x32')])){_0x411c52[_0xf240('0x32')]=moment();}if(moment()>moment(_0x411c52['scheduledat'])){_0x45ea2a=moment()[_0xf240('0x33')](_0x189f85||0x3,_0xf240('0x34'));}else{if(_0x411c52[_0xf240('0x20')]==0x0){_0x45ea2a=moment(_0x411c52[_0xf240('0x32')]);}else{_0x45ea2a=moment()[_0xf240('0x33')](_0x189f85||0x3,_0xf240('0x34'));}}if(_[_0xf240('0x31')](_0x45ea2a)){_0x45ea2a=moment()[_0xf240('0x33')](_0x189f85||0x3,'minutes');}var _0x47018b={'phone':_0x36fee0[_0xf240('0x35')],'active':0x0,'OrderBy':_[_0xf240('0x31')](_0x36fee0['OrderBy'])?0x0:_0x36fee0[_0xf240('0x20')],'scheduledat':moment()[_0xf240('0x33')](_0x343c06||0x1,_0xf240('0x34')),'countbusyretry':_0x59d224[_0xf240('0x22')],'countcongestionretry':_0x59d224[_0xf240('0x23')],'countnoanswerretry':_0x59d224[_0xf240('0x24')],'countnosuchnumberretry':_0x59d224['countnosuchnumberretry'],'countdropretry':_0x59d224[_0xf240('0x29')],'countabandonedretry':_0x59d224[_0xf240('0x26')],'countmachineretry':_0x59d224[_0xf240('0x27')],'countagentrejectretry':_0x59d224[_0xf240('0x2a')],'createdAt':_0x59d224[_0xf240('0x36')],'updatedAt':_0x59d224['updatedAt']};var _0x2a4686={'CmHopperId':_0x36fee0['id'],'phone':_0x411c52[_0xf240('0x35')],'active':0x0,'OrderBy':_[_0xf240('0x31')](_0x411c52[_0xf240('0x20')])?0x0:_0x411c52['OrderBy'],'scheduledat':_0x45ea2a,'countbusyretry':_0x411c52[_0xf240('0x22')],'countcongestionretry':_0x411c52[_0xf240('0x23')],'countnoanswerretry':_0x411c52[_0xf240('0x24')],'countnosuchnumberretry':_0x411c52[_0xf240('0x25')],'countdropretry':_0x411c52[_0xf240('0x29')],'countabandonedretry':_0x411c52[_0xf240('0x26')],'countmachineretry':_0x411c52[_0xf240('0x27')],'countagentrejectretry':_0x411c52[_0xf240('0x2a')],'createdAt':_0x411c52[_0xf240('0x36')],'updatedAt':_0x411c52['updatedAt']};return db['sequelize']['transaction'](function(_0x4f4d1b){return db[_0xf240('0x28')]['update'](_0x47018b,{'where':{'id':_0x411c52['id']}},{'transaction':_0x4f4d1b})[_0xf240('0xe')](function(){return db['CmHopper'][_0xf240('0x37')](_0x2a4686,{'where':{'id':_0x36fee0['id']}},{'transaction':_0x4f4d1b});});})[_0xf240('0xe')](function(_0x4d9da5){_0x3b9509({'id':_0x36fee0['id'],'phone':_0x411c52[_0xf240('0x35')]});})[_0xf240('0x18')](function(_0x1c59da){logger[_0xf240('0x15')](_0xf240('0x38'),_0x1c59da[_0xf240('0x16')]);_0x11e7b4({'error':_0x1c59da[_0xf240('0x16')]});});});}exports[_0xf240('0x39')]=function(_0x5d02b6){var _0x29bd9f=this;return new Promise(function(_0x201f72,_0x4b18f4){return db[_0xf240('0x19')][_0xf240('0x37')](_0x5d02b6[_0xf240('0x1b')][_0xf240('0x3a')],{'where':{'id':_0x5d02b6[_0xf240('0x1b')]['id']}})[_0xf240('0xe')](function(_0x284436){_0x201f72(_0x284436);})[_0xf240('0x18')](function(_0x4eace0){logger[_0xf240('0x15')](_0xf240('0x39'),_0x4eace0['message']);_0x4b18f4(_0x29bd9f[_0xf240('0x15')](0x1f4,_0x4eace0[_0xf240('0x16')]));});});};
\ No newline at end of file