Built motion from commit 6a0adb95.|2.6.31
[motion2.git] / server / services / routing / server / index.js
index 318ea16..3a72fc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x806d=['hasOwnProperty','CurrentCapacity','updateRealtime','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','transfer','applications','isArray','length','app','.js','appdata','split','mail','push','join','slice','dialogflow','amazonlex','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','intervals','consequence','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','QueueReport','UserId','stack','message\x20is\x20empty','end','capacity'];(function(_0x4e097f,_0x3bbf8e){var _0x3df1de=function(_0x38516b){while(--_0x38516b){_0x4e097f['push'](_0x4e097f['shift']());}};_0x3df1de(++_0x3bbf8e);}(_0x806d,0x131));var _0xd806=function(_0x40a849,_0x373204){_0x40a849=_0x40a849-0x0;var _0x5758e8=_0x806d[_0x40a849];return _0x5758e8;};'use strict';var _=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var path=require(_0xd806('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0xd806('0x3'));var logger=require(_0xd806('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0xd806('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd806('0x6')),'smsQueueReport':require(_0xd806('0x7')),'faxQueueReport':require(_0xd806('0x8')),'whatsappQueueReport':require(_0xd806('0x9'))};var RuleEngine=require(_0xd806('0xa'));function getId(_0x3873bf,_0x1c1932,_0x4c8dea){return util[_0xd806('0xb')](_0xd806('0xc'),_0x3873bf,_0x1c1932||0x0,_0x4c8dea||0x0);}function getIntervals(_0x902695,_0xf68dd6){var _0x55fb02=[];if(!_[_0xd806('0xd')](_0xf68dd6['IntervalId'])&&!_[_0xd806('0xd')](_0x902695[_0xf68dd6[_0xd806('0xe')]])&&!_['isNil'](_0x902695[_0xf68dd6[_0xd806('0xe')]][_0xd806('0xf')])){_0x55fb02=_[_0xd806('0x10')](_0x902695[_0xf68dd6[_0xd806('0xe')]][_0xd806('0xf')],_0xd806('0x11'));}else if(!_[_0xd806('0xd')](_0xf68dd6[_0xd806('0x11')])){_0x55fb02=[_0xf68dd6[_0xd806('0x11')]];}return _0x55fb02;}exports[_0xd806('0x12')]=function(_0x32f405){_0x32f405['rules']={};return new BPromise(function(_0x17d8bc,_0x359bfa){var _0x69dd14={'Start':function(_0x4a2139){var _0x7a8ed1=this;return new Promise(function(_0x5a4ae4,_0x33127f){if(_0x4a2139){try{var _0x1195c4=[];var _0x47f679=getId(_0x4a2139[_0xd806('0x13')],_0x4a2139[_0xd806('0x14')]?_0x4a2139[_0xd806('0x14')]['id']:0x0,_0x4a2139[_0xd806('0x15')]?_0x4a2139[_0xd806('0x15')]['id']:0x0);var _0x1c9ce4=sUtils['checkWaitingNotifications'](_0x32f405,_0x4a2139);if(_0x4a2139[_0xd806('0x16')]||!_0x1c9ce4&&_0x4a2139[_0xd806('0x17')]&&_[_0xd806('0x18')](_0x4a2139['applications'])&&_0x4a2139[_0xd806('0x17')]['length']){for(var _0x2dcb40=0x0;_0x2dcb40<_0x4a2139[_0xd806('0x17')][_0xd806('0x19')];_0x2dcb40+=0x1){var _0x469f01=_0x4a2139[_0xd806('0x17')][_0x2dcb40];if(fs['existsSync'](path['join'](__dirname,_0xd806('0x17'),_0x469f01[_0xd806('0x1a')]+_0xd806('0x1b')))){var _0x95450b=[];switch(_0x469f01[_0xd806('0x1a')]['toLowerCase']()){case'autoreply':var _0x2a173b=_0x469f01[_0xd806('0x1c')][_0xd806('0x1d')](',');if(_0x4a2139[_0xd806('0x13')]===_0xd806('0x1e')){_0x95450b['push'](_0x2a173b[0x0]);_0x95450b[_0xd806('0x1f')](_0x2a173b[0x1]);_0x95450b[_0xd806('0x1f')](_0x2a173b['slice'](0x2,_0x2a173b['length'])[_0xd806('0x20')](','));}else{_0x95450b['push'](_0x2a173b[0x0]);_0x95450b[_0xd806('0x1f')](_0x2a173b[_0xd806('0x21')](0x1,_0x2a173b[_0xd806('0x19')])[_0xd806('0x20')](','));}break;case _0xd806('0x22'):var _0x59b43d=_0x469f01['appdata'][_0xd806('0x1d')](',');_0x95450b[_0xd806('0x1f')](_0x59b43d[0x0]);_0x95450b[_0xd806('0x1f')](_0x59b43d[0x1]);_0x95450b['push'](_0x59b43d[_0xd806('0x21')](0x2,_0x59b43d[_0xd806('0x19')])[_0xd806('0x20')](','));break;case'dialogflowv2':var _0x47dc87=_0x469f01[_0xd806('0x1c')][_0xd806('0x1d')](',');_0x95450b[_0xd806('0x1f')](_0x47dc87[0x0]);_0x95450b[_0xd806('0x1f')](_0x47dc87[0x1]);_0x95450b[_0xd806('0x1f')](_0x47dc87[0x2]);_0x95450b['push'](_0x47dc87[0x3]);_0x95450b['push'](_0x47dc87['slice'](0x4,_0x47dc87['length'])[_0xd806('0x20')](','));break;case _0xd806('0x23'):var _0x14ba23=_0x469f01[_0xd806('0x1c')][_0xd806('0x1d')](',');_0x95450b[_0xd806('0x1f')](_0x14ba23[0x0]);_0x95450b[_0xd806('0x1f')](_0x14ba23[0x1]);_0x95450b[_0xd806('0x1f')](_0x14ba23[0x2]);_0x95450b[_0xd806('0x1f')](_0x14ba23[0x3]);_0x95450b['push'](_0x14ba23[_0xd806('0x21')](0x4,_0x14ba23[_0xd806('0x19')])[_0xd806('0x20')](','));break;case _0xd806('0x14'):_0x95450b['push'](_0x469f01[_0xd806('0x1c')]);break;case'tag':_0x95450b[_0xd806('0x1f')](_0x469f01['TagId']);_0x95450b['push'](_0x469f01[_0xd806('0x1c')]);break;case _0xd806('0x24'):var _0x4a5b26=utils[_0xd806('0x25')](_0x4a2139[_0xd806('0x26')]['notificationTemplate'],_0x4a2139);var _0x63d562=_0x469f01[_0xd806('0x1c')]['split'](',');_0x95450b[_0xd806('0x1f')](_0x63d562[0x0]);_0x95450b[_0xd806('0x1f')](_0x63d562[0x1]);_0x95450b['push'](_0x63d562[0x2]);_0x95450b['push'](_0x63d562[0x3]);_0x95450b[_0xd806('0x1f')](_0x63d562[0x4]);_0x95450b[_0xd806('0x1f')](_0x63d562[0x5]);_0x95450b['push'](_0x63d562[0x6]);_0x95450b[_0xd806('0x1f')](_0x63d562[0x7]);_0x95450b[_0xd806('0x1f')](_0x63d562[0x8]);_0x95450b['push'](_0x63d562[0x9]);_0x95450b['push'](_0x63d562[0xa]);_0x95450b['push'](_0x4a2139[_0xd806('0x15')]['id']);_0x95450b[_0xd806('0x1f')](_0x4a2139[_0xd806('0x14')]['id']);_0x95450b[_0xd806('0x1f')](_0x469f01[_0xd806('0x27')]);_0x95450b[_0xd806('0x1f')](_0x4a2139[_0xd806('0x15')][_0xd806('0x28')]);_0x95450b[_0xd806('0x1f')](_0x4a2139[_0xd806('0x29')]['body']);_0x95450b[_0xd806('0x1f')](_0x4a5b26);break;default:_0x95450b=_['isNil'](_0x469f01[_0xd806('0x1c')])?[]:_0x469f01[_0xd806('0x1c')]['split'](',');}var _0x18340e={'id':util['format'](_0xd806('0x2a'),_0x47f679,_0x469f01['id'],_0x469f01['app']),'condition':require('./interval')['condition'](_0x47f679,getIntervals(_0x32f405[_0xd806('0x2b')],_0x469f01),_0x32f405),'consequence':require('./applications/'+_0x469f01[_0xd806('0x1a')])[_0xd806('0x2c')](_0x47f679,_0x95450b,_0x32f405,_0x4a2139),'p':_0x469f01[_0xd806('0x2d')]||0x0};logger[_0xd806('0x2e')](_0xd806('0x2f'),_0x18340e['id'],'on\x20interval',getIntervals(_0x32f405['intervals'],_0x469f01)[_0xd806('0x20')]('\x20|\x20'));_0x1195c4[_0xd806('0x1f')](_0x18340e);}else{logger[_0xd806('0x30')](_0xd806('0x31'),path['join'](__dirname,_0xd806('0x17'),_0x469f01['app']+_0xd806('0x1b')));}}_0x32f405[_0xd806('0x32')][_0x47f679]=new RuleEngine(_0x1195c4);_0x32f405[_0xd806('0x32')][_0x47f679][_0xd806('0x33')](_0x4a2139,function(_0x4ee130){logger[_0xd806('0x2e')](_0xd806('0x34'),JSON[_0xd806('0x35')](_0x4ee130['matchPath']));if(_0x32f405[_0xd806('0x32')][_0x47f679]){_0x32f405['rules'][_0x47f679][_0xd806('0x36')](_0xd806('0x37'));}});return _0x5a4ae4({'code':0xc8,'message':_0x4a2139});}else{if(_0x1c9ce4){logger[_0xd806('0x2e')](util[_0xd806('0xb')]('Skipped\x20routing\x20for\x20%s',_0x47f679));}else{logger['info'](_0xd806('0x38'));}return _0x5a4ae4({'code':0xc8,'message':_0x4a2139});}}catch(_0x33d2a0){logger['error'](_0x33d2a0['stack']);return _0x33127f(_0x7a8ed1[_0xd806('0x30')](0x1f4,_0x33d2a0));}}return _0x33127f(_0xd806('0x39'));});},'AcceptMessage':function(_0x2b54c1){var _0x449f50=this;return new Promise(function(_0x2e6c48,_0x558532){if(_0x2b54c1['agent']&&_0x2b54c1[_0xd806('0x3a')]['id']){if(_0x32f405['agents'][_0x2b54c1['agent']['id']]){_0x32f405[_0xd806('0x3b')][_0x2b54c1[_0xd806('0x3a')]['id']][_0xd806('0x3c')]=![];_0x32f405['agents'][_0x2b54c1[_0xd806('0x3a')]['id']]['busyQueue']=undefined;}}if(_0x2b54c1[_0xd806('0x14')]&&_0x2b54c1[_0xd806('0x14')]['id']){try{var _0x1064ae=getId(_0x2b54c1[_0xd806('0x13')],_0x2b54c1[_0xd806('0x14')]?_0x2b54c1['message']['id']:0x0,_0x2b54c1['interaction']?_0x2b54c1['interaction']['id']:0x0);if(_0x32f405[_0xd806('0x32')][_0x1064ae]){_0x32f405[_0xd806('0x32')][_0x1064ae]['emit']('end');if(rpc[_0x2b54c1[_0xd806('0x13')]+_0xd806('0x3d')]){rpc[_0x2b54c1['channel']+_0xd806('0x3d')]['update'](_0x1064ae,{'UserId':_0x2b54c1[_0xd806('0x14')][_0xd806('0x3e')]})['catch'](function(){logger[_0xd806('0x30')]('error\x20update\x20queue\x20report');});}}return _0x2e6c48({'code':0xc8,'message':_0x2b54c1});}catch(_0x453f41){logger['error'](_0x453f41[_0xd806('0x3f')]);return _0x558532(_0x449f50[_0xd806('0x30')](0x1f4,_0x453f41));}}logger['error']('message\x20is\x20empty');return _0x558532(_0x449f50['error'](0x1f4,_0xd806('0x40')));});},'RejectMessage':function(_0x5aea03){var _0x187b24=this;return new Promise(function(_0x551149,_0x4ca58a){if(_0x5aea03[_0xd806('0x3a')]&&_0x5aea03[_0xd806('0x3a')]['id']){try{if(_0x32f405[_0xd806('0x3b')][_0x5aea03['agent']['id']]){_0x32f405[_0xd806('0x3b')][_0x5aea03['agent']['id']][_0xd806('0x3c')]=![];_0x32f405['agents'][_0x5aea03['agent']['id']]['busyQueue']=undefined;}return _0x551149({'code':0xc8,'message':_0x5aea03});}catch(_0x404c1c){logger[_0xd806('0x30')](_0x404c1c['stack']);return _0x4ca58a(_0x187b24[_0xd806('0x30')](0x1f4,_0x404c1c));}}logger[_0xd806('0x30')](_0xd806('0x40'));return _0x4ca58a(_0x187b24[_0xd806('0x30')](0x1f4,_0xd806('0x40')));});},'AbandonInteraction':function(_0x4b67ce){var _0x215a41=this;return new Promise(function(_0x332d6d,_0x4f009f){if(_0x4b67ce[_0xd806('0x13')]&&_0x4b67ce[_0xd806('0x15')]&&_0x4b67ce['interaction']['id']){try{var _0x1e483c=getId(_0x4b67ce['channel'],_0x4b67ce[_0xd806('0x14')]?_0x4b67ce[_0xd806('0x14')]['id']:0x0,_0x4b67ce[_0xd806('0x15')]?_0x4b67ce['interaction']['id']:0x0);if(_0x32f405[_0xd806('0x32')][_0x1e483c]){_0x32f405['rules'][_0x1e483c][_0xd806('0x36')](_0xd806('0x41'));}return _0x332d6d({'code':0xc8,'message':_0x4b67ce});}catch(_0xdf669b){logger[_0xd806('0x30')](_0xdf669b[_0xd806('0x3f')]);return _0x4f009f(_0x215a41['error'](0x1f4,_0xdf669b));}}logger[_0xd806('0x30')](_0xd806('0x40'));return _0x4f009f(_0x215a41[_0xd806('0x30')](0x1f4,_0xd806('0x40')));});},'AgentCapacity':function(_0x3b4298){var _0x56562d=this;return new Promise(function(_0x5248cd,_0x547958){if(_0x32f405[_0xd806('0x3b')]['hasOwnProperty'](_0x3b4298['id'])){for(var _0x505857 in _0x3b4298[_0xd806('0x42')]){if(_0x3b4298[_0xd806('0x42')][_0xd806('0x43')](_0x505857)){if(_0x32f405[_0xd806('0x3b')][_0x3b4298['id']]['hasOwnProperty'](_0x505857+'CurrentCapacity')){_0x32f405['agents'][_0x3b4298['id']][_0x505857+_0xd806('0x44')]=parseInt(_0x3b4298[_0xd806('0x42')][_0x505857],0xa);}}}_0x32f405['agents'][_0x3b4298['id']][_0xd806('0x45')]();return _0x5248cd({'code':0xc8,'message':_0x32f405[_0xd806('0x3b')][_0x3b4298['id']]});}else{return _0x547958(_0x56562d[_0xd806('0x30')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc20252){return new Promise(function(_0x1324c9){var _0x2ea911=_['values'](_0x32f405['agents']);if(_0xc20252&&_0xc20252['id']){var _0x175fa6=_[_0xd806('0x46')](_0x2ea911,function(_0x363c8d){return _0x363c8d['id']===_0xc20252['id'];});_0x1324c9(_0x175fa6);}else{_0x1324c9({'count':_0x2ea911[_0xd806('0x19')],'rows':_0x2ea911});}});},'ChatQueues':function(){return new Promise(function(_0x36593f){var _0x2da721=[];for(var _0x542cf7 in _0x32f405[_0xd806('0x47')]){if(_0x32f405['chatQueues'][_0xd806('0x43')](_0x542cf7)){var _0x52fa18=_0x32f405[_0xd806('0x47')][_0x542cf7];var _0x56eead={'id':_0x52fa18['id'],'available':_0x52fa18[_0xd806('0x48')],'loggedIn':_0x52fa18[_0xd806('0x49')],'name':_0x52fa18[_0xd806('0x4a')],'paused':_0x52fa18[_0xd806('0x4b')],'waiting':_0x52fa18[_0xd806('0x4c')]};_0x2da721['push'](_0x56eead);}}_0x36593f({'count':_0x2da721[_0xd806('0x19')],'rows':_0x2da721});});},'MailQueues':function(){return new Promise(function(_0x14984e){var _0x5f3893=[];for(var _0x40a8da in _0x32f405[_0xd806('0x4d')]){if(_0x32f405['mailQueues'][_0xd806('0x43')](_0x40a8da)){var _0xc08f88=_0x32f405[_0xd806('0x4d')][_0x40a8da];var _0x1032af={'id':_0xc08f88['id'],'available':_0xc08f88['available'],'loggedIn':_0xc08f88[_0xd806('0x49')],'name':_0xc08f88[_0xd806('0x4a')],'paused':_0xc08f88['paused'],'waiting':_0xc08f88['waiting']};_0x5f3893[_0xd806('0x1f')](_0x1032af);}}_0x14984e({'count':_0x5f3893[_0xd806('0x19')],'rows':_0x5f3893});});},'OpenchannelQueues':function(){return new Promise(function(_0xfc8a0c){var _0x29a147=[];for(var _0x4c6be2 in _0x32f405[_0xd806('0x4e')]){if(_0x32f405['openchannelQueues'][_0xd806('0x43')](_0x4c6be2)){var _0x53b810=_0x32f405[_0xd806('0x4e')][_0x4c6be2];var _0x1a56c9={'id':_0x53b810['id'],'available':_0x53b810[_0xd806('0x48')],'loggedIn':_0x53b810[_0xd806('0x49')],'name':_0x53b810[_0xd806('0x4a')],'paused':_0x53b810[_0xd806('0x4b')],'waiting':_0x53b810[_0xd806('0x4c')]};_0x29a147[_0xd806('0x1f')](_0x1a56c9);}}_0xfc8a0c({'count':_0x29a147[_0xd806('0x19')],'rows':_0x29a147});});},'SmsQueues':function(){return new Promise(function(_0x3545aa){var _0x14803c=[];for(var _0x288066 in _0x32f405[_0xd806('0x4f')]){if(_0x32f405['smsQueues'][_0xd806('0x43')](_0x288066)){var _0x285f4a=_0x32f405['smsQueues'][_0x288066];var _0x24d34a={'id':_0x285f4a['id'],'available':_0x285f4a[_0xd806('0x48')],'loggedIn':_0x285f4a[_0xd806('0x49')],'name':_0x285f4a[_0xd806('0x4a')],'paused':_0x285f4a[_0xd806('0x4b')],'waiting':_0x285f4a[_0xd806('0x4c')]};_0x14803c['push'](_0x24d34a);}}_0x3545aa({'count':_0x14803c['length'],'rows':_0x14803c});});},'FaxQueues':function(){return new Promise(function(_0x4adf58){var _0x2eec91=[];for(var _0x7a31ed in _0x32f405[_0xd806('0x50')]){if(_0x32f405['faxQueues'][_0xd806('0x43')](_0x7a31ed)){var _0x587c69=_0x32f405['faxQueues'][_0x7a31ed];var _0x5f3938={'id':_0x587c69['id'],'available':_0x587c69[_0xd806('0x48')],'loggedIn':_0x587c69[_0xd806('0x49')],'name':_0x587c69[_0xd806('0x4a')],'paused':_0x587c69[_0xd806('0x4b')],'waiting':_0x587c69[_0xd806('0x4c')]};_0x2eec91[_0xd806('0x1f')](_0x5f3938);}}_0x4adf58({'count':_0x2eec91[_0xd806('0x19')],'rows':_0x2eec91});});},'WhatsappQueues':function(){return new Promise(function(_0x314f0d){var _0x4a03a4=[];for(var _0x567230 in _0x32f405[_0xd806('0x51')]){if(_0x32f405['whatsappQueues'][_0xd806('0x43')](_0x567230)){var _0x4535ab=_0x32f405[_0xd806('0x51')][_0x567230];var _0x2e896c={'id':_0x4535ab['id'],'available':_0x4535ab[_0xd806('0x48')],'loggedIn':_0x4535ab[_0xd806('0x49')],'name':_0x4535ab[_0xd806('0x4a')],'paused':_0x4535ab['paused'],'waiting':_0x4535ab[_0xd806('0x4c')]};_0x4a03a4[_0xd806('0x1f')](_0x2e896c);}}_0x314f0d({'count':_0x4a03a4[_0xd806('0x19')],'rows':_0x4a03a4});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2a1481){var _0x103416=_[_0xd806('0x52')](_0x32f405[_0xd806('0x53')]);_0x2a1481({'count':_0x103416[_0xd806('0x19')],'rows':_0x103416});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x205f3c){var _0x589975=_['values'](_0x32f405[_0xd806('0x54')]);_0x205f3c({'count':_0x589975[_0xd806('0x19')],'rows':_0x589975});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2d8ee6){var _0x2e6368=_['values'](_0x32f405[_0xd806('0x55')]);_0x2d8ee6({'count':_0x2e6368[_0xd806('0x19')],'rows':_0x2e6368});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x132aa5){var _0x44a5e9=_[_0xd806('0x52')](_0x32f405[_0xd806('0x56')]);_0x132aa5({'count':_0x44a5e9[_0xd806('0x19')],'rows':_0x44a5e9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xf4b252){var _0x3be72f=_['values'](_0x32f405[_0xd806('0x57')]);_0xf4b252({'count':_0x3be72f[_0xd806('0x19')],'rows':_0x3be72f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x54c427){var _0x460767=_[_0xd806('0x52')](_0x32f405[_0xd806('0x58')]);_0x54c427({'count':_0x460767[_0xd806('0x19')],'rows':_0x460767});});}};var _0x49e77b=jayson['server'](_0x69dd14)[_0xd806('0x59')]();_0x49e77b['on'](_0xd806('0x30'),function(_0x15ab48){logger[_0xd806('0x30')](JSON[_0xd806('0x35')](_0x15ab48));return _0x359bfa(_0x15ab48);});_0x49e77b['listen'](0x232c,_0xd806('0x5a'),function(){console['log'](_0xd806('0x5b'),0x232c);return _0x17d8bc(_0xd806('0x5c')+0x232c);});});};
\ No newline at end of file
+var _0x4eb8=['agent\x20not\x20found','values','chatQueues','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','transfer','applications','isArray','length','join','.js','app','toLowerCase','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','interaction','ContactId','body','./interval','condition','intervals','consequence','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime'];(function(_0x356708,_0x47a694){var _0x152505=function(_0x569476){while(--_0x569476){_0x356708['push'](_0x356708['shift']());}};_0x152505(++_0x47a694);}(_0x4eb8,0x1b5));var _0x84eb=function(_0x21c068,_0x369d6a){_0x21c068=_0x21c068-0x0;var _0x5cf199=_0x4eb8[_0x21c068];return _0x5cf199;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var path=require(_0x84eb('0x2'));var fs=require('fs');var jayson=require(_0x84eb('0x3'));var BPromise=require('bluebird');var utils=require(_0x84eb('0x4'));var sUtils=require(_0x84eb('0x5'));var logger=require(_0x84eb('0x6'))(_0x84eb('0x7'));var rpc={'openchannelQueueReport':require(_0x84eb('0x8')),'mailQueueReport':require(_0x84eb('0x9')),'chatQueueReport':require(_0x84eb('0xa')),'smsQueueReport':require(_0x84eb('0xb')),'faxQueueReport':require(_0x84eb('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x84eb('0xd'));function getId(_0x37d9e6,_0x12b996,_0xb3d36c){return util[_0x84eb('0xe')](_0x84eb('0xf'),_0x37d9e6,_0x12b996||0x0,_0xb3d36c||0x0);}function getIntervals(_0xf85549,_0x33e9cc){var _0x2709d7=[];if(!_['isNil'](_0x33e9cc[_0x84eb('0x10')])&&!_[_0x84eb('0x11')](_0xf85549[_0x33e9cc[_0x84eb('0x10')]])&&!_[_0x84eb('0x11')](_0xf85549[_0x33e9cc['IntervalId']][_0x84eb('0x12')])){_0x2709d7=_[_0x84eb('0x13')](_0xf85549[_0x33e9cc[_0x84eb('0x10')]][_0x84eb('0x12')],_0x84eb('0x14'));}else if(!_['isNil'](_0x33e9cc[_0x84eb('0x14')])){_0x2709d7=[_0x33e9cc[_0x84eb('0x14')]];}return _0x2709d7;}exports[_0x84eb('0x15')]=function(_0x10f4e1){_0x10f4e1[_0x84eb('0x16')]={};return new BPromise(function(_0x44783b,_0x1ec4cb){var _0x352f81={'Start':function(_0x2670ae){var _0xb19d09=this;return new Promise(function(_0x264565,_0x2f2785){if(_0x2670ae){try{var _0x5a984d=[];var _0x3d6711=getId(_0x2670ae[_0x84eb('0x17')],_0x2670ae[_0x84eb('0x18')]?_0x2670ae[_0x84eb('0x18')]['id']:0x0,_0x2670ae['interaction']?_0x2670ae['interaction']['id']:0x0);var _0x5e4482=sUtils['checkWaitingNotifications'](_0x10f4e1,_0x2670ae);if(_0x2670ae[_0x84eb('0x19')]||!_0x5e4482&&_0x2670ae[_0x84eb('0x1a')]&&_[_0x84eb('0x1b')](_0x2670ae['applications'])&&_0x2670ae[_0x84eb('0x1a')][_0x84eb('0x1c')]){for(var _0xdaf548=0x0;_0xdaf548<_0x2670ae[_0x84eb('0x1a')][_0x84eb('0x1c')];_0xdaf548+=0x1){var _0x37994b=_0x2670ae[_0x84eb('0x1a')][_0xdaf548];if(fs['existsSync'](path[_0x84eb('0x1d')](__dirname,_0x84eb('0x1a'),_0x37994b['app']+_0x84eb('0x1e')))){var _0x5d64cb=[];switch(_0x37994b[_0x84eb('0x1f')][_0x84eb('0x20')]()){case'autoreply':var _0x352989=_0x37994b[_0x84eb('0x21')][_0x84eb('0x22')](',');if(_0x2670ae[_0x84eb('0x17')]===_0x84eb('0x23')){_0x5d64cb[_0x84eb('0x24')](_0x352989[0x0]);_0x5d64cb[_0x84eb('0x24')](_0x352989[0x1]);_0x5d64cb[_0x84eb('0x24')](_0x352989['slice'](0x2,_0x352989[_0x84eb('0x1c')])[_0x84eb('0x1d')](','));}else{_0x5d64cb[_0x84eb('0x24')](_0x352989[0x0]);_0x5d64cb[_0x84eb('0x24')](_0x352989[_0x84eb('0x25')](0x1,_0x352989[_0x84eb('0x1c')])[_0x84eb('0x1d')](','));}break;case _0x84eb('0x26'):var _0x43bd1b=_0x37994b[_0x84eb('0x21')][_0x84eb('0x22')](',');_0x5d64cb[_0x84eb('0x24')](_0x43bd1b[0x0]);_0x5d64cb[_0x84eb('0x24')](_0x43bd1b[0x1]);_0x5d64cb[_0x84eb('0x24')](_0x43bd1b['slice'](0x2,_0x43bd1b[_0x84eb('0x1c')])[_0x84eb('0x1d')](','));break;case _0x84eb('0x27'):var _0x4aec10=_0x37994b[_0x84eb('0x21')]['split'](',');_0x5d64cb[_0x84eb('0x24')](_0x4aec10[0x0]);_0x5d64cb[_0x84eb('0x24')](_0x4aec10[0x1]);_0x5d64cb[_0x84eb('0x24')](_0x4aec10[0x2]);_0x5d64cb['push'](_0x4aec10[0x3]);_0x5d64cb[_0x84eb('0x24')](_0x4aec10[_0x84eb('0x25')](0x4,_0x4aec10[_0x84eb('0x1c')])['join'](','));break;case _0x84eb('0x28'):var _0x5e0ee3=_0x37994b[_0x84eb('0x21')][_0x84eb('0x22')](',');_0x5d64cb[_0x84eb('0x24')](_0x5e0ee3[0x0]);_0x5d64cb[_0x84eb('0x24')](_0x5e0ee3[0x1]);_0x5d64cb[_0x84eb('0x24')](_0x5e0ee3[0x2]);_0x5d64cb[_0x84eb('0x24')](_0x5e0ee3[0x3]);_0x5d64cb[_0x84eb('0x24')](_0x5e0ee3[_0x84eb('0x25')](0x4,_0x5e0ee3['length'])[_0x84eb('0x1d')](','));break;case _0x84eb('0x18'):_0x5d64cb['push'](_0x37994b[_0x84eb('0x21')]);break;case _0x84eb('0x29'):_0x5d64cb[_0x84eb('0x24')](_0x37994b[_0x84eb('0x2a')]);_0x5d64cb[_0x84eb('0x24')](_0x37994b['appdata']);break;case _0x84eb('0x2b'):var _0x10b57b=utils[_0x84eb('0x2c')](_0x2670ae[_0x84eb('0x2d')][_0x84eb('0x2e')],_0x2670ae);var _0x33c20c=_0x37994b[_0x84eb('0x21')]['split'](',');_0x5d64cb['push'](_0x33c20c[0x0]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0x1]);_0x5d64cb['push'](_0x33c20c[0x2]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0x3]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0x4]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0x5]);_0x5d64cb['push'](_0x33c20c[0x6]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0x7]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0x8]);_0x5d64cb['push'](_0x33c20c[0x9]);_0x5d64cb[_0x84eb('0x24')](_0x33c20c[0xa]);_0x5d64cb[_0x84eb('0x24')](_0x2670ae['interaction']['id']);_0x5d64cb[_0x84eb('0x24')](_0x2670ae[_0x84eb('0x18')]['id']);_0x5d64cb[_0x84eb('0x24')](_0x37994b[_0x84eb('0x2f')]);_0x5d64cb[_0x84eb('0x24')](_0x2670ae[_0x84eb('0x30')][_0x84eb('0x31')]);_0x5d64cb[_0x84eb('0x24')](_0x2670ae['body'][_0x84eb('0x32')]);_0x5d64cb[_0x84eb('0x24')](_0x10b57b);break;default:_0x5d64cb=_['isNil'](_0x37994b['appdata'])?[]:_0x37994b['appdata'][_0x84eb('0x22')](',');}var _0x31781d={'id':util[_0x84eb('0xe')]('%s:%s:%s',_0x3d6711,_0x37994b['id'],_0x37994b[_0x84eb('0x1f')]),'condition':require(_0x84eb('0x33'))[_0x84eb('0x34')](_0x3d6711,getIntervals(_0x10f4e1[_0x84eb('0x35')],_0x37994b),_0x10f4e1),'consequence':require('./applications/'+_0x37994b[_0x84eb('0x1f')])[_0x84eb('0x36')](_0x3d6711,_0x5d64cb,_0x10f4e1,_0x2670ae),'p':_0x37994b['priority']||0x0};logger[_0x84eb('0x37')]('Push\x20new\x20rule',_0x31781d['id'],_0x84eb('0x38'),getIntervals(_0x10f4e1[_0x84eb('0x35')],_0x37994b)[_0x84eb('0x1d')]('\x20|\x20'));_0x5a984d['push'](_0x31781d);}else{logger[_0x84eb('0x39')](_0x84eb('0x3a'),path['join'](__dirname,_0x84eb('0x1a'),_0x37994b[_0x84eb('0x1f')]+_0x84eb('0x1e')));}}_0x10f4e1['rules'][_0x3d6711]=new RuleEngine(_0x5a984d);_0x10f4e1[_0x84eb('0x16')][_0x3d6711][_0x84eb('0x3b')](_0x2670ae,function(_0x177770){logger['info'](_0x84eb('0x3c'),JSON['stringify'](_0x177770[_0x84eb('0x3d')]));if(_0x10f4e1['rules'][_0x3d6711]){_0x10f4e1[_0x84eb('0x16')][_0x3d6711][_0x84eb('0x3e')](_0x84eb('0x3f'));}});return _0x264565({'code':0xc8,'message':_0x2670ae});}else{if(_0x5e4482){logger[_0x84eb('0x37')](util['format'](_0x84eb('0x40'),_0x3d6711));}else{logger['info'](_0x84eb('0x41'));}return _0x264565({'code':0xc8,'message':_0x2670ae});}}catch(_0x1990d0){logger[_0x84eb('0x39')](_0x1990d0[_0x84eb('0x42')]);return _0x2f2785(_0xb19d09[_0x84eb('0x39')](0x1f4,_0x1990d0));}}return _0x2f2785(_0x84eb('0x43'));});},'AcceptMessage':function(_0x818aae){var _0x244319=this;return new Promise(function(_0x5e8a2f,_0x4a8e5b){if(_0x818aae[_0x84eb('0x44')]&&_0x818aae[_0x84eb('0x44')]['id']){if(_0x10f4e1[_0x84eb('0x45')][_0x818aae['agent']['id']]){_0x10f4e1['agents'][_0x818aae['agent']['id']][_0x84eb('0x46')]=![];_0x10f4e1[_0x84eb('0x45')][_0x818aae[_0x84eb('0x44')]['id']][_0x84eb('0x47')]=undefined;}}if(_0x818aae[_0x84eb('0x18')]&&_0x818aae['message']['id']){try{var _0x4d44a4=getId(_0x818aae['channel'],_0x818aae[_0x84eb('0x18')]?_0x818aae[_0x84eb('0x18')]['id']:0x0,_0x818aae[_0x84eb('0x30')]?_0x818aae[_0x84eb('0x30')]['id']:0x0);if(_0x10f4e1[_0x84eb('0x16')][_0x4d44a4]){_0x10f4e1[_0x84eb('0x16')][_0x4d44a4][_0x84eb('0x3e')](_0x84eb('0x48'));if(rpc[_0x818aae[_0x84eb('0x17')]+_0x84eb('0x49')]){rpc[_0x818aae[_0x84eb('0x17')]+_0x84eb('0x49')][_0x84eb('0x4a')](_0x4d44a4,{'UserId':_0x818aae[_0x84eb('0x18')][_0x84eb('0x4b')]})[_0x84eb('0x4c')](function(){logger[_0x84eb('0x39')](_0x84eb('0x4d'));});}}return _0x5e8a2f({'code':0xc8,'message':_0x818aae});}catch(_0x355f6a){logger[_0x84eb('0x39')](_0x355f6a[_0x84eb('0x42')]);return _0x4a8e5b(_0x244319['error'](0x1f4,_0x355f6a));}}logger['error'](_0x84eb('0x4e'));return _0x4a8e5b(_0x244319[_0x84eb('0x39')](0x1f4,_0x84eb('0x4e')));});},'RejectMessage':function(_0x18c159){var _0x38de5a=this;return new Promise(function(_0x4d4224,_0x2d51af){if(_0x18c159['agent']&&_0x18c159[_0x84eb('0x44')]['id']){try{if(_0x10f4e1[_0x84eb('0x45')][_0x18c159[_0x84eb('0x44')]['id']]){_0x10f4e1[_0x84eb('0x45')][_0x18c159[_0x84eb('0x44')]['id']][_0x84eb('0x46')]=![];_0x10f4e1[_0x84eb('0x45')][_0x18c159[_0x84eb('0x44')]['id']][_0x84eb('0x47')]=undefined;}return _0x4d4224({'code':0xc8,'message':_0x18c159});}catch(_0x211848){logger[_0x84eb('0x39')](_0x211848[_0x84eb('0x42')]);return _0x2d51af(_0x38de5a[_0x84eb('0x39')](0x1f4,_0x211848));}}logger[_0x84eb('0x39')]('message\x20is\x20empty');return _0x2d51af(_0x38de5a[_0x84eb('0x39')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xe3d960){var _0x36f4b5=this;return new Promise(function(_0x583e67,_0x3ee340){if(_0xe3d960[_0x84eb('0x17')]&&_0xe3d960[_0x84eb('0x30')]&&_0xe3d960[_0x84eb('0x30')]['id']){try{var _0x1ba910=getId(_0xe3d960[_0x84eb('0x17')],_0xe3d960['message']?_0xe3d960[_0x84eb('0x18')]['id']:0x0,_0xe3d960[_0x84eb('0x30')]?_0xe3d960[_0x84eb('0x30')]['id']:0x0);if(_0x10f4e1[_0x84eb('0x16')][_0x1ba910]){_0x10f4e1[_0x84eb('0x16')][_0x1ba910][_0x84eb('0x3e')]('end');}return _0x583e67({'code':0xc8,'message':_0xe3d960});}catch(_0x52f2b3){logger['error'](_0x52f2b3[_0x84eb('0x42')]);return _0x3ee340(_0x36f4b5[_0x84eb('0x39')](0x1f4,_0x52f2b3));}}logger[_0x84eb('0x39')](_0x84eb('0x4e'));return _0x3ee340(_0x36f4b5[_0x84eb('0x39')](0x1f4,_0x84eb('0x4e')));});},'AgentCapacity':function(_0x141b6d){var _0x5e677b=this;return new Promise(function(_0x4650b3,_0x127a3d){if(_0x10f4e1[_0x84eb('0x45')][_0x84eb('0x4f')](_0x141b6d['id'])){for(var _0x53da2c in _0x141b6d['capacity']){if(_0x141b6d[_0x84eb('0x50')][_0x84eb('0x4f')](_0x53da2c)){if(_0x10f4e1[_0x84eb('0x45')][_0x141b6d['id']][_0x84eb('0x4f')](_0x53da2c+'CurrentCapacity')){_0x10f4e1['agents'][_0x141b6d['id']][_0x53da2c+_0x84eb('0x51')]=parseInt(_0x141b6d[_0x84eb('0x50')][_0x53da2c],0xa);}}}_0x10f4e1[_0x84eb('0x45')][_0x141b6d['id']][_0x84eb('0x52')]();return _0x4650b3({'code':0xc8,'message':_0x10f4e1[_0x84eb('0x45')][_0x141b6d['id']]});}else{return _0x127a3d(_0x5e677b[_0x84eb('0x39')](0x1f4,_0x84eb('0x53')));}});},'Agents':function(_0x30f85a){return new Promise(function(_0x322ad7){var _0x2b4a3b=_[_0x84eb('0x54')](_0x10f4e1[_0x84eb('0x45')]);if(_0x30f85a&&_0x30f85a['id']){var _0x2509f1=_['find'](_0x2b4a3b,function(_0x2e5d0a){return _0x2e5d0a['id']===_0x30f85a['id'];});_0x322ad7(_0x2509f1);}else{_0x322ad7({'count':_0x2b4a3b[_0x84eb('0x1c')],'rows':_0x2b4a3b});}});},'ChatQueues':function(){return new Promise(function(_0x6d2e0c){var _0x41c6e3=[];for(var _0x344355 in _0x10f4e1[_0x84eb('0x55')]){if(_0x10f4e1[_0x84eb('0x55')][_0x84eb('0x4f')](_0x344355)){var _0x27d970=_0x10f4e1[_0x84eb('0x55')][_0x344355];var _0x17410d={'id':_0x27d970['id'],'available':_0x27d970['available'],'loggedIn':_0x27d970['loggedIn'],'name':_0x27d970[_0x84eb('0x56')],'paused':_0x27d970[_0x84eb('0x57')],'waiting':_0x27d970[_0x84eb('0x58')]};_0x41c6e3[_0x84eb('0x24')](_0x17410d);}}_0x6d2e0c({'count':_0x41c6e3[_0x84eb('0x1c')],'rows':_0x41c6e3});});},'MailQueues':function(){return new Promise(function(_0x2cb511){var _0x47289a=[];for(var _0x8dfc66 in _0x10f4e1[_0x84eb('0x59')]){if(_0x10f4e1[_0x84eb('0x59')][_0x84eb('0x4f')](_0x8dfc66)){var _0x1b6cc3=_0x10f4e1[_0x84eb('0x59')][_0x8dfc66];var _0x2ba589={'id':_0x1b6cc3['id'],'available':_0x1b6cc3[_0x84eb('0x5a')],'loggedIn':_0x1b6cc3['loggedIn'],'name':_0x1b6cc3[_0x84eb('0x56')],'paused':_0x1b6cc3[_0x84eb('0x57')],'waiting':_0x1b6cc3[_0x84eb('0x58')]};_0x47289a['push'](_0x2ba589);}}_0x2cb511({'count':_0x47289a[_0x84eb('0x1c')],'rows':_0x47289a});});},'OpenchannelQueues':function(){return new Promise(function(_0xb2d84e){var _0x5b78a9=[];for(var _0x546ed9 in _0x10f4e1[_0x84eb('0x5b')]){if(_0x10f4e1[_0x84eb('0x5b')][_0x84eb('0x4f')](_0x546ed9)){var _0x400836=_0x10f4e1['openchannelQueues'][_0x546ed9];var _0x27c21a={'id':_0x400836['id'],'available':_0x400836['available'],'loggedIn':_0x400836['loggedIn'],'name':_0x400836[_0x84eb('0x56')],'paused':_0x400836[_0x84eb('0x57')],'waiting':_0x400836['waiting']};_0x5b78a9['push'](_0x27c21a);}}_0xb2d84e({'count':_0x5b78a9[_0x84eb('0x1c')],'rows':_0x5b78a9});});},'SmsQueues':function(){return new Promise(function(_0x3d8139){var _0x5b9c1c=[];for(var _0x534674 in _0x10f4e1[_0x84eb('0x5c')]){if(_0x10f4e1[_0x84eb('0x5c')][_0x84eb('0x4f')](_0x534674)){var _0x4441ba=_0x10f4e1['smsQueues'][_0x534674];var _0x43b6a6={'id':_0x4441ba['id'],'available':_0x4441ba[_0x84eb('0x5a')],'loggedIn':_0x4441ba[_0x84eb('0x5d')],'name':_0x4441ba['name'],'paused':_0x4441ba[_0x84eb('0x57')],'waiting':_0x4441ba['waiting']};_0x5b9c1c[_0x84eb('0x24')](_0x43b6a6);}}_0x3d8139({'count':_0x5b9c1c[_0x84eb('0x1c')],'rows':_0x5b9c1c});});},'FaxQueues':function(){return new Promise(function(_0x3d283c){var _0xd8a564=[];for(var _0x3b4565 in _0x10f4e1[_0x84eb('0x5e')]){if(_0x10f4e1[_0x84eb('0x5e')][_0x84eb('0x4f')](_0x3b4565)){var _0x26837d=_0x10f4e1[_0x84eb('0x5e')][_0x3b4565];var _0xa97579={'id':_0x26837d['id'],'available':_0x26837d['available'],'loggedIn':_0x26837d[_0x84eb('0x5d')],'name':_0x26837d[_0x84eb('0x56')],'paused':_0x26837d[_0x84eb('0x57')],'waiting':_0x26837d[_0x84eb('0x58')]};_0xd8a564['push'](_0xa97579);}}_0x3d283c({'count':_0xd8a564[_0x84eb('0x1c')],'rows':_0xd8a564});});},'WhatsappQueues':function(){return new Promise(function(_0x2d84c7){var _0x43c05c=[];for(var _0x322239 in _0x10f4e1['whatsappQueues']){if(_0x10f4e1[_0x84eb('0x5f')][_0x84eb('0x4f')](_0x322239)){var _0x21d0f0=_0x10f4e1[_0x84eb('0x5f')][_0x322239];var _0x1dea9d={'id':_0x21d0f0['id'],'available':_0x21d0f0[_0x84eb('0x5a')],'loggedIn':_0x21d0f0[_0x84eb('0x5d')],'name':_0x21d0f0[_0x84eb('0x56')],'paused':_0x21d0f0[_0x84eb('0x57')],'waiting':_0x21d0f0[_0x84eb('0x58')]};_0x43c05c[_0x84eb('0x24')](_0x1dea9d);}}_0x2d84c7({'count':_0x43c05c[_0x84eb('0x1c')],'rows':_0x43c05c});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x57680f){var _0x391a4a=_[_0x84eb('0x54')](_0x10f4e1[_0x84eb('0x60')]);_0x57680f({'count':_0x391a4a[_0x84eb('0x1c')],'rows':_0x391a4a});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x344cce){var _0x2e5b8f=_[_0x84eb('0x54')](_0x10f4e1['mailQueuesWaitingInteractions']);_0x344cce({'count':_0x2e5b8f['length'],'rows':_0x2e5b8f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x35d654){var _0x34863d=_[_0x84eb('0x54')](_0x10f4e1[_0x84eb('0x61')]);_0x35d654({'count':_0x34863d[_0x84eb('0x1c')],'rows':_0x34863d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xb278e6){var _0x1ef33b=_[_0x84eb('0x54')](_0x10f4e1['smsQueuesWaitingInteractions']);_0xb278e6({'count':_0x1ef33b[_0x84eb('0x1c')],'rows':_0x1ef33b});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x313262){var _0x1e006c=_[_0x84eb('0x54')](_0x10f4e1[_0x84eb('0x62')]);_0x313262({'count':_0x1e006c[_0x84eb('0x1c')],'rows':_0x1e006c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4335c3){var _0x134738=_['values'](_0x10f4e1[_0x84eb('0x63')]);_0x4335c3({'count':_0x134738[_0x84eb('0x1c')],'rows':_0x134738});});}};var _0x3b2f69=jayson[_0x84eb('0x64')](_0x352f81)[_0x84eb('0x65')]();_0x3b2f69['on'](_0x84eb('0x39'),function(_0x58cde3){logger[_0x84eb('0x39')](JSON['stringify'](_0x58cde3));return _0x1ec4cb(_0x58cde3);});_0x3b2f69['listen'](0x232c,_0x84eb('0x66'),function(){console[_0x84eb('0x67')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x44783b('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file