Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / services / routing / server / index.js
index d461662..68dae45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc95=['routing','../rpc/openchannelQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','channel','message','interaction','transfer','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','mail','push','slice','join','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','split','ContactId','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','info','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird'];(function(_0x4044c2,_0x2f2ad6){var _0x15b5fb=function(_0x3f2c5f){while(--_0x3f2c5f){_0x4044c2['push'](_0x4044c2['shift']());}};_0x15b5fb(++_0x2f2ad6);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x1d4bdb,_0x58f77b){_0x1d4bdb=_0x1d4bdb-0x0;var _0x288bea=_0xbc95[_0x1d4bdb];return _0x288bea;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var path=require(_0x5bc9('0x2'));var fs=require('fs');var jayson=require(_0x5bc9('0x3'));var BPromise=require(_0x5bc9('0x4'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0x5bc9('0x5'));var rpc={'openchannelQueueReport':require(_0x5bc9('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x5bc9('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x5bc9('0x8'));function getId(_0x4bdc20,_0x49ab1a,_0x6cc9f1){return util[_0x5bc9('0x9')](_0x5bc9('0xa'),_0x4bdc20,_0x49ab1a||0x0,_0x6cc9f1||0x0);}function getIntervals(_0x357d27,_0x24d4b3){var _0x2caa35=[];if(!_['isNil'](_0x24d4b3[_0x5bc9('0xb')])&&!_['isNil'](_0x357d27[_0x24d4b3['IntervalId']])&&!_[_0x5bc9('0xc')](_0x357d27[_0x24d4b3['IntervalId']][_0x5bc9('0xd')])){_0x2caa35=_[_0x5bc9('0xe')](_0x357d27[_0x24d4b3[_0x5bc9('0xb')]][_0x5bc9('0xd')],_0x5bc9('0xf'));}else if(!_['isNil'](_0x24d4b3[_0x5bc9('0xf')])){_0x2caa35=[_0x24d4b3[_0x5bc9('0xf')]];}return _0x2caa35;}exports['listen']=function(_0x1e345a){_0x1e345a['rules']={};return new BPromise(function(_0x48a2c2,_0x767740){var _0x11341a={'Start':function(_0x298800){var _0x16cf5f=this;return new Promise(function(_0x443185,_0x33053f){if(_0x298800){try{var _0x5db036=[];var _0x49e2a2=getId(_0x298800[_0x5bc9('0x10')],_0x298800[_0x5bc9('0x11')]?_0x298800['message']['id']:0x0,_0x298800[_0x5bc9('0x12')]?_0x298800[_0x5bc9('0x12')]['id']:0x0);var _0x20e02d=sUtils['checkWaitingNotifications'](_0x1e345a,_0x298800);if(_0x298800[_0x5bc9('0x13')]||!_0x20e02d&&_0x298800[_0x5bc9('0x14')]&&_[_0x5bc9('0x15')](_0x298800['applications'])&&_0x298800[_0x5bc9('0x14')]['length']){for(var _0x102ab2=0x0;_0x102ab2<_0x298800[_0x5bc9('0x14')][_0x5bc9('0x16')];_0x102ab2+=0x1){var _0x242bb4=_0x298800[_0x5bc9('0x14')][_0x102ab2];if(fs['existsSync'](path['join'](__dirname,_0x5bc9('0x14'),_0x242bb4[_0x5bc9('0x17')]+_0x5bc9('0x18')))){var _0x4433ab=[];switch(_0x242bb4[_0x5bc9('0x17')][_0x5bc9('0x19')]()){case _0x5bc9('0x1a'):var _0x37f3aa=_0x242bb4[_0x5bc9('0x1b')]['split'](',');if(_0x298800[_0x5bc9('0x10')]===_0x5bc9('0x1c')){_0x4433ab[_0x5bc9('0x1d')](_0x37f3aa[0x0]);_0x4433ab[_0x5bc9('0x1d')](_0x37f3aa[0x1]);_0x4433ab['push'](_0x37f3aa[_0x5bc9('0x1e')](0x2,_0x37f3aa['length'])[_0x5bc9('0x1f')](','));}else{_0x4433ab[_0x5bc9('0x1d')](_0x37f3aa[0x0]);_0x4433ab[_0x5bc9('0x1d')](_0x37f3aa[_0x5bc9('0x1e')](0x1,_0x37f3aa['length'])[_0x5bc9('0x1f')](','));}break;case'dialogflow':var _0x4cb942=_0x242bb4[_0x5bc9('0x1b')]['split'](',');_0x4433ab[_0x5bc9('0x1d')](_0x4cb942[0x0]);_0x4433ab['push'](_0x4cb942[0x1]);_0x4433ab['push'](_0x4cb942[_0x5bc9('0x1e')](0x2,_0x4cb942[_0x5bc9('0x16')])[_0x5bc9('0x1f')](','));break;case _0x5bc9('0x20'):var _0x2ff10a=_0x242bb4[_0x5bc9('0x1b')]['split'](',');_0x4433ab['push'](_0x2ff10a[0x0]);_0x4433ab['push'](_0x2ff10a[0x1]);_0x4433ab['push'](_0x2ff10a[0x2]);_0x4433ab[_0x5bc9('0x1d')](_0x2ff10a[0x3]);_0x4433ab[_0x5bc9('0x1d')](_0x2ff10a[_0x5bc9('0x1e')](0x4,_0x2ff10a[_0x5bc9('0x16')])[_0x5bc9('0x1f')](','));break;case _0x5bc9('0x21'):var _0x73a4d2=_0x242bb4[_0x5bc9('0x1b')]['split'](',');_0x4433ab[_0x5bc9('0x1d')](_0x73a4d2[0x0]);_0x4433ab['push'](_0x73a4d2[0x1]);_0x4433ab['push'](_0x73a4d2[0x2]);_0x4433ab[_0x5bc9('0x1d')](_0x73a4d2[0x3]);_0x4433ab[_0x5bc9('0x1d')](_0x73a4d2[_0x5bc9('0x1e')](0x4,_0x73a4d2['length'])['join'](','));break;case'message':_0x4433ab[_0x5bc9('0x1d')](_0x242bb4[_0x5bc9('0x1b')]);break;case _0x5bc9('0x22'):_0x4433ab[_0x5bc9('0x1d')](_0x242bb4[_0x5bc9('0x23')]);_0x4433ab[_0x5bc9('0x1d')](_0x242bb4[_0x5bc9('0x1b')]);break;case _0x5bc9('0x24'):var _0x4fda67=utils[_0x5bc9('0x25')](_0x298800[_0x5bc9('0x26')][_0x5bc9('0x27')],_0x298800);var _0x43f827=_0x242bb4[_0x5bc9('0x1b')][_0x5bc9('0x28')](',');_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x0]);_0x4433ab['push'](_0x43f827[0x1]);_0x4433ab['push'](_0x43f827[0x2]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x3]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x4]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x5]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x6]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x7]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x8]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0x9]);_0x4433ab[_0x5bc9('0x1d')](_0x43f827[0xa]);_0x4433ab[_0x5bc9('0x1d')](_0x298800['interaction']['id']);_0x4433ab[_0x5bc9('0x1d')](_0x298800[_0x5bc9('0x11')]['id']);_0x4433ab[_0x5bc9('0x1d')](_0x242bb4['ChatWebsiteId']);_0x4433ab['push'](_0x298800[_0x5bc9('0x12')][_0x5bc9('0x29')]);_0x4433ab[_0x5bc9('0x1d')](_0x298800['body']['body']);_0x4433ab[_0x5bc9('0x1d')](_0x4fda67);break;default:_0x4433ab=_['isNil'](_0x242bb4[_0x5bc9('0x1b')])?[]:_0x242bb4[_0x5bc9('0x1b')]['split'](',');}var _0x22a736={'id':util[_0x5bc9('0x9')]('%s:%s:%s',_0x49e2a2,_0x242bb4['id'],_0x242bb4['app']),'condition':require(_0x5bc9('0x2a'))[_0x5bc9('0x2b')](_0x49e2a2,getIntervals(_0x1e345a[_0x5bc9('0x2c')],_0x242bb4),_0x1e345a),'consequence':require(_0x5bc9('0x2d')+_0x242bb4[_0x5bc9('0x17')])[_0x5bc9('0x2e')](_0x49e2a2,_0x4433ab,_0x1e345a,_0x298800),'p':_0x242bb4[_0x5bc9('0x2f')]||0x0};logger['info'](_0x5bc9('0x30'),_0x22a736['id'],'on\x20interval',getIntervals(_0x1e345a[_0x5bc9('0x2c')],_0x242bb4)['join'](_0x5bc9('0x31')));_0x5db036['push'](_0x22a736);}else{logger['error'](_0x5bc9('0x32'),path['join'](__dirname,_0x5bc9('0x14'),_0x242bb4[_0x5bc9('0x17')]+'.js'));}}_0x1e345a[_0x5bc9('0x33')][_0x49e2a2]=new RuleEngine(_0x5db036);_0x1e345a[_0x5bc9('0x33')][_0x49e2a2]['execute'](_0x298800,function(_0x315fea){logger[_0x5bc9('0x34')]('Applications\x20executed',JSON[_0x5bc9('0x35')](_0x315fea[_0x5bc9('0x36')]));if(_0x1e345a[_0x5bc9('0x33')][_0x49e2a2]){_0x1e345a[_0x5bc9('0x33')][_0x49e2a2][_0x5bc9('0x37')](_0x5bc9('0x38'));}});return _0x443185({'code':0xc8,'message':_0x298800});}else{if(_0x20e02d){logger[_0x5bc9('0x34')](util[_0x5bc9('0x9')]('Skipped\x20routing\x20for\x20%s',_0x49e2a2));}else{logger[_0x5bc9('0x34')](_0x5bc9('0x39'));}return _0x443185({'code':0xc8,'message':_0x298800});}}catch(_0x29f69c){logger[_0x5bc9('0x3a')](_0x29f69c[_0x5bc9('0x3b')]);return _0x33053f(_0x16cf5f[_0x5bc9('0x3a')](0x1f4,_0x29f69c));}}return _0x33053f(_0x5bc9('0x3c'));});},'AcceptMessage':function(_0x395940){var _0x2c767f=this;return new Promise(function(_0x590a66,_0x2be96b){if(_0x395940[_0x5bc9('0x3d')]&&_0x395940[_0x5bc9('0x3d')]['id']){if(_0x1e345a[_0x5bc9('0x3e')][_0x395940['agent']['id']]){_0x1e345a[_0x5bc9('0x3e')][_0x395940[_0x5bc9('0x3d')]['id']][_0x5bc9('0x3f')]=![];_0x1e345a[_0x5bc9('0x3e')][_0x395940[_0x5bc9('0x3d')]['id']][_0x5bc9('0x40')]=undefined;}}if(_0x395940['message']&&_0x395940[_0x5bc9('0x11')]['id']){try{var _0xd90ff9=getId(_0x395940['channel'],_0x395940['message']?_0x395940[_0x5bc9('0x11')]['id']:0x0,_0x395940[_0x5bc9('0x12')]?_0x395940['interaction']['id']:0x0);if(_0x1e345a[_0x5bc9('0x33')][_0xd90ff9]){_0x1e345a[_0x5bc9('0x33')][_0xd90ff9][_0x5bc9('0x37')](_0x5bc9('0x41'));if(rpc[_0x395940[_0x5bc9('0x10')]+_0x5bc9('0x42')]){rpc[_0x395940[_0x5bc9('0x10')]+'QueueReport']['update'](_0xd90ff9,{'UserId':_0x395940[_0x5bc9('0x11')][_0x5bc9('0x43')]})[_0x5bc9('0x44')](function(){logger[_0x5bc9('0x3a')](_0x5bc9('0x45'));});}}return _0x590a66({'code':0xc8,'message':_0x395940});}catch(_0x32bb65){logger['error'](_0x32bb65['stack']);return _0x2be96b(_0x2c767f['error'](0x1f4,_0x32bb65));}}logger[_0x5bc9('0x3a')](_0x5bc9('0x46'));return _0x2be96b(_0x2c767f['error'](0x1f4,_0x5bc9('0x46')));});},'RejectMessage':function(_0x2636fc){var _0x410995=this;return new Promise(function(_0x341d2b,_0x3f9067){if(_0x2636fc[_0x5bc9('0x3d')]&&_0x2636fc[_0x5bc9('0x3d')]['id']){try{if(_0x1e345a[_0x5bc9('0x3e')][_0x2636fc[_0x5bc9('0x3d')]['id']]){_0x1e345a[_0x5bc9('0x3e')][_0x2636fc[_0x5bc9('0x3d')]['id']][_0x5bc9('0x3f')]=![];_0x1e345a[_0x5bc9('0x3e')][_0x2636fc['agent']['id']][_0x5bc9('0x40')]=undefined;}return _0x341d2b({'code':0xc8,'message':_0x2636fc});}catch(_0x568577){logger['error'](_0x568577['stack']);return _0x3f9067(_0x410995[_0x5bc9('0x3a')](0x1f4,_0x568577));}}logger['error'](_0x5bc9('0x46'));return _0x3f9067(_0x410995[_0x5bc9('0x3a')](0x1f4,_0x5bc9('0x46')));});},'AbandonInteraction':function(_0x2ec2b6){var _0x3863c0=this;return new Promise(function(_0x907ff,_0x57cba7){if(_0x2ec2b6[_0x5bc9('0x10')]&&_0x2ec2b6[_0x5bc9('0x12')]&&_0x2ec2b6[_0x5bc9('0x12')]['id']){try{var _0x28fe28=getId(_0x2ec2b6[_0x5bc9('0x10')],_0x2ec2b6[_0x5bc9('0x11')]?_0x2ec2b6[_0x5bc9('0x11')]['id']:0x0,_0x2ec2b6[_0x5bc9('0x12')]?_0x2ec2b6[_0x5bc9('0x12')]['id']:0x0);if(_0x1e345a[_0x5bc9('0x33')][_0x28fe28]){_0x1e345a[_0x5bc9('0x33')][_0x28fe28][_0x5bc9('0x37')](_0x5bc9('0x41'));}return _0x907ff({'code':0xc8,'message':_0x2ec2b6});}catch(_0x158643){logger[_0x5bc9('0x3a')](_0x158643[_0x5bc9('0x3b')]);return _0x57cba7(_0x3863c0[_0x5bc9('0x3a')](0x1f4,_0x158643));}}logger['error']('message\x20is\x20empty');return _0x57cba7(_0x3863c0[_0x5bc9('0x3a')](0x1f4,_0x5bc9('0x46')));});},'AgentCapacity':function(_0x334119){var _0x4fa74d=this;return new Promise(function(_0x1b4e32,_0x4c4bbb){if(_0x1e345a['agents']['hasOwnProperty'](_0x334119['id'])){for(var _0x2d96d0 in _0x334119[_0x5bc9('0x47')]){if(_0x334119[_0x5bc9('0x47')][_0x5bc9('0x48')](_0x2d96d0)){if(_0x1e345a['agents'][_0x334119['id']][_0x5bc9('0x48')](_0x2d96d0+'CurrentCapacity')){_0x1e345a[_0x5bc9('0x3e')][_0x334119['id']][_0x2d96d0+_0x5bc9('0x49')]=parseInt(_0x334119['capacity'][_0x2d96d0],0xa);}}}_0x1e345a[_0x5bc9('0x3e')][_0x334119['id']][_0x5bc9('0x4a')]();return _0x1b4e32({'code':0xc8,'message':_0x1e345a['agents'][_0x334119['id']]});}else{return _0x4c4bbb(_0x4fa74d['error'](0x1f4,_0x5bc9('0x4b')));}});},'Agents':function(_0xb3ab0a){return new Promise(function(_0x35cc49){var _0x221efd=_[_0x5bc9('0x4c')](_0x1e345a[_0x5bc9('0x3e')]);if(_0xb3ab0a&&_0xb3ab0a['id']){var _0x4ae73d=_[_0x5bc9('0x4d')](_0x221efd,function(_0x47edab){return _0x47edab['id']===_0xb3ab0a['id'];});_0x35cc49(_0x4ae73d);}else{_0x35cc49({'count':_0x221efd['length'],'rows':_0x221efd});}});},'ChatQueues':function(){return new Promise(function(_0x542834){var _0x1c20ed=[];for(var _0x23b711 in _0x1e345a[_0x5bc9('0x4e')]){if(_0x1e345a['chatQueues']['hasOwnProperty'](_0x23b711)){var _0x2b17b5=_0x1e345a[_0x5bc9('0x4e')][_0x23b711];var _0x542aa9={'id':_0x2b17b5['id'],'available':_0x2b17b5[_0x5bc9('0x4f')],'loggedIn':_0x2b17b5[_0x5bc9('0x50')],'name':_0x2b17b5[_0x5bc9('0x51')],'paused':_0x2b17b5[_0x5bc9('0x52')],'waiting':_0x2b17b5[_0x5bc9('0x53')]};_0x1c20ed[_0x5bc9('0x1d')](_0x542aa9);}}_0x542834({'count':_0x1c20ed[_0x5bc9('0x16')],'rows':_0x1c20ed});});},'MailQueues':function(){return new Promise(function(_0x447e80){var _0x2328e3=[];for(var _0x3d5d27 in _0x1e345a[_0x5bc9('0x54')]){if(_0x1e345a[_0x5bc9('0x54')][_0x5bc9('0x48')](_0x3d5d27)){var _0x5f20e5=_0x1e345a['mailQueues'][_0x3d5d27];var _0x635317={'id':_0x5f20e5['id'],'available':_0x5f20e5[_0x5bc9('0x4f')],'loggedIn':_0x5f20e5[_0x5bc9('0x50')],'name':_0x5f20e5['name'],'paused':_0x5f20e5[_0x5bc9('0x52')],'waiting':_0x5f20e5[_0x5bc9('0x53')]};_0x2328e3[_0x5bc9('0x1d')](_0x635317);}}_0x447e80({'count':_0x2328e3[_0x5bc9('0x16')],'rows':_0x2328e3});});},'OpenchannelQueues':function(){return new Promise(function(_0x5739a3){var _0x1234ca=[];for(var _0x5a7930 in _0x1e345a['openchannelQueues']){if(_0x1e345a[_0x5bc9('0x55')][_0x5bc9('0x48')](_0x5a7930)){var _0x3b1d25=_0x1e345a['openchannelQueues'][_0x5a7930];var _0x55e667={'id':_0x3b1d25['id'],'available':_0x3b1d25['available'],'loggedIn':_0x3b1d25[_0x5bc9('0x50')],'name':_0x3b1d25['name'],'paused':_0x3b1d25[_0x5bc9('0x52')],'waiting':_0x3b1d25[_0x5bc9('0x53')]};_0x1234ca['push'](_0x55e667);}}_0x5739a3({'count':_0x1234ca[_0x5bc9('0x16')],'rows':_0x1234ca});});},'SmsQueues':function(){return new Promise(function(_0x965d1){var _0x5210df=[];for(var _0x4b0ff0 in _0x1e345a[_0x5bc9('0x56')]){if(_0x1e345a[_0x5bc9('0x56')][_0x5bc9('0x48')](_0x4b0ff0)){var _0x256fb1=_0x1e345a['smsQueues'][_0x4b0ff0];var _0x3593d0={'id':_0x256fb1['id'],'available':_0x256fb1[_0x5bc9('0x4f')],'loggedIn':_0x256fb1[_0x5bc9('0x50')],'name':_0x256fb1[_0x5bc9('0x51')],'paused':_0x256fb1[_0x5bc9('0x52')],'waiting':_0x256fb1[_0x5bc9('0x53')]};_0x5210df[_0x5bc9('0x1d')](_0x3593d0);}}_0x965d1({'count':_0x5210df[_0x5bc9('0x16')],'rows':_0x5210df});});},'FaxQueues':function(){return new Promise(function(_0x1cc032){var _0x2ceae8=[];for(var _0x3bc38b in _0x1e345a['faxQueues']){if(_0x1e345a['faxQueues'][_0x5bc9('0x48')](_0x3bc38b)){var _0x1e4a93=_0x1e345a[_0x5bc9('0x57')][_0x3bc38b];var _0x1c153e={'id':_0x1e4a93['id'],'available':_0x1e4a93[_0x5bc9('0x4f')],'loggedIn':_0x1e4a93['loggedIn'],'name':_0x1e4a93[_0x5bc9('0x51')],'paused':_0x1e4a93['paused'],'waiting':_0x1e4a93[_0x5bc9('0x53')]};_0x2ceae8[_0x5bc9('0x1d')](_0x1c153e);}}_0x1cc032({'count':_0x2ceae8[_0x5bc9('0x16')],'rows':_0x2ceae8});});},'WhatsappQueues':function(){return new Promise(function(_0x233378){var _0x35955d=[];for(var _0xda6b15 in _0x1e345a[_0x5bc9('0x58')]){if(_0x1e345a[_0x5bc9('0x58')][_0x5bc9('0x48')](_0xda6b15)){var _0x3381a0=_0x1e345a['whatsappQueues'][_0xda6b15];var _0x5d1a91={'id':_0x3381a0['id'],'available':_0x3381a0[_0x5bc9('0x4f')],'loggedIn':_0x3381a0[_0x5bc9('0x50')],'name':_0x3381a0[_0x5bc9('0x51')],'paused':_0x3381a0[_0x5bc9('0x52')],'waiting':_0x3381a0[_0x5bc9('0x53')]};_0x35955d[_0x5bc9('0x1d')](_0x5d1a91);}}_0x233378({'count':_0x35955d[_0x5bc9('0x16')],'rows':_0x35955d});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3f47c5){var _0x211812=_['values'](_0x1e345a[_0x5bc9('0x59')]);_0x3f47c5({'count':_0x211812[_0x5bc9('0x16')],'rows':_0x211812});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4e7286){var _0xa7acbf=_[_0x5bc9('0x4c')](_0x1e345a[_0x5bc9('0x5a')]);_0x4e7286({'count':_0xa7acbf[_0x5bc9('0x16')],'rows':_0xa7acbf});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2416b4){var _0x4b1b63=_['values'](_0x1e345a[_0x5bc9('0x5b')]);_0x2416b4({'count':_0x4b1b63[_0x5bc9('0x16')],'rows':_0x4b1b63});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xa67332){var _0x572d64=_[_0x5bc9('0x4c')](_0x1e345a['smsQueuesWaitingInteractions']);_0xa67332({'count':_0x572d64[_0x5bc9('0x16')],'rows':_0x572d64});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xf2c589){var _0x514d57=_['values'](_0x1e345a[_0x5bc9('0x5c')]);_0xf2c589({'count':_0x514d57[_0x5bc9('0x16')],'rows':_0x514d57});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4cce77){var _0x2ef48f=_['values'](_0x1e345a[_0x5bc9('0x5d')]);_0x4cce77({'count':_0x2ef48f['length'],'rows':_0x2ef48f});});}};var _0x275ab7=jayson[_0x5bc9('0x5e')](_0x11341a)[_0x5bc9('0x5f')]();_0x275ab7['on'](_0x5bc9('0x3a'),function(_0x4fe72c){logger[_0x5bc9('0x3a')](JSON[_0x5bc9('0x35')](_0x4fe72c));return _0x767740(_0x4fe72c);});_0x275ab7[_0x5bc9('0x60')](0x232c,_0x5bc9('0x61'),function(){console[_0x5bc9('0x62')](_0x5bc9('0x63'),0x232c);return _0x48a2c2(_0x5bc9('0x64')+0x232c);});});};
\ No newline at end of file
+var _0x8d62=['rules','execute','stringify','matchPath','complete','format','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busyQueue','emit','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','mailQueues','loggedIn','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','.js'];(function(_0x27d446,_0x17135c){var _0x16935f=function(_0x119593){while(--_0x119593){_0x27d446['push'](_0x27d446['shift']());}};_0x16935f(++_0x17135c);}(_0x8d62,0xf8));var _0x28d6=function(_0x1e1762,_0x185229){_0x1e1762=_0x1e1762-0x0;var _0x3f58d0=_0x8d62[_0x1e1762];return _0x3f58d0;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var path=require(_0x28d6('0x1'));var fs=require('fs');var jayson=require(_0x28d6('0x2'));var BPromise=require(_0x28d6('0x3'));var utils=require(_0x28d6('0x4'));var sUtils=require(_0x28d6('0x5'));var logger=require(_0x28d6('0x6'))(_0x28d6('0x7'));var rpc={'openchannelQueueReport':require(_0x28d6('0x8')),'mailQueueReport':require(_0x28d6('0x9')),'chatQueueReport':require(_0x28d6('0xa')),'smsQueueReport':require(_0x28d6('0xb')),'faxQueueReport':require(_0x28d6('0xc')),'whatsappQueueReport':require(_0x28d6('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x1d5399,_0xb9dccb,_0x3f3235){return util['format'](_0x28d6('0xe'),_0x1d5399,_0xb9dccb||0x0,_0x3f3235||0x0);}function getIntervals(_0x4b564f,_0x13eeb6){var _0x7726e1=[];if(!_[_0x28d6('0xf')](_0x13eeb6[_0x28d6('0x10')])&&!_[_0x28d6('0xf')](_0x4b564f[_0x13eeb6['IntervalId']])&&!_[_0x28d6('0xf')](_0x4b564f[_0x13eeb6[_0x28d6('0x10')]][_0x28d6('0x11')])){_0x7726e1=_[_0x28d6('0x12')](_0x4b564f[_0x13eeb6[_0x28d6('0x10')]][_0x28d6('0x11')],_0x28d6('0x13'));}else if(!_[_0x28d6('0xf')](_0x13eeb6['interval'])){_0x7726e1=[_0x13eeb6[_0x28d6('0x13')]];}return _0x7726e1;}exports[_0x28d6('0x14')]=function(_0x33ba38){_0x33ba38['rules']={};return new BPromise(function(_0x1621ee,_0x53f101){var _0x19c21d={'Start':function(_0x425ffb){var _0x4b82e2=this;return new Promise(function(_0x1881a8,_0x159d2a){if(_0x425ffb){try{var _0x2d5eee=[];var _0x17a822=getId(_0x425ffb[_0x28d6('0x15')],_0x425ffb['message']?_0x425ffb[_0x28d6('0x16')]['id']:0x0,_0x425ffb['interaction']?_0x425ffb[_0x28d6('0x17')]['id']:0x0);var _0x155151=sUtils[_0x28d6('0x18')](_0x33ba38,_0x425ffb);if(_0x425ffb[_0x28d6('0x19')]||!_0x155151&&_0x425ffb[_0x28d6('0x1a')]&&_[_0x28d6('0x1b')](_0x425ffb[_0x28d6('0x1a')])&&_0x425ffb['applications'][_0x28d6('0x1c')]){for(var _0x20f2fd=0x0;_0x20f2fd<_0x425ffb['applications'][_0x28d6('0x1c')];_0x20f2fd+=0x1){var _0x24f764=_0x425ffb[_0x28d6('0x1a')][_0x20f2fd];if(fs[_0x28d6('0x1d')](path[_0x28d6('0x1e')](__dirname,_0x28d6('0x1a'),_0x24f764[_0x28d6('0x1f')]+'.js'))){var _0xcf8fa0=[];switch(_0x24f764['app'][_0x28d6('0x20')]()){case _0x28d6('0x21'):var _0x455dd6=_0x24f764[_0x28d6('0x22')][_0x28d6('0x23')](',');if(_0x425ffb[_0x28d6('0x15')]==='mail'){_0xcf8fa0['push'](_0x455dd6[0x0]);_0xcf8fa0[_0x28d6('0x24')](_0x455dd6[0x1]);_0xcf8fa0[_0x28d6('0x24')](_0x455dd6[_0x28d6('0x25')](0x2,_0x455dd6[_0x28d6('0x1c')])['join'](','));}else{_0xcf8fa0[_0x28d6('0x24')](_0x455dd6[0x0]);_0xcf8fa0[_0x28d6('0x24')](_0x455dd6[_0x28d6('0x25')](0x1,_0x455dd6[_0x28d6('0x1c')])[_0x28d6('0x1e')](','));}break;case _0x28d6('0x26'):var _0x60ded0=_0x24f764[_0x28d6('0x22')][_0x28d6('0x23')](',');_0xcf8fa0[_0x28d6('0x24')](_0x60ded0[0x0]);_0xcf8fa0[_0x28d6('0x24')](_0x60ded0[0x1]);_0xcf8fa0[_0x28d6('0x24')](_0x60ded0[_0x28d6('0x25')](0x2,_0x60ded0[_0x28d6('0x1c')])['join'](','));break;case'dialogflowv2':var _0x1de585=_0x24f764[_0x28d6('0x22')][_0x28d6('0x23')](',');_0xcf8fa0[_0x28d6('0x24')](_0x1de585[0x0]);_0xcf8fa0[_0x28d6('0x24')](_0x1de585[0x1]);_0xcf8fa0[_0x28d6('0x24')](_0x1de585[0x2]);_0xcf8fa0['push'](_0x1de585[0x3]);_0xcf8fa0[_0x28d6('0x24')](_0x1de585['slice'](0x4,_0x1de585[_0x28d6('0x1c')])['join'](','));break;case _0x28d6('0x27'):var _0x2594cb=_0x24f764[_0x28d6('0x22')][_0x28d6('0x23')](',');_0xcf8fa0[_0x28d6('0x24')](_0x2594cb[0x0]);_0xcf8fa0['push'](_0x2594cb[0x1]);_0xcf8fa0['push'](_0x2594cb[0x2]);_0xcf8fa0[_0x28d6('0x24')](_0x2594cb[0x3]);_0xcf8fa0[_0x28d6('0x24')](_0x2594cb['slice'](0x4,_0x2594cb[_0x28d6('0x1c')])['join'](','));break;case _0x28d6('0x16'):_0xcf8fa0['push'](_0x24f764[_0x28d6('0x22')]);break;case'tag':_0xcf8fa0[_0x28d6('0x24')](_0x24f764[_0x28d6('0x28')]);_0xcf8fa0[_0x28d6('0x24')](_0x24f764[_0x28d6('0x22')]);break;case _0x28d6('0x29'):var _0x10b374=utils[_0x28d6('0x2a')](_0x425ffb['account'][_0x28d6('0x2b')],_0x425ffb);var _0x23a04b=_0x24f764[_0x28d6('0x22')][_0x28d6('0x23')](',');_0xcf8fa0['push'](_0x23a04b[0x0]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x1]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x2]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x3]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x4]);_0xcf8fa0['push'](_0x23a04b[0x5]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x6]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x7]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x8]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0x9]);_0xcf8fa0[_0x28d6('0x24')](_0x23a04b[0xa]);_0xcf8fa0[_0x28d6('0x24')](_0x425ffb[_0x28d6('0x17')]['id']);_0xcf8fa0[_0x28d6('0x24')](_0x425ffb[_0x28d6('0x16')]['id']);_0xcf8fa0[_0x28d6('0x24')](_0x24f764[_0x28d6('0x2c')]);_0xcf8fa0[_0x28d6('0x24')](_0x425ffb[_0x28d6('0x17')][_0x28d6('0x2d')]);_0xcf8fa0[_0x28d6('0x24')](_0x425ffb[_0x28d6('0x2e')]['body']);_0xcf8fa0['push'](_0x10b374);break;default:_0xcf8fa0=_['isNil'](_0x24f764[_0x28d6('0x22')])?[]:_0x24f764['appdata']['split'](',');}var _0x293320={'id':util['format'](_0x28d6('0x2f'),_0x17a822,_0x24f764['id'],_0x24f764[_0x28d6('0x1f')]),'condition':require('./interval')[_0x28d6('0x30')](_0x17a822,getIntervals(_0x33ba38[_0x28d6('0x31')],_0x24f764),_0x33ba38),'consequence':require(_0x28d6('0x32')+_0x24f764[_0x28d6('0x1f')])[_0x28d6('0x33')](_0x17a822,_0xcf8fa0,_0x33ba38,_0x425ffb),'p':_0x24f764[_0x28d6('0x34')]||0x0};logger[_0x28d6('0x35')](_0x28d6('0x36'),_0x293320['id'],'on\x20interval',getIntervals(_0x33ba38[_0x28d6('0x31')],_0x24f764)[_0x28d6('0x1e')]('\x20|\x20'));_0x2d5eee[_0x28d6('0x24')](_0x293320);}else{logger[_0x28d6('0x37')](_0x28d6('0x38'),path['join'](__dirname,_0x28d6('0x1a'),_0x24f764[_0x28d6('0x1f')]+_0x28d6('0x39')));}}_0x33ba38[_0x28d6('0x3a')][_0x17a822]=new RuleEngine(_0x2d5eee);_0x33ba38['rules'][_0x17a822][_0x28d6('0x3b')](_0x425ffb,function(_0x3559ab){logger[_0x28d6('0x35')]('Applications\x20executed',JSON[_0x28d6('0x3c')](_0x3559ab[_0x28d6('0x3d')]));if(_0x33ba38[_0x28d6('0x3a')][_0x17a822]){_0x33ba38[_0x28d6('0x3a')][_0x17a822]['emit'](_0x28d6('0x3e'));}});return _0x1881a8({'code':0xc8,'message':_0x425ffb});}else{if(_0x155151){logger[_0x28d6('0x35')](util[_0x28d6('0x3f')](_0x28d6('0x40'),_0x17a822));}else{logger[_0x28d6('0x35')]('No\x20applications\x20to\x20execute');}return _0x1881a8({'code':0xc8,'message':_0x425ffb});}}catch(_0x159580){logger[_0x28d6('0x37')](_0x159580[_0x28d6('0x41')]);return _0x159d2a(_0x4b82e2[_0x28d6('0x37')](0x1f4,_0x159580));}}return _0x159d2a(_0x28d6('0x42'));});},'AcceptMessage':function(_0x182d70){var _0x10a52=this;return new Promise(function(_0x6876a5,_0x293c76){if(_0x182d70[_0x28d6('0x43')]&&_0x182d70['agent']['id']){if(_0x33ba38['agents'][_0x182d70[_0x28d6('0x43')]['id']]){_0x33ba38['agents'][_0x182d70['agent']['id']]['busy']=![];_0x33ba38[_0x28d6('0x44')][_0x182d70['agent']['id']][_0x28d6('0x45')]=undefined;}}if(_0x182d70['message']&&_0x182d70[_0x28d6('0x16')]['id']){try{var _0x3b7f2e=getId(_0x182d70[_0x28d6('0x15')],_0x182d70['message']?_0x182d70['message']['id']:0x0,_0x182d70['interaction']?_0x182d70[_0x28d6('0x17')]['id']:0x0);if(_0x33ba38[_0x28d6('0x3a')][_0x3b7f2e]){_0x33ba38['rules'][_0x3b7f2e][_0x28d6('0x46')](_0x28d6('0x47'));if(rpc[_0x182d70[_0x28d6('0x15')]+_0x28d6('0x48')]){rpc[_0x182d70[_0x28d6('0x15')]+_0x28d6('0x48')][_0x28d6('0x49')](_0x3b7f2e,{'UserId':_0x182d70[_0x28d6('0x16')]['UserId']})[_0x28d6('0x4a')](function(){logger[_0x28d6('0x37')](_0x28d6('0x4b'));});}}return _0x6876a5({'code':0xc8,'message':_0x182d70});}catch(_0x2b0b72){logger[_0x28d6('0x37')](_0x2b0b72[_0x28d6('0x41')]);return _0x293c76(_0x10a52[_0x28d6('0x37')](0x1f4,_0x2b0b72));}}logger['error'](_0x28d6('0x4c'));return _0x293c76(_0x10a52['error'](0x1f4,_0x28d6('0x4c')));});},'RejectMessage':function(_0x2f8f42){var _0x6ee4d9=this;return new Promise(function(_0x15edd6,_0x69aa04){if(_0x2f8f42[_0x28d6('0x43')]&&_0x2f8f42['agent']['id']){try{if(_0x33ba38[_0x28d6('0x44')][_0x2f8f42['agent']['id']]){_0x33ba38[_0x28d6('0x44')][_0x2f8f42['agent']['id']][_0x28d6('0x4d')]=![];_0x33ba38[_0x28d6('0x44')][_0x2f8f42[_0x28d6('0x43')]['id']][_0x28d6('0x45')]=undefined;}return _0x15edd6({'code':0xc8,'message':_0x2f8f42});}catch(_0x49a01a){logger[_0x28d6('0x37')](_0x49a01a[_0x28d6('0x41')]);return _0x69aa04(_0x6ee4d9[_0x28d6('0x37')](0x1f4,_0x49a01a));}}logger[_0x28d6('0x37')](_0x28d6('0x4c'));return _0x69aa04(_0x6ee4d9[_0x28d6('0x37')](0x1f4,_0x28d6('0x4c')));});},'AbandonInteraction':function(_0x1ed92e){var _0x164f53=this;return new Promise(function(_0xe55cde,_0x267661){if(_0x1ed92e['channel']&&_0x1ed92e[_0x28d6('0x17')]&&_0x1ed92e[_0x28d6('0x17')]['id']){try{var _0x45a288=getId(_0x1ed92e[_0x28d6('0x15')],_0x1ed92e[_0x28d6('0x16')]?_0x1ed92e['message']['id']:0x0,_0x1ed92e[_0x28d6('0x17')]?_0x1ed92e[_0x28d6('0x17')]['id']:0x0);if(_0x33ba38[_0x28d6('0x3a')][_0x45a288]){_0x33ba38[_0x28d6('0x3a')][_0x45a288][_0x28d6('0x46')]('end');}return _0xe55cde({'code':0xc8,'message':_0x1ed92e});}catch(_0x3bf12f){logger[_0x28d6('0x37')](_0x3bf12f[_0x28d6('0x41')]);return _0x267661(_0x164f53[_0x28d6('0x37')](0x1f4,_0x3bf12f));}}logger['error'](_0x28d6('0x4c'));return _0x267661(_0x164f53['error'](0x1f4,_0x28d6('0x4c')));});},'AgentCapacity':function(_0x1b8ed6){var _0x351f8d=this;return new Promise(function(_0x4c5c36,_0x21fd25){if(_0x33ba38[_0x28d6('0x44')][_0x28d6('0x4e')](_0x1b8ed6['id'])){for(var _0x16ced4 in _0x1b8ed6[_0x28d6('0x4f')]){if(_0x1b8ed6[_0x28d6('0x4f')][_0x28d6('0x4e')](_0x16ced4)){if(_0x33ba38['agents'][_0x1b8ed6['id']][_0x28d6('0x4e')](_0x16ced4+_0x28d6('0x50'))){_0x33ba38[_0x28d6('0x44')][_0x1b8ed6['id']][_0x16ced4+_0x28d6('0x50')]=parseInt(_0x1b8ed6[_0x28d6('0x4f')][_0x16ced4],0xa);}}}_0x33ba38[_0x28d6('0x44')][_0x1b8ed6['id']][_0x28d6('0x51')]();return _0x4c5c36({'code':0xc8,'message':_0x33ba38[_0x28d6('0x44')][_0x1b8ed6['id']]});}else{return _0x21fd25(_0x351f8d[_0x28d6('0x37')](0x1f4,_0x28d6('0x52')));}});},'Agents':function(_0x5d1441){return new Promise(function(_0x3a87c8){var _0xbe3e6=_[_0x28d6('0x53')](_0x33ba38[_0x28d6('0x44')]);if(_0x5d1441&&_0x5d1441['id']){var _0xbd4b4b=_['find'](_0xbe3e6,function(_0x2322c6){return _0x2322c6['id']===_0x5d1441['id'];});_0x3a87c8(_0xbd4b4b);}else{_0x3a87c8({'count':_0xbe3e6[_0x28d6('0x1c')],'rows':_0xbe3e6});}});},'ChatQueues':function(){return new Promise(function(_0xd6b590){var _0x3676b3=[];for(var _0x221dec in _0x33ba38[_0x28d6('0x54')]){if(_0x33ba38[_0x28d6('0x54')]['hasOwnProperty'](_0x221dec)){var _0x543770=_0x33ba38[_0x28d6('0x54')][_0x221dec];var _0x245872={'id':_0x543770['id'],'available':_0x543770[_0x28d6('0x55')],'loggedIn':_0x543770['loggedIn'],'name':_0x543770[_0x28d6('0x56')],'paused':_0x543770['paused'],'waiting':_0x543770['waiting']};_0x3676b3[_0x28d6('0x24')](_0x245872);}}_0xd6b590({'count':_0x3676b3[_0x28d6('0x1c')],'rows':_0x3676b3});});},'MailQueues':function(){return new Promise(function(_0x2613fb){var _0x2f0580=[];for(var _0x45245a in _0x33ba38[_0x28d6('0x57')]){if(_0x33ba38[_0x28d6('0x57')]['hasOwnProperty'](_0x45245a)){var _0x5956de=_0x33ba38['mailQueues'][_0x45245a];var _0x2fae42={'id':_0x5956de['id'],'available':_0x5956de[_0x28d6('0x55')],'loggedIn':_0x5956de[_0x28d6('0x58')],'name':_0x5956de[_0x28d6('0x56')],'paused':_0x5956de[_0x28d6('0x59')],'waiting':_0x5956de[_0x28d6('0x5a')]};_0x2f0580[_0x28d6('0x24')](_0x2fae42);}}_0x2613fb({'count':_0x2f0580[_0x28d6('0x1c')],'rows':_0x2f0580});});},'OpenchannelQueues':function(){return new Promise(function(_0x26a2f7){var _0x1ed7e3=[];for(var _0x5e1ba4 in _0x33ba38[_0x28d6('0x5b')]){if(_0x33ba38[_0x28d6('0x5b')][_0x28d6('0x4e')](_0x5e1ba4)){var _0xb9a647=_0x33ba38[_0x28d6('0x5b')][_0x5e1ba4];var _0x278401={'id':_0xb9a647['id'],'available':_0xb9a647[_0x28d6('0x55')],'loggedIn':_0xb9a647[_0x28d6('0x58')],'name':_0xb9a647[_0x28d6('0x56')],'paused':_0xb9a647['paused'],'waiting':_0xb9a647['waiting']};_0x1ed7e3[_0x28d6('0x24')](_0x278401);}}_0x26a2f7({'count':_0x1ed7e3[_0x28d6('0x1c')],'rows':_0x1ed7e3});});},'SmsQueues':function(){return new Promise(function(_0x6bdf9f){var _0x5418ba=[];for(var _0x376a7d in _0x33ba38[_0x28d6('0x5c')]){if(_0x33ba38[_0x28d6('0x5c')][_0x28d6('0x4e')](_0x376a7d)){var _0x228f44=_0x33ba38[_0x28d6('0x5c')][_0x376a7d];var _0x2dbdf6={'id':_0x228f44['id'],'available':_0x228f44[_0x28d6('0x55')],'loggedIn':_0x228f44[_0x28d6('0x58')],'name':_0x228f44[_0x28d6('0x56')],'paused':_0x228f44[_0x28d6('0x59')],'waiting':_0x228f44[_0x28d6('0x5a')]};_0x5418ba[_0x28d6('0x24')](_0x2dbdf6);}}_0x6bdf9f({'count':_0x5418ba[_0x28d6('0x1c')],'rows':_0x5418ba});});},'FaxQueues':function(){return new Promise(function(_0x22d73b){var _0x51adbb=[];for(var _0x12cac4 in _0x33ba38[_0x28d6('0x5d')]){if(_0x33ba38[_0x28d6('0x5d')][_0x28d6('0x4e')](_0x12cac4)){var _0x4bf2cd=_0x33ba38[_0x28d6('0x5d')][_0x12cac4];var _0x51c690={'id':_0x4bf2cd['id'],'available':_0x4bf2cd[_0x28d6('0x55')],'loggedIn':_0x4bf2cd[_0x28d6('0x58')],'name':_0x4bf2cd['name'],'paused':_0x4bf2cd[_0x28d6('0x59')],'waiting':_0x4bf2cd['waiting']};_0x51adbb[_0x28d6('0x24')](_0x51c690);}}_0x22d73b({'count':_0x51adbb[_0x28d6('0x1c')],'rows':_0x51adbb});});},'WhatsappQueues':function(){return new Promise(function(_0x4a6903){var _0x3fede2=[];for(var _0x18c0aa in _0x33ba38[_0x28d6('0x5e')]){if(_0x33ba38['whatsappQueues'][_0x28d6('0x4e')](_0x18c0aa)){var _0x359fe2=_0x33ba38[_0x28d6('0x5e')][_0x18c0aa];var _0x1a8def={'id':_0x359fe2['id'],'available':_0x359fe2[_0x28d6('0x55')],'loggedIn':_0x359fe2[_0x28d6('0x58')],'name':_0x359fe2[_0x28d6('0x56')],'paused':_0x359fe2[_0x28d6('0x59')],'waiting':_0x359fe2['waiting']};_0x3fede2[_0x28d6('0x24')](_0x1a8def);}}_0x4a6903({'count':_0x3fede2[_0x28d6('0x1c')],'rows':_0x3fede2});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x801f2f){var _0x4f2ac4=_[_0x28d6('0x53')](_0x33ba38[_0x28d6('0x5f')]);_0x801f2f({'count':_0x4f2ac4[_0x28d6('0x1c')],'rows':_0x4f2ac4});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x26aab9){var _0x5632ba=_['values'](_0x33ba38[_0x28d6('0x60')]);_0x26aab9({'count':_0x5632ba[_0x28d6('0x1c')],'rows':_0x5632ba});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4da055){var _0x15b53a=_['values'](_0x33ba38[_0x28d6('0x61')]);_0x4da055({'count':_0x15b53a[_0x28d6('0x1c')],'rows':_0x15b53a});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3f0eff){var _0xca226b=_['values'](_0x33ba38['smsQueuesWaitingInteractions']);_0x3f0eff({'count':_0xca226b[_0x28d6('0x1c')],'rows':_0xca226b});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5e1ce0){var _0x261cfb=_['values'](_0x33ba38[_0x28d6('0x62')]);_0x5e1ce0({'count':_0x261cfb[_0x28d6('0x1c')],'rows':_0x261cfb});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3b6e84){var _0x5383c8=_[_0x28d6('0x53')](_0x33ba38['whatsappQueuesWaitingInteractions']);_0x3b6e84({'count':_0x5383c8[_0x28d6('0x1c')],'rows':_0x5383c8});});}};var _0x2788b7=jayson['server'](_0x19c21d)[_0x28d6('0x63')]();_0x2788b7['on'](_0x28d6('0x37'),function(_0x420931){logger['error'](JSON[_0x28d6('0x3c')](_0x420931));return _0x53f101(_0x420931);});_0x2788b7['listen'](0x232c,_0x28d6('0x64'),function(){console['log'](_0x28d6('0x65'),0x232c);return _0x1621ee('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file