a2889f126c99bb483d6a206beae5d91eedb94ae0
[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 _0x81f8=['format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','join','app','toLowerCase','split','mail','push','slice','dialogflow','appdata','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','body','%s:%s:%s','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','intervals','error','.js','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine'];(function(_0x61c264,_0x1237f0){var _0x20797b=function(_0x1c3554){while(--_0x1c3554){_0x61c264['push'](_0x61c264['shift']());}};_0x20797b(++_0x1237f0);}(_0x81f8,0x186));var _0x881f=function(_0x5accb2,_0x490563){_0x5accb2=_0x5accb2-0x0;var _0x2e200c=_0x81f8[_0x5accb2];return _0x2e200c;};'use strict';var _=require(_0x881f('0x0'));var util=require(_0x881f('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x881f('0x2'));var BPromise=require(_0x881f('0x3'));var utils=require(_0x881f('0x4'));var sUtils=require(_0x881f('0x5'));var logger=require(_0x881f('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x881f('0x7')),'mailQueueReport':require(_0x881f('0x8')),'chatQueueReport':require(_0x881f('0x9')),'smsQueueReport':require(_0x881f('0xa')),'faxQueueReport':require(_0x881f('0xb')),'whatsappQueueReport':require(_0x881f('0xc'))};var RuleEngine=require(_0x881f('0xd'));function getId(_0x521af3,_0x5b1564,_0x8ae33d){return util[_0x881f('0xe')]('%s.%s.%s',_0x521af3,_0x5b1564||0x0,_0x8ae33d||0x0);}function getIntervals(_0x8d94d7,_0x213a06){var _0x44b3e2=[];if(!_[_0x881f('0xf')](_0x213a06['IntervalId'])&&!_['isNil'](_0x8d94d7[_0x213a06[_0x881f('0x10')]])&&!_[_0x881f('0xf')](_0x8d94d7[_0x213a06[_0x881f('0x10')]]['Intervals'])){_0x44b3e2=_['map'](_0x8d94d7[_0x213a06[_0x881f('0x10')]][_0x881f('0x11')],'interval');}else if(!_['isNil'](_0x213a06[_0x881f('0x12')])){_0x44b3e2=[_0x213a06[_0x881f('0x12')]];}return _0x44b3e2;}exports[_0x881f('0x13')]=function(_0x52c140){_0x52c140[_0x881f('0x14')]={};return new BPromise(function(_0x1f51aa,_0x58bd20){var _0x3d8353={'Start':function(_0x3d9e50){var _0x4b7378=this;return new Promise(function(_0x301d66,_0x167107){if(_0x3d9e50){try{var _0x3704fa=[];var _0xf35b6e=getId(_0x3d9e50[_0x881f('0x15')],_0x3d9e50[_0x881f('0x16')]?_0x3d9e50['message']['id']:0x0,_0x3d9e50[_0x881f('0x17')]?_0x3d9e50['interaction']['id']:0x0);var _0x5d2955=sUtils[_0x881f('0x18')](_0x52c140,_0x3d9e50);if(_0x3d9e50[_0x881f('0x19')]||!_0x5d2955&&_0x3d9e50[_0x881f('0x1a')]&&_['isArray'](_0x3d9e50[_0x881f('0x1a')])&&_0x3d9e50[_0x881f('0x1a')]['length']){for(var _0x954062=0x0;_0x954062<_0x3d9e50[_0x881f('0x1a')][_0x881f('0x1b')];_0x954062+=0x1){var _0x537c77=_0x3d9e50['applications'][_0x954062];if(fs[_0x881f('0x1c')](path[_0x881f('0x1d')](__dirname,_0x881f('0x1a'),_0x537c77[_0x881f('0x1e')]+'.js'))){var _0x1b434d=[];switch(_0x537c77[_0x881f('0x1e')][_0x881f('0x1f')]()){case'autoreply':var _0x16392b=_0x537c77['appdata'][_0x881f('0x20')](',');if(_0x3d9e50['channel']===_0x881f('0x21')){_0x1b434d[_0x881f('0x22')](_0x16392b[0x0]);_0x1b434d[_0x881f('0x22')](_0x16392b[0x1]);_0x1b434d[_0x881f('0x22')](_0x16392b['slice'](0x2,_0x16392b[_0x881f('0x1b')])[_0x881f('0x1d')](','));}else{_0x1b434d[_0x881f('0x22')](_0x16392b[0x0]);_0x1b434d[_0x881f('0x22')](_0x16392b[_0x881f('0x23')](0x1,_0x16392b[_0x881f('0x1b')])['join'](','));}break;case _0x881f('0x24'):var _0x269741=_0x537c77[_0x881f('0x25')][_0x881f('0x20')](',');_0x1b434d[_0x881f('0x22')](_0x269741[0x0]);_0x1b434d['push'](_0x269741[0x1]);_0x1b434d['push'](_0x269741[_0x881f('0x23')](0x2,_0x269741[_0x881f('0x1b')])[_0x881f('0x1d')](','));break;case'dialogflowv2':var _0x213d9d=_0x537c77[_0x881f('0x25')][_0x881f('0x20')](',');_0x1b434d[_0x881f('0x22')](_0x213d9d[0x0]);_0x1b434d[_0x881f('0x22')](_0x213d9d[0x1]);_0x1b434d[_0x881f('0x22')](_0x213d9d[0x2]);_0x1b434d[_0x881f('0x22')](_0x213d9d[0x3]);_0x1b434d[_0x881f('0x22')](_0x213d9d[_0x881f('0x23')](0x4,_0x213d9d[_0x881f('0x1b')])[_0x881f('0x1d')](','));break;case _0x881f('0x26'):var _0x33e2a9=_0x537c77['appdata'][_0x881f('0x20')](',');_0x1b434d[_0x881f('0x22')](_0x33e2a9[0x0]);_0x1b434d[_0x881f('0x22')](_0x33e2a9[0x1]);_0x1b434d['push'](_0x33e2a9[0x2]);_0x1b434d[_0x881f('0x22')](_0x33e2a9[0x3]);_0x1b434d[_0x881f('0x22')](_0x33e2a9['slice'](0x4,_0x33e2a9[_0x881f('0x1b')])[_0x881f('0x1d')](','));break;case _0x881f('0x16'):_0x1b434d[_0x881f('0x22')](_0x537c77[_0x881f('0x25')]);break;case _0x881f('0x27'):_0x1b434d[_0x881f('0x22')](_0x537c77[_0x881f('0x28')]);_0x1b434d[_0x881f('0x22')](_0x537c77[_0x881f('0x25')]);break;case _0x881f('0x29'):var _0x5da091=utils[_0x881f('0x2a')](_0x3d9e50[_0x881f('0x2b')]['notificationTemplate'],_0x3d9e50);var _0x24006f=_0x537c77[_0x881f('0x25')][_0x881f('0x20')](',');_0x1b434d[_0x881f('0x22')](_0x24006f[0x0]);_0x1b434d[_0x881f('0x22')](_0x24006f[0x1]);_0x1b434d['push'](_0x24006f[0x2]);_0x1b434d['push'](_0x24006f[0x3]);_0x1b434d[_0x881f('0x22')](_0x24006f[0x4]);_0x1b434d[_0x881f('0x22')](_0x24006f[0x5]);_0x1b434d['push'](_0x24006f[0x6]);_0x1b434d[_0x881f('0x22')](_0x24006f[0x7]);_0x1b434d['push'](_0x24006f[0x8]);_0x1b434d[_0x881f('0x22')](_0x24006f[0x9]);_0x1b434d[_0x881f('0x22')](_0x24006f[0xa]);_0x1b434d[_0x881f('0x22')](_0x3d9e50[_0x881f('0x17')]['id']);_0x1b434d[_0x881f('0x22')](_0x3d9e50[_0x881f('0x16')]['id']);_0x1b434d['push'](_0x537c77[_0x881f('0x2c')]);_0x1b434d[_0x881f('0x22')](_0x3d9e50[_0x881f('0x17')]['ContactId']);_0x1b434d[_0x881f('0x22')](_0x3d9e50[_0x881f('0x2d')][_0x881f('0x2d')]);_0x1b434d['push'](_0x5da091);break;default:_0x1b434d=_[_0x881f('0xf')](_0x537c77[_0x881f('0x25')])?[]:_0x537c77[_0x881f('0x25')][_0x881f('0x20')](',');}var _0x463883={'id':util[_0x881f('0xe')](_0x881f('0x2e'),_0xf35b6e,_0x537c77['id'],_0x537c77['app']),'condition':require('./interval')[_0x881f('0x2f')](_0xf35b6e,getIntervals(_0x52c140['intervals'],_0x537c77),_0x52c140),'consequence':require(_0x881f('0x30')+_0x537c77['app'])[_0x881f('0x31')](_0xf35b6e,_0x1b434d,_0x52c140,_0x3d9e50),'p':_0x537c77[_0x881f('0x32')]||0x0};logger[_0x881f('0x33')](_0x881f('0x34'),_0x463883['id'],'on\x20interval',getIntervals(_0x52c140[_0x881f('0x35')],_0x537c77)['join']('\x20|\x20'));_0x3704fa[_0x881f('0x22')](_0x463883);}else{logger[_0x881f('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x881f('0x1d')](__dirname,_0x881f('0x1a'),_0x537c77[_0x881f('0x1e')]+_0x881f('0x37')));}}_0x52c140[_0x881f('0x14')][_0xf35b6e]=new RuleEngine(_0x3704fa);_0x52c140['rules'][_0xf35b6e]['execute'](_0x3d9e50,function(_0x4ce377){logger[_0x881f('0x33')](_0x881f('0x38'),JSON[_0x881f('0x39')](_0x4ce377[_0x881f('0x3a')]));if(_0x52c140[_0x881f('0x14')][_0xf35b6e]){_0x52c140[_0x881f('0x14')][_0xf35b6e][_0x881f('0x3b')](_0x881f('0x3c'));}});return _0x301d66({'code':0xc8,'message':_0x3d9e50});}else{if(_0x5d2955){logger['info'](util[_0x881f('0xe')](_0x881f('0x3d'),_0xf35b6e));}else{logger['info'](_0x881f('0x3e'));}return _0x301d66({'code':0xc8,'message':_0x3d9e50});}}catch(_0xf80e6c){logger['error'](_0xf80e6c['stack']);return _0x167107(_0x4b7378[_0x881f('0x36')](0x1f4,_0xf80e6c));}}return _0x167107(_0x881f('0x3f'));});},'AcceptMessage':function(_0x584cc3){var _0x1ac26b=this;return new Promise(function(_0x4b91a3,_0x5ed67e){if(_0x584cc3['agent']&&_0x584cc3[_0x881f('0x40')]['id']){if(_0x52c140['agents'][_0x584cc3[_0x881f('0x40')]['id']]){_0x52c140[_0x881f('0x41')][_0x584cc3[_0x881f('0x40')]['id']][_0x881f('0x42')]=![];_0x52c140[_0x881f('0x41')][_0x584cc3[_0x881f('0x40')]['id']][_0x881f('0x43')]=undefined;}}if(_0x584cc3[_0x881f('0x16')]&&_0x584cc3[_0x881f('0x16')]['id']){try{var _0xc79124=getId(_0x584cc3[_0x881f('0x15')],_0x584cc3[_0x881f('0x16')]?_0x584cc3[_0x881f('0x16')]['id']:0x0,_0x584cc3[_0x881f('0x17')]?_0x584cc3[_0x881f('0x17')]['id']:0x0);if(_0x52c140['rules'][_0xc79124]){_0x52c140[_0x881f('0x14')][_0xc79124][_0x881f('0x3b')]('end');if(rpc[_0x584cc3[_0x881f('0x15')]+_0x881f('0x44')]){rpc[_0x584cc3[_0x881f('0x15')]+_0x881f('0x44')][_0x881f('0x45')](_0xc79124,{'UserId':_0x584cc3[_0x881f('0x16')][_0x881f('0x46')]})[_0x881f('0x47')](function(){logger[_0x881f('0x36')](_0x881f('0x48'));});}}return _0x4b91a3({'code':0xc8,'message':_0x584cc3});}catch(_0x13a428){logger[_0x881f('0x36')](_0x13a428[_0x881f('0x49')]);return _0x5ed67e(_0x1ac26b['error'](0x1f4,_0x13a428));}}logger[_0x881f('0x36')](_0x881f('0x4a'));return _0x5ed67e(_0x1ac26b[_0x881f('0x36')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4999fd){var _0x52c18b=this;return new Promise(function(_0xbb2c0c,_0x183d6b){if(_0x4999fd[_0x881f('0x40')]&&_0x4999fd[_0x881f('0x40')]['id']){try{if(_0x52c140['agents'][_0x4999fd[_0x881f('0x40')]['id']]){_0x52c140[_0x881f('0x41')][_0x4999fd[_0x881f('0x40')]['id']][_0x881f('0x42')]=![];_0x52c140['agents'][_0x4999fd[_0x881f('0x40')]['id']][_0x881f('0x43')]=undefined;}return _0xbb2c0c({'code':0xc8,'message':_0x4999fd});}catch(_0x109777){logger['error'](_0x109777[_0x881f('0x49')]);return _0x183d6b(_0x52c18b['error'](0x1f4,_0x109777));}}logger[_0x881f('0x36')]('message\x20is\x20empty');return _0x183d6b(_0x52c18b[_0x881f('0x36')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2fcdc3){var _0x5f5bb7=this;return new Promise(function(_0x5a3d13,_0x26d6ef){if(_0x2fcdc3[_0x881f('0x15')]&&_0x2fcdc3[_0x881f('0x17')]&&_0x2fcdc3[_0x881f('0x17')]['id']){try{var _0x36e87f=getId(_0x2fcdc3['channel'],_0x2fcdc3['message']?_0x2fcdc3[_0x881f('0x16')]['id']:0x0,_0x2fcdc3[_0x881f('0x17')]?_0x2fcdc3['interaction']['id']:0x0);if(_0x52c140['rules'][_0x36e87f]){_0x52c140[_0x881f('0x14')][_0x36e87f][_0x881f('0x3b')](_0x881f('0x4b'));}return _0x5a3d13({'code':0xc8,'message':_0x2fcdc3});}catch(_0x1d8b43){logger[_0x881f('0x36')](_0x1d8b43['stack']);return _0x26d6ef(_0x5f5bb7[_0x881f('0x36')](0x1f4,_0x1d8b43));}}logger[_0x881f('0x36')](_0x881f('0x4a'));return _0x26d6ef(_0x5f5bb7[_0x881f('0x36')](0x1f4,_0x881f('0x4a')));});},'AgentCapacity':function(_0x12475d){var _0x52b8fe=this;return new Promise(function(_0x53bfe4,_0xb5e4f4){if(_0x52c140[_0x881f('0x41')][_0x881f('0x4c')](_0x12475d['id'])){for(var _0x52cead in _0x12475d[_0x881f('0x4d')]){if(_0x12475d[_0x881f('0x4d')][_0x881f('0x4c')](_0x52cead)){if(_0x52c140['agents'][_0x12475d['id']][_0x881f('0x4c')](_0x52cead+_0x881f('0x4e'))){_0x52c140['agents'][_0x12475d['id']][_0x52cead+'CurrentCapacity']=parseInt(_0x12475d[_0x881f('0x4d')][_0x52cead],0xa);}}}_0x52c140[_0x881f('0x41')][_0x12475d['id']]['updateRealtime']();return _0x53bfe4({'code':0xc8,'message':_0x52c140[_0x881f('0x41')][_0x12475d['id']]});}else{return _0xb5e4f4(_0x52b8fe[_0x881f('0x36')](0x1f4,_0x881f('0x4f')));}});},'Agents':function(_0x3b418f){return new Promise(function(_0x410e64){var _0x13a897=_[_0x881f('0x50')](_0x52c140[_0x881f('0x41')]);if(_0x3b418f&&_0x3b418f['id']){var _0x26c887=_[_0x881f('0x51')](_0x13a897,function(_0x2b6d76){return _0x2b6d76['id']===_0x3b418f['id'];});_0x410e64(_0x26c887);}else{_0x410e64({'count':_0x13a897[_0x881f('0x1b')],'rows':_0x13a897});}});},'ChatQueues':function(){return new Promise(function(_0x571b50){var _0x16f1a2=[];for(var _0x4128d3 in _0x52c140[_0x881f('0x52')]){if(_0x52c140['chatQueues'][_0x881f('0x4c')](_0x4128d3)){var _0x3a0232=_0x52c140[_0x881f('0x52')][_0x4128d3];var _0x1b6d39={'id':_0x3a0232['id'],'available':_0x3a0232[_0x881f('0x53')],'loggedIn':_0x3a0232[_0x881f('0x54')],'name':_0x3a0232[_0x881f('0x55')],'paused':_0x3a0232[_0x881f('0x56')],'waiting':_0x3a0232[_0x881f('0x57')]};_0x16f1a2[_0x881f('0x22')](_0x1b6d39);}}_0x571b50({'count':_0x16f1a2['length'],'rows':_0x16f1a2});});},'MailQueues':function(){return new Promise(function(_0x465bca){var _0x1d17a0=[];for(var _0x58156d in _0x52c140[_0x881f('0x58')]){if(_0x52c140[_0x881f('0x58')][_0x881f('0x4c')](_0x58156d)){var _0x351c1a=_0x52c140[_0x881f('0x58')][_0x58156d];var _0x56153f={'id':_0x351c1a['id'],'available':_0x351c1a[_0x881f('0x53')],'loggedIn':_0x351c1a[_0x881f('0x54')],'name':_0x351c1a['name'],'paused':_0x351c1a['paused'],'waiting':_0x351c1a[_0x881f('0x57')]};_0x1d17a0[_0x881f('0x22')](_0x56153f);}}_0x465bca({'count':_0x1d17a0[_0x881f('0x1b')],'rows':_0x1d17a0});});},'OpenchannelQueues':function(){return new Promise(function(_0x1edfad){var _0x2cf3a8=[];for(var _0x247a66 in _0x52c140[_0x881f('0x59')]){if(_0x52c140[_0x881f('0x59')][_0x881f('0x4c')](_0x247a66)){var _0x446c97=_0x52c140['openchannelQueues'][_0x247a66];var _0x49db85={'id':_0x446c97['id'],'available':_0x446c97[_0x881f('0x53')],'loggedIn':_0x446c97[_0x881f('0x54')],'name':_0x446c97[_0x881f('0x55')],'paused':_0x446c97[_0x881f('0x56')],'waiting':_0x446c97[_0x881f('0x57')]};_0x2cf3a8[_0x881f('0x22')](_0x49db85);}}_0x1edfad({'count':_0x2cf3a8[_0x881f('0x1b')],'rows':_0x2cf3a8});});},'SmsQueues':function(){return new Promise(function(_0x5494e8){var _0x468c1a=[];for(var _0x803868 in _0x52c140[_0x881f('0x5a')]){if(_0x52c140[_0x881f('0x5a')]['hasOwnProperty'](_0x803868)){var _0x4fec3f=_0x52c140[_0x881f('0x5a')][_0x803868];var _0x379061={'id':_0x4fec3f['id'],'available':_0x4fec3f['available'],'loggedIn':_0x4fec3f['loggedIn'],'name':_0x4fec3f['name'],'paused':_0x4fec3f[_0x881f('0x56')],'waiting':_0x4fec3f[_0x881f('0x57')]};_0x468c1a[_0x881f('0x22')](_0x379061);}}_0x5494e8({'count':_0x468c1a['length'],'rows':_0x468c1a});});},'FaxQueues':function(){return new Promise(function(_0x102b9f){var _0x3ec52e=[];for(var _0x164d27 in _0x52c140[_0x881f('0x5b')]){if(_0x52c140[_0x881f('0x5b')][_0x881f('0x4c')](_0x164d27)){var _0x5b555e=_0x52c140[_0x881f('0x5b')][_0x164d27];var _0x18c2d0={'id':_0x5b555e['id'],'available':_0x5b555e['available'],'loggedIn':_0x5b555e[_0x881f('0x54')],'name':_0x5b555e[_0x881f('0x55')],'paused':_0x5b555e[_0x881f('0x56')],'waiting':_0x5b555e[_0x881f('0x57')]};_0x3ec52e[_0x881f('0x22')](_0x18c2d0);}}_0x102b9f({'count':_0x3ec52e[_0x881f('0x1b')],'rows':_0x3ec52e});});},'WhatsappQueues':function(){return new Promise(function(_0x383f24){var _0x5af69e=[];for(var _0x293e19 in _0x52c140[_0x881f('0x5c')]){if(_0x52c140[_0x881f('0x5c')]['hasOwnProperty'](_0x293e19)){var _0xf1eb83=_0x52c140[_0x881f('0x5c')][_0x293e19];var _0x257f09={'id':_0xf1eb83['id'],'available':_0xf1eb83[_0x881f('0x53')],'loggedIn':_0xf1eb83[_0x881f('0x54')],'name':_0xf1eb83[_0x881f('0x55')],'paused':_0xf1eb83['paused'],'waiting':_0xf1eb83[_0x881f('0x57')]};_0x5af69e['push'](_0x257f09);}}_0x383f24({'count':_0x5af69e['length'],'rows':_0x5af69e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x99be36){var _0x385863=_[_0x881f('0x50')](_0x52c140[_0x881f('0x5d')]);_0x99be36({'count':_0x385863['length'],'rows':_0x385863});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x57e09e){var _0xa3cfce=_[_0x881f('0x50')](_0x52c140['mailQueuesWaitingInteractions']);_0x57e09e({'count':_0xa3cfce['length'],'rows':_0xa3cfce});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x15f4cb){var _0x3779c8=_[_0x881f('0x50')](_0x52c140[_0x881f('0x5e')]);_0x15f4cb({'count':_0x3779c8[_0x881f('0x1b')],'rows':_0x3779c8});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x36258d){var _0x401765=_[_0x881f('0x50')](_0x52c140[_0x881f('0x5f')]);_0x36258d({'count':_0x401765[_0x881f('0x1b')],'rows':_0x401765});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1e8356){var _0x3afce4=_[_0x881f('0x50')](_0x52c140[_0x881f('0x60')]);_0x1e8356({'count':_0x3afce4[_0x881f('0x1b')],'rows':_0x3afce4});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2684e6){var _0x46a623=_[_0x881f('0x50')](_0x52c140['whatsappQueuesWaitingInteractions']);_0x2684e6({'count':_0x46a623[_0x881f('0x1b')],'rows':_0x46a623});});}};var _0x36b422=jayson['server'](_0x3d8353)[_0x881f('0x61')]();_0x36b422['on']('error',function(_0x2840ed){logger['error'](JSON[_0x881f('0x39')](_0x2840ed));return _0x58bd20(_0x2840ed);});_0x36b422[_0x881f('0x13')](0x232c,_0x881f('0x62'),function(){console[_0x881f('0x63')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1f51aa(_0x881f('0x64')+0x232c);});});};