Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / services / routing / server / index.js
index 6584fce..f4d61df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69c=['end','QueueReport','update','UserId','message\x20is\x20empty','busyQueue','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','info','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy'];(function(_0x495c18,_0xae1131){var _0x27b50d=function(_0x44fbaf){while(--_0x44fbaf){_0x495c18['push'](_0x495c18['shift']());}};_0x27b50d(++_0xae1131);}(_0xf69c,0x151));var _0xcf69=function(_0x1ac53b,_0x31c1f1){_0x1ac53b=_0x1ac53b-0x0;var _0x6dcc75=_0xf69c[_0x1ac53b];return _0x6dcc75;};'use strict';var _=require(_0xcf69('0x0'));var util=require('util');var path=require(_0xcf69('0x1'));var fs=require('fs');var jayson=require(_0xcf69('0x2'));var BPromise=require('bluebird');var utils=require(_0xcf69('0x3'));var sUtils=require('./applications/strategy/util');var logger=require(_0xcf69('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0xcf69('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xcf69('0x6')),'smsQueueReport':require(_0xcf69('0x7')),'faxQueueReport':require(_0xcf69('0x8')),'whatsappQueueReport':require(_0xcf69('0x9'))};var RuleEngine=require(_0xcf69('0xa'));function getId(_0x5f1e98,_0x38478c,_0xbeb916){return util[_0xcf69('0xb')](_0xcf69('0xc'),_0x5f1e98,_0x38478c||0x0,_0xbeb916||0x0);}function getIntervals(_0x4ab0f3,_0xd73ebd){var _0x38489e=[];if(!_[_0xcf69('0xd')](_0xd73ebd[_0xcf69('0xe')])&&!_[_0xcf69('0xd')](_0x4ab0f3[_0xd73ebd[_0xcf69('0xe')]])&&!_['isNil'](_0x4ab0f3[_0xd73ebd[_0xcf69('0xe')]]['Intervals'])){_0x38489e=_[_0xcf69('0xf')](_0x4ab0f3[_0xd73ebd[_0xcf69('0xe')]][_0xcf69('0x10')],_0xcf69('0x11'));}else if(!_[_0xcf69('0xd')](_0xd73ebd[_0xcf69('0x11')])){_0x38489e=[_0xd73ebd[_0xcf69('0x11')]];}return _0x38489e;}exports[_0xcf69('0x12')]=function(_0x537a1c){_0x537a1c['rules']={};return new BPromise(function(_0x5c66b6,_0x525102){var _0x41ff4a={'Start':function(_0x569d0b){var _0xf1c2d2=this;return new Promise(function(_0x3fad1d,_0x2309f){if(_0x569d0b){try{var _0x2ca371=[];var _0x5691ec=getId(_0x569d0b[_0xcf69('0x13')],_0x569d0b[_0xcf69('0x14')]?_0x569d0b['message']['id']:0x0,_0x569d0b['interaction']?_0x569d0b[_0xcf69('0x15')]['id']:0x0);var _0x3198a6=sUtils[_0xcf69('0x16')](_0x537a1c,_0x569d0b);if(_0x569d0b[_0xcf69('0x17')]||!_0x3198a6&&_0x569d0b[_0xcf69('0x18')]&&_[_0xcf69('0x19')](_0x569d0b[_0xcf69('0x18')])&&_0x569d0b[_0xcf69('0x18')]['length']){for(var _0x19b5ed=0x0;_0x19b5ed<_0x569d0b['applications'][_0xcf69('0x1a')];_0x19b5ed+=0x1){var _0x5d2019=_0x569d0b[_0xcf69('0x18')][_0x19b5ed];if(fs[_0xcf69('0x1b')](path[_0xcf69('0x1c')](__dirname,_0xcf69('0x18'),_0x5d2019[_0xcf69('0x1d')]+_0xcf69('0x1e')))){var _0x3a159f=[];switch(_0x5d2019[_0xcf69('0x1d')][_0xcf69('0x1f')]()){case _0xcf69('0x20'):var _0x2170c1=_0x5d2019[_0xcf69('0x21')][_0xcf69('0x22')](',');if(_0x569d0b['channel']===_0xcf69('0x23')){_0x3a159f[_0xcf69('0x24')](_0x2170c1[0x0]);_0x3a159f[_0xcf69('0x24')](_0x2170c1[0x1]);_0x3a159f[_0xcf69('0x24')](_0x2170c1[_0xcf69('0x25')](0x2,_0x2170c1[_0xcf69('0x1a')])['join'](','));}else{_0x3a159f['push'](_0x2170c1[0x0]);_0x3a159f[_0xcf69('0x24')](_0x2170c1['slice'](0x1,_0x2170c1[_0xcf69('0x1a')])[_0xcf69('0x1c')](','));}break;case _0xcf69('0x26'):var _0x42dbed=_0x5d2019[_0xcf69('0x21')][_0xcf69('0x22')](',');_0x3a159f[_0xcf69('0x24')](_0x42dbed[0x0]);_0x3a159f[_0xcf69('0x24')](_0x42dbed[0x1]);_0x3a159f['push'](_0x42dbed['slice'](0x2,_0x42dbed[_0xcf69('0x1a')])[_0xcf69('0x1c')](','));break;case _0xcf69('0x27'):var _0x415d69=_0x5d2019['appdata'][_0xcf69('0x22')](',');_0x3a159f[_0xcf69('0x24')](_0x415d69[0x0]);_0x3a159f[_0xcf69('0x24')](_0x415d69[0x1]);_0x3a159f[_0xcf69('0x24')](_0x415d69[0x2]);_0x3a159f[_0xcf69('0x24')](_0x415d69[0x3]);_0x3a159f[_0xcf69('0x24')](_0x415d69[_0xcf69('0x25')](0x4,_0x415d69[_0xcf69('0x1a')])[_0xcf69('0x1c')](','));break;case _0xcf69('0x28'):var _0x4a5db6=_0x5d2019[_0xcf69('0x21')]['split'](',');_0x3a159f[_0xcf69('0x24')](_0x4a5db6[0x0]);_0x3a159f[_0xcf69('0x24')](_0x4a5db6[0x1]);_0x3a159f[_0xcf69('0x24')](_0x4a5db6[0x2]);_0x3a159f[_0xcf69('0x24')](_0x4a5db6[0x3]);_0x3a159f[_0xcf69('0x24')](_0x4a5db6[_0xcf69('0x25')](0x4,_0x4a5db6[_0xcf69('0x1a')])[_0xcf69('0x1c')](','));break;case _0xcf69('0x14'):_0x3a159f[_0xcf69('0x24')](_0x5d2019['appdata']);break;case _0xcf69('0x29'):_0x3a159f[_0xcf69('0x24')](_0x5d2019['TagId']);_0x3a159f[_0xcf69('0x24')](_0x5d2019['appdata']);break;case _0xcf69('0x2a'):var _0x5396cf=utils['getMustacheRender'](_0x569d0b[_0xcf69('0x2b')][_0xcf69('0x2c')],_0x569d0b);var _0x2d8dde=_0x5d2019[_0xcf69('0x21')][_0xcf69('0x22')](',');_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x0]);_0x3a159f['push'](_0x2d8dde[0x1]);_0x3a159f['push'](_0x2d8dde[0x2]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x3]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x4]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x5]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x6]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x7]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x8]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0x9]);_0x3a159f[_0xcf69('0x24')](_0x2d8dde[0xa]);_0x3a159f[_0xcf69('0x24')](_0x569d0b[_0xcf69('0x15')]['id']);_0x3a159f[_0xcf69('0x24')](_0x569d0b[_0xcf69('0x14')]['id']);_0x3a159f[_0xcf69('0x24')](_0x5d2019[_0xcf69('0x2d')]);_0x3a159f[_0xcf69('0x24')](_0x569d0b[_0xcf69('0x15')][_0xcf69('0x2e')]);_0x3a159f[_0xcf69('0x24')](_0x569d0b[_0xcf69('0x2f')][_0xcf69('0x2f')]);_0x3a159f[_0xcf69('0x24')](_0x5396cf);break;default:_0x3a159f=_['isNil'](_0x5d2019['appdata'])?[]:_0x5d2019[_0xcf69('0x21')][_0xcf69('0x22')](',');}var _0x129d73={'id':util[_0xcf69('0xb')]('%s:%s:%s',_0x5691ec,_0x5d2019['id'],_0x5d2019[_0xcf69('0x1d')]),'condition':require(_0xcf69('0x30'))[_0xcf69('0x31')](_0x5691ec,getIntervals(_0x537a1c[_0xcf69('0x32')],_0x5d2019),_0x537a1c),'consequence':require(_0xcf69('0x33')+_0x5d2019['app'])[_0xcf69('0x34')](_0x5691ec,_0x3a159f,_0x537a1c,_0x569d0b),'p':_0x5d2019[_0xcf69('0x35')]||0x0};logger['info'](_0xcf69('0x36'),_0x129d73['id'],_0xcf69('0x37'),getIntervals(_0x537a1c[_0xcf69('0x32')],_0x5d2019)['join'](_0xcf69('0x38')));_0x2ca371['push'](_0x129d73);}else{logger[_0xcf69('0x39')](_0xcf69('0x3a'),path['join'](__dirname,'applications',_0x5d2019[_0xcf69('0x1d')]+_0xcf69('0x1e')));}}_0x537a1c[_0xcf69('0x3b')][_0x5691ec]=new RuleEngine(_0x2ca371);_0x537a1c['rules'][_0x5691ec]['execute'](_0x569d0b,function(_0xd07799){logger[_0xcf69('0x3c')]('Applications\x20executed',JSON[_0xcf69('0x3d')](_0xd07799[_0xcf69('0x3e')]));if(_0x537a1c[_0xcf69('0x3b')][_0x5691ec]){_0x537a1c[_0xcf69('0x3b')][_0x5691ec][_0xcf69('0x3f')](_0xcf69('0x40'));}});return _0x3fad1d({'code':0xc8,'message':_0x569d0b});}else{if(_0x3198a6){logger['info'](util[_0xcf69('0xb')](_0xcf69('0x41'),_0x5691ec));}else{logger[_0xcf69('0x3c')]('No\x20applications\x20to\x20execute');}return _0x3fad1d({'code':0xc8,'message':_0x569d0b});}}catch(_0x1a1270){logger['error'](_0x1a1270[_0xcf69('0x42')]);return _0x2309f(_0xf1c2d2[_0xcf69('0x39')](0x1f4,_0x1a1270));}}return _0x2309f(_0xcf69('0x43'));});},'AcceptMessage':function(_0x45c458){var _0x3cc66c=this;return new Promise(function(_0x57a296,_0x57748d){if(_0x45c458[_0xcf69('0x44')]&&_0x45c458[_0xcf69('0x44')]['id']){if(_0x537a1c[_0xcf69('0x45')][_0x45c458['agent']['id']]){_0x537a1c['agents'][_0x45c458['agent']['id']][_0xcf69('0x46')]=![];_0x537a1c[_0xcf69('0x45')][_0x45c458[_0xcf69('0x44')]['id']]['busyQueue']=undefined;}}if(_0x45c458[_0xcf69('0x14')]&&_0x45c458['message']['id']){try{var _0x1cb56d=getId(_0x45c458['channel'],_0x45c458[_0xcf69('0x14')]?_0x45c458[_0xcf69('0x14')]['id']:0x0,_0x45c458[_0xcf69('0x15')]?_0x45c458[_0xcf69('0x15')]['id']:0x0);if(_0x537a1c[_0xcf69('0x3b')][_0x1cb56d]){_0x537a1c[_0xcf69('0x3b')][_0x1cb56d][_0xcf69('0x3f')](_0xcf69('0x47'));if(rpc[_0x45c458[_0xcf69('0x13')]+_0xcf69('0x48')]){rpc[_0x45c458[_0xcf69('0x13')]+'QueueReport'][_0xcf69('0x49')](_0x1cb56d,{'UserId':_0x45c458[_0xcf69('0x14')][_0xcf69('0x4a')]})['catch'](function(){logger[_0xcf69('0x39')]('error\x20update\x20queue\x20report');});}}return _0x57a296({'code':0xc8,'message':_0x45c458});}catch(_0x2ddca9){logger[_0xcf69('0x39')](_0x2ddca9[_0xcf69('0x42')]);return _0x57748d(_0x3cc66c[_0xcf69('0x39')](0x1f4,_0x2ddca9));}}logger[_0xcf69('0x39')](_0xcf69('0x4b'));return _0x57748d(_0x3cc66c[_0xcf69('0x39')](0x1f4,_0xcf69('0x4b')));});},'RejectMessage':function(_0x196975){var _0x13740f=this;return new Promise(function(_0x2f83f6,_0x2be62c){if(_0x196975[_0xcf69('0x44')]&&_0x196975['agent']['id']){try{if(_0x537a1c[_0xcf69('0x45')][_0x196975[_0xcf69('0x44')]['id']]){_0x537a1c[_0xcf69('0x45')][_0x196975['agent']['id']]['busy']=![];_0x537a1c[_0xcf69('0x45')][_0x196975['agent']['id']][_0xcf69('0x4c')]=undefined;}return _0x2f83f6({'code':0xc8,'message':_0x196975});}catch(_0x212903){logger['error'](_0x212903[_0xcf69('0x42')]);return _0x2be62c(_0x13740f['error'](0x1f4,_0x212903));}}logger['error'](_0xcf69('0x4b'));return _0x2be62c(_0x13740f[_0xcf69('0x39')](0x1f4,_0xcf69('0x4b')));});},'AbandonInteraction':function(_0x2f1749){var _0x59294e=this;return new Promise(function(_0x3a0821,_0x200813){if(_0x2f1749[_0xcf69('0x13')]&&_0x2f1749['interaction']&&_0x2f1749['interaction']['id']){try{var _0x31d4fe=getId(_0x2f1749[_0xcf69('0x13')],_0x2f1749[_0xcf69('0x14')]?_0x2f1749['message']['id']:0x0,_0x2f1749['interaction']?_0x2f1749['interaction']['id']:0x0);if(_0x537a1c['rules'][_0x31d4fe]){_0x537a1c['rules'][_0x31d4fe]['emit'](_0xcf69('0x47'));}return _0x3a0821({'code':0xc8,'message':_0x2f1749});}catch(_0x3111db){logger['error'](_0x3111db[_0xcf69('0x42')]);return _0x200813(_0x59294e[_0xcf69('0x39')](0x1f4,_0x3111db));}}logger[_0xcf69('0x39')](_0xcf69('0x4b'));return _0x200813(_0x59294e[_0xcf69('0x39')](0x1f4,_0xcf69('0x4b')));});},'AgentCapacity':function(_0x5a5dbb){var _0x5605f4=this;return new Promise(function(_0x2021c2,_0x18ed60){if(_0x537a1c[_0xcf69('0x45')][_0xcf69('0x4d')](_0x5a5dbb['id'])){for(var _0x59d608 in _0x5a5dbb['capacity']){if(_0x5a5dbb['capacity']['hasOwnProperty'](_0x59d608)){if(_0x537a1c[_0xcf69('0x45')][_0x5a5dbb['id']][_0xcf69('0x4d')](_0x59d608+_0xcf69('0x4e'))){_0x537a1c[_0xcf69('0x45')][_0x5a5dbb['id']][_0x59d608+_0xcf69('0x4e')]=parseInt(_0x5a5dbb[_0xcf69('0x4f')][_0x59d608],0xa);}}}_0x537a1c['agents'][_0x5a5dbb['id']][_0xcf69('0x50')]();return _0x2021c2({'code':0xc8,'message':_0x537a1c[_0xcf69('0x45')][_0x5a5dbb['id']]});}else{return _0x18ed60(_0x5605f4[_0xcf69('0x39')](0x1f4,_0xcf69('0x51')));}});},'Agents':function(_0xcc88d6){return new Promise(function(_0x46976b){var _0x4227e8=_[_0xcf69('0x52')](_0x537a1c[_0xcf69('0x45')]);if(_0xcc88d6&&_0xcc88d6['id']){var _0x431b6b=_[_0xcf69('0x53')](_0x4227e8,function(_0x570b2a){return _0x570b2a['id']===_0xcc88d6['id'];});_0x46976b(_0x431b6b);}else{_0x46976b({'count':_0x4227e8[_0xcf69('0x1a')],'rows':_0x4227e8});}});},'ChatQueues':function(){return new Promise(function(_0x3e5450){var _0x37ad37=[];for(var _0x4bf10b in _0x537a1c[_0xcf69('0x54')]){if(_0x537a1c['chatQueues'][_0xcf69('0x4d')](_0x4bf10b)){var _0x5154ae=_0x537a1c['chatQueues'][_0x4bf10b];var _0x3bff41={'id':_0x5154ae['id'],'available':_0x5154ae[_0xcf69('0x55')],'loggedIn':_0x5154ae[_0xcf69('0x56')],'name':_0x5154ae[_0xcf69('0x57')],'paused':_0x5154ae[_0xcf69('0x58')],'waiting':_0x5154ae['waiting']};_0x37ad37[_0xcf69('0x24')](_0x3bff41);}}_0x3e5450({'count':_0x37ad37[_0xcf69('0x1a')],'rows':_0x37ad37});});},'MailQueues':function(){return new Promise(function(_0x2e4014){var _0x55f6d1=[];for(var _0x4d79d0 in _0x537a1c['mailQueues']){if(_0x537a1c[_0xcf69('0x59')][_0xcf69('0x4d')](_0x4d79d0)){var _0x49513e=_0x537a1c[_0xcf69('0x59')][_0x4d79d0];var _0x4de575={'id':_0x49513e['id'],'available':_0x49513e[_0xcf69('0x55')],'loggedIn':_0x49513e[_0xcf69('0x56')],'name':_0x49513e[_0xcf69('0x57')],'paused':_0x49513e[_0xcf69('0x58')],'waiting':_0x49513e[_0xcf69('0x5a')]};_0x55f6d1['push'](_0x4de575);}}_0x2e4014({'count':_0x55f6d1['length'],'rows':_0x55f6d1});});},'OpenchannelQueues':function(){return new Promise(function(_0x277996){var _0x5f20b3=[];for(var _0x188d15 in _0x537a1c['openchannelQueues']){if(_0x537a1c['openchannelQueues']['hasOwnProperty'](_0x188d15)){var _0x2abdbc=_0x537a1c[_0xcf69('0x5b')][_0x188d15];var _0x122e0b={'id':_0x2abdbc['id'],'available':_0x2abdbc[_0xcf69('0x55')],'loggedIn':_0x2abdbc[_0xcf69('0x56')],'name':_0x2abdbc[_0xcf69('0x57')],'paused':_0x2abdbc['paused'],'waiting':_0x2abdbc[_0xcf69('0x5a')]};_0x5f20b3['push'](_0x122e0b);}}_0x277996({'count':_0x5f20b3[_0xcf69('0x1a')],'rows':_0x5f20b3});});},'SmsQueues':function(){return new Promise(function(_0x303198){var _0x5986bf=[];for(var _0x2bf787 in _0x537a1c[_0xcf69('0x5c')]){if(_0x537a1c[_0xcf69('0x5c')]['hasOwnProperty'](_0x2bf787)){var _0x55a3fd=_0x537a1c[_0xcf69('0x5c')][_0x2bf787];var _0x3cb8cd={'id':_0x55a3fd['id'],'available':_0x55a3fd['available'],'loggedIn':_0x55a3fd[_0xcf69('0x56')],'name':_0x55a3fd[_0xcf69('0x57')],'paused':_0x55a3fd[_0xcf69('0x58')],'waiting':_0x55a3fd['waiting']};_0x5986bf['push'](_0x3cb8cd);}}_0x303198({'count':_0x5986bf[_0xcf69('0x1a')],'rows':_0x5986bf});});},'FaxQueues':function(){return new Promise(function(_0x484d54){var _0x13d332=[];for(var _0x3269a5 in _0x537a1c['faxQueues']){if(_0x537a1c[_0xcf69('0x5d')][_0xcf69('0x4d')](_0x3269a5)){var _0x5b68b8=_0x537a1c[_0xcf69('0x5d')][_0x3269a5];var _0x56a654={'id':_0x5b68b8['id'],'available':_0x5b68b8[_0xcf69('0x55')],'loggedIn':_0x5b68b8[_0xcf69('0x56')],'name':_0x5b68b8[_0xcf69('0x57')],'paused':_0x5b68b8[_0xcf69('0x58')],'waiting':_0x5b68b8[_0xcf69('0x5a')]};_0x13d332[_0xcf69('0x24')](_0x56a654);}}_0x484d54({'count':_0x13d332[_0xcf69('0x1a')],'rows':_0x13d332});});},'WhatsappQueues':function(){return new Promise(function(_0x4ad18b){var _0x2ed020=[];for(var _0x2ff889 in _0x537a1c[_0xcf69('0x5e')]){if(_0x537a1c[_0xcf69('0x5e')]['hasOwnProperty'](_0x2ff889)){var _0x4c5d06=_0x537a1c[_0xcf69('0x5e')][_0x2ff889];var _0xdee466={'id':_0x4c5d06['id'],'available':_0x4c5d06[_0xcf69('0x55')],'loggedIn':_0x4c5d06[_0xcf69('0x56')],'name':_0x4c5d06[_0xcf69('0x57')],'paused':_0x4c5d06[_0xcf69('0x58')],'waiting':_0x4c5d06['waiting']};_0x2ed020[_0xcf69('0x24')](_0xdee466);}}_0x4ad18b({'count':_0x2ed020[_0xcf69('0x1a')],'rows':_0x2ed020});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1822f6){var _0x2fe7b5=_[_0xcf69('0x52')](_0x537a1c['chatQueuesWaitingInteractions']);_0x1822f6({'count':_0x2fe7b5[_0xcf69('0x1a')],'rows':_0x2fe7b5});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x595e2f){var _0x4dbf4e=_[_0xcf69('0x52')](_0x537a1c[_0xcf69('0x5f')]);_0x595e2f({'count':_0x4dbf4e['length'],'rows':_0x4dbf4e});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x51e014){var _0x48648b=_[_0xcf69('0x52')](_0x537a1c[_0xcf69('0x60')]);_0x51e014({'count':_0x48648b[_0xcf69('0x1a')],'rows':_0x48648b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x687234){var _0x3d1055=_[_0xcf69('0x52')](_0x537a1c['smsQueuesWaitingInteractions']);_0x687234({'count':_0x3d1055[_0xcf69('0x1a')],'rows':_0x3d1055});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x240778){var _0x5dc414=_[_0xcf69('0x52')](_0x537a1c[_0xcf69('0x61')]);_0x240778({'count':_0x5dc414[_0xcf69('0x1a')],'rows':_0x5dc414});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4286b6){var _0x19889d=_[_0xcf69('0x52')](_0x537a1c['whatsappQueuesWaitingInteractions']);_0x4286b6({'count':_0x19889d[_0xcf69('0x1a')],'rows':_0x19889d});});}};var _0x2ef260=jayson[_0xcf69('0x62')](_0x41ff4a)[_0xcf69('0x63')]();_0x2ef260['on']('error',function(_0x208f96){logger[_0xcf69('0x39')](JSON[_0xcf69('0x3d')](_0x208f96));return _0x525102(_0x208f96);});_0x2ef260[_0xcf69('0x12')](0x232c,'127.0.0.1',function(){console[_0xcf69('0x64')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5c66b6(_0xcf69('0x65')+0x232c);});});};
\ No newline at end of file
+var _0xc022=['smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/mailQueueReport','../rpc/faxQueueReport','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','.js','app','toLowerCase','mail','push','slice','dialogflow','appdata','dialogflowv2','split','amazonlex','getMustacheRender','notificationTemplate','body','./interval','condition','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','execute','Applications\x20executed','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues'];(function(_0x482bea,_0xb6c790){var _0x25f4f4=function(_0x272df8){while(--_0x272df8){_0x482bea['push'](_0x482bea['shift']());}};_0x25f4f4(++_0xb6c790);}(_0xc022,0x173));var _0x2c02=function(_0x397c86,_0x24edb8){_0x397c86=_0x397c86-0x0;var _0x5c40c5=_0xc022[_0x397c86];return _0x5c40c5;};'use strict';var _=require('lodash');var util=require(_0x2c02('0x0'));var path=require(_0x2c02('0x1'));var fs=require('fs');var jayson=require(_0x2c02('0x2'));var BPromise=require(_0x2c02('0x3'));var utils=require(_0x2c02('0x4'));var sUtils=require(_0x2c02('0x5'));var logger=require('../../../config/logger')(_0x2c02('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2c02('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x2c02('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x305ca6,_0x22014c,_0x3a914e){return util[_0x2c02('0x9')]('%s.%s.%s',_0x305ca6,_0x22014c||0x0,_0x3a914e||0x0);}function getIntervals(_0x82145e,_0x316c63){var _0xd522c7=[];if(!_[_0x2c02('0xa')](_0x316c63['IntervalId'])&&!_[_0x2c02('0xa')](_0x82145e[_0x316c63['IntervalId']])&&!_['isNil'](_0x82145e[_0x316c63[_0x2c02('0xb')]][_0x2c02('0xc')])){_0xd522c7=_['map'](_0x82145e[_0x316c63[_0x2c02('0xb')]][_0x2c02('0xc')],_0x2c02('0xd'));}else if(!_[_0x2c02('0xa')](_0x316c63[_0x2c02('0xd')])){_0xd522c7=[_0x316c63[_0x2c02('0xd')]];}return _0xd522c7;}exports[_0x2c02('0xe')]=function(_0x4f4e33){_0x4f4e33[_0x2c02('0xf')]={};return new BPromise(function(_0x29f647,_0x26c1fa){var _0x3e86b3={'Start':function(_0x1bd1d9){var _0x57854f=this;return new Promise(function(_0x9e8ae6,_0x15d347){if(_0x1bd1d9){try{var _0x770f2e=[];var _0x2cd047=getId(_0x1bd1d9[_0x2c02('0x10')],_0x1bd1d9[_0x2c02('0x11')]?_0x1bd1d9['message']['id']:0x0,_0x1bd1d9[_0x2c02('0x12')]?_0x1bd1d9['interaction']['id']:0x0);var _0x840b9b=sUtils[_0x2c02('0x13')](_0x4f4e33,_0x1bd1d9);if(_0x1bd1d9['transfer']||!_0x840b9b&&_0x1bd1d9[_0x2c02('0x14')]&&_[_0x2c02('0x15')](_0x1bd1d9[_0x2c02('0x14')])&&_0x1bd1d9[_0x2c02('0x14')][_0x2c02('0x16')]){for(var _0x4f2f50=0x0;_0x4f2f50<_0x1bd1d9[_0x2c02('0x14')]['length'];_0x4f2f50+=0x1){var _0x220138=_0x1bd1d9[_0x2c02('0x14')][_0x4f2f50];if(fs[_0x2c02('0x17')](path[_0x2c02('0x18')](__dirname,_0x2c02('0x14'),_0x220138['app']+_0x2c02('0x19')))){var _0x3adf3e=[];switch(_0x220138[_0x2c02('0x1a')][_0x2c02('0x1b')]()){case'autoreply':var _0x4eb454=_0x220138['appdata']['split'](',');if(_0x1bd1d9['channel']===_0x2c02('0x1c')){_0x3adf3e['push'](_0x4eb454[0x0]);_0x3adf3e[_0x2c02('0x1d')](_0x4eb454[0x1]);_0x3adf3e[_0x2c02('0x1d')](_0x4eb454[_0x2c02('0x1e')](0x2,_0x4eb454[_0x2c02('0x16')])[_0x2c02('0x18')](','));}else{_0x3adf3e['push'](_0x4eb454[0x0]);_0x3adf3e[_0x2c02('0x1d')](_0x4eb454['slice'](0x1,_0x4eb454[_0x2c02('0x16')])[_0x2c02('0x18')](','));}break;case _0x2c02('0x1f'):var _0x47dc8f=_0x220138[_0x2c02('0x20')]['split'](',');_0x3adf3e[_0x2c02('0x1d')](_0x47dc8f[0x0]);_0x3adf3e['push'](_0x47dc8f[0x1]);_0x3adf3e[_0x2c02('0x1d')](_0x47dc8f[_0x2c02('0x1e')](0x2,_0x47dc8f['length'])[_0x2c02('0x18')](','));break;case _0x2c02('0x21'):var _0xd8cdd3=_0x220138[_0x2c02('0x20')][_0x2c02('0x22')](',');_0x3adf3e[_0x2c02('0x1d')](_0xd8cdd3[0x0]);_0x3adf3e[_0x2c02('0x1d')](_0xd8cdd3[0x1]);_0x3adf3e[_0x2c02('0x1d')](_0xd8cdd3[0x2]);_0x3adf3e[_0x2c02('0x1d')](_0xd8cdd3[0x3]);_0x3adf3e[_0x2c02('0x1d')](_0xd8cdd3['slice'](0x4,_0xd8cdd3[_0x2c02('0x16')])['join'](','));break;case _0x2c02('0x23'):var _0x124101=_0x220138[_0x2c02('0x20')][_0x2c02('0x22')](',');_0x3adf3e[_0x2c02('0x1d')](_0x124101[0x0]);_0x3adf3e[_0x2c02('0x1d')](_0x124101[0x1]);_0x3adf3e[_0x2c02('0x1d')](_0x124101[0x2]);_0x3adf3e['push'](_0x124101[0x3]);_0x3adf3e['push'](_0x124101[_0x2c02('0x1e')](0x4,_0x124101[_0x2c02('0x16')])[_0x2c02('0x18')](','));break;case _0x2c02('0x11'):_0x3adf3e[_0x2c02('0x1d')](_0x220138[_0x2c02('0x20')]);break;case'tag':_0x3adf3e[_0x2c02('0x1d')](_0x220138['TagId']);_0x3adf3e[_0x2c02('0x1d')](_0x220138[_0x2c02('0x20')]);break;case'tvox':var _0x80665d=utils[_0x2c02('0x24')](_0x1bd1d9['account'][_0x2c02('0x25')],_0x1bd1d9);var _0x5d1a07=_0x220138[_0x2c02('0x20')][_0x2c02('0x22')](',');_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x0]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x1]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x2]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x3]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x4]);_0x3adf3e['push'](_0x5d1a07[0x5]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x6]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x7]);_0x3adf3e['push'](_0x5d1a07[0x8]);_0x3adf3e[_0x2c02('0x1d')](_0x5d1a07[0x9]);_0x3adf3e['push'](_0x5d1a07[0xa]);_0x3adf3e[_0x2c02('0x1d')](_0x1bd1d9[_0x2c02('0x12')]['id']);_0x3adf3e[_0x2c02('0x1d')](_0x1bd1d9['message']['id']);_0x3adf3e[_0x2c02('0x1d')](_0x220138['ChatWebsiteId']);_0x3adf3e[_0x2c02('0x1d')](_0x1bd1d9[_0x2c02('0x12')]['ContactId']);_0x3adf3e[_0x2c02('0x1d')](_0x1bd1d9[_0x2c02('0x26')][_0x2c02('0x26')]);_0x3adf3e[_0x2c02('0x1d')](_0x80665d);break;default:_0x3adf3e=_['isNil'](_0x220138[_0x2c02('0x20')])?[]:_0x220138[_0x2c02('0x20')][_0x2c02('0x22')](',');}var _0x197c12={'id':util[_0x2c02('0x9')]('%s:%s:%s',_0x2cd047,_0x220138['id'],_0x220138[_0x2c02('0x1a')]),'condition':require(_0x2c02('0x27'))[_0x2c02('0x28')](_0x2cd047,getIntervals(_0x4f4e33['intervals'],_0x220138),_0x4f4e33),'consequence':require(_0x2c02('0x29')+_0x220138[_0x2c02('0x1a')])[_0x2c02('0x2a')](_0x2cd047,_0x3adf3e,_0x4f4e33,_0x1bd1d9),'p':_0x220138['priority']||0x0};logger[_0x2c02('0x2b')](_0x2c02('0x2c'),_0x197c12['id'],_0x2c02('0x2d'),getIntervals(_0x4f4e33[_0x2c02('0x2e')],_0x220138)[_0x2c02('0x18')](_0x2c02('0x2f')));_0x770f2e[_0x2c02('0x1d')](_0x197c12);}else{logger[_0x2c02('0x30')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x220138['app']+_0x2c02('0x19')));}}_0x4f4e33[_0x2c02('0xf')][_0x2cd047]=new RuleEngine(_0x770f2e);_0x4f4e33[_0x2c02('0xf')][_0x2cd047][_0x2c02('0x31')](_0x1bd1d9,function(_0x497963){logger[_0x2c02('0x2b')](_0x2c02('0x32'),JSON['stringify'](_0x497963[_0x2c02('0x33')]));if(_0x4f4e33[_0x2c02('0xf')][_0x2cd047]){_0x4f4e33[_0x2c02('0xf')][_0x2cd047][_0x2c02('0x34')]('complete');}});return _0x9e8ae6({'code':0xc8,'message':_0x1bd1d9});}else{if(_0x840b9b){logger[_0x2c02('0x2b')](util[_0x2c02('0x9')]('Skipped\x20routing\x20for\x20%s',_0x2cd047));}else{logger[_0x2c02('0x2b')](_0x2c02('0x35'));}return _0x9e8ae6({'code':0xc8,'message':_0x1bd1d9});}}catch(_0x570850){logger[_0x2c02('0x30')](_0x570850['stack']);return _0x15d347(_0x57854f[_0x2c02('0x30')](0x1f4,_0x570850));}}return _0x15d347(_0x2c02('0x36'));});},'AcceptMessage':function(_0x1b4266){var _0x35b953=this;return new Promise(function(_0x22b4c8,_0x27753e){if(_0x1b4266[_0x2c02('0x37')]&&_0x1b4266['agent']['id']){if(_0x4f4e33['agents'][_0x1b4266[_0x2c02('0x37')]['id']]){_0x4f4e33[_0x2c02('0x38')][_0x1b4266[_0x2c02('0x37')]['id']][_0x2c02('0x39')]=![];_0x4f4e33['agents'][_0x1b4266[_0x2c02('0x37')]['id']]['busyQueue']=undefined;}}if(_0x1b4266[_0x2c02('0x11')]&&_0x1b4266['message']['id']){try{var _0xecb41d=getId(_0x1b4266[_0x2c02('0x10')],_0x1b4266['message']?_0x1b4266[_0x2c02('0x11')]['id']:0x0,_0x1b4266['interaction']?_0x1b4266[_0x2c02('0x12')]['id']:0x0);if(_0x4f4e33[_0x2c02('0xf')][_0xecb41d]){_0x4f4e33[_0x2c02('0xf')][_0xecb41d][_0x2c02('0x34')](_0x2c02('0x3a'));if(rpc[_0x1b4266[_0x2c02('0x10')]+_0x2c02('0x3b')]){rpc[_0x1b4266[_0x2c02('0x10')]+_0x2c02('0x3b')]['update'](_0xecb41d,{'UserId':_0x1b4266[_0x2c02('0x11')]['UserId']})[_0x2c02('0x3c')](function(){logger[_0x2c02('0x30')](_0x2c02('0x3d'));});}}return _0x22b4c8({'code':0xc8,'message':_0x1b4266});}catch(_0x55a903){logger[_0x2c02('0x30')](_0x55a903[_0x2c02('0x3e')]);return _0x27753e(_0x35b953[_0x2c02('0x30')](0x1f4,_0x55a903));}}logger[_0x2c02('0x30')](_0x2c02('0x3f'));return _0x27753e(_0x35b953['error'](0x1f4,_0x2c02('0x3f')));});},'RejectMessage':function(_0x825df){var _0x395d00=this;return new Promise(function(_0x2ffccc,_0x5d862d){if(_0x825df[_0x2c02('0x37')]&&_0x825df[_0x2c02('0x37')]['id']){try{if(_0x4f4e33[_0x2c02('0x38')][_0x825df[_0x2c02('0x37')]['id']]){_0x4f4e33[_0x2c02('0x38')][_0x825df[_0x2c02('0x37')]['id']]['busy']=![];_0x4f4e33[_0x2c02('0x38')][_0x825df[_0x2c02('0x37')]['id']]['busyQueue']=undefined;}return _0x2ffccc({'code':0xc8,'message':_0x825df});}catch(_0x3adc97){logger[_0x2c02('0x30')](_0x3adc97['stack']);return _0x5d862d(_0x395d00[_0x2c02('0x30')](0x1f4,_0x3adc97));}}logger[_0x2c02('0x30')](_0x2c02('0x3f'));return _0x5d862d(_0x395d00['error'](0x1f4,_0x2c02('0x3f')));});},'AbandonInteraction':function(_0x2690c9){var _0x4a4b7a=this;return new Promise(function(_0x15a1c7,_0x176e36){if(_0x2690c9[_0x2c02('0x10')]&&_0x2690c9[_0x2c02('0x12')]&&_0x2690c9[_0x2c02('0x12')]['id']){try{var _0xb11a4=getId(_0x2690c9['channel'],_0x2690c9[_0x2c02('0x11')]?_0x2690c9[_0x2c02('0x11')]['id']:0x0,_0x2690c9['interaction']?_0x2690c9[_0x2c02('0x12')]['id']:0x0);if(_0x4f4e33[_0x2c02('0xf')][_0xb11a4]){_0x4f4e33['rules'][_0xb11a4]['emit'](_0x2c02('0x3a'));}return _0x15a1c7({'code':0xc8,'message':_0x2690c9});}catch(_0x2d39a6){logger['error'](_0x2d39a6[_0x2c02('0x3e')]);return _0x176e36(_0x4a4b7a[_0x2c02('0x30')](0x1f4,_0x2d39a6));}}logger[_0x2c02('0x30')](_0x2c02('0x3f'));return _0x176e36(_0x4a4b7a[_0x2c02('0x30')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x358df2){var _0x44fcae=this;return new Promise(function(_0x447a14,_0xa72222){if(_0x4f4e33[_0x2c02('0x38')][_0x2c02('0x40')](_0x358df2['id'])){for(var _0x3f613b in _0x358df2['capacity']){if(_0x358df2[_0x2c02('0x41')][_0x2c02('0x40')](_0x3f613b)){if(_0x4f4e33[_0x2c02('0x38')][_0x358df2['id']]['hasOwnProperty'](_0x3f613b+_0x2c02('0x42'))){_0x4f4e33[_0x2c02('0x38')][_0x358df2['id']][_0x3f613b+_0x2c02('0x42')]=parseInt(_0x358df2[_0x2c02('0x41')][_0x3f613b],0xa);}}}_0x4f4e33[_0x2c02('0x38')][_0x358df2['id']][_0x2c02('0x43')]();return _0x447a14({'code':0xc8,'message':_0x4f4e33['agents'][_0x358df2['id']]});}else{return _0xa72222(_0x44fcae[_0x2c02('0x30')](0x1f4,_0x2c02('0x44')));}});},'Agents':function(_0x38af9f){return new Promise(function(_0x3fbd50){var _0x311e35=_[_0x2c02('0x45')](_0x4f4e33['agents']);if(_0x38af9f&&_0x38af9f['id']){var _0x291d78=_[_0x2c02('0x46')](_0x311e35,function(_0x118586){return _0x118586['id']===_0x38af9f['id'];});_0x3fbd50(_0x291d78);}else{_0x3fbd50({'count':_0x311e35[_0x2c02('0x16')],'rows':_0x311e35});}});},'ChatQueues':function(){return new Promise(function(_0x5c04b5){var _0x379051=[];for(var _0x24056a in _0x4f4e33[_0x2c02('0x47')]){if(_0x4f4e33[_0x2c02('0x47')]['hasOwnProperty'](_0x24056a)){var _0x5e0e08=_0x4f4e33[_0x2c02('0x47')][_0x24056a];var _0x2ecd13={'id':_0x5e0e08['id'],'available':_0x5e0e08['available'],'loggedIn':_0x5e0e08[_0x2c02('0x48')],'name':_0x5e0e08[_0x2c02('0x49')],'paused':_0x5e0e08[_0x2c02('0x4a')],'waiting':_0x5e0e08[_0x2c02('0x4b')]};_0x379051[_0x2c02('0x1d')](_0x2ecd13);}}_0x5c04b5({'count':_0x379051[_0x2c02('0x16')],'rows':_0x379051});});},'MailQueues':function(){return new Promise(function(_0x34f46e){var _0x5d118d=[];for(var _0x3955ba in _0x4f4e33[_0x2c02('0x4c')]){if(_0x4f4e33[_0x2c02('0x4c')][_0x2c02('0x40')](_0x3955ba)){var _0x4436fd=_0x4f4e33['mailQueues'][_0x3955ba];var _0x26fe2a={'id':_0x4436fd['id'],'available':_0x4436fd[_0x2c02('0x4d')],'loggedIn':_0x4436fd[_0x2c02('0x48')],'name':_0x4436fd[_0x2c02('0x49')],'paused':_0x4436fd[_0x2c02('0x4a')],'waiting':_0x4436fd[_0x2c02('0x4b')]};_0x5d118d['push'](_0x26fe2a);}}_0x34f46e({'count':_0x5d118d['length'],'rows':_0x5d118d});});},'OpenchannelQueues':function(){return new Promise(function(_0x40a015){var _0x301f98=[];for(var _0x52d424 in _0x4f4e33[_0x2c02('0x4e')]){if(_0x4f4e33[_0x2c02('0x4e')][_0x2c02('0x40')](_0x52d424)){var _0x85e915=_0x4f4e33['openchannelQueues'][_0x52d424];var _0x3e0153={'id':_0x85e915['id'],'available':_0x85e915[_0x2c02('0x4d')],'loggedIn':_0x85e915['loggedIn'],'name':_0x85e915[_0x2c02('0x49')],'paused':_0x85e915[_0x2c02('0x4a')],'waiting':_0x85e915[_0x2c02('0x4b')]};_0x301f98[_0x2c02('0x1d')](_0x3e0153);}}_0x40a015({'count':_0x301f98[_0x2c02('0x16')],'rows':_0x301f98});});},'SmsQueues':function(){return new Promise(function(_0x2b9f43){var _0x2eef80=[];for(var _0x3c19ca in _0x4f4e33['smsQueues']){if(_0x4f4e33[_0x2c02('0x4f')][_0x2c02('0x40')](_0x3c19ca)){var _0x1e3918=_0x4f4e33['smsQueues'][_0x3c19ca];var _0x518e7f={'id':_0x1e3918['id'],'available':_0x1e3918[_0x2c02('0x4d')],'loggedIn':_0x1e3918[_0x2c02('0x48')],'name':_0x1e3918['name'],'paused':_0x1e3918[_0x2c02('0x4a')],'waiting':_0x1e3918[_0x2c02('0x4b')]};_0x2eef80[_0x2c02('0x1d')](_0x518e7f);}}_0x2b9f43({'count':_0x2eef80[_0x2c02('0x16')],'rows':_0x2eef80});});},'FaxQueues':function(){return new Promise(function(_0x313c33){var _0x282b1e=[];for(var _0x2897ea in _0x4f4e33[_0x2c02('0x50')]){if(_0x4f4e33[_0x2c02('0x50')]['hasOwnProperty'](_0x2897ea)){var _0x44d10a=_0x4f4e33['faxQueues'][_0x2897ea];var _0x91d3e0={'id':_0x44d10a['id'],'available':_0x44d10a[_0x2c02('0x4d')],'loggedIn':_0x44d10a[_0x2c02('0x48')],'name':_0x44d10a[_0x2c02('0x49')],'paused':_0x44d10a[_0x2c02('0x4a')],'waiting':_0x44d10a[_0x2c02('0x4b')]};_0x282b1e['push'](_0x91d3e0);}}_0x313c33({'count':_0x282b1e[_0x2c02('0x16')],'rows':_0x282b1e});});},'WhatsappQueues':function(){return new Promise(function(_0x56417b){var _0x392fa8=[];for(var _0x2d0f51 in _0x4f4e33[_0x2c02('0x51')]){if(_0x4f4e33['whatsappQueues'][_0x2c02('0x40')](_0x2d0f51)){var _0x102763=_0x4f4e33[_0x2c02('0x51')][_0x2d0f51];var _0x51d754={'id':_0x102763['id'],'available':_0x102763[_0x2c02('0x4d')],'loggedIn':_0x102763['loggedIn'],'name':_0x102763[_0x2c02('0x49')],'paused':_0x102763['paused'],'waiting':_0x102763['waiting']};_0x392fa8[_0x2c02('0x1d')](_0x51d754);}}_0x56417b({'count':_0x392fa8[_0x2c02('0x16')],'rows':_0x392fa8});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x395740){var _0x3007af=_[_0x2c02('0x45')](_0x4f4e33[_0x2c02('0x52')]);_0x395740({'count':_0x3007af[_0x2c02('0x16')],'rows':_0x3007af});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x48bcaa){var _0xecdeb1=_[_0x2c02('0x45')](_0x4f4e33[_0x2c02('0x53')]);_0x48bcaa({'count':_0xecdeb1[_0x2c02('0x16')],'rows':_0xecdeb1});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x54c40b){var _0x43c7a9=_['values'](_0x4f4e33['openchannelQueuesWaitingInteractions']);_0x54c40b({'count':_0x43c7a9[_0x2c02('0x16')],'rows':_0x43c7a9});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x361f4c){var _0x4f2b50=_['values'](_0x4f4e33['smsQueuesWaitingInteractions']);_0x361f4c({'count':_0x4f2b50[_0x2c02('0x16')],'rows':_0x4f2b50});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x39b6d7){var _0x295799=_['values'](_0x4f4e33[_0x2c02('0x54')]);_0x39b6d7({'count':_0x295799[_0x2c02('0x16')],'rows':_0x295799});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x15c6f7){var _0x400008=_[_0x2c02('0x45')](_0x4f4e33['whatsappQueuesWaitingInteractions']);_0x15c6f7({'count':_0x400008[_0x2c02('0x16')],'rows':_0x400008});});}};var _0x435c65=jayson['server'](_0x3e86b3)[_0x2c02('0x55')]();_0x435c65['on'](_0x2c02('0x30'),function(_0x44c76d){logger[_0x2c02('0x30')](JSON[_0x2c02('0x56')](_0x44c76d));return _0x26c1fa(_0x44c76d);});_0x435c65[_0x2c02('0xe')](0x232c,_0x2c02('0x57'),function(){console[_0x2c02('0x58')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x29f647(_0x2c02('0x59')+0x232c);});});};
\ No newline at end of file