Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / services / routing / server / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xdc78=['complete','format','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','name','waiting','mailQueues','available','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ContactId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','rules','execute','Applications\x20executed','matchPath','emit'];(function(_0x227b09,_0x3d432b){var _0x5493cc=function(_0x48f650){while(--_0x48f650){_0x227b09['push'](_0x227b09['shift']());}};_0x5493cc(++_0x3d432b);}(_0xdc78,0x89));var _0x8dc7=function(_0x3eceb2,_0x509ff8){_0x3eceb2=_0x3eceb2-0x0;var _0x818bc4=_0xdc78[_0x3eceb2];return _0x818bc4;};'use strict';var _=require(_0x8dc7('0x0'));var util=require(_0x8dc7('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x8dc7('0x2'));var BPromise=require(_0x8dc7('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x8dc7('0x4'));var logger=require('../../../config/logger')(_0x8dc7('0x5'));var rpc={'openchannelQueueReport':require(_0x8dc7('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x8dc7('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x8dc7('0x8')),'whatsappQueueReport':require(_0x8dc7('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3777e2,_0x35a25b,_0x5ab48d){return util['format']('%s.%s.%s',_0x3777e2,_0x35a25b||0x0,_0x5ab48d||0x0);}function getIntervals(_0x2f4e12,_0x4ab9db){var _0x44120c=[];if(!_[_0x8dc7('0xa')](_0x4ab9db[_0x8dc7('0xb')])&&!_[_0x8dc7('0xa')](_0x2f4e12[_0x4ab9db[_0x8dc7('0xb')]])&&!_[_0x8dc7('0xa')](_0x2f4e12[_0x4ab9db[_0x8dc7('0xb')]][_0x8dc7('0xc')])){_0x44120c=_[_0x8dc7('0xd')](_0x2f4e12[_0x4ab9db['IntervalId']][_0x8dc7('0xc')],'interval');}else if(!_[_0x8dc7('0xa')](_0x4ab9db[_0x8dc7('0xe')])){_0x44120c=[_0x4ab9db[_0x8dc7('0xe')]];}return _0x44120c;}exports[_0x8dc7('0xf')]=function(_0xa1aa68){_0xa1aa68['rules']={};return new BPromise(function(_0x5ebb72,_0x49a93f){var _0x3aaa3e={'Start':function(_0x5d5598){var _0x4b7f6a=this;return new Promise(function(_0x17b448,_0x25cc06){if(_0x5d5598){try{var _0x5d331c=[];var _0x113b29=getId(_0x5d5598[_0x8dc7('0x10')],_0x5d5598[_0x8dc7('0x11')]?_0x5d5598[_0x8dc7('0x11')]['id']:0x0,_0x5d5598[_0x8dc7('0x12')]?_0x5d5598[_0x8dc7('0x12')]['id']:0x0);var _0x5d3d97=sUtils[_0x8dc7('0x13')](_0xa1aa68,_0x5d5598);if(!_0x5d3d97&&_0x5d5598['applications']&&_[_0x8dc7('0x14')](_0x5d5598[_0x8dc7('0x15')])&&_0x5d5598[_0x8dc7('0x15')][_0x8dc7('0x16')]){for(var _0x229f39=0x0;_0x229f39<_0x5d5598['applications'][_0x8dc7('0x16')];_0x229f39+=0x1){var _0x267ab0=_0x5d5598[_0x8dc7('0x15')][_0x229f39];if(fs['existsSync'](path[_0x8dc7('0x17')](__dirname,_0x8dc7('0x15'),_0x267ab0[_0x8dc7('0x18')]+_0x8dc7('0x19')))){var _0x52f202=[];switch(_0x267ab0[_0x8dc7('0x18')][_0x8dc7('0x1a')]()){case'autoreply':var _0x36e3e3=_0x267ab0[_0x8dc7('0x1b')][_0x8dc7('0x1c')](',');if(_0x5d5598[_0x8dc7('0x10')]==='mail'){_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[_0x8dc7('0x1e')](0x2,_0x36e3e3[_0x8dc7('0x16')])[_0x8dc7('0x17')](','));}else{_0x52f202['push'](_0x36e3e3[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[_0x8dc7('0x1e')](0x1,_0x36e3e3[_0x8dc7('0x16')])[_0x8dc7('0x17')](','));}break;case _0x8dc7('0x1f'):var _0x2be07e=_0x267ab0[_0x8dc7('0x1b')]['split'](',');_0x52f202['push'](_0x2be07e[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x2be07e[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x2be07e[_0x8dc7('0x1e')](0x2,_0x2be07e[_0x8dc7('0x16')])[_0x8dc7('0x17')](','));break;case _0x8dc7('0x20'):var _0x48418c=_0x267ab0['appdata'][_0x8dc7('0x1c')](',');_0x52f202[_0x8dc7('0x1d')](_0x48418c[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x48418c[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x48418c[0x2]);_0x52f202['push'](_0x48418c[0x3]);_0x52f202['push'](_0x48418c[_0x8dc7('0x1e')](0x4,_0x48418c[_0x8dc7('0x16')])['join'](','));break;case _0x8dc7('0x21'):var _0x3e8884=_0x267ab0[_0x8dc7('0x1b')][_0x8dc7('0x1c')](',');_0x52f202[_0x8dc7('0x1d')](_0x3e8884[0x0]);_0x52f202['push'](_0x3e8884[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x3e8884[0x2]);_0x52f202[_0x8dc7('0x1d')](_0x3e8884[0x3]);_0x52f202['push'](_0x3e8884[_0x8dc7('0x1e')](0x4,_0x3e8884['length'])[_0x8dc7('0x17')](','));break;case _0x8dc7('0x11'):_0x52f202[_0x8dc7('0x1d')](_0x267ab0['appdata']);break;case _0x8dc7('0x22'):_0x52f202[_0x8dc7('0x1d')](_0x267ab0[_0x8dc7('0x23')]);_0x52f202[_0x8dc7('0x1d')](_0x267ab0[_0x8dc7('0x1b')]);break;case _0x8dc7('0x24'):var _0x5674ef=utils[_0x8dc7('0x25')](_0x5d5598[_0x8dc7('0x26')]['notificationTemplate'],_0x5d5598);var _0x16d950=_0x267ab0['appdata'][_0x8dc7('0x1c')](',');_0x52f202['push'](_0x16d950[0x0]);_0x52f202['push'](_0x16d950[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x2]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x3]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x4]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x5]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x6]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x7]);_0x52f202['push'](_0x16d950[0x8]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x9]);_0x52f202['push'](_0x16d950[0xa]);_0x52f202[_0x8dc7('0x1d')](_0x5d5598[_0x8dc7('0x12')]['id']);_0x52f202[_0x8dc7('0x1d')](_0x5d5598['message']['id']);_0x52f202[_0x8dc7('0x1d')](_0x267ab0['ChatWebsiteId']);_0x52f202['push'](_0x5d5598[_0x8dc7('0x12')][_0x8dc7('0x27')]);_0x52f202['push'](_0x5d5598['body']['body']);_0x52f202[_0x8dc7('0x1d')](_0x5674ef);break;default:_0x52f202=_[_0x8dc7('0xa')](_0x267ab0[_0x8dc7('0x1b')])?[]:_0x267ab0['appdata'][_0x8dc7('0x1c')](',');}var _0x473820={'id':util['format'](_0x8dc7('0x28'),_0x113b29,_0x267ab0['id'],_0x267ab0[_0x8dc7('0x18')]),'condition':require(_0x8dc7('0x29'))['condition'](_0x113b29,getIntervals(_0xa1aa68[_0x8dc7('0x2a')],_0x267ab0),_0xa1aa68),'consequence':require(_0x8dc7('0x2b')+_0x267ab0[_0x8dc7('0x18')])[_0x8dc7('0x2c')](_0x113b29,_0x52f202,_0xa1aa68,_0x5d5598),'p':_0x267ab0[_0x8dc7('0x2d')]||0x0};logger[_0x8dc7('0x2e')](_0x8dc7('0x2f'),_0x473820['id'],_0x8dc7('0x30'),getIntervals(_0xa1aa68[_0x8dc7('0x2a')],_0x267ab0)[_0x8dc7('0x17')](_0x8dc7('0x31')));_0x5d331c[_0x8dc7('0x1d')](_0x473820);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x8dc7('0x17')](__dirname,_0x8dc7('0x15'),_0x267ab0[_0x8dc7('0x18')]+'.js'));}}_0xa1aa68[_0x8dc7('0x32')][_0x113b29]=new RuleEngine(_0x5d331c);_0xa1aa68['rules'][_0x113b29][_0x8dc7('0x33')](_0x5d5598,function(_0x573b0d){logger[_0x8dc7('0x2e')](_0x8dc7('0x34'),JSON['stringify'](_0x573b0d[_0x8dc7('0x35')]));if(_0xa1aa68[_0x8dc7('0x32')][_0x113b29]){_0xa1aa68[_0x8dc7('0x32')][_0x113b29][_0x8dc7('0x36')](_0x8dc7('0x37'));}});return _0x17b448({'code':0xc8,'message':_0x5d5598});}else{if(_0x5d3d97){logger[_0x8dc7('0x2e')](util[_0x8dc7('0x38')](_0x8dc7('0x39'),_0x113b29));}else{logger[_0x8dc7('0x2e')](_0x8dc7('0x3a'));}return _0x17b448({'code':0xc8,'message':_0x5d5598});}}catch(_0x3f2b92){logger[_0x8dc7('0x3b')](_0x3f2b92[_0x8dc7('0x3c')]);return _0x25cc06(_0x4b7f6a[_0x8dc7('0x3b')](0x1f4,_0x3f2b92));}}return _0x25cc06(_0x8dc7('0x3d'));});},'AcceptMessage':function(_0x446e8c){var _0x42f3ea=this;return new Promise(function(_0x992f34,_0x3a61fc){if(_0x446e8c[_0x8dc7('0x3e')]&&_0x446e8c[_0x8dc7('0x3e')]['id']){if(_0xa1aa68[_0x8dc7('0x3f')][_0x446e8c[_0x8dc7('0x3e')]['id']]){_0xa1aa68[_0x8dc7('0x3f')][_0x446e8c['agent']['id']][_0x8dc7('0x40')]=![];_0xa1aa68['agents'][_0x446e8c['agent']['id']]['busyQueue']=undefined;}}if(_0x446e8c['message']&&_0x446e8c[_0x8dc7('0x11')]['id']){try{var _0x3ac822=getId(_0x446e8c[_0x8dc7('0x10')],_0x446e8c[_0x8dc7('0x11')]?_0x446e8c[_0x8dc7('0x11')]['id']:0x0,_0x446e8c[_0x8dc7('0x12')]?_0x446e8c[_0x8dc7('0x12')]['id']:0x0);if(_0xa1aa68[_0x8dc7('0x32')][_0x3ac822]){_0xa1aa68['rules'][_0x3ac822]['emit'](_0x8dc7('0x41'));if(rpc[_0x446e8c[_0x8dc7('0x10')]+_0x8dc7('0x42')]){rpc[_0x446e8c[_0x8dc7('0x10')]+_0x8dc7('0x42')]['update'](_0x3ac822,{'UserId':_0x446e8c[_0x8dc7('0x11')][_0x8dc7('0x43')]})[_0x8dc7('0x44')](function(){logger[_0x8dc7('0x3b')](_0x8dc7('0x45'));});}}return _0x992f34({'code':0xc8,'message':_0x446e8c});}catch(_0x3f1f7a){logger['error'](_0x3f1f7a[_0x8dc7('0x3c')]);return _0x3a61fc(_0x42f3ea['error'](0x1f4,_0x3f1f7a));}}logger[_0x8dc7('0x3b')](_0x8dc7('0x46'));return _0x3a61fc(_0x42f3ea['error'](0x1f4,_0x8dc7('0x46')));});},'RejectMessage':function(_0x2ebdc3){var _0x5765d3=this;return new Promise(function(_0x210acd,_0xfc7525){if(_0x2ebdc3[_0x8dc7('0x3e')]&&_0x2ebdc3[_0x8dc7('0x3e')]['id']){try{if(_0xa1aa68['agents'][_0x2ebdc3[_0x8dc7('0x3e')]['id']]){_0xa1aa68[_0x8dc7('0x3f')][_0x2ebdc3['agent']['id']][_0x8dc7('0x40')]=![];_0xa1aa68[_0x8dc7('0x3f')][_0x2ebdc3[_0x8dc7('0x3e')]['id']][_0x8dc7('0x47')]=undefined;}return _0x210acd({'code':0xc8,'message':_0x2ebdc3});}catch(_0x251066){logger[_0x8dc7('0x3b')](_0x251066[_0x8dc7('0x3c')]);return _0xfc7525(_0x5765d3[_0x8dc7('0x3b')](0x1f4,_0x251066));}}logger[_0x8dc7('0x3b')](_0x8dc7('0x46'));return _0xfc7525(_0x5765d3[_0x8dc7('0x3b')](0x1f4,_0x8dc7('0x46')));});},'AbandonInteraction':function(_0xc8908a){var _0x3f3083=this;return new Promise(function(_0x529f9d,_0x242275){if(_0xc8908a[_0x8dc7('0x10')]&&_0xc8908a['interaction']&&_0xc8908a['interaction']['id']){try{var _0x951d09=getId(_0xc8908a[_0x8dc7('0x10')],_0xc8908a[_0x8dc7('0x11')]?_0xc8908a['message']['id']:0x0,_0xc8908a['interaction']?_0xc8908a[_0x8dc7('0x12')]['id']:0x0);if(_0xa1aa68['rules'][_0x951d09]){_0xa1aa68[_0x8dc7('0x32')][_0x951d09][_0x8dc7('0x36')]('end');}return _0x529f9d({'code':0xc8,'message':_0xc8908a});}catch(_0x48aff5){logger[_0x8dc7('0x3b')](_0x48aff5[_0x8dc7('0x3c')]);return _0x242275(_0x3f3083[_0x8dc7('0x3b')](0x1f4,_0x48aff5));}}logger[_0x8dc7('0x3b')](_0x8dc7('0x46'));return _0x242275(_0x3f3083['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1f7091){var _0x3cf2cb=this;return new Promise(function(_0x494b62,_0x98976a){if(_0xa1aa68[_0x8dc7('0x3f')][_0x8dc7('0x48')](_0x1f7091['id'])){for(var _0x813384 in _0x1f7091[_0x8dc7('0x49')]){if(_0x1f7091[_0x8dc7('0x49')][_0x8dc7('0x48')](_0x813384)){if(_0xa1aa68['agents'][_0x1f7091['id']][_0x8dc7('0x48')](_0x813384+_0x8dc7('0x4a'))){_0xa1aa68[_0x8dc7('0x3f')][_0x1f7091['id']][_0x813384+_0x8dc7('0x4a')]=parseInt(_0x1f7091[_0x8dc7('0x49')][_0x813384],0xa);}}}_0xa1aa68[_0x8dc7('0x3f')][_0x1f7091['id']][_0x8dc7('0x4b')]();return _0x494b62({'code':0xc8,'message':_0xa1aa68[_0x8dc7('0x3f')][_0x1f7091['id']]});}else{return _0x98976a(_0x3cf2cb['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x43a2b9){return new Promise(function(_0x405a20){var _0x3d0e7a=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x3f')]);if(_0x43a2b9&&_0x43a2b9['id']){var _0x2562e7=_['find'](_0x3d0e7a,function(_0x4cd61f){return _0x4cd61f['id']===_0x43a2b9['id'];});_0x405a20(_0x2562e7);}else{_0x405a20({'count':_0x3d0e7a['length'],'rows':_0x3d0e7a});}});},'ChatQueues':function(){return new Promise(function(_0x2cd0c2){var _0xd84608=[];for(var _0x52c0dc in _0xa1aa68['chatQueues']){if(_0xa1aa68['chatQueues'][_0x8dc7('0x48')](_0x52c0dc)){var _0x3f0b48=_0xa1aa68['chatQueues'][_0x52c0dc];var _0x1f9eb3={'id':_0x3f0b48['id'],'available':_0x3f0b48['available'],'loggedIn':_0x3f0b48['loggedIn'],'name':_0x3f0b48[_0x8dc7('0x4d')],'paused':_0x3f0b48['paused'],'waiting':_0x3f0b48[_0x8dc7('0x4e')]};_0xd84608[_0x8dc7('0x1d')](_0x1f9eb3);}}_0x2cd0c2({'count':_0xd84608['length'],'rows':_0xd84608});});},'MailQueues':function(){return new Promise(function(_0x3bea7d){var _0x258414=[];for(var _0x2245cc in _0xa1aa68[_0x8dc7('0x4f')]){if(_0xa1aa68[_0x8dc7('0x4f')][_0x8dc7('0x48')](_0x2245cc)){var _0xeee187=_0xa1aa68['mailQueues'][_0x2245cc];var _0x203720={'id':_0xeee187['id'],'available':_0xeee187[_0x8dc7('0x50')],'loggedIn':_0xeee187[_0x8dc7('0x51')],'name':_0xeee187[_0x8dc7('0x4d')],'paused':_0xeee187[_0x8dc7('0x52')],'waiting':_0xeee187['waiting']};_0x258414[_0x8dc7('0x1d')](_0x203720);}}_0x3bea7d({'count':_0x258414[_0x8dc7('0x16')],'rows':_0x258414});});},'OpenchannelQueues':function(){return new Promise(function(_0x578989){var _0x4b4bcd=[];for(var _0x256678 in _0xa1aa68[_0x8dc7('0x53')]){if(_0xa1aa68[_0x8dc7('0x53')][_0x8dc7('0x48')](_0x256678)){var _0x27873e=_0xa1aa68['openchannelQueues'][_0x256678];var _0x5472df={'id':_0x27873e['id'],'available':_0x27873e[_0x8dc7('0x50')],'loggedIn':_0x27873e[_0x8dc7('0x51')],'name':_0x27873e['name'],'paused':_0x27873e[_0x8dc7('0x52')],'waiting':_0x27873e[_0x8dc7('0x4e')]};_0x4b4bcd[_0x8dc7('0x1d')](_0x5472df);}}_0x578989({'count':_0x4b4bcd[_0x8dc7('0x16')],'rows':_0x4b4bcd});});},'SmsQueues':function(){return new Promise(function(_0x121f63){var _0x3787a8=[];for(var _0x203126 in _0xa1aa68[_0x8dc7('0x54')]){if(_0xa1aa68[_0x8dc7('0x54')][_0x8dc7('0x48')](_0x203126)){var _0x466b51=_0xa1aa68[_0x8dc7('0x54')][_0x203126];var _0x409908={'id':_0x466b51['id'],'available':_0x466b51[_0x8dc7('0x50')],'loggedIn':_0x466b51[_0x8dc7('0x51')],'name':_0x466b51['name'],'paused':_0x466b51[_0x8dc7('0x52')],'waiting':_0x466b51[_0x8dc7('0x4e')]};_0x3787a8['push'](_0x409908);}}_0x121f63({'count':_0x3787a8[_0x8dc7('0x16')],'rows':_0x3787a8});});},'FaxQueues':function(){return new Promise(function(_0x33f90c){var _0x1189f8=[];for(var _0x1b8420 in _0xa1aa68[_0x8dc7('0x55')]){if(_0xa1aa68[_0x8dc7('0x55')][_0x8dc7('0x48')](_0x1b8420)){var _0x271ced=_0xa1aa68[_0x8dc7('0x55')][_0x1b8420];var _0x485dbc={'id':_0x271ced['id'],'available':_0x271ced[_0x8dc7('0x50')],'loggedIn':_0x271ced[_0x8dc7('0x51')],'name':_0x271ced[_0x8dc7('0x4d')],'paused':_0x271ced[_0x8dc7('0x52')],'waiting':_0x271ced['waiting']};_0x1189f8[_0x8dc7('0x1d')](_0x485dbc);}}_0x33f90c({'count':_0x1189f8['length'],'rows':_0x1189f8});});},'WhatsappQueues':function(){return new Promise(function(_0x1751bf){var _0x162dd6=[];for(var _0x5a7f1a in _0xa1aa68['whatsappQueues']){if(_0xa1aa68[_0x8dc7('0x56')]['hasOwnProperty'](_0x5a7f1a)){var _0x32d12a=_0xa1aa68['whatsappQueues'][_0x5a7f1a];var _0x35ad98={'id':_0x32d12a['id'],'available':_0x32d12a[_0x8dc7('0x50')],'loggedIn':_0x32d12a[_0x8dc7('0x51')],'name':_0x32d12a[_0x8dc7('0x4d')],'paused':_0x32d12a['paused'],'waiting':_0x32d12a[_0x8dc7('0x4e')]};_0x162dd6['push'](_0x35ad98);}}_0x1751bf({'count':_0x162dd6['length'],'rows':_0x162dd6});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x464062){var _0x31ce69=_[_0x8dc7('0x4c')](_0xa1aa68['chatQueuesWaitingInteractions']);_0x464062({'count':_0x31ce69['length'],'rows':_0x31ce69});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2cc70b){var _0x11ace9=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x57')]);_0x2cc70b({'count':_0x11ace9[_0x8dc7('0x16')],'rows':_0x11ace9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x593d41){var _0x121ce6=_['values'](_0xa1aa68[_0x8dc7('0x58')]);_0x593d41({'count':_0x121ce6[_0x8dc7('0x16')],'rows':_0x121ce6});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x120799){var _0x546692=_['values'](_0xa1aa68[_0x8dc7('0x59')]);_0x120799({'count':_0x546692[_0x8dc7('0x16')],'rows':_0x546692});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2b8891){var _0x173e4b=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x5a')]);_0x2b8891({'count':_0x173e4b[_0x8dc7('0x16')],'rows':_0x173e4b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x46b3bc){var _0x33ff2f=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x5b')]);_0x46b3bc({'count':_0x33ff2f['length'],'rows':_0x33ff2f});});}};var _0x44d6f9=jayson[_0x8dc7('0x5c')](_0x3aaa3e)['http']();_0x44d6f9['on'](_0x8dc7('0x3b'),function(_0x55d72b){logger[_0x8dc7('0x3b')](JSON['stringify'](_0x55d72b));return _0x49a93f(_0x55d72b);});_0x44d6f9[_0x8dc7('0xf')](0x232c,_0x8dc7('0x5d'),function(){console[_0x8dc7('0x5e')](_0x8dc7('0x5f'),0x232c);return _0x5ebb72('RPC\x20listening\x20on\x20port:'+0x232c);});});};