Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.rpc.js
index 9ea0df8..49bc1b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f9=['duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countcongestionretry','countabandonedretry','CmHopper'];(function(_0x1dc4fd,_0x47c249){var _0x5631c1=function(_0x185da0){while(--_0x185da0){_0x1dc4fd['push'](_0x1dc4fd['shift']());}};_0x5631c1(++_0x47c249);}(_0x62f9,0x196));var _0x962f=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x62f9[_0x3ef45e];return _0x69e7c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x962f('0x0'));var BPromise=require('bluebird');var rs=require(_0x962f('0x1'));var fs=require('fs');var Redis=require(_0x962f('0x2'));var db=require(_0x962f('0x3'))['db'];var utils=require(_0x962f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x962f('0x5'));var jayson=require(_0x962f('0x6'));var client=jayson[_0x962f('0x7')][_0x962f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x527511,_0x342958,_0x451259){return new BPromise(function(_0x461303,_0x26f8f6){return client[_0x962f('0x9')](_0x527511,_0x451259)[_0x962f('0xa')](function(_0x440db6){logger[_0x962f('0xb')](_0x962f('0xc'),_0x342958,_0x962f('0xd'));logger[_0x962f('0xe')](_0x962f('0xf'),_0x342958,'request\x20sent',JSON[_0x962f('0x10')](_0x440db6));if(_0x440db6[_0x962f('0x11')]){if(_0x440db6[_0x962f('0x11')][_0x962f('0x12')]===0x1f4){logger['error'](_0x962f('0xc'),_0x342958,_0x440db6[_0x962f('0x11')][_0x962f('0x13')]);return _0x26f8f6(_0x440db6[_0x962f('0x11')][_0x962f('0x13')]);}logger[_0x962f('0x11')](_0x962f('0xc'),_0x342958,_0x440db6[_0x962f('0x11')][_0x962f('0x13')]);return _0x461303(_0x440db6[_0x962f('0x11')][_0x962f('0x13')]);}else{logger[_0x962f('0xb')](_0x962f('0xc'),_0x342958,'request\x20sent');_0x461303(_0x440db6[_0x962f('0x14')][_0x962f('0x13')]);}})[_0x962f('0x15')](function(_0x2806bc){logger[_0x962f('0x11')](_0x962f('0xc'),_0x342958,_0x2806bc);_0x26f8f6(_0x2806bc);});});}exports[_0x962f('0x16')]=function(_0x5b5adb){var _0x278494=this;return new Promise(function(_0x1984d0,_0x244f25){return db['CmHopper'][_0x962f('0x17')]({'raw':!![],'where':{'ContactId':_0x5b5adb[_0x962f('0x18')]['ContactId'],'ListId':_0x5b5adb['body'][_0x962f('0x19')],'VoiceQueueId':_0x5b5adb[_0x962f('0x18')][_0x962f('0x1a')]===undefined?null:_0x5b5adb[_0x962f('0x18')][_0x962f('0x1a')],'CampaignId':_0x5b5adb[_0x962f('0x18')][_0x962f('0x1b')]===undefined?null:_0x5b5adb['body'][_0x962f('0x1b')]}})[_0x962f('0xa')](function(_0x1dd1ca){if(_0x1dd1ca!=null){return db[_0x962f('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1dd1ca['id'],'OrderBy':{'$gt':_0x1dd1ca[_0x962f('0x1d')]}},'order':[[_0x962f('0x1d'),'ASC']]})['then'](function(_0x71dea9){var _0x43e6f9=0x0;if(_0x71dea9){if(_0x71dea9[_0x962f('0x1e')]+_0x71dea9['countcongestionretry']+_0x71dea9[_0x962f('0x1f')]+_0x71dea9[_0x962f('0x20')]+_0x71dea9[_0x962f('0x21')]+_0x71dea9['countabandonedretry']+_0x71dea9[_0x962f('0x22')]+_0x71dea9[_0x962f('0x23')]<_0x5b5adb[_0x962f('0x24')][_0x962f('0x25')])_0x43e6f9=0x1;_0x1984d0({'additional':_0x43e6f9});}else{return db[_0x962f('0x1c')][_0x962f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x1dd1ca['id']},'order':[['OrderBy',_0x962f('0x26')]]})['then'](function(_0x45c94d){var _0x435522=0x0;if(_0x45c94d){if(_0x45c94d[_0x962f('0x1e')]+_0x45c94d[_0x962f('0x27')]+_0x45c94d[_0x962f('0x1f')]+_0x45c94d[_0x962f('0x20')]+_0x45c94d['countdropretry']+_0x45c94d[_0x962f('0x28')]+_0x45c94d['countmachineretry']+_0x45c94d[_0x962f('0x23')]<_0x5b5adb[_0x962f('0x24')]['dialGlobalMaxRetry'])_0x435522=0x1;_0x1984d0({'additional':_0x435522});}else{_0x1984d0({'additional':0x0});}})['catch'](function(_0x438361){logger[_0x962f('0x11')](_0x962f('0x16'),_0x438361[_0x962f('0x13')]);_0x244f25(_0x278494['error'](0x1f4,_0x438361[_0x962f('0x13')]));});}})[_0x962f('0x15')](function(_0x42c5cf){logger[_0x962f('0x11')](_0x962f('0x16'),_0x42c5cf[_0x962f('0x13')]);_0x244f25(_0x278494[_0x962f('0x11')](0x1f4,_0x42c5cf[_0x962f('0x13')]));});}else _0x1984d0({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x387785){var _0x1782c5=this;return new Promise(function(_0x5ef603,_0x55eae5){return db[_0x962f('0x29')][_0x962f('0x17')]({'raw':!![],'where':{'ContactId':_0x387785[_0x962f('0x18')]['ContactId'],'ListId':_0x387785[_0x962f('0x18')][_0x962f('0x19')],'VoiceQueueId':_0x387785['body']['VoiceQueueId']===undefined?null:_0x387785['body'][_0x962f('0x1a')],'CampaignId':_0x387785['body']['CampaignId']===undefined?null:_0x387785[_0x962f('0x18')][_0x962f('0x1b')]}})[_0x962f('0xa')](function(_0x671cec){if(_0x671cec!=null){return db[_0x962f('0x1c')][_0x962f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x671cec['id'],'OrderBy':{'$gte':_0x671cec[_0x962f('0x1d')]}},'order':[[_0x962f('0x1d'),'ASC']]})[_0x962f('0xa')](function(_0x57e72f){if(_0x57e72f)return activateAdditionalPhone(_0x671cec,_0x387785['body'],_0x57e72f,_0x387785[_0x962f('0x2a')],_0x387785[_0x962f('0x2b')])['then'](function(_0x2e5a41){_0x5ef603(_0x2e5a41);});else{return db[_0x962f('0x1c')][_0x962f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x671cec['id']},'order':[[_0x962f('0x1d'),_0x962f('0x26')]]})[_0x962f('0xa')](function(_0x487667){if(_0x487667)return activateAdditionalPhone(_0x671cec,_0x387785[_0x962f('0x18')],_0x487667,_0x387785[_0x962f('0x2a')],_0x387785[_0x962f('0x2b')])[_0x962f('0xa')](function(_0x32ba68){_0x5ef603(_0x32ba68);});else{_0x5ef603({'id':_0x671cec['id'],'phone':''});}})['catch'](function(_0x5ab866){logger['error'](_0x962f('0x16'),_0x5ab866[_0x962f('0x13')]);_0x55eae5(_0x1782c5['error'](0x1f4,_0x5ab866[_0x962f('0x13')]));});}})[_0x962f('0x15')](function(_0x4d3ba3){logger[_0x962f('0x11')](_0x962f('0x16'),_0x4d3ba3['message']);_0x55eae5(_0x1782c5['error'](0x1f4,_0x4d3ba3[_0x962f('0x13')]));});}else _0x5ef603(0x1);});});};function activateAdditionalPhone(_0x5c6900,_0x513938,_0x5576b0,_0x1050f4,_0x410274){return new Promise(function(_0x41879b,_0x1aa883){var _0xf050f9;if(_[_0x962f('0x2c')](_0x5576b0[_0x962f('0x2d')])){_0x5576b0[_0x962f('0x2d')]=moment();}if(moment()>moment(_0x5576b0[_0x962f('0x2d')])){_0xf050f9=moment()[_0x962f('0x2e')](_0x410274||0x3,_0x962f('0x2f'));}else{if(_0x5576b0['OrderBy']==0x0){_0xf050f9=moment(_0x5576b0[_0x962f('0x2d')]);}else{_0xf050f9=moment()[_0x962f('0x2e')](_0x410274||0x3,_0x962f('0x2f'));}}if(_[_0x962f('0x2c')](_0xf050f9)){_0xf050f9=moment()[_0x962f('0x2e')](_0x410274||0x3,_0x962f('0x2f'));}var _0x1fc32b={'phone':_0x5c6900[_0x962f('0x30')],'active':0x0,'OrderBy':_[_0x962f('0x2c')](_0x5c6900[_0x962f('0x1d')])?0x0:_0x5c6900[_0x962f('0x1d')],'scheduledat':moment()[_0x962f('0x2e')](_0x1050f4||0x1,_0x962f('0x2f')),'countbusyretry':_0x513938[_0x962f('0x1e')],'countcongestionretry':_0x513938['countcongestionretry'],'countnoanswerretry':_0x513938[_0x962f('0x1f')],'countnosuchnumberretry':_0x513938[_0x962f('0x20')],'countdropretry':_0x513938[_0x962f('0x21')],'countabandonedretry':_0x513938[_0x962f('0x28')],'countmachineretry':_0x513938['countmachineretry'],'countagentrejectretry':_0x513938[_0x962f('0x23')],'createdAt':_0x513938['createdAt'],'updatedAt':_0x513938[_0x962f('0x31')]};var _0x4c0a0d={'CmHopperId':_0x5c6900['id'],'phone':_0x5576b0[_0x962f('0x30')],'active':0x0,'OrderBy':_[_0x962f('0x2c')](_0x5576b0[_0x962f('0x1d')])?0x0:_0x5576b0[_0x962f('0x1d')],'scheduledat':_0xf050f9,'countbusyretry':_0x5576b0[_0x962f('0x1e')],'countcongestionretry':_0x5576b0[_0x962f('0x27')],'countnoanswerretry':_0x5576b0[_0x962f('0x1f')],'countnosuchnumberretry':_0x5576b0[_0x962f('0x20')],'countdropretry':_0x5576b0['countdropretry'],'countabandonedretry':_0x5576b0[_0x962f('0x28')],'countmachineretry':_0x5576b0[_0x962f('0x22')],'countagentrejectretry':_0x5576b0['countagentrejectretry'],'createdAt':_0x5576b0[_0x962f('0x32')],'updatedAt':_0x5576b0[_0x962f('0x31')]};return db[_0x962f('0x33')][_0x962f('0x34')](function(_0xe211f6){return db['CmHopperAdditionalPhone'][_0x962f('0x35')](_0x1fc32b,{'where':{'id':_0x5576b0['id']}},{'transaction':_0xe211f6})[_0x962f('0xa')](function(){return db['CmHopper'][_0x962f('0x35')](_0x4c0a0d,{'where':{'id':_0x5c6900['id']}},{'transaction':_0xe211f6});});})[_0x962f('0xa')](function(_0x2bce60){_0x41879b({'id':_0x5c6900['id'],'phone':_0x5576b0[_0x962f('0x30')]});})['catch'](function(_0x398653){logger[_0x962f('0x11')](_0x962f('0x36'),_0x398653['message']);_0x1aa883({'error':_0x398653[_0x962f('0x13')]});});});}exports[_0x962f('0x37')]=function(_0x22b663){var _0x4f3a62=this;return new Promise(function(_0x3ce8ad,_0x192f38){return db[_0x962f('0x29')]['update'](_0x22b663[_0x962f('0x18')]['field'],{'where':{'id':_0x22b663[_0x962f('0x18')]['id']}})[_0x962f('0xa')](function(_0xd8126d){_0x3ce8ad(_0xd8126d);})['catch'](function(_0x49dde7){logger[_0x962f('0x11')]('IncrementPreviewCounters',_0x49dde7['message']);_0x192f38(_0x4f3a62['error'](0x1f4,_0x49dde7['message']));});});};
\ No newline at end of file
+var _0x7490=['rpc','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VerifyAdditionalPhones','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','countcongestionretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','SwapAdditionalPhones','CmHopper','duration','waitTime','scheduledat','minutes','add','isNil','phone','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13f34e,_0xec65f2){var _0x41e2be=function(_0x49e65c){while(--_0x49e65c){_0x13f34e['push'](_0x13f34e['shift']());}};_0x41e2be(++_0xec65f2);}(_0x7490,0x71));var _0x0749=function(_0x8b82f8,_0x23f7ce){_0x8b82f8=_0x8b82f8-0x0;var _0x316967=_0x7490[_0x8b82f8];return _0x316967;};'use strict';var _=require(_0x0749('0x0'));var util=require(_0x0749('0x1'));var moment=require(_0x0749('0x2'));var BPromise=require(_0x0749('0x3'));var rs=require(_0x0749('0x4'));var fs=require('fs');var Redis=require(_0x0749('0x5'));var db=require(_0x0749('0x6'))['db'];var utils=require(_0x0749('0x7'));var logger=require(_0x0749('0x8'))(_0x0749('0x9'));var config=require('../../config/environment');var jayson=require(_0x0749('0xa'));var client=jayson[_0x0749('0xb')][_0x0749('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e7dde,_0x3cc561,_0x2cd9b2){return new BPromise(function(_0x34aad7,_0x44d302){return client[_0x0749('0xd')](_0x1e7dde,_0x2cd9b2)[_0x0749('0xe')](function(_0x3c0142){logger[_0x0749('0xf')](_0x0749('0x10'),_0x3cc561,_0x0749('0x11'));logger[_0x0749('0x12')](_0x0749('0x13'),_0x3cc561,'request\x20sent',JSON['stringify'](_0x3c0142));if(_0x3c0142[_0x0749('0x14')]){if(_0x3c0142[_0x0749('0x14')][_0x0749('0x15')]===0x1f4){logger['error'](_0x0749('0x10'),_0x3cc561,_0x3c0142[_0x0749('0x14')]['message']);return _0x44d302(_0x3c0142[_0x0749('0x14')]['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3cc561,_0x3c0142['error']['message']);return _0x34aad7(_0x3c0142[_0x0749('0x14')][_0x0749('0x16')]);}else{logger[_0x0749('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3cc561,_0x0749('0x11'));_0x34aad7(_0x3c0142[_0x0749('0x17')][_0x0749('0x16')]);}})[_0x0749('0x18')](function(_0x537fd8){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3cc561,_0x537fd8);_0x44d302(_0x537fd8);});});}exports[_0x0749('0x19')]=function(_0x2a8d18){var _0x2c691a=this;return new Promise(function(_0x53d237,_0x351e43){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x2a8d18[_0x0749('0x1a')][_0x0749('0x1b')],'ListId':_0x2a8d18[_0x0749('0x1a')][_0x0749('0x1c')],'VoiceQueueId':_0x2a8d18['body'][_0x0749('0x1d')]===undefined?null:_0x2a8d18[_0x0749('0x1a')]['VoiceQueueId'],'CampaignId':_0x2a8d18[_0x0749('0x1a')][_0x0749('0x1e')]===undefined?null:_0x2a8d18['body']['CampaignId']}})['then'](function(_0x57fadb){if(_0x57fadb!=null){return db[_0x0749('0x1f')][_0x0749('0x20')]({'raw':!![],'where':{'CmHopperId':_0x57fadb['id'],'OrderBy':{'$gt':_0x57fadb[_0x0749('0x21')]}},'order':[[_0x0749('0x21'),_0x0749('0x22')]]})[_0x0749('0xe')](function(_0x4da267){var _0x562ffd=0x0;if(_0x4da267){if(_0x4da267[_0x0749('0x23')]+_0x4da267['countcongestionretry']+_0x4da267[_0x0749('0x24')]+_0x4da267[_0x0749('0x25')]+_0x4da267[_0x0749('0x26')]+_0x4da267['countabandonedretry']+_0x4da267[_0x0749('0x27')]+_0x4da267['countagentrejectretry']<_0x2a8d18[_0x0749('0x28')]['dialGlobalMaxRetry'])_0x562ffd=0x1;_0x53d237({'additional':_0x562ffd});}else{return db['CmHopperAdditionalPhone'][_0x0749('0x20')]({'raw':!![],'where':{'CmHopperId':_0x57fadb['id']},'order':[[_0x0749('0x21'),_0x0749('0x22')]]})[_0x0749('0xe')](function(_0x1c0a33){var _0x313794=0x0;if(_0x1c0a33){if(_0x1c0a33['countbusyretry']+_0x1c0a33[_0x0749('0x29')]+_0x1c0a33[_0x0749('0x24')]+_0x1c0a33[_0x0749('0x25')]+_0x1c0a33['countdropretry']+_0x1c0a33[_0x0749('0x2a')]+_0x1c0a33[_0x0749('0x27')]+_0x1c0a33[_0x0749('0x2b')]<_0x2a8d18[_0x0749('0x28')][_0x0749('0x2c')])_0x313794=0x1;_0x53d237({'additional':_0x313794});}else{_0x53d237({'additional':0x0});}})[_0x0749('0x18')](function(_0x48a131){logger[_0x0749('0x14')](_0x0749('0x19'),_0x48a131[_0x0749('0x16')]);_0x351e43(_0x2c691a[_0x0749('0x14')](0x1f4,_0x48a131[_0x0749('0x16')]));});}})[_0x0749('0x18')](function(_0xd3be80){logger[_0x0749('0x14')]('VerifyAdditionalPhones',_0xd3be80['message']);_0x351e43(_0x2c691a[_0x0749('0x14')](0x1f4,_0xd3be80[_0x0749('0x16')]));});}else _0x53d237({'additional':0x0});});});};exports[_0x0749('0x2d')]=function(_0x290a40){var _0x4a5d94=this;return new Promise(function(_0x5a1b9a,_0x574776){return db[_0x0749('0x2e')][_0x0749('0x20')]({'raw':!![],'where':{'ContactId':_0x290a40[_0x0749('0x1a')][_0x0749('0x1b')],'ListId':_0x290a40[_0x0749('0x1a')]['ListId'],'VoiceQueueId':_0x290a40[_0x0749('0x1a')]['VoiceQueueId']===undefined?null:_0x290a40[_0x0749('0x1a')][_0x0749('0x1d')],'CampaignId':_0x290a40[_0x0749('0x1a')][_0x0749('0x1e')]===undefined?null:_0x290a40[_0x0749('0x1a')][_0x0749('0x1e')]}})[_0x0749('0xe')](function(_0x491bba){if(_0x491bba!=null){return db[_0x0749('0x1f')][_0x0749('0x20')]({'raw':!![],'where':{'CmHopperId':_0x491bba['id'],'OrderBy':{'$gte':_0x491bba[_0x0749('0x21')]}},'order':[[_0x0749('0x21'),_0x0749('0x22')]]})[_0x0749('0xe')](function(_0x1f7c8c){if(_0x1f7c8c)return activateAdditionalPhone(_0x491bba,_0x290a40['body'],_0x1f7c8c,_0x290a40[_0x0749('0x2f')],_0x290a40[_0x0749('0x30')])['then'](function(_0x4e8451){_0x5a1b9a(_0x4e8451);});else{return db[_0x0749('0x1f')][_0x0749('0x20')]({'raw':!![],'where':{'CmHopperId':_0x491bba['id']},'order':[[_0x0749('0x21'),_0x0749('0x22')]]})[_0x0749('0xe')](function(_0x1a6cf8){if(_0x1a6cf8)return activateAdditionalPhone(_0x491bba,_0x290a40[_0x0749('0x1a')],_0x1a6cf8,_0x290a40[_0x0749('0x2f')],_0x290a40[_0x0749('0x30')])['then'](function(_0x34b6c6){_0x5a1b9a(_0x34b6c6);});else{_0x5a1b9a({'id':_0x491bba['id'],'phone':''});}})[_0x0749('0x18')](function(_0x501f04){logger[_0x0749('0x14')]('VerifyAdditionalPhones',_0x501f04['message']);_0x574776(_0x4a5d94[_0x0749('0x14')](0x1f4,_0x501f04[_0x0749('0x16')]));});}})[_0x0749('0x18')](function(_0x3236a2){logger[_0x0749('0x14')](_0x0749('0x19'),_0x3236a2['message']);_0x574776(_0x4a5d94[_0x0749('0x14')](0x1f4,_0x3236a2['message']));});}else _0x5a1b9a(0x1);});});};function activateAdditionalPhone(_0x2465bd,_0x599376,_0x12c97b,_0x39dfbc,_0x1495b5){return new Promise(function(_0x18bf01,_0x1f7024){var _0x58b445;if(_['isNil'](_0x12c97b[_0x0749('0x31')])){_0x12c97b[_0x0749('0x31')]=moment();}if(moment()>moment(_0x12c97b[_0x0749('0x31')])){_0x58b445=moment()['add'](_0x1495b5||0x3,_0x0749('0x32'));}else{if(_0x12c97b[_0x0749('0x21')]==0x0){_0x58b445=moment(_0x12c97b[_0x0749('0x31')]);}else{_0x58b445=moment()[_0x0749('0x33')](_0x1495b5||0x3,_0x0749('0x32'));}}if(_[_0x0749('0x34')](_0x58b445)){_0x58b445=moment()[_0x0749('0x33')](_0x1495b5||0x3,_0x0749('0x32'));}var _0xb74e20={'phone':_0x2465bd[_0x0749('0x35')],'active':0x0,'OrderBy':_[_0x0749('0x34')](_0x2465bd[_0x0749('0x21')])?0x0:_0x2465bd['OrderBy'],'scheduledat':moment()[_0x0749('0x33')](_0x39dfbc||0x1,_0x0749('0x32')),'countbusyretry':_0x599376['countbusyretry'],'countcongestionretry':_0x599376[_0x0749('0x29')],'countnoanswerretry':_0x599376['countnoanswerretry'],'countnosuchnumberretry':_0x599376[_0x0749('0x25')],'countdropretry':_0x599376[_0x0749('0x26')],'countabandonedretry':_0x599376[_0x0749('0x2a')],'countmachineretry':_0x599376[_0x0749('0x27')],'countagentrejectretry':_0x599376[_0x0749('0x2b')],'createdAt':_0x599376[_0x0749('0x36')],'updatedAt':_0x599376[_0x0749('0x37')]};var _0x52d73d={'CmHopperId':_0x2465bd['id'],'phone':_0x12c97b[_0x0749('0x35')],'active':0x0,'OrderBy':_[_0x0749('0x34')](_0x12c97b['OrderBy'])?0x0:_0x12c97b[_0x0749('0x21')],'scheduledat':_0x58b445,'countbusyretry':_0x12c97b[_0x0749('0x23')],'countcongestionretry':_0x12c97b[_0x0749('0x29')],'countnoanswerretry':_0x12c97b[_0x0749('0x24')],'countnosuchnumberretry':_0x12c97b[_0x0749('0x25')],'countdropretry':_0x12c97b['countdropretry'],'countabandonedretry':_0x12c97b[_0x0749('0x2a')],'countmachineretry':_0x12c97b[_0x0749('0x27')],'countagentrejectretry':_0x12c97b['countagentrejectretry'],'createdAt':_0x12c97b[_0x0749('0x36')],'updatedAt':_0x12c97b[_0x0749('0x37')]};return db[_0x0749('0x38')]['transaction'](function(_0x572f2e){return db[_0x0749('0x1f')][_0x0749('0x39')](_0xb74e20,{'where':{'id':_0x12c97b['id']}},{'transaction':_0x572f2e})['then'](function(){return db[_0x0749('0x2e')][_0x0749('0x39')](_0x52d73d,{'where':{'id':_0x2465bd['id']}},{'transaction':_0x572f2e});});})[_0x0749('0xe')](function(_0xc5bab5){_0x18bf01({'id':_0x2465bd['id'],'phone':_0x12c97b[_0x0749('0x35')]});})[_0x0749('0x18')](function(_0x315d3b){logger['error'](_0x0749('0x3a'),_0x315d3b['message']);_0x1f7024({'error':_0x315d3b[_0x0749('0x16')]});});});}exports[_0x0749('0x3b')]=function(_0x5cd1e2){var _0x2a2bf2=this;return new Promise(function(_0x5641dd,_0x203829){return db['CmHopper'][_0x0749('0x39')](_0x5cd1e2[_0x0749('0x1a')][_0x0749('0x3c')],{'where':{'id':_0x5cd1e2[_0x0749('0x1a')]['id']}})[_0x0749('0xe')](function(_0x3c7c4d){_0x5641dd(_0x3c7c4d);})[_0x0749('0x18')](function(_0x113186){logger[_0x0749('0x14')](_0x0749('0x3b'),_0x113186[_0x0749('0x16')]);_0x203829(_0x2a2bf2['error'](0x1f4,_0x113186[_0x0749('0x16')]));});});};
\ No newline at end of file