Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.rpc.js
index 9ea0df8..86303c8 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 _0xdcda=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','countagentrejectretry','VoiceQueueId','waitTime','duration','isNil','scheduledat','add','minutes','phone','countnoanswerretry','updatedAt','createdAt','sequelize','transaction','CmHopper','update','activateAdditionalPhone','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','CampaignId','OrderBy','ASC','countbusyretry'];(function(_0xb72818,_0xd5575a){var _0x37dc47=function(_0x4c9faf){while(--_0x4c9faf){_0xb72818['push'](_0xb72818['shift']());}};_0x37dc47(++_0xd5575a);}(_0xdcda,0x101));var _0xadcd=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdcda[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xadcd('0x0'));var util=require(_0xadcd('0x1'));var moment=require(_0xadcd('0x2'));var BPromise=require(_0xadcd('0x3'));var rs=require(_0xadcd('0x4'));var fs=require('fs');var Redis=require(_0xadcd('0x5'));var db=require(_0xadcd('0x6'))['db'];var utils=require(_0xadcd('0x7'));var logger=require(_0xadcd('0x8'))(_0xadcd('0x9'));var config=require(_0xadcd('0xa'));var jayson=require(_0xadcd('0xb'));var client=jayson[_0xadcd('0xc')][_0xadcd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x525c1d,_0x1104ce,_0x415bb6){return new BPromise(function(_0x22647b,_0x229e9a){return client[_0xadcd('0xe')](_0x525c1d,_0x415bb6)[_0xadcd('0xf')](function(_0x45c8c4){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1104ce,_0xadcd('0x10'));logger['debug'](_0xadcd('0x11'),_0x1104ce,'request\x20sent',JSON[_0xadcd('0x12')](_0x45c8c4));if(_0x45c8c4['error']){if(_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x14')]===0x1f4){logger[_0xadcd('0x13')](_0xadcd('0x15'),_0x1104ce,_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x16')]);return _0x229e9a(_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x16')]);}logger[_0xadcd('0x13')](_0xadcd('0x15'),_0x1104ce,_0x45c8c4['error']['message']);return _0x22647b(_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x16')]);}else{logger['info'](_0xadcd('0x15'),_0x1104ce,_0xadcd('0x10'));_0x22647b(_0x45c8c4[_0xadcd('0x17')]['message']);}})[_0xadcd('0x18')](function(_0x6aeba0){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1104ce,_0x6aeba0);_0x229e9a(_0x6aeba0);});});}exports[_0xadcd('0x19')]=function(_0x28c355){var _0x2b0e6d=this;return new Promise(function(_0x2a3dda,_0x1e9e06){return db['CmHopper'][_0xadcd('0x1a')]({'raw':!![],'where':{'ContactId':_0x28c355[_0xadcd('0x1b')][_0xadcd('0x1c')],'ListId':_0x28c355['body']['ListId'],'VoiceQueueId':_0x28c355['body']['VoiceQueueId']===undefined?null:_0x28c355[_0xadcd('0x1b')]['VoiceQueueId'],'CampaignId':_0x28c355['body'][_0xadcd('0x1d')]===undefined?null:_0x28c355[_0xadcd('0x1b')][_0xadcd('0x1d')]}})[_0xadcd('0xf')](function(_0x5c9775){if(_0x5c9775!=null){return db['CmHopperAdditionalPhone'][_0xadcd('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x5c9775['id'],'OrderBy':{'$gt':_0x5c9775[_0xadcd('0x1e')]}},'order':[[_0xadcd('0x1e'),_0xadcd('0x1f')]]})[_0xadcd('0xf')](function(_0x459334){var _0x55e7df=0x0;if(_0x459334){if(_0x459334[_0xadcd('0x20')]+_0x459334['countcongestionretry']+_0x459334['countnoanswerretry']+_0x459334[_0xadcd('0x21')]+_0x459334[_0xadcd('0x22')]+_0x459334[_0xadcd('0x23')]+_0x459334[_0xadcd('0x24')]+_0x459334['countagentrejectretry']<_0x28c355[_0xadcd('0x25')][_0xadcd('0x26')])_0x55e7df=0x1;_0x2a3dda({'additional':_0x55e7df});}else{return db[_0xadcd('0x27')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5c9775['id']},'order':[[_0xadcd('0x1e'),_0xadcd('0x1f')]]})['then'](function(_0x54b9ee){var _0x14042a=0x0;if(_0x54b9ee){if(_0x54b9ee[_0xadcd('0x20')]+_0x54b9ee[_0xadcd('0x28')]+_0x54b9ee['countnoanswerretry']+_0x54b9ee[_0xadcd('0x21')]+_0x54b9ee[_0xadcd('0x22')]+_0x54b9ee[_0xadcd('0x23')]+_0x54b9ee[_0xadcd('0x24')]+_0x54b9ee[_0xadcd('0x29')]<_0x28c355[_0xadcd('0x25')][_0xadcd('0x26')])_0x14042a=0x1;_0x2a3dda({'additional':_0x14042a});}else{_0x2a3dda({'additional':0x0});}})['catch'](function(_0x3e05b0){logger[_0xadcd('0x13')](_0xadcd('0x19'),_0x3e05b0['message']);_0x1e9e06(_0x2b0e6d[_0xadcd('0x13')](0x1f4,_0x3e05b0[_0xadcd('0x16')]));});}})[_0xadcd('0x18')](function(_0x1ab058){logger[_0xadcd('0x13')](_0xadcd('0x19'),_0x1ab058[_0xadcd('0x16')]);_0x1e9e06(_0x2b0e6d['error'](0x1f4,_0x1ab058['message']));});}else _0x2a3dda({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x458fc9){var _0x1d8591=this;return new Promise(function(_0x4176e9,_0x6ca8d8){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x1c')],'ListId':_0x458fc9[_0xadcd('0x1b')]['ListId'],'VoiceQueueId':_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x2a')]===undefined?null:_0x458fc9['body'][_0xadcd('0x2a')],'CampaignId':_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x1d')]===undefined?null:_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x1d')]}})[_0xadcd('0xf')](function(_0x332787){if(_0x332787!=null){return db[_0xadcd('0x27')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x332787['id'],'OrderBy':{'$gte':_0x332787['OrderBy']}},'order':[[_0xadcd('0x1e'),_0xadcd('0x1f')]]})[_0xadcd('0xf')](function(_0x475f6e){if(_0x475f6e)return activateAdditionalPhone(_0x332787,_0x458fc9[_0xadcd('0x1b')],_0x475f6e,_0x458fc9['duration'],_0x458fc9[_0xadcd('0x2b')])[_0xadcd('0xf')](function(_0x47f33f){_0x4176e9(_0x47f33f);});else{return db[_0xadcd('0x27')][_0xadcd('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x332787['id']},'order':[['OrderBy',_0xadcd('0x1f')]]})[_0xadcd('0xf')](function(_0x570ff2){if(_0x570ff2)return activateAdditionalPhone(_0x332787,_0x458fc9[_0xadcd('0x1b')],_0x570ff2,_0x458fc9[_0xadcd('0x2c')],_0x458fc9[_0xadcd('0x2b')])[_0xadcd('0xf')](function(_0x3e1bf8){_0x4176e9(_0x3e1bf8);});else{_0x4176e9({'id':_0x332787['id'],'phone':''});}})[_0xadcd('0x18')](function(_0x3c5ead){logger[_0xadcd('0x13')]('VerifyAdditionalPhones',_0x3c5ead['message']);_0x6ca8d8(_0x1d8591[_0xadcd('0x13')](0x1f4,_0x3c5ead[_0xadcd('0x16')]));});}})[_0xadcd('0x18')](function(_0x15ce75){logger['error'](_0xadcd('0x19'),_0x15ce75[_0xadcd('0x16')]);_0x6ca8d8(_0x1d8591[_0xadcd('0x13')](0x1f4,_0x15ce75[_0xadcd('0x16')]));});}else _0x4176e9(0x1);});});};function activateAdditionalPhone(_0x1ae04c,_0x33866a,_0x3d5c64,_0x1d05bc,_0xa69556){return new Promise(function(_0x3638f2,_0x1e7934){var _0xe9a630;if(_[_0xadcd('0x2d')](_0x3d5c64[_0xadcd('0x2e')])){_0x3d5c64[_0xadcd('0x2e')]=moment();}if(moment()>moment(_0x3d5c64['scheduledat'])){_0xe9a630=moment()[_0xadcd('0x2f')](_0xa69556||0x3,_0xadcd('0x30'));}else{if(_0x3d5c64[_0xadcd('0x1e')]==0x0){_0xe9a630=moment(_0x3d5c64['scheduledat']);}else{_0xe9a630=moment()[_0xadcd('0x2f')](_0xa69556||0x3,_0xadcd('0x30'));}}if(_[_0xadcd('0x2d')](_0xe9a630)){_0xe9a630=moment()[_0xadcd('0x2f')](_0xa69556||0x3,_0xadcd('0x30'));}var _0x121da8={'phone':_0x1ae04c[_0xadcd('0x31')],'active':0x0,'OrderBy':_[_0xadcd('0x2d')](_0x1ae04c[_0xadcd('0x1e')])?0x0:_0x1ae04c[_0xadcd('0x1e')],'scheduledat':moment()['add'](_0x1d05bc||0x1,_0xadcd('0x30')),'countbusyretry':_0x33866a[_0xadcd('0x20')],'countcongestionretry':_0x33866a[_0xadcd('0x28')],'countnoanswerretry':_0x33866a[_0xadcd('0x32')],'countnosuchnumberretry':_0x33866a[_0xadcd('0x21')],'countdropretry':_0x33866a[_0xadcd('0x22')],'countabandonedretry':_0x33866a[_0xadcd('0x23')],'countmachineretry':_0x33866a['countmachineretry'],'countagentrejectretry':_0x33866a[_0xadcd('0x29')],'createdAt':_0x33866a['createdAt'],'updatedAt':_0x33866a[_0xadcd('0x33')]};var _0x3566a2={'CmHopperId':_0x1ae04c['id'],'phone':_0x3d5c64[_0xadcd('0x31')],'active':0x0,'OrderBy':_[_0xadcd('0x2d')](_0x3d5c64[_0xadcd('0x1e')])?0x0:_0x3d5c64[_0xadcd('0x1e')],'scheduledat':_0xe9a630,'countbusyretry':_0x3d5c64[_0xadcd('0x20')],'countcongestionretry':_0x3d5c64[_0xadcd('0x28')],'countnoanswerretry':_0x3d5c64[_0xadcd('0x32')],'countnosuchnumberretry':_0x3d5c64[_0xadcd('0x21')],'countdropretry':_0x3d5c64[_0xadcd('0x22')],'countabandonedretry':_0x3d5c64[_0xadcd('0x23')],'countmachineretry':_0x3d5c64[_0xadcd('0x24')],'countagentrejectretry':_0x3d5c64[_0xadcd('0x29')],'createdAt':_0x3d5c64[_0xadcd('0x34')],'updatedAt':_0x3d5c64[_0xadcd('0x33')]};return db[_0xadcd('0x35')][_0xadcd('0x36')](function(_0x371396){return db['CmHopperAdditionalPhone']['update'](_0x121da8,{'where':{'id':_0x3d5c64['id']}},{'transaction':_0x371396})[_0xadcd('0xf')](function(){return db[_0xadcd('0x37')][_0xadcd('0x38')](_0x3566a2,{'where':{'id':_0x1ae04c['id']}},{'transaction':_0x371396});});})[_0xadcd('0xf')](function(_0x374ce8){_0x3638f2({'id':_0x1ae04c['id'],'phone':_0x3d5c64[_0xadcd('0x31')]});})['catch'](function(_0xd70c4a){logger[_0xadcd('0x13')](_0xadcd('0x39'),_0xd70c4a[_0xadcd('0x16')]);_0x1e7934({'error':_0xd70c4a['message']});});});}exports['IncrementPreviewCounters']=function(_0x54a27f){var _0x417c55=this;return new Promise(function(_0x1efb8f,_0x41d09a){return db[_0xadcd('0x37')]['update'](_0x54a27f[_0xadcd('0x1b')]['field'],{'where':{'id':_0x54a27f['body']['id']}})[_0xadcd('0xf')](function(_0x45e8ce){_0x1efb8f(_0x45e8ce);})[_0xadcd('0x18')](function(_0x563acb){logger[_0xadcd('0x13')]('IncrementPreviewCounters',_0x563acb[_0xadcd('0x16')]);_0x41d09a(_0x417c55[_0xadcd('0x13')](0x1f4,_0x563acb[_0xadcd('0x16')]));});});};
\ No newline at end of file