Built motion from commit cafec4f3.|2.6.31
[motion2.git] / server / api / cmHopperAdditionalPhone / cmHopperAdditionalPhone.rpc.js
index 5c475ca..54919c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbaf=['ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countnoanswerretry','countabandonedretry','countmachineretry','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','activateAdditionalPhone','update','IncrementPreviewCounters','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body'];(function(_0x497ef1,_0x2e1dc3){var _0x20feae=function(_0x9fca32){while(--_0x9fca32){_0x497ef1['push'](_0x497ef1['shift']());}};_0x20feae(++_0x2e1dc3);}(_0xfbaf,0x17c));var _0xffba=function(_0x59865a,_0x28fecb){_0x59865a=_0x59865a-0x0;var _0x19f209=_0xfbaf[_0x59865a];return _0x19f209;};'use strict';var _=require('lodash');var util=require(_0xffba('0x0'));var moment=require(_0xffba('0x1'));var BPromise=require('bluebird');var rs=require(_0xffba('0x2'));var fs=require('fs');var Redis=require(_0xffba('0x3'));var db=require(_0xffba('0x4'))['db'];var utils=require(_0xffba('0x5'));var logger=require('../../config/logger')(_0xffba('0x6'));var config=require(_0xffba('0x7'));var jayson=require(_0xffba('0x8'));var client=jayson[_0xffba('0x9')][_0xffba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6b9f6c,_0x124d5b,_0x1af407){return new BPromise(function(_0x462106,_0x30fca2){return client[_0xffba('0xb')](_0x6b9f6c,_0x1af407)[_0xffba('0xc')](function(_0x1e03de){logger[_0xffba('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x124d5b,'request\x20sent');logger[_0xffba('0xe')](_0xffba('0xf'),_0x124d5b,_0xffba('0x10'),JSON['stringify'](_0x1e03de));if(_0x1e03de['error']){if(_0x1e03de[_0xffba('0x11')]['code']===0x1f4){logger[_0xffba('0x11')](_0xffba('0x12'),_0x124d5b,_0x1e03de[_0xffba('0x11')][_0xffba('0x13')]);return _0x30fca2(_0x1e03de[_0xffba('0x11')][_0xffba('0x13')]);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x124d5b,_0x1e03de[_0xffba('0x11')][_0xffba('0x13')]);return _0x462106(_0x1e03de[_0xffba('0x11')][_0xffba('0x13')]);}else{logger[_0xffba('0xd')](_0xffba('0x12'),_0x124d5b,'request\x20sent');_0x462106(_0x1e03de[_0xffba('0x14')]['message']);}})[_0xffba('0x15')](function(_0x3b06b2){logger[_0xffba('0x11')](_0xffba('0x12'),_0x124d5b,_0x3b06b2);_0x30fca2(_0x3b06b2);});});}exports[_0xffba('0x16')]=function(_0xde9b71){var _0x3c3a9c=this;return new Promise(function(_0x29554e,_0x537a26){return db[_0xffba('0x17')][_0xffba('0x18')]({'raw':!![],'where':{'ContactId':_0xde9b71[_0xffba('0x19')][_0xffba('0x1a')],'ListId':_0xde9b71[_0xffba('0x19')][_0xffba('0x1b')],'VoiceQueueId':_0xde9b71['body'][_0xffba('0x1c')]===undefined?null:_0xde9b71['body'][_0xffba('0x1c')],'CampaignId':_0xde9b71[_0xffba('0x19')][_0xffba('0x1d')]===undefined?null:_0xde9b71[_0xffba('0x19')][_0xffba('0x1d')]}})[_0xffba('0xc')](function(_0x29ca47){if(_0x29ca47!=null){return db[_0xffba('0x1e')][_0xffba('0x18')]({'raw':!![],'where':{'CmHopperId':_0x29ca47['id'],'OrderBy':{'$gt':_0x29ca47[_0xffba('0x1f')]}},'order':[[_0xffba('0x1f'),'ASC']]})[_0xffba('0xc')](function(_0x8cb740){var _0x9a56a3=0x0;if(_0x8cb740){if(_0x8cb740[_0xffba('0x20')]+_0x8cb740[_0xffba('0x21')]+_0x8cb740['countnoanswerretry']+_0x8cb740[_0xffba('0x22')]+_0x8cb740[_0xffba('0x23')]+_0x8cb740['countabandonedretry']+_0x8cb740['countmachineretry']+_0x8cb740[_0xffba('0x24')]<_0xde9b71[_0xffba('0x25')][_0xffba('0x26')])_0x9a56a3=0x1;_0x29554e({'additional':_0x9a56a3});}else{return db[_0xffba('0x1e')][_0xffba('0x18')]({'raw':!![],'where':{'CmHopperId':_0x29ca47['id']},'order':[[_0xffba('0x1f'),_0xffba('0x27')]]})[_0xffba('0xc')](function(_0x2d2c07){var _0x261c9d=0x0;if(_0x2d2c07){if(_0x2d2c07[_0xffba('0x20')]+_0x2d2c07['countcongestionretry']+_0x2d2c07[_0xffba('0x28')]+_0x2d2c07[_0xffba('0x22')]+_0x2d2c07[_0xffba('0x23')]+_0x2d2c07[_0xffba('0x29')]+_0x2d2c07[_0xffba('0x2a')]+_0x2d2c07['countagentrejectretry']<_0xde9b71['entity']['dialGlobalMaxRetry'])_0x261c9d=0x1;_0x29554e({'additional':_0x261c9d});}else{_0x29554e({'additional':0x0});}})[_0xffba('0x15')](function(_0x2d7e69){logger[_0xffba('0x11')]('VerifyAdditionalPhones',_0x2d7e69['message']);_0x537a26(_0x3c3a9c[_0xffba('0x11')](0x1f4,_0x2d7e69['message']));});}})['catch'](function(_0x1b744b){logger[_0xffba('0x11')](_0xffba('0x16'),_0x1b744b[_0xffba('0x13')]);_0x537a26(_0x3c3a9c[_0xffba('0x11')](0x1f4,_0x1b744b[_0xffba('0x13')]));});}else _0x29554e({'additional':0x0});});});};exports[_0xffba('0x2b')]=function(_0x4d70fa){var _0x44cdd3=this;return new Promise(function(_0x32fa94,_0x2c88ad){return db[_0xffba('0x17')][_0xffba('0x18')]({'raw':!![],'where':{'ContactId':_0x4d70fa[_0xffba('0x19')]['ContactId'],'ListId':_0x4d70fa[_0xffba('0x19')][_0xffba('0x1b')],'VoiceQueueId':_0x4d70fa['body'][_0xffba('0x1c')]===undefined?null:_0x4d70fa[_0xffba('0x19')][_0xffba('0x1c')],'CampaignId':_0x4d70fa[_0xffba('0x19')][_0xffba('0x1d')]===undefined?null:_0x4d70fa[_0xffba('0x19')][_0xffba('0x1d')]}})['then'](function(_0x464c69){if(_0x464c69!=null){return db[_0xffba('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x464c69['id'],'OrderBy':{'$gte':_0x464c69[_0xffba('0x1f')]}},'order':[[_0xffba('0x1f'),_0xffba('0x27')]]})[_0xffba('0xc')](function(_0x2292d0){if(_0x2292d0)return activateAdditionalPhone(_0x464c69,_0x4d70fa[_0xffba('0x19')],_0x2292d0,_0x4d70fa[_0xffba('0x2c')],_0x4d70fa['waitTime'])['then'](function(_0x1c616f){_0x32fa94(_0x1c616f);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x464c69['id']},'order':[['OrderBy',_0xffba('0x27')]]})[_0xffba('0xc')](function(_0x43cdae){if(_0x43cdae)return activateAdditionalPhone(_0x464c69,_0x4d70fa[_0xffba('0x19')],_0x43cdae,_0x4d70fa[_0xffba('0x2c')],_0x4d70fa[_0xffba('0x2d')])[_0xffba('0xc')](function(_0x500968){_0x32fa94(_0x500968);});else{_0x32fa94({'id':_0x464c69['id'],'phone':''});}})['catch'](function(_0x3988e6){logger['error']('VerifyAdditionalPhones',_0x3988e6[_0xffba('0x13')]);_0x2c88ad(_0x44cdd3[_0xffba('0x11')](0x1f4,_0x3988e6['message']));});}})[_0xffba('0x15')](function(_0x1540f7){logger['error']('VerifyAdditionalPhones',_0x1540f7['message']);_0x2c88ad(_0x44cdd3[_0xffba('0x11')](0x1f4,_0x1540f7[_0xffba('0x13')]));});}else _0x32fa94(0x1);});});};function activateAdditionalPhone(_0xbd1e4d,_0x2f2861,_0x10fbf3,_0x2409dc,_0xbcef50){return new Promise(function(_0x1a69fe,_0x36f7df){var _0x38bb48;if(_['isNil'](_0x10fbf3[_0xffba('0x2e')])){_0x10fbf3[_0xffba('0x2e')]=moment();}if(moment()>moment(_0x10fbf3[_0xffba('0x2e')])){_0x38bb48=moment()[_0xffba('0x2f')](_0xbcef50||0x3,'minutes');}else{if(_0x10fbf3[_0xffba('0x1f')]==0x0){_0x38bb48=moment(_0x10fbf3['scheduledat']);}else{_0x38bb48=moment()['add'](_0xbcef50||0x3,_0xffba('0x30'));}}if(_[_0xffba('0x31')](_0x38bb48)){_0x38bb48=moment()[_0xffba('0x2f')](_0xbcef50||0x3,_0xffba('0x30'));}var _0x1b0916={'phone':_0xbd1e4d[_0xffba('0x32')],'active':0x0,'OrderBy':_[_0xffba('0x31')](_0xbd1e4d[_0xffba('0x1f')])?0x0:_0xbd1e4d['OrderBy'],'scheduledat':moment()[_0xffba('0x2f')](_0x2409dc||0x1,_0xffba('0x30')),'countbusyretry':_0x2f2861[_0xffba('0x20')],'countcongestionretry':_0x2f2861[_0xffba('0x21')],'countnoanswerretry':_0x2f2861[_0xffba('0x28')],'countnosuchnumberretry':_0x2f2861[_0xffba('0x22')],'countdropretry':_0x2f2861[_0xffba('0x23')],'countabandonedretry':_0x2f2861[_0xffba('0x29')],'countmachineretry':_0x2f2861['countmachineretry'],'countagentrejectretry':_0x2f2861[_0xffba('0x24')],'createdAt':_0x2f2861[_0xffba('0x33')],'updatedAt':_0x2f2861['updatedAt']};var _0x3c9141={'CmHopperId':_0xbd1e4d['id'],'phone':_0x10fbf3[_0xffba('0x32')],'active':0x0,'OrderBy':_[_0xffba('0x31')](_0x10fbf3[_0xffba('0x1f')])?0x0:_0x10fbf3[_0xffba('0x1f')],'scheduledat':_0x38bb48,'countbusyretry':_0x10fbf3[_0xffba('0x20')],'countcongestionretry':_0x10fbf3[_0xffba('0x21')],'countnoanswerretry':_0x10fbf3[_0xffba('0x28')],'countnosuchnumberretry':_0x10fbf3[_0xffba('0x22')],'countdropretry':_0x10fbf3['countdropretry'],'countabandonedretry':_0x10fbf3['countabandonedretry'],'countmachineretry':_0x10fbf3['countmachineretry'],'countagentrejectretry':_0x10fbf3[_0xffba('0x24')],'createdAt':_0x10fbf3[_0xffba('0x33')],'updatedAt':_0x10fbf3[_0xffba('0x34')]};return db[_0xffba('0x35')][_0xffba('0x36')](function(_0x585dd4){return db[_0xffba('0x1e')]['update'](_0x1b0916,{'where':{'id':_0x10fbf3['id']}},{'transaction':_0x585dd4})[_0xffba('0xc')](function(){return db[_0xffba('0x17')]['update'](_0x3c9141,{'where':{'id':_0xbd1e4d['id']}},{'transaction':_0x585dd4});});})[_0xffba('0xc')](function(_0xb0314d){_0x1a69fe({'id':_0xbd1e4d['id'],'phone':_0x10fbf3[_0xffba('0x32')]});})['catch'](function(_0x4a10dc){logger['error'](_0xffba('0x37'),_0x4a10dc[_0xffba('0x13')]);_0x36f7df({'error':_0x4a10dc[_0xffba('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x238357){var _0x43887b=this;return new Promise(function(_0x4d3bcd,_0x3abede){return db[_0xffba('0x17')][_0xffba('0x38')](_0x238357['body']['field'],{'where':{'id':_0x238357[_0xffba('0x19')]['id']}})['then'](function(_0x268717){_0x4d3bcd(_0x268717);})[_0xffba('0x15')](function(_0x34028f){logger['error'](_0xffba('0x39'),_0x34028f[_0xffba('0x13')]);_0x3abede(_0x43887b[_0xffba('0x11')](0x1f4,_0x34028f[_0xffba('0x13')]));});});};
\ No newline at end of file
+var _0x664d=['countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countcongestionretry','SwapAdditionalPhones','CmHopper','ContactId','ListId','CmHopperAdditionalPhone','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','VoiceQueueId','CampaignId','then','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x664d,0x1f2));var _0xd664=function(_0x1190c2,_0x2c078b){_0x1190c2=_0x1190c2-0x0;var _0x6ec988=_0x664d[_0x1190c2];return _0x6ec988;};'use strict';var _=require(_0xd664('0x0'));var util=require(_0xd664('0x1'));var moment=require(_0xd664('0x2'));var BPromise=require(_0xd664('0x3'));var rs=require(_0xd664('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd664('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd664('0x6'))(_0xd664('0x7'));var config=require(_0xd664('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd664('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x114486,_0x2d63bf,_0x112d79){return new BPromise(function(_0x33b238,_0x4db7df){return client['request'](_0x114486,_0x112d79)['then'](function(_0x270c17){logger[_0xd664('0xa')](_0xd664('0xb'),_0x2d63bf,'request\x20sent');logger[_0xd664('0xc')](_0xd664('0xd'),_0x2d63bf,_0xd664('0xe'),JSON[_0xd664('0xf')](_0x270c17));if(_0x270c17['error']){if(_0x270c17[_0xd664('0x10')][_0xd664('0x11')]===0x1f4){logger[_0xd664('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2d63bf,_0x270c17[_0xd664('0x10')][_0xd664('0x12')]);return _0x4db7df(_0x270c17[_0xd664('0x10')][_0xd664('0x12')]);}logger[_0xd664('0x10')](_0xd664('0xb'),_0x2d63bf,_0x270c17[_0xd664('0x10')][_0xd664('0x12')]);return _0x33b238(_0x270c17[_0xd664('0x10')][_0xd664('0x12')]);}else{logger[_0xd664('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2d63bf,_0xd664('0xe'));_0x33b238(_0x270c17[_0xd664('0x13')]['message']);}})[_0xd664('0x14')](function(_0xe56b40){logger[_0xd664('0x10')](_0xd664('0xb'),_0x2d63bf,_0xe56b40);_0x4db7df(_0xe56b40);});});}exports[_0xd664('0x15')]=function(_0x2d8727){var _0x5c77f4=this;return new Promise(function(_0x60ca09,_0x1b393a){return db['CmHopper'][_0xd664('0x16')]({'raw':!![],'where':{'ContactId':_0x2d8727[_0xd664('0x17')]['ContactId'],'ListId':_0x2d8727[_0xd664('0x17')]['ListId'],'VoiceQueueId':_0x2d8727['body'][_0xd664('0x18')]===undefined?null:_0x2d8727['body'][_0xd664('0x18')],'CampaignId':_0x2d8727[_0xd664('0x17')][_0xd664('0x19')]===undefined?null:_0x2d8727[_0xd664('0x17')][_0xd664('0x19')]}})[_0xd664('0x1a')](function(_0x1e3d17){if(_0x1e3d17!=null){return db['CmHopperAdditionalPhone'][_0xd664('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1e3d17['id'],'OrderBy':{'$gt':_0x1e3d17['OrderBy']}},'order':[[_0xd664('0x1b'),_0xd664('0x1c')]]})[_0xd664('0x1a')](function(_0x1cd29e){var _0x4a1c04=0x0;if(_0x1cd29e){if(_0x1cd29e[_0xd664('0x1d')]+_0x1cd29e['countcongestionretry']+_0x1cd29e[_0xd664('0x1e')]+_0x1cd29e[_0xd664('0x1f')]+_0x1cd29e[_0xd664('0x20')]+_0x1cd29e[_0xd664('0x21')]+_0x1cd29e[_0xd664('0x22')]+_0x1cd29e[_0xd664('0x23')]<_0x2d8727[_0xd664('0x24')][_0xd664('0x25')])_0x4a1c04=0x1;_0x60ca09({'additional':_0x4a1c04});}else{return db['CmHopperAdditionalPhone'][_0xd664('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1e3d17['id']},'order':[[_0xd664('0x1b'),_0xd664('0x1c')]]})['then'](function(_0x1bb911){var _0x14510e=0x0;if(_0x1bb911){if(_0x1bb911[_0xd664('0x1d')]+_0x1bb911[_0xd664('0x26')]+_0x1bb911['countnoanswerretry']+_0x1bb911[_0xd664('0x1f')]+_0x1bb911[_0xd664('0x20')]+_0x1bb911[_0xd664('0x21')]+_0x1bb911[_0xd664('0x22')]+_0x1bb911[_0xd664('0x23')]<_0x2d8727[_0xd664('0x24')][_0xd664('0x25')])_0x14510e=0x1;_0x60ca09({'additional':_0x14510e});}else{_0x60ca09({'additional':0x0});}})[_0xd664('0x14')](function(_0x1d9e09){logger['error'](_0xd664('0x15'),_0x1d9e09['message']);_0x1b393a(_0x5c77f4['error'](0x1f4,_0x1d9e09[_0xd664('0x12')]));});}})[_0xd664('0x14')](function(_0x1fb8be){logger[_0xd664('0x10')](_0xd664('0x15'),_0x1fb8be[_0xd664('0x12')]);_0x1b393a(_0x5c77f4['error'](0x1f4,_0x1fb8be[_0xd664('0x12')]));});}else _0x60ca09({'additional':0x0});});});};exports[_0xd664('0x27')]=function(_0x3bc5d1){var _0xcc5496=this;return new Promise(function(_0x379ebb,_0x395274){return db[_0xd664('0x28')]['findOne']({'raw':!![],'where':{'ContactId':_0x3bc5d1[_0xd664('0x17')][_0xd664('0x29')],'ListId':_0x3bc5d1[_0xd664('0x17')][_0xd664('0x2a')],'VoiceQueueId':_0x3bc5d1[_0xd664('0x17')][_0xd664('0x18')]===undefined?null:_0x3bc5d1[_0xd664('0x17')][_0xd664('0x18')],'CampaignId':_0x3bc5d1['body']['CampaignId']===undefined?null:_0x3bc5d1['body'][_0xd664('0x19')]}})[_0xd664('0x1a')](function(_0x297231){if(_0x297231!=null){return db[_0xd664('0x2b')][_0xd664('0x16')]({'raw':!![],'where':{'CmHopperId':_0x297231['id'],'OrderBy':{'$gte':_0x297231[_0xd664('0x1b')]}},'order':[[_0xd664('0x1b'),'ASC']]})[_0xd664('0x1a')](function(_0x128bc4){if(_0x128bc4)return activateAdditionalPhone(_0x297231,_0x3bc5d1[_0xd664('0x17')],_0x128bc4,_0x3bc5d1[_0xd664('0x2c')],_0x3bc5d1['waitTime'])[_0xd664('0x1a')](function(_0x30ff58){_0x379ebb(_0x30ff58);});else{return db[_0xd664('0x2b')][_0xd664('0x16')]({'raw':!![],'where':{'CmHopperId':_0x297231['id']},'order':[['OrderBy',_0xd664('0x1c')]]})[_0xd664('0x1a')](function(_0x332f41){if(_0x332f41)return activateAdditionalPhone(_0x297231,_0x3bc5d1[_0xd664('0x17')],_0x332f41,_0x3bc5d1[_0xd664('0x2c')],_0x3bc5d1[_0xd664('0x2d')])[_0xd664('0x1a')](function(_0x16fef5){_0x379ebb(_0x16fef5);});else{_0x379ebb({'id':_0x297231['id'],'phone':''});}})['catch'](function(_0x12abd7){logger[_0xd664('0x10')](_0xd664('0x15'),_0x12abd7[_0xd664('0x12')]);_0x395274(_0xcc5496[_0xd664('0x10')](0x1f4,_0x12abd7['message']));});}})[_0xd664('0x14')](function(_0x3f02c5){logger[_0xd664('0x10')](_0xd664('0x15'),_0x3f02c5[_0xd664('0x12')]);_0x395274(_0xcc5496[_0xd664('0x10')](0x1f4,_0x3f02c5[_0xd664('0x12')]));});}else _0x379ebb(0x1);});});};function activateAdditionalPhone(_0x50006e,_0x4efd17,_0x4b7502,_0x11efa8,_0x3d6a05){return new Promise(function(_0x22d0b3,_0x6a67db){var _0x38a550;if(_[_0xd664('0x2e')](_0x4b7502['scheduledat'])){_0x4b7502[_0xd664('0x2f')]=moment();}if(moment()>moment(_0x4b7502[_0xd664('0x2f')])){_0x38a550=moment()[_0xd664('0x30')](_0x3d6a05||0x3,_0xd664('0x31'));}else{if(_0x4b7502[_0xd664('0x1b')]==0x0){_0x38a550=moment(_0x4b7502[_0xd664('0x2f')]);}else{_0x38a550=moment()[_0xd664('0x30')](_0x3d6a05||0x3,'minutes');}}if(_[_0xd664('0x2e')](_0x38a550)){_0x38a550=moment()[_0xd664('0x30')](_0x3d6a05||0x3,'minutes');}var _0x536e04={'phone':_0x50006e[_0xd664('0x32')],'active':0x0,'OrderBy':_[_0xd664('0x2e')](_0x50006e[_0xd664('0x1b')])?0x0:_0x50006e[_0xd664('0x1b')],'scheduledat':moment()[_0xd664('0x30')](_0x11efa8||0x1,_0xd664('0x31')),'countbusyretry':_0x4efd17[_0xd664('0x1d')],'countcongestionretry':_0x4efd17[_0xd664('0x26')],'countnoanswerretry':_0x4efd17[_0xd664('0x1e')],'countnosuchnumberretry':_0x4efd17[_0xd664('0x1f')],'countdropretry':_0x4efd17[_0xd664('0x20')],'countabandonedretry':_0x4efd17['countabandonedretry'],'countmachineretry':_0x4efd17[_0xd664('0x22')],'countagentrejectretry':_0x4efd17[_0xd664('0x23')],'createdAt':_0x4efd17['createdAt'],'updatedAt':_0x4efd17['updatedAt']};var _0x36ee77={'CmHopperId':_0x50006e['id'],'phone':_0x4b7502[_0xd664('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x4b7502[_0xd664('0x1b')])?0x0:_0x4b7502['OrderBy'],'scheduledat':_0x38a550,'countbusyretry':_0x4b7502['countbusyretry'],'countcongestionretry':_0x4b7502[_0xd664('0x26')],'countnoanswerretry':_0x4b7502[_0xd664('0x1e')],'countnosuchnumberretry':_0x4b7502['countnosuchnumberretry'],'countdropretry':_0x4b7502[_0xd664('0x20')],'countabandonedretry':_0x4b7502[_0xd664('0x21')],'countmachineretry':_0x4b7502[_0xd664('0x22')],'countagentrejectretry':_0x4b7502[_0xd664('0x23')],'createdAt':_0x4b7502[_0xd664('0x33')],'updatedAt':_0x4b7502[_0xd664('0x34')]};return db[_0xd664('0x35')][_0xd664('0x36')](function(_0xf95c1f){return db[_0xd664('0x2b')][_0xd664('0x37')](_0x536e04,{'where':{'id':_0x4b7502['id']}},{'transaction':_0xf95c1f})[_0xd664('0x1a')](function(){return db[_0xd664('0x28')][_0xd664('0x37')](_0x36ee77,{'where':{'id':_0x50006e['id']}},{'transaction':_0xf95c1f});});})[_0xd664('0x1a')](function(_0x19e403){_0x22d0b3({'id':_0x50006e['id'],'phone':_0x4b7502[_0xd664('0x32')]});})[_0xd664('0x14')](function(_0x45796d){logger[_0xd664('0x10')](_0xd664('0x38'),_0x45796d[_0xd664('0x12')]);_0x6a67db({'error':_0x45796d[_0xd664('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x89248){var _0x12754c=this;return new Promise(function(_0x5b512b,_0x4a446a){return db[_0xd664('0x28')]['update'](_0x89248[_0xd664('0x17')][_0xd664('0x39')],{'where':{'id':_0x89248[_0xd664('0x17')]['id']}})[_0xd664('0x1a')](function(_0x325de4){_0x5b512b(_0x325de4);})[_0xd664('0x14')](function(_0x1d3d28){logger[_0xd664('0x10')](_0xd664('0x3a'),_0x1d3d28['message']);_0x4a446a(_0x12754c[_0xd664('0x10')](0x1f4,_0x1d3d28['message']));});});};
\ No newline at end of file