Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.rpc.js
index 94b3704..2118c0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02f4=['ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','countabandonedretry','SwapAdditionalPhones','CmHopper','duration','waitTime','scheduledat','minutes','isNil','add','updatedAt','phone','createdAt','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy'];(function(_0x26793a,_0x49cf51){var _0x575efb=function(_0x2f4db7){while(--_0x2f4db7){_0x26793a['push'](_0x26793a['shift']());}};_0x575efb(++_0x49cf51);}(_0x02f4,0x142));var _0x402f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x02f4[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x402f('0x0'));var util=require(_0x402f('0x1'));var moment=require('moment');var BPromise=require(_0x402f('0x2'));var rs=require(_0x402f('0x3'));var fs=require('fs');var Redis=require(_0x402f('0x4'));var db=require(_0x402f('0x5'))['db'];var utils=require(_0x402f('0x6'));var logger=require(_0x402f('0x7'))(_0x402f('0x8'));var config=require(_0x402f('0x9'));var jayson=require(_0x402f('0xa'));var client=jayson[_0x402f('0xb')][_0x402f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x392904,_0x28ee78,_0x3bc4f1){return new BPromise(function(_0x12bad8,_0x5ca55d){return client['request'](_0x392904,_0x3bc4f1)[_0x402f('0xd')](function(_0x34711d){logger[_0x402f('0xe')](_0x402f('0xf'),_0x28ee78,_0x402f('0x10'));logger['debug'](_0x402f('0x11'),_0x28ee78,_0x402f('0x10'),JSON['stringify'](_0x34711d));if(_0x34711d[_0x402f('0x12')]){if(_0x34711d[_0x402f('0x12')][_0x402f('0x13')]===0x1f4){logger[_0x402f('0x12')](_0x402f('0xf'),_0x28ee78,_0x34711d[_0x402f('0x12')][_0x402f('0x14')]);return _0x5ca55d(_0x34711d[_0x402f('0x12')]['message']);}logger[_0x402f('0x12')](_0x402f('0xf'),_0x28ee78,_0x34711d['error'][_0x402f('0x14')]);return _0x12bad8(_0x34711d[_0x402f('0x12')][_0x402f('0x14')]);}else{logger[_0x402f('0xe')](_0x402f('0xf'),_0x28ee78,_0x402f('0x10'));_0x12bad8(_0x34711d[_0x402f('0x15')][_0x402f('0x14')]);}})[_0x402f('0x16')](function(_0xa71478){logger[_0x402f('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x28ee78,_0xa71478);_0x5ca55d(_0xa71478);});});}exports[_0x402f('0x17')]=function(_0x3a1a29){var _0x2bcd2a=this;return new Promise(function(_0x3066a8,_0x24d650){return db['CmHopper'][_0x402f('0x18')]({'raw':!![],'where':{'ContactId':_0x3a1a29[_0x402f('0x19')][_0x402f('0x1a')],'ListId':_0x3a1a29[_0x402f('0x19')][_0x402f('0x1b')],'VoiceQueueId':_0x3a1a29[_0x402f('0x19')][_0x402f('0x1c')]===undefined?null:_0x3a1a29[_0x402f('0x19')]['VoiceQueueId'],'CampaignId':_0x3a1a29[_0x402f('0x19')][_0x402f('0x1d')]===undefined?null:_0x3a1a29[_0x402f('0x19')][_0x402f('0x1d')]}})['then'](function(_0x4bca0e){if(_0x4bca0e!=null){return db[_0x402f('0x1e')][_0x402f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4bca0e['id'],'OrderBy':{'$gt':_0x4bca0e[_0x402f('0x1f')]}},'order':[[_0x402f('0x1f'),_0x402f('0x20')]]})[_0x402f('0xd')](function(_0x28a1e4){var _0x48b554=0x0;if(_0x28a1e4){if(_0x28a1e4[_0x402f('0x21')]+_0x28a1e4[_0x402f('0x22')]+_0x28a1e4['countnoanswerretry']+_0x28a1e4[_0x402f('0x23')]+_0x28a1e4[_0x402f('0x24')]+_0x28a1e4['countabandonedretry']+_0x28a1e4[_0x402f('0x25')]+_0x28a1e4[_0x402f('0x26')]<_0x3a1a29[_0x402f('0x27')][_0x402f('0x28')])_0x48b554=0x1;_0x3066a8({'additional':_0x48b554});}else{return db[_0x402f('0x1e')][_0x402f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4bca0e['id']},'order':[[_0x402f('0x1f'),'ASC']]})[_0x402f('0xd')](function(_0x1d001e){var _0x456564=0x0;if(_0x1d001e){if(_0x1d001e['countbusyretry']+_0x1d001e['countcongestionretry']+_0x1d001e[_0x402f('0x29')]+_0x1d001e['countnosuchnumberretry']+_0x1d001e['countdropretry']+_0x1d001e[_0x402f('0x2a')]+_0x1d001e[_0x402f('0x25')]+_0x1d001e['countagentrejectretry']<_0x3a1a29[_0x402f('0x27')][_0x402f('0x28')])_0x456564=0x1;_0x3066a8({'additional':_0x456564});}else{_0x3066a8({'additional':0x0});}})['catch'](function(_0xaf6cf8){logger[_0x402f('0x12')](_0x402f('0x17'),_0xaf6cf8[_0x402f('0x14')]);_0x24d650(_0x2bcd2a[_0x402f('0x12')](0x1f4,_0xaf6cf8[_0x402f('0x14')]));});}})['catch'](function(_0x205038){logger[_0x402f('0x12')](_0x402f('0x17'),_0x205038['message']);_0x24d650(_0x2bcd2a[_0x402f('0x12')](0x1f4,_0x205038[_0x402f('0x14')]));});}else _0x3066a8({'additional':0x0});});});};exports[_0x402f('0x2b')]=function(_0x4f50f2){var _0x1ca7f3=this;return new Promise(function(_0x3b1398,_0x4c9880){return db[_0x402f('0x2c')][_0x402f('0x18')]({'raw':!![],'where':{'ContactId':_0x4f50f2['body'][_0x402f('0x1a')],'ListId':_0x4f50f2['body'][_0x402f('0x1b')],'VoiceQueueId':_0x4f50f2[_0x402f('0x19')][_0x402f('0x1c')]===undefined?null:_0x4f50f2[_0x402f('0x19')]['VoiceQueueId'],'CampaignId':_0x4f50f2[_0x402f('0x19')][_0x402f('0x1d')]===undefined?null:_0x4f50f2[_0x402f('0x19')]['CampaignId']}})[_0x402f('0xd')](function(_0x587503){if(_0x587503!=null){return db[_0x402f('0x1e')][_0x402f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x587503['id'],'OrderBy':{'$gte':_0x587503[_0x402f('0x1f')]}},'order':[[_0x402f('0x1f'),_0x402f('0x20')]]})[_0x402f('0xd')](function(_0x2589c9){if(_0x2589c9)return activateAdditionalPhone(_0x587503,_0x4f50f2[_0x402f('0x19')],_0x2589c9,_0x4f50f2[_0x402f('0x2d')],_0x4f50f2['waitTime'])[_0x402f('0xd')](function(_0x55ecce){_0x3b1398(_0x55ecce);});else{return db[_0x402f('0x1e')][_0x402f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x587503['id']},'order':[[_0x402f('0x1f'),_0x402f('0x20')]]})[_0x402f('0xd')](function(_0x4a3b8c){if(_0x4a3b8c)return activateAdditionalPhone(_0x587503,_0x4f50f2[_0x402f('0x19')],_0x4a3b8c,_0x4f50f2[_0x402f('0x2d')],_0x4f50f2[_0x402f('0x2e')])[_0x402f('0xd')](function(_0x406041){_0x3b1398(_0x406041);});else{_0x3b1398({'id':_0x587503['id'],'phone':''});}})[_0x402f('0x16')](function(_0x68d0aa){logger[_0x402f('0x12')](_0x402f('0x17'),_0x68d0aa[_0x402f('0x14')]);_0x4c9880(_0x1ca7f3['error'](0x1f4,_0x68d0aa[_0x402f('0x14')]));});}})[_0x402f('0x16')](function(_0x2c7e00){logger[_0x402f('0x12')](_0x402f('0x17'),_0x2c7e00[_0x402f('0x14')]);_0x4c9880(_0x1ca7f3[_0x402f('0x12')](0x1f4,_0x2c7e00[_0x402f('0x14')]));});}else _0x3b1398(0x1);});});};function activateAdditionalPhone(_0x29c591,_0xbc0d4c,_0x204e47,_0x453553,_0x1a330e){return new Promise(function(_0x1d2f0b,_0x542fa0){var _0x4bd246;if(_['isNil'](_0x204e47[_0x402f('0x2f')])){_0x204e47[_0x402f('0x2f')]=moment();}if(moment()>moment(_0x204e47['scheduledat'])){_0x4bd246=moment()['add'](_0x1a330e||0x3,_0x402f('0x30'));}else{if(_0x204e47[_0x402f('0x1f')]==0x0){_0x4bd246=moment(_0x204e47[_0x402f('0x2f')]);}else{_0x4bd246=moment()['add'](_0x1a330e||0x3,_0x402f('0x30'));}}if(_[_0x402f('0x31')](_0x4bd246)){_0x4bd246=moment()[_0x402f('0x32')](_0x1a330e||0x3,_0x402f('0x30'));}var _0x5cfa47={'phone':_0x29c591['phone'],'active':0x0,'OrderBy':_[_0x402f('0x31')](_0x29c591[_0x402f('0x1f')])?0x0:_0x29c591[_0x402f('0x1f')],'scheduledat':moment()[_0x402f('0x32')](_0x453553||0x1,_0x402f('0x30')),'countbusyretry':_0xbc0d4c[_0x402f('0x21')],'countcongestionretry':_0xbc0d4c[_0x402f('0x22')],'countnoanswerretry':_0xbc0d4c['countnoanswerretry'],'countnosuchnumberretry':_0xbc0d4c[_0x402f('0x23')],'countdropretry':_0xbc0d4c['countdropretry'],'countabandonedretry':_0xbc0d4c[_0x402f('0x2a')],'countmachineretry':_0xbc0d4c[_0x402f('0x25')],'countagentrejectretry':_0xbc0d4c[_0x402f('0x26')],'createdAt':_0xbc0d4c['createdAt'],'updatedAt':_0xbc0d4c[_0x402f('0x33')]};var _0x36b963={'CmHopperId':_0x29c591['id'],'phone':_0x204e47[_0x402f('0x34')],'active':0x0,'OrderBy':_[_0x402f('0x31')](_0x204e47[_0x402f('0x1f')])?0x0:_0x204e47[_0x402f('0x1f')],'scheduledat':_0x4bd246,'countbusyretry':_0x204e47[_0x402f('0x21')],'countcongestionretry':_0x204e47[_0x402f('0x22')],'countnoanswerretry':_0x204e47['countnoanswerretry'],'countnosuchnumberretry':_0x204e47[_0x402f('0x23')],'countdropretry':_0x204e47[_0x402f('0x24')],'countabandonedretry':_0x204e47[_0x402f('0x2a')],'countmachineretry':_0x204e47['countmachineretry'],'countagentrejectretry':_0x204e47[_0x402f('0x26')],'createdAt':_0x204e47[_0x402f('0x35')],'updatedAt':_0x204e47[_0x402f('0x33')]};return db[_0x402f('0x36')][_0x402f('0x37')](function(_0xe08d56){return db['CmHopperAdditionalPhone'][_0x402f('0x38')](_0x5cfa47,{'where':{'id':_0x204e47['id']}},{'transaction':_0xe08d56})[_0x402f('0xd')](function(){return db[_0x402f('0x2c')]['update'](_0x36b963,{'where':{'id':_0x29c591['id']}},{'transaction':_0xe08d56});});})['then'](function(_0x5eb9b1){_0x1d2f0b({'id':_0x29c591['id'],'phone':_0x204e47['phone']});})['catch'](function(_0x16b659){logger[_0x402f('0x12')]('activateAdditionalPhone',_0x16b659[_0x402f('0x14')]);_0x542fa0({'error':_0x16b659['message']});});});}exports[_0x402f('0x39')]=function(_0x3e6148){var _0x2f05d0=this;return new Promise(function(_0x3d6d15,_0x471125){return db[_0x402f('0x2c')][_0x402f('0x38')](_0x3e6148[_0x402f('0x19')][_0x402f('0x3a')],{'where':{'id':_0x3e6148[_0x402f('0x19')]['id']}})[_0x402f('0xd')](function(_0x3c5afc){_0x3d6d15(_0x3c5afc);})[_0x402f('0x16')](function(_0x43214d){logger['error'](_0x402f('0x39'),_0x43214d[_0x402f('0x14')]);_0x471125(_0x2f05d0['error'](0x1f4,_0x43214d[_0x402f('0x14')]));});});};
\ No newline at end of file
+var _0xe5d6=['add','minutes','isNil','phone','createdAt','updatedAt','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','CmHopper','body','ListId','VoiceQueueId','CampaignId','then','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','findOne','ContactId','waitTime','duration','scheduledat'];(function(_0x157df5,_0x33f022){var _0x4972ed=function(_0x4d6792){while(--_0x4d6792){_0x157df5['push'](_0x157df5['shift']());}};_0x4972ed(++_0x33f022);}(_0xe5d6,0xba));var _0x6e5d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xe5d6[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x6e5d('0x0'));var util=require(_0x6e5d('0x1'));var moment=require(_0x6e5d('0x2'));var BPromise=require(_0x6e5d('0x3'));var rs=require(_0x6e5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e5d('0x5'))['db'];var utils=require(_0x6e5d('0x6'));var logger=require(_0x6e5d('0x7'))(_0x6e5d('0x8'));var config=require(_0x6e5d('0x9'));var jayson=require(_0x6e5d('0xa'));var client=jayson[_0x6e5d('0xb')][_0x6e5d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18f7b4,_0x25152b,_0x264e29){return new BPromise(function(_0x52387b,_0x5b8f3c){return client[_0x6e5d('0xd')](_0x18f7b4,_0x264e29)['then'](function(_0x28ac0a){logger['info'](_0x6e5d('0xe'),_0x25152b,_0x6e5d('0xf'));logger[_0x6e5d('0x10')](_0x6e5d('0x11'),_0x25152b,_0x6e5d('0xf'),JSON[_0x6e5d('0x12')](_0x28ac0a));if(_0x28ac0a['error']){if(_0x28ac0a[_0x6e5d('0x13')][_0x6e5d('0x14')]===0x1f4){logger[_0x6e5d('0x13')](_0x6e5d('0xe'),_0x25152b,_0x28ac0a[_0x6e5d('0x13')][_0x6e5d('0x15')]);return _0x5b8f3c(_0x28ac0a[_0x6e5d('0x13')]['message']);}logger[_0x6e5d('0x13')](_0x6e5d('0xe'),_0x25152b,_0x28ac0a[_0x6e5d('0x13')]['message']);return _0x52387b(_0x28ac0a[_0x6e5d('0x13')][_0x6e5d('0x15')]);}else{logger[_0x6e5d('0x16')](_0x6e5d('0xe'),_0x25152b,'request\x20sent');_0x52387b(_0x28ac0a[_0x6e5d('0x17')][_0x6e5d('0x15')]);}})[_0x6e5d('0x18')](function(_0x3e4745){logger['error'](_0x6e5d('0xe'),_0x25152b,_0x3e4745);_0x5b8f3c(_0x3e4745);});});}exports[_0x6e5d('0x19')]=function(_0x3b11ad){var _0x1a8b08=this;return new Promise(function(_0x71f6be,_0x4606f3){return db[_0x6e5d('0x1a')]['findOne']({'raw':!![],'where':{'ContactId':_0x3b11ad[_0x6e5d('0x1b')]['ContactId'],'ListId':_0x3b11ad[_0x6e5d('0x1b')][_0x6e5d('0x1c')],'VoiceQueueId':_0x3b11ad['body'][_0x6e5d('0x1d')]===undefined?null:_0x3b11ad[_0x6e5d('0x1b')]['VoiceQueueId'],'CampaignId':_0x3b11ad[_0x6e5d('0x1b')][_0x6e5d('0x1e')]===undefined?null:_0x3b11ad['body'][_0x6e5d('0x1e')]}})[_0x6e5d('0x1f')](function(_0x4a9c5f){if(_0x4a9c5f!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4a9c5f['id'],'OrderBy':{'$gt':_0x4a9c5f[_0x6e5d('0x20')]}},'order':[[_0x6e5d('0x20'),_0x6e5d('0x21')]]})[_0x6e5d('0x1f')](function(_0xc1c432){var _0x323bc4=0x0;if(_0xc1c432){if(_0xc1c432[_0x6e5d('0x22')]+_0xc1c432['countcongestionretry']+_0xc1c432[_0x6e5d('0x23')]+_0xc1c432[_0x6e5d('0x24')]+_0xc1c432[_0x6e5d('0x25')]+_0xc1c432[_0x6e5d('0x26')]+_0xc1c432[_0x6e5d('0x27')]+_0xc1c432[_0x6e5d('0x28')]<_0x3b11ad[_0x6e5d('0x29')][_0x6e5d('0x2a')])_0x323bc4=0x1;_0x71f6be({'additional':_0x323bc4});}else{return db[_0x6e5d('0x2b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4a9c5f['id']},'order':[[_0x6e5d('0x20'),_0x6e5d('0x21')]]})[_0x6e5d('0x1f')](function(_0x5b5225){var _0x3c98ba=0x0;if(_0x5b5225){if(_0x5b5225['countbusyretry']+_0x5b5225[_0x6e5d('0x2c')]+_0x5b5225[_0x6e5d('0x23')]+_0x5b5225['countnosuchnumberretry']+_0x5b5225[_0x6e5d('0x25')]+_0x5b5225[_0x6e5d('0x26')]+_0x5b5225[_0x6e5d('0x27')]+_0x5b5225[_0x6e5d('0x28')]<_0x3b11ad[_0x6e5d('0x29')]['dialGlobalMaxRetry'])_0x3c98ba=0x1;_0x71f6be({'additional':_0x3c98ba});}else{_0x71f6be({'additional':0x0});}})[_0x6e5d('0x18')](function(_0x5cb6db){logger[_0x6e5d('0x13')](_0x6e5d('0x19'),_0x5cb6db[_0x6e5d('0x15')]);_0x4606f3(_0x1a8b08[_0x6e5d('0x13')](0x1f4,_0x5cb6db['message']));});}})['catch'](function(_0x6c3d49){logger[_0x6e5d('0x13')](_0x6e5d('0x19'),_0x6c3d49[_0x6e5d('0x15')]);_0x4606f3(_0x1a8b08[_0x6e5d('0x13')](0x1f4,_0x6c3d49[_0x6e5d('0x15')]));});}else _0x71f6be({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x47df1c){var _0x34ce1e=this;return new Promise(function(_0x54fe34,_0x36e8df){return db[_0x6e5d('0x1a')][_0x6e5d('0x2d')]({'raw':!![],'where':{'ContactId':_0x47df1c[_0x6e5d('0x1b')][_0x6e5d('0x2e')],'ListId':_0x47df1c[_0x6e5d('0x1b')][_0x6e5d('0x1c')],'VoiceQueueId':_0x47df1c[_0x6e5d('0x1b')]['VoiceQueueId']===undefined?null:_0x47df1c[_0x6e5d('0x1b')][_0x6e5d('0x1d')],'CampaignId':_0x47df1c['body'][_0x6e5d('0x1e')]===undefined?null:_0x47df1c['body'][_0x6e5d('0x1e')]}})[_0x6e5d('0x1f')](function(_0x46b431){if(_0x46b431!=null){return db[_0x6e5d('0x2b')][_0x6e5d('0x2d')]({'raw':!![],'where':{'CmHopperId':_0x46b431['id'],'OrderBy':{'$gte':_0x46b431[_0x6e5d('0x20')]}},'order':[[_0x6e5d('0x20'),_0x6e5d('0x21')]]})['then'](function(_0x55a7b6){if(_0x55a7b6)return activateAdditionalPhone(_0x46b431,_0x47df1c['body'],_0x55a7b6,_0x47df1c['duration'],_0x47df1c[_0x6e5d('0x2f')])[_0x6e5d('0x1f')](function(_0xb4be9c){_0x54fe34(_0xb4be9c);});else{return db[_0x6e5d('0x2b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x46b431['id']},'order':[['OrderBy',_0x6e5d('0x21')]]})[_0x6e5d('0x1f')](function(_0x315c0c){if(_0x315c0c)return activateAdditionalPhone(_0x46b431,_0x47df1c[_0x6e5d('0x1b')],_0x315c0c,_0x47df1c[_0x6e5d('0x30')],_0x47df1c[_0x6e5d('0x2f')])[_0x6e5d('0x1f')](function(_0x393fae){_0x54fe34(_0x393fae);});else{_0x54fe34({'id':_0x46b431['id'],'phone':''});}})[_0x6e5d('0x18')](function(_0x20aa81){logger[_0x6e5d('0x13')](_0x6e5d('0x19'),_0x20aa81[_0x6e5d('0x15')]);_0x36e8df(_0x34ce1e[_0x6e5d('0x13')](0x1f4,_0x20aa81[_0x6e5d('0x15')]));});}})['catch'](function(_0x545d75){logger[_0x6e5d('0x13')](_0x6e5d('0x19'),_0x545d75[_0x6e5d('0x15')]);_0x36e8df(_0x34ce1e[_0x6e5d('0x13')](0x1f4,_0x545d75[_0x6e5d('0x15')]));});}else _0x54fe34(0x1);});});};function activateAdditionalPhone(_0x1da82a,_0x65fb1c,_0x412b8f,_0x15ff06,_0x2ed923){return new Promise(function(_0x3c1214,_0x4b844d){var _0x212a96;if(_['isNil'](_0x412b8f['scheduledat'])){_0x412b8f[_0x6e5d('0x31')]=moment();}if(moment()>moment(_0x412b8f[_0x6e5d('0x31')])){_0x212a96=moment()[_0x6e5d('0x32')](_0x2ed923||0x3,_0x6e5d('0x33'));}else{if(_0x412b8f['OrderBy']==0x0){_0x212a96=moment(_0x412b8f['scheduledat']);}else{_0x212a96=moment()['add'](_0x2ed923||0x3,_0x6e5d('0x33'));}}if(_[_0x6e5d('0x34')](_0x212a96)){_0x212a96=moment()[_0x6e5d('0x32')](_0x2ed923||0x3,_0x6e5d('0x33'));}var _0x50e05a={'phone':_0x1da82a[_0x6e5d('0x35')],'active':0x0,'OrderBy':_[_0x6e5d('0x34')](_0x1da82a[_0x6e5d('0x20')])?0x0:_0x1da82a[_0x6e5d('0x20')],'scheduledat':moment()[_0x6e5d('0x32')](_0x15ff06||0x1,'minutes'),'countbusyretry':_0x65fb1c['countbusyretry'],'countcongestionretry':_0x65fb1c['countcongestionretry'],'countnoanswerretry':_0x65fb1c[_0x6e5d('0x23')],'countnosuchnumberretry':_0x65fb1c[_0x6e5d('0x24')],'countdropretry':_0x65fb1c[_0x6e5d('0x25')],'countabandonedretry':_0x65fb1c[_0x6e5d('0x26')],'countmachineretry':_0x65fb1c[_0x6e5d('0x27')],'countagentrejectretry':_0x65fb1c[_0x6e5d('0x28')],'createdAt':_0x65fb1c[_0x6e5d('0x36')],'updatedAt':_0x65fb1c[_0x6e5d('0x37')]};var _0x6acd34={'CmHopperId':_0x1da82a['id'],'phone':_0x412b8f[_0x6e5d('0x35')],'active':0x0,'OrderBy':_[_0x6e5d('0x34')](_0x412b8f['OrderBy'])?0x0:_0x412b8f[_0x6e5d('0x20')],'scheduledat':_0x212a96,'countbusyretry':_0x412b8f[_0x6e5d('0x22')],'countcongestionretry':_0x412b8f[_0x6e5d('0x2c')],'countnoanswerretry':_0x412b8f[_0x6e5d('0x23')],'countnosuchnumberretry':_0x412b8f['countnosuchnumberretry'],'countdropretry':_0x412b8f[_0x6e5d('0x25')],'countabandonedretry':_0x412b8f[_0x6e5d('0x26')],'countmachineretry':_0x412b8f[_0x6e5d('0x27')],'countagentrejectretry':_0x412b8f[_0x6e5d('0x28')],'createdAt':_0x412b8f['createdAt'],'updatedAt':_0x412b8f['updatedAt']};return db['sequelize']['transaction'](function(_0xc66dba){return db[_0x6e5d('0x2b')][_0x6e5d('0x38')](_0x50e05a,{'where':{'id':_0x412b8f['id']}},{'transaction':_0xc66dba})['then'](function(){return db[_0x6e5d('0x1a')][_0x6e5d('0x38')](_0x6acd34,{'where':{'id':_0x1da82a['id']}},{'transaction':_0xc66dba});});})[_0x6e5d('0x1f')](function(_0x4339b2){_0x3c1214({'id':_0x1da82a['id'],'phone':_0x412b8f[_0x6e5d('0x35')]});})['catch'](function(_0x3aa8e3){logger[_0x6e5d('0x13')](_0x6e5d('0x39'),_0x3aa8e3[_0x6e5d('0x15')]);_0x4b844d({'error':_0x3aa8e3[_0x6e5d('0x15')]});});});}exports[_0x6e5d('0x3a')]=function(_0x21f7fd){var _0x6fc33=this;return new Promise(function(_0x26e82e,_0x118d70){return db[_0x6e5d('0x1a')]['update'](_0x21f7fd[_0x6e5d('0x1b')]['field'],{'where':{'id':_0x21f7fd[_0x6e5d('0x1b')]['id']}})[_0x6e5d('0x1f')](function(_0x16cd63){_0x26e82e(_0x16cd63);})['catch'](function(_0x64b79){logger[_0x6e5d('0x13')](_0x6e5d('0x3a'),_0x64b79[_0x6e5d('0x15')]);_0x118d70(_0x6fc33['error'](0x1f4,_0x64b79[_0x6e5d('0x15')]));});});};
\ No newline at end of file