Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / services / routing / server / applications / queue.js
index 2570e25..26863d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c9a=['rrmemory','beepall','log','validate','lodash','util','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','upperFirst','InteractionId','interaction','MessageId','message','chat','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7c9a,0x1c5));var _0xa7c9=function(_0xad9b66,_0x4a6b2c){_0xad9b66=_0xad9b66-0x0;var _0x3e4c3f=_0x7c9a[_0xad9b66];return _0x3e4c3f;};'use strict';var schema=require(_0xa7c9('0x0'));var _=require(_0xa7c9('0x1'));var util=require(_0xa7c9('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xa7c9('0x3'));var Redis=require(_0xa7c9('0x4'));var config=require('../../../../config/environment');var logger=require(_0xa7c9('0x5'))(_0xa7c9('0x6'));var strategy=require('./strategy');config[_0xa7c9('0x7')]=_[_0xa7c9('0x8')](config[_0xa7c9('0x7')],{'host':_0xa7c9('0x9'),'port':0x18eb});var io=require(_0xa7c9('0xa'))(new Redis(config[_0xa7c9('0x7')]));var attributes=['id',_0xa7c9('0xb'),'account',_0xa7c9('0xc'),_0xa7c9('0xd'),_0xa7c9('0xe')];function emit(_0xda0c02,_0x5ef5d6,_0x1ca777){io['to'](_0xda0c02)[_0xa7c9('0xf')](_0x5ef5d6,_0x1ca777);}function emitChannelQueueInteraction(_0x397612,_0x3a09ec,_0x3de612,_0x164cb3,_0x538a26,_0x14a79d,_0x536adc,_0x1ee55d){var _0x7c2b98=_[_0xa7c9('0x10')](_0x3de612);_0x7c2b98['queue_id']=_0x1ee55d;_0x7c2b98[_0xa7c9('0xc')]=_0x3a09ec;_0x7c2b98['account']=_0x164cb3;_0x7c2b98['id']=_0x538a26;if(_0x14a79d){_0x536adc[util[_0xa7c9('0x11')](_0xa7c9('0x12'),_0x397612)][_0x538a26]=_[_0xa7c9('0x13')](_0x7c2b98,attributes);}else{delete _0x536adc[util[_0xa7c9('0x11')](_0xa7c9('0x12'),_0x397612)][_0x538a26];}emit(util[_0xa7c9('0x11')](_0xa7c9('0x14'),_0x397612,_0x3a09ec),util[_0xa7c9('0x11')](_0xa7c9('0x15'),_0x397612,_0x14a79d?_0xa7c9('0x16'):'remove'),_[_0xa7c9('0x13')](_0x7c2b98,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xa7c9('0x17')),'chatQueueReport':require(_0xa7c9('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xa7c9('0x19')),'whatsappQueueReport':require(_0xa7c9('0x1a'))};var queue=schema({'name':{'type':_0xa7c9('0x1b'),'required':!![],'message':_0xa7c9('0x1c')},'timeout':{'type':'number','message':_0xa7c9('0x1d')}});function startRouting(_0x1e65df,_0x394738,_0x3faf30,_0x5b4698){if(_0x1e65df&&_0x394738&&_0x3faf30){_0x394738[_0xa7c9('0x1e')]+=0x1;var _0x5a3a7f={'uniqueid':_0x1e65df,'from':_0x3faf30[_0xa7c9('0x1f')]?_0x3faf30[_0xa7c9('0x1f')][_0xa7c9('0xd')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3faf30[_0xa7c9('0x20')]?_0x3faf30[_0xa7c9('0x20')]['id']:null,'ListId':_0x3faf30[_0xa7c9('0x21')]?_0x3faf30[_0xa7c9('0x21')]['id']:null};_0x5a3a7f[_['upperFirst'](_0x3faf30[_0xa7c9('0x22')])+'QueueId']=_0x394738['id']||null;_0x5a3a7f[_[_0xa7c9('0x23')](_0x3faf30[_0xa7c9('0x22')])+_0xa7c9('0x24')]=_0x3faf30[_0xa7c9('0x25')]?_0x3faf30[_0xa7c9('0x25')]['id']:null;_0x5a3a7f[_[_0xa7c9('0x23')](_0x3faf30[_0xa7c9('0x22')])+_0xa7c9('0x26')]=_0x3faf30[_0xa7c9('0x27')]?_0x3faf30[_0xa7c9('0x27')]['id']:null;_0x5a3a7f[_[_0xa7c9('0x23')](_0x3faf30['channel'])+(_0x3faf30['channel']!==_0xa7c9('0x28')?'AccountId':_0xa7c9('0x29'))]=_0x3faf30[_0xa7c9('0x2a')]?_0x3faf30['account']['id']:null;logger[_0xa7c9('0x2b')](util['format'](_0xa7c9('0x2c'),_0x1e65df,_0x394738[_0xa7c9('0x2d')]));emitChannelQueueInteraction(_0x3faf30[_0xa7c9('0x22')],_0x394738[_0xa7c9('0x2d')],_0x5a3a7f,_0x3faf30[_0xa7c9('0x2a')][_0xa7c9('0x2d')],_0x3faf30[_0xa7c9('0x27')]['id'],!![],_0x5b4698,_0x394738['id']);if(rpc[_0x3faf30[_0xa7c9('0x22')]+_0xa7c9('0x2e')]){return rpc[_0x3faf30[_0xa7c9('0x22')]+_0xa7c9('0x2e')][_0xa7c9('0x2f')](_0x5a3a7f)[_0xa7c9('0x30')](function(_0x29c962){logger[_0xa7c9('0x31')](_0xa7c9('0x32'));});}}}function stopRouting(_0x54570f,_0x16c6ef,_0x766911,_0x544ccd){if(_0x54570f&&_0x16c6ef){_0x16c6ef[_0xa7c9('0x1e')]-=0x1;var _0x78a47d={'leaveAt':moment()['format'](_0xa7c9('0x33')),'acceptAt':moment()[_0xa7c9('0x11')](_0xa7c9('0x33')),'reason':'accepted'};logger[_0xa7c9('0x2b')](util[_0xa7c9('0x11')](_0xa7c9('0x34'),_0x54570f,_0x16c6ef[_0xa7c9('0x2d')]));emitChannelQueueInteraction(_0x766911[_0xa7c9('0x22')],_0x16c6ef['name'],_0x766911[_0xa7c9('0x1f')],_0x766911[_0xa7c9('0x2a')][_0xa7c9('0x2d')],_0x766911['message']['id'],![],_0x544ccd,_0x16c6ef['id']);if(rpc[_0x766911[_0xa7c9('0x22')]+_0xa7c9('0x2e')]){return rpc[_0x766911[_0xa7c9('0x22')]+_0xa7c9('0x2e')][_0xa7c9('0x35')](_0x54570f,_0x78a47d)[_0xa7c9('0x30')](function(_0x351d5a){logger[_0xa7c9('0x31')](_0xa7c9('0x36'));});}}}function endRouting(_0x3c3a38,_0x28ff88,_0x377c34,_0x3a5610){if(_0x3c3a38&&_0x28ff88){_0x28ff88[_0xa7c9('0x1e')]-=0x1;var _0x515ce9={'leaveAt':moment()[_0xa7c9('0x11')](_0xa7c9('0x33')),'exitAt':moment()[_0xa7c9('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa7c9('0x37')};logger[_0xa7c9('0x2b')](util[_0xa7c9('0x11')](_0xa7c9('0x38'),_0x3c3a38,_0x28ff88[_0xa7c9('0x2d')]));emitChannelQueueInteraction(_0x377c34[_0xa7c9('0x22')],_0x28ff88['name'],_0x377c34['body'],_0x377c34['account'][_0xa7c9('0x2d')],_0x377c34[_0xa7c9('0x27')]['id'],![],_0x3a5610);if(rpc[_0x377c34[_0xa7c9('0x22')]+_0xa7c9('0x2e')]){return rpc[_0x377c34[_0xa7c9('0x22')]+_0xa7c9('0x2e')]['update'](_0x3c3a38,_0x515ce9)[_0xa7c9('0x30')](function(_0x5b868b){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x11b9e5){return function(_0xb35f96){return _0xb35f96['name'][_0xa7c9('0x39')]()===_0x11b9e5[_0xa7c9('0x39')]();};}exports[_0xa7c9('0x3a')]=function(_0x395a35,_0x4975c4,_0x4c433f,_0x5f4b97){return function(_0x4e7127){try{var _0x547e8b={'name':_0x4975c4[0x0],'timeout':_0x4975c4[0x1]};var _0x4de773=queue[_0xa7c9('0x0')](_0x547e8b,{'typecast':!![]});if(_0x4de773['length']){logger[_0xa7c9('0x31')](_0xa7c9('0x3b'),_0x395a35,_[_0xa7c9('0x3c')](_0x4de773,_0xa7c9('0x27'))['join'](',\x20'));_0x4e7127[_0xa7c9('0x3d')]();}else{var _0x32eadc=_[_0xa7c9('0x3e')](_0x4c433f[_0x5f4b97[_0xa7c9('0x22')]+_0xa7c9('0x3f')],handleFindQueue(_0x547e8b[_0xa7c9('0x2d')]));if(_0x32eadc){startRouting(_0x395a35,_0x32eadc,_0x5f4b97,_0x4c433f);var _0x43f04e=(_0x32eadc['timeout']||0xa)*0x3e8;var _0x13650d=(_0x547e8b[_0xa7c9('0x37')]||0x14)*0x3e8;var _0x443389,_0x27f8f4;if(_0x43f04e>_0x13650d){_0x13650d=_0x43f04e;}var _0x5c21ea=seqqueue[_0xa7c9('0x40')](_0x43f04e);_0x5c21ea['id']=_0x395a35;_0x5c21ea[_0xa7c9('0x41')]=_0x43f04e;_0x5c21ea['qtimeout']=_0x13650d;_0x5c21ea[_0xa7c9('0x22')]=_0x5f4b97[_0xa7c9('0x22')];_0x4c433f[_0xa7c9('0x42')][_0x395a35]['on'](_0xa7c9('0x43'),function(){logger[_0xa7c9('0x2b')](_0xa7c9('0x44'),_0x395a35);stopRouting(_0x395a35,_0x32eadc,_0x5f4b97,_0x4c433f);clearTimeout(_0x443389);_0x443389=undefined;_0x5c21ea[_0xa7c9('0x45')](!![]);if(_0x4c433f['rules'][_0x395a35]){delete _0x4c433f['rules'][_0x395a35];}_0x4e7127['stop']();});_0x4c433f[_0xa7c9('0x42')][_0x395a35]['on'](_0xa7c9('0x46'),function(){if(_0x4c433f[_0xa7c9('0x42')][_0x395a35]){delete _0x4c433f[_0xa7c9('0x42')][_0x395a35];}});_0x443389=setTimeout(function(){logger[_0xa7c9('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x395a35);endRouting(_0x395a35,_0x32eadc,_0x5f4b97,_0x4c433f);clearTimeout(_0x443389);_0x5c21ea[_0xa7c9('0x45')](!![]);_0x4e7127[_0xa7c9('0x47')]();},_0x13650d);switch(_0x32eadc['strategy']){case'rrmemory':strategy[_0xa7c9('0x48')](_0x5c21ea,_0x32eadc,_0x4c433f,_0x5f4b97);break;default:strategy[_0xa7c9('0x49')](_0x5c21ea,_0x32eadc,_0x4c433f,_0x5f4b97);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x395a35,_0x547e8b[_0xa7c9('0x2d')]);_0x4e7127[_0xa7c9('0x3d')]();}}}catch(_0x85c73d){console[_0xa7c9('0x4a')](_0x85c73d);logger[_0xa7c9('0x31')]('[%s][QUEUE]\x20%s',_0x395a35,_0x85c73d['stack']);_0x4e7127['stop']();}};};
\ No newline at end of file
+var _0x8f9b=['MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','util','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction'];(function(_0x162799,_0x438388){var _0x1dd583=function(_0x3b0ef9){while(--_0x3b0ef9){_0x162799['push'](_0x162799['shift']());}};_0x1dd583(++_0x438388);}(_0x8f9b,0x1bb));var _0xb8f9=function(_0x34fc4e,_0x4c42af){_0x34fc4e=_0x34fc4e-0x0;var _0xcdd3fb=_0x8f9b[_0x34fc4e];return _0xcdd3fb;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xb8f9('0x0'));var seqqueue=require('seq-queue');var moment=require(_0xb8f9('0x1'));var Redis=require(_0xb8f9('0x2'));var config=require('../../../../config/environment');var logger=require(_0xb8f9('0x3'))(_0xb8f9('0x4'));var strategy=require(_0xb8f9('0x5'));config[_0xb8f9('0x6')]=_[_0xb8f9('0x7')](config[_0xb8f9('0x6')],{'host':_0xb8f9('0x8'),'port':0x18eb});var io=require(_0xb8f9('0x9'))(new Redis(config[_0xb8f9('0x6')]));var attributes=['id',_0xb8f9('0xa'),_0xb8f9('0xb'),_0xb8f9('0xc'),'from',_0xb8f9('0xd')];function emit(_0x37841f,_0x5c74aa,_0x5a4652){io['to'](_0x37841f)['emit'](_0x5c74aa,_0x5a4652);}function emitChannelQueueInteraction(_0x3c8c18,_0x4dd243,_0x561ccb,_0x2db0a9,_0x350635,_0x5f5410,_0x58d6b6,_0x440662){var _0x16f327=_[_0xb8f9('0xe')](_0x561ccb);_0x16f327['queue_id']=_0x440662;_0x16f327['queue']=_0x4dd243;_0x16f327[_0xb8f9('0xb')]=_0x2db0a9;_0x16f327['id']=_0x350635;if(_0x5f5410){_0x58d6b6[util[_0xb8f9('0xf')](_0xb8f9('0x10'),_0x3c8c18)][_0x350635]=_[_0xb8f9('0x11')](_0x16f327,attributes);}else{delete _0x58d6b6[util[_0xb8f9('0xf')](_0xb8f9('0x10'),_0x3c8c18)][_0x350635];}emit(util[_0xb8f9('0xf')](_0xb8f9('0x12'),_0x3c8c18,_0x4dd243),util[_0xb8f9('0xf')](_0xb8f9('0x13'),_0x3c8c18,_0x5f5410?'save':_0xb8f9('0x14')),_[_0xb8f9('0x11')](_0x16f327,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb8f9('0x15')),'chatQueueReport':require(_0xb8f9('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xb8f9('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xb8f9('0x18'),'required':!![],'message':_0xb8f9('0x19')},'timeout':{'type':'number','message':_0xb8f9('0x1a')}});function startRouting(_0x315860,_0x1b84a5,_0xe9cb1a,_0x234e40){if(_0x315860&&_0x1b84a5&&_0xe9cb1a){_0x1b84a5['waiting']+=0x1;var _0x370890={'uniqueid':_0x315860,'from':_0xe9cb1a[_0xb8f9('0x1b')]?_0xe9cb1a[_0xb8f9('0x1b')][_0xb8f9('0x1c')]:'','joinAt':moment()[_0xb8f9('0xf')](_0xb8f9('0x1d')),'ContactId':_0xe9cb1a['contact']?_0xe9cb1a[_0xb8f9('0x1e')]['id']:null,'ListId':_0xe9cb1a['list']?_0xe9cb1a[_0xb8f9('0x1f')]['id']:null};_0x370890[_[_0xb8f9('0x20')](_0xe9cb1a[_0xb8f9('0x21')])+_0xb8f9('0x22')]=_0x1b84a5['id']||null;_0x370890[_[_0xb8f9('0x20')](_0xe9cb1a[_0xb8f9('0x21')])+_0xb8f9('0x23')]=_0xe9cb1a[_0xb8f9('0x24')]?_0xe9cb1a[_0xb8f9('0x24')]['id']:null;_0x370890[_[_0xb8f9('0x20')](_0xe9cb1a[_0xb8f9('0x21')])+_0xb8f9('0x25')]=_0xe9cb1a[_0xb8f9('0x26')]?_0xe9cb1a[_0xb8f9('0x26')]['id']:null;_0x370890[_[_0xb8f9('0x20')](_0xe9cb1a['channel'])+(_0xe9cb1a[_0xb8f9('0x21')]!==_0xb8f9('0x27')?_0xb8f9('0x28'):_0xb8f9('0x29'))]=_0xe9cb1a[_0xb8f9('0xb')]?_0xe9cb1a['account']['id']:null;logger[_0xb8f9('0x2a')](util[_0xb8f9('0xf')](_0xb8f9('0x2b'),_0x315860,_0x1b84a5[_0xb8f9('0x2c')]));emitChannelQueueInteraction(_0xe9cb1a[_0xb8f9('0x21')],_0x1b84a5[_0xb8f9('0x2c')],_0x370890,_0xe9cb1a[_0xb8f9('0xb')][_0xb8f9('0x2c')],_0xe9cb1a[_0xb8f9('0x26')]['id'],!![],_0x234e40,_0x1b84a5['id']);if(rpc[_0xe9cb1a['channel']+_0xb8f9('0x2d')]){return rpc[_0xe9cb1a[_0xb8f9('0x21')]+_0xb8f9('0x2d')][_0xb8f9('0x2e')](_0x370890)[_0xb8f9('0x2f')](function(_0xe77425){logger[_0xb8f9('0x30')](_0xb8f9('0x31'));});}}}function stopRouting(_0x2ec8d3,_0x2b695b,_0x4eace2,_0x33e620){if(_0x2ec8d3&&_0x2b695b){_0x2b695b[_0xb8f9('0x32')]-=0x1;var _0x3693fd={'leaveAt':moment()[_0xb8f9('0xf')](_0xb8f9('0x1d')),'acceptAt':moment()[_0xb8f9('0xf')](_0xb8f9('0x1d')),'reason':_0xb8f9('0x33')};logger['info'](util[_0xb8f9('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x2ec8d3,_0x2b695b['name']));emitChannelQueueInteraction(_0x4eace2['channel'],_0x2b695b['name'],_0x4eace2[_0xb8f9('0x1b')],_0x4eace2[_0xb8f9('0xb')][_0xb8f9('0x2c')],_0x4eace2['message']['id'],![],_0x33e620,_0x2b695b['id']);if(rpc[_0x4eace2[_0xb8f9('0x21')]+_0xb8f9('0x2d')]){return rpc[_0x4eace2[_0xb8f9('0x21')]+_0xb8f9('0x2d')][_0xb8f9('0x34')](_0x2ec8d3,_0x3693fd)[_0xb8f9('0x2f')](function(_0x6bf60d){logger[_0xb8f9('0x30')](_0xb8f9('0x35'));});}}}function endRouting(_0x3e0014,_0x2a1122,_0x2f1b21,_0x36c98c){if(_0x3e0014&&_0x2a1122){_0x2a1122[_0xb8f9('0x32')]-=0x1;var _0x387cfd={'leaveAt':moment()['format'](_0xb8f9('0x1d')),'exitAt':moment()[_0xb8f9('0xf')](_0xb8f9('0x1d')),'reason':_0xb8f9('0x36')};logger[_0xb8f9('0x2a')](util[_0xb8f9('0xf')](_0xb8f9('0x37'),_0x3e0014,_0x2a1122[_0xb8f9('0x2c')]));emitChannelQueueInteraction(_0x2f1b21[_0xb8f9('0x21')],_0x2a1122[_0xb8f9('0x2c')],_0x2f1b21['body'],_0x2f1b21['account'][_0xb8f9('0x2c')],_0x2f1b21[_0xb8f9('0x26')]['id'],![],_0x36c98c);if(rpc[_0x2f1b21[_0xb8f9('0x21')]+_0xb8f9('0x2d')]){return rpc[_0x2f1b21['channel']+_0xb8f9('0x2d')][_0xb8f9('0x34')](_0x3e0014,_0x387cfd)['catch'](function(_0x56a916){logger[_0xb8f9('0x30')](_0xb8f9('0x35'));});}}}function handleFindQueue(_0x34eb39){return function(_0x4e49ba){return _0x4e49ba[_0xb8f9('0x2c')][_0xb8f9('0x38')]()===_0x34eb39['toLowerCase']();};}exports[_0xb8f9('0x39')]=function(_0x22f080,_0x4e4719,_0x1f8810,_0x215efa){return function(_0x415b4f){try{var _0xbcef2e={'name':_0x4e4719[0x0],'timeout':_0x4e4719[0x1]};var _0x1c80bb=queue[_0xb8f9('0x3a')](_0xbcef2e,{'typecast':!![]});if(_0x1c80bb[_0xb8f9('0x3b')]){logger[_0xb8f9('0x30')](_0xb8f9('0x3c'),_0x22f080,_[_0xb8f9('0x3d')](_0x1c80bb,_0xb8f9('0x26'))[_0xb8f9('0x3e')](',\x20'));_0x415b4f[_0xb8f9('0x3f')]();}else{var _0x32dcbc=_['find'](_0x1f8810[_0x215efa['channel']+_0xb8f9('0x40')],handleFindQueue(_0xbcef2e[_0xb8f9('0x2c')]));if(_0x32dcbc){startRouting(_0x22f080,_0x32dcbc,_0x215efa,_0x1f8810);var _0x2c57e1=(_0x32dcbc[_0xb8f9('0x36')]||0xa)*0x3e8;var _0x43b1fa=(_0xbcef2e[_0xb8f9('0x36')]||0x14)*0x3e8;var _0x17356f,_0x45c865;if(_0x2c57e1>_0x43b1fa){_0x43b1fa=_0x2c57e1;}var _0x4f3c31=seqqueue[_0xb8f9('0x41')](_0x2c57e1);_0x4f3c31['id']=_0x22f080;_0x4f3c31[_0xb8f9('0x42')]=_0x2c57e1;_0x4f3c31[_0xb8f9('0x43')]=_0x43b1fa;_0x4f3c31[_0xb8f9('0x21')]=_0x215efa[_0xb8f9('0x21')];_0x1f8810[_0xb8f9('0x44')][_0x22f080]['on'](_0xb8f9('0x45'),function(){logger['info'](_0xb8f9('0x46'),_0x22f080);stopRouting(_0x22f080,_0x32dcbc,_0x215efa,_0x1f8810);clearTimeout(_0x17356f);_0x17356f=undefined;_0x4f3c31[_0xb8f9('0x47')](!![]);if(_0x1f8810[_0xb8f9('0x44')][_0x22f080]){delete _0x1f8810['rules'][_0x22f080];}_0x415b4f['stop']();});_0x1f8810[_0xb8f9('0x44')][_0x22f080]['on'](_0xb8f9('0x48'),function(){if(_0x1f8810[_0xb8f9('0x44')][_0x22f080]){delete _0x1f8810['rules'][_0x22f080];}});_0x17356f=setTimeout(function(){logger[_0xb8f9('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x22f080);endRouting(_0x22f080,_0x32dcbc,_0x215efa,_0x1f8810);clearTimeout(_0x17356f);_0x4f3c31[_0xb8f9('0x47')](!![]);_0x415b4f[_0xb8f9('0x49')]();},_0x43b1fa);switch(_0x32dcbc[_0xb8f9('0x4a')]){case'rrmemory':strategy[_0xb8f9('0x4b')](_0x4f3c31,_0x32dcbc,_0x1f8810,_0x215efa);break;default:strategy[_0xb8f9('0x4c')](_0x4f3c31,_0x32dcbc,_0x1f8810,_0x215efa);}}else{logger[_0xb8f9('0x30')](_0xb8f9('0x4d'),_0x22f080,_0xbcef2e[_0xb8f9('0x2c')]);_0x415b4f[_0xb8f9('0x3f')]();}}}catch(_0x498e37){console[_0xb8f9('0x4e')](_0x498e37);logger[_0xb8f9('0x30')](_0xb8f9('0x3c'),_0x22f080,_0x498e37[_0xb8f9('0x4f')]);_0x415b4f[_0xb8f9('0x3f')]();}};};
\ No newline at end of file