Built motion from commit b58257bb.|2.5.37
[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 _0x26c2=['smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','log','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','interaction','applications','isArray','length','join','app','.js','appdata','mail','push','slice','split','amazonlex','message','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','rules','execute','Applications\x20executed','complete','stack','error','routing\x20is\x20empty','agent','agents','busyQueue','emit','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues'];(function(_0x44c0f5,_0x14fa0){var _0x3875d2=function(_0xa81e63){while(--_0xa81e63){_0x44c0f5['push'](_0x44c0f5['shift']());}};_0x3875d2(++_0x14fa0);}(_0x26c2,0x130));var _0x226c=function(_0x18ed49,_0x34502c){_0x18ed49=_0x18ed49-0x0;var _0x22e649=_0x26c2[_0x18ed49];return _0x22e649;};'use strict';var _=require('lodash');var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x226c('0x0'));var BPromise=require(_0x226c('0x1'));var uuid=require(_0x226c('0x2'));var utils=require(_0x226c('0x3'));var config=require('../../../config/environment');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x226c('0x6')),'chatQueueReport':require(_0x226c('0x7')),'smsQueueReport':require(_0x226c('0x8')),'faxQueueReport':require(_0x226c('0x9')),'whatsappQueueReport':require(_0x226c('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x34cbc3,_0x461773,_0x335cab){return util[_0x226c('0xb')](_0x226c('0xc'),_0x34cbc3,_0x461773||0x0,_0x335cab||0x0);}function getIntervals(_0x51879f,_0x16cbbd){var _0x3280f8=[];if(!_['isNil'](_0x16cbbd['IntervalId'])&&!_[_0x226c('0xd')](_0x51879f[_0x16cbbd[_0x226c('0xe')]])&&!_[_0x226c('0xd')](_0x51879f[_0x16cbbd[_0x226c('0xe')]][_0x226c('0xf')])){_0x3280f8=_[_0x226c('0x10')](_0x51879f[_0x16cbbd[_0x226c('0xe')]]['Intervals'],'interval');}else if(!_[_0x226c('0xd')](_0x16cbbd[_0x226c('0x11')])){_0x3280f8=[_0x16cbbd[_0x226c('0x11')]];}return _0x3280f8;}exports[_0x226c('0x12')]=function(_0x4eb557){_0x4eb557['rules']={};return new BPromise(function(_0x21d61b,_0x3cff57){var _0x15e13b={'Start':function(_0x55697c){var _0x5d6c21=this;return new Promise(function(_0x694eef,_0x2e4a51){if(_0x55697c){try{var _0x30755=[];var _0x45a804=getId(_0x55697c[_0x226c('0x13')],_0x55697c['message']?_0x55697c['message']['id']:0x0,_0x55697c['interaction']?_0x55697c[_0x226c('0x14')]['id']:0x0);if(_0x55697c[_0x226c('0x15')]&&_[_0x226c('0x16')](_0x55697c[_0x226c('0x15')])&&_0x55697c['applications'][_0x226c('0x17')]){for(var _0xb6417f=0x0;_0xb6417f<_0x55697c[_0x226c('0x15')][_0x226c('0x17')];_0xb6417f+=0x1){var _0x11fa82=_0x55697c[_0x226c('0x15')][_0xb6417f];if(fs['existsSync'](path[_0x226c('0x18')](__dirname,_0x226c('0x15'),_0x11fa82[_0x226c('0x19')]+_0x226c('0x1a')))){var _0x272f26=[];switch(_0x11fa82['app']['toLowerCase']()){case'autoreply':var _0x1f1bf2=_0x11fa82[_0x226c('0x1b')]['split'](',');if(_0x55697c[_0x226c('0x13')]===_0x226c('0x1c')){_0x272f26[_0x226c('0x1d')](_0x1f1bf2[0x0]);_0x272f26[_0x226c('0x1d')](_0x1f1bf2[0x1]);_0x272f26[_0x226c('0x1d')](_0x1f1bf2['slice'](0x2,_0x1f1bf2[_0x226c('0x17')])['join'](','));}else{_0x272f26[_0x226c('0x1d')](_0x1f1bf2[0x0]);_0x272f26['push'](_0x1f1bf2[_0x226c('0x1e')](0x1,_0x1f1bf2[_0x226c('0x17')])[_0x226c('0x18')](','));}break;case'dialogflow':var _0x14c49b=_0x11fa82['appdata'][_0x226c('0x1f')](',');_0x272f26['push'](_0x14c49b[0x0]);_0x272f26[_0x226c('0x1d')](_0x14c49b[0x1]);_0x272f26['push'](_0x14c49b[_0x226c('0x1e')](0x2,_0x14c49b[_0x226c('0x17')])['join'](','));break;case'dialogflowv2':var _0x3b1e93=_0x11fa82[_0x226c('0x1b')][_0x226c('0x1f')](',');_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x0]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x1]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x2]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x3]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[_0x226c('0x1e')](0x4,_0x3b1e93[_0x226c('0x17')])[_0x226c('0x18')](','));break;case _0x226c('0x20'):var _0x49e901=_0x11fa82[_0x226c('0x1b')][_0x226c('0x1f')](',');_0x272f26[_0x226c('0x1d')](_0x49e901[0x0]);_0x272f26[_0x226c('0x1d')](_0x49e901[0x1]);_0x272f26[_0x226c('0x1d')](_0x49e901[0x2]);_0x272f26['push'](_0x49e901[0x3]);_0x272f26[_0x226c('0x1d')](_0x49e901[_0x226c('0x1e')](0x4,_0x49e901[_0x226c('0x17')])['join'](','));break;case _0x226c('0x21'):_0x272f26['push'](_0x11fa82[_0x226c('0x1b')]);break;case _0x226c('0x22'):_0x272f26[_0x226c('0x1d')](_0x11fa82[_0x226c('0x23')]);_0x272f26[_0x226c('0x1d')](_0x11fa82[_0x226c('0x1b')]);break;case _0x226c('0x24'):var _0x39e942=utils[_0x226c('0x25')](_0x55697c[_0x226c('0x26')][_0x226c('0x27')],_0x55697c);var _0x3062d7=_0x11fa82[_0x226c('0x1b')][_0x226c('0x1f')](',');_0x272f26['push'](_0x3062d7[0x0]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x1]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x2]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x3]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x4]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x5]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x6]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x7]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x8]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x9]);_0x272f26['push'](_0x3062d7[0xa]);_0x272f26['push'](_0x55697c[_0x226c('0x14')]['id']);_0x272f26[_0x226c('0x1d')](_0x55697c[_0x226c('0x21')]['id']);_0x272f26[_0x226c('0x1d')](_0x11fa82[_0x226c('0x28')]);_0x272f26[_0x226c('0x1d')](_0x55697c[_0x226c('0x14')][_0x226c('0x29')]);_0x272f26[_0x226c('0x1d')](_0x55697c['body'][_0x226c('0x2a')]);_0x272f26['push'](_0x39e942);break;default:_0x272f26=_[_0x226c('0xd')](_0x11fa82[_0x226c('0x1b')])?[]:_0x11fa82[_0x226c('0x1b')]['split'](',');}var _0x507aa8={'id':util[_0x226c('0xb')](_0x226c('0x2b'),_0x45a804,_0x11fa82['id'],_0x11fa82['app']),'condition':require(_0x226c('0x2c'))[_0x226c('0x2d')](_0x45a804,getIntervals(_0x4eb557[_0x226c('0x2e')],_0x11fa82),_0x4eb557),'consequence':require(_0x226c('0x2f')+_0x11fa82['app'])[_0x226c('0x30')](_0x45a804,_0x272f26,_0x4eb557,_0x55697c),'p':_0x11fa82[_0x226c('0x31')]||0x0};logger[_0x226c('0x32')]('Push\x20new\x20rule',_0x507aa8['id'],_0x226c('0x33'),getIntervals(_0x4eb557[_0x226c('0x2e')],_0x11fa82)[_0x226c('0x18')](_0x226c('0x34')));_0x30755[_0x226c('0x1d')](_0x507aa8);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x226c('0x15'),_0x11fa82[_0x226c('0x19')]+_0x226c('0x1a')));}}_0x4eb557[_0x226c('0x35')][_0x45a804]=new RuleEngine(_0x30755);_0x4eb557[_0x226c('0x35')][_0x45a804][_0x226c('0x36')](_0x55697c,function(_0x16ae23){logger[_0x226c('0x32')](_0x226c('0x37'),JSON['stringify'](_0x16ae23['matchPath']));if(_0x4eb557[_0x226c('0x35')][_0x45a804]){_0x4eb557[_0x226c('0x35')][_0x45a804]['emit'](_0x226c('0x38'));}});return _0x694eef({'code':0xc8,'message':_0x55697c});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x694eef({'code':0xc8,'message':_0x55697c});}}catch(_0x1b2338){logger['error'](_0x1b2338[_0x226c('0x39')]);return _0x2e4a51(_0x5d6c21[_0x226c('0x3a')](0x1f4,_0x1b2338));}}return _0x2e4a51(_0x226c('0x3b'));});},'AcceptMessage':function(_0x1c6618){var _0x89b599=this;return new Promise(function(_0x1e3cda,_0x4e705c){if(_0x1c6618[_0x226c('0x3c')]&&_0x1c6618['agent']['id']){if(_0x4eb557[_0x226c('0x3d')][_0x1c6618[_0x226c('0x3c')]['id']]){_0x4eb557[_0x226c('0x3d')][_0x1c6618[_0x226c('0x3c')]['id']]['busy']=![];_0x4eb557[_0x226c('0x3d')][_0x1c6618['agent']['id']][_0x226c('0x3e')]=undefined;}}if(_0x1c6618[_0x226c('0x21')]&&_0x1c6618[_0x226c('0x21')]['id']){try{var _0x707957=getId(_0x1c6618[_0x226c('0x13')],_0x1c6618[_0x226c('0x21')]?_0x1c6618['message']['id']:0x0,_0x1c6618[_0x226c('0x14')]?_0x1c6618[_0x226c('0x14')]['id']:0x0);if(_0x4eb557[_0x226c('0x35')][_0x707957]){_0x4eb557[_0x226c('0x35')][_0x707957][_0x226c('0x3f')](_0x226c('0x40'));if(rpc[_0x1c6618[_0x226c('0x13')]+_0x226c('0x41')]){rpc[_0x1c6618[_0x226c('0x13')]+_0x226c('0x41')][_0x226c('0x42')](_0x707957,{'UserId':_0x1c6618[_0x226c('0x21')]['UserId']})['catch'](function(_0x486510){logger[_0x226c('0x3a')](_0x226c('0x43'));});}}return _0x1e3cda({'code':0xc8,'message':_0x1c6618});}catch(_0x1cbf5d){logger['error'](_0x1cbf5d[_0x226c('0x39')]);return _0x4e705c(_0x89b599[_0x226c('0x3a')](0x1f4,_0x1cbf5d));}}logger['error'](_0x226c('0x44'));return _0x4e705c(_0x89b599[_0x226c('0x3a')](0x1f4,_0x226c('0x44')));});},'RejectMessage':function(_0x28d055){var _0x2a1d64=this;return new Promise(function(_0x3c0dfb,_0x3e60bf){if(_0x28d055[_0x226c('0x3c')]&&_0x28d055['agent']['id']){try{if(_0x4eb557[_0x226c('0x3d')][_0x28d055[_0x226c('0x3c')]['id']]){_0x4eb557['agents'][_0x28d055[_0x226c('0x3c')]['id']][_0x226c('0x45')]=![];_0x4eb557[_0x226c('0x3d')][_0x28d055[_0x226c('0x3c')]['id']][_0x226c('0x3e')]=undefined;}return _0x3c0dfb({'code':0xc8,'message':_0x28d055});}catch(_0x2a099a){logger['error'](_0x2a099a[_0x226c('0x39')]);return _0x3e60bf(_0x2a1d64['error'](0x1f4,_0x2a099a));}}logger['error'](_0x226c('0x44'));return _0x3e60bf(_0x2a1d64[_0x226c('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x3861be){var _0x17cfc1=this;return new Promise(function(_0x347be6,_0x54b6bc){if(_0x3861be[_0x226c('0x13')]&&_0x3861be[_0x226c('0x14')]&&_0x3861be[_0x226c('0x14')]['id']){try{var _0x24096f=getId(_0x3861be[_0x226c('0x13')],_0x3861be['message']?_0x3861be[_0x226c('0x21')]['id']:0x0,_0x3861be['interaction']?_0x3861be['interaction']['id']:0x0);if(_0x4eb557[_0x226c('0x35')][_0x24096f]){_0x4eb557[_0x226c('0x35')][_0x24096f][_0x226c('0x3f')]('end');}return _0x347be6({'code':0xc8,'message':_0x3861be});}catch(_0xb225d3){logger[_0x226c('0x3a')](_0xb225d3['stack']);return _0x54b6bc(_0x17cfc1[_0x226c('0x3a')](0x1f4,_0xb225d3));}}logger[_0x226c('0x3a')](_0x226c('0x44'));return _0x54b6bc(_0x17cfc1['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x26cfd5){var _0x55db16=this;return new Promise(function(_0x29d34c,_0xfb8c4b){if(_0x4eb557['agents']['hasOwnProperty'](_0x26cfd5['id'])){for(var _0x1790c7 in _0x26cfd5[_0x226c('0x46')]){if(_0x26cfd5[_0x226c('0x46')][_0x226c('0x47')](_0x1790c7)){if(_0x4eb557['agents'][_0x26cfd5['id']][_0x226c('0x47')](_0x1790c7+_0x226c('0x48'))){_0x4eb557[_0x226c('0x3d')][_0x26cfd5['id']][_0x1790c7+'CurrentCapacity']=parseInt(_0x26cfd5[_0x226c('0x46')][_0x1790c7],0xa);}}}_0x4eb557['agents'][_0x26cfd5['id']][_0x226c('0x49')]();return _0x29d34c({'code':0xc8,'message':_0x4eb557[_0x226c('0x3d')][_0x26cfd5['id']]});}else{return _0xfb8c4b(_0x55db16[_0x226c('0x3a')](0x1f4,_0x226c('0x4a')));}});},'Agents':function(_0x30ddc2){return new Promise(function(_0x3711c9,_0x222932){var _0x40ed3a=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x3d')]);_0x3711c9({'count':_0x40ed3a[_0x226c('0x17')],'rows':_0x40ed3a});});},'ChatQueues':function(_0x2268e6){return new Promise(function(_0x52605b,_0x435c42){var _0x3d128d=[];for(var _0x1c3973 in _0x4eb557[_0x226c('0x4c')]){if(_0x4eb557[_0x226c('0x4c')][_0x226c('0x47')](_0x1c3973)){var _0x29ff98=_0x4eb557['chatQueues'][_0x1c3973];var _0x2856f4={'id':_0x29ff98['id'],'available':_0x29ff98['available'],'loggedIn':_0x29ff98[_0x226c('0x4d')],'name':_0x29ff98['name'],'paused':_0x29ff98[_0x226c('0x4e')],'waiting':_0x29ff98[_0x226c('0x4f')]};_0x3d128d[_0x226c('0x1d')](_0x2856f4);}}_0x52605b({'count':_0x3d128d[_0x226c('0x17')],'rows':_0x3d128d});});},'MailQueues':function(_0x5645a7){return new Promise(function(_0x13a8d6,_0x2d447d){var _0x315ac6=[];for(var _0x57490f in _0x4eb557[_0x226c('0x50')]){if(_0x4eb557[_0x226c('0x50')][_0x226c('0x47')](_0x57490f)){var _0xb580f0=_0x4eb557[_0x226c('0x50')][_0x57490f];var _0x487451={'id':_0xb580f0['id'],'available':_0xb580f0[_0x226c('0x51')],'loggedIn':_0xb580f0['loggedIn'],'name':_0xb580f0[_0x226c('0x52')],'paused':_0xb580f0[_0x226c('0x4e')],'waiting':_0xb580f0[_0x226c('0x4f')]};_0x315ac6[_0x226c('0x1d')](_0x487451);}}_0x13a8d6({'count':_0x315ac6['length'],'rows':_0x315ac6});});},'OpenchannelQueues':function(_0xda4304){return new Promise(function(_0x33cd69,_0x50b481){var _0x19d927=[];for(var _0x3fc153 in _0x4eb557[_0x226c('0x53')]){if(_0x4eb557[_0x226c('0x53')][_0x226c('0x47')](_0x3fc153)){var _0x1a0aca=_0x4eb557['openchannelQueues'][_0x3fc153];var _0x389cb7={'id':_0x1a0aca['id'],'available':_0x1a0aca[_0x226c('0x51')],'loggedIn':_0x1a0aca[_0x226c('0x4d')],'name':_0x1a0aca[_0x226c('0x52')],'paused':_0x1a0aca['paused'],'waiting':_0x1a0aca[_0x226c('0x4f')]};_0x19d927['push'](_0x389cb7);}}_0x33cd69({'count':_0x19d927[_0x226c('0x17')],'rows':_0x19d927});});},'SmsQueues':function(_0xb756b9){return new Promise(function(_0x59c9c3,_0x2a00f9){var _0x501597=[];for(var _0x564d3a in _0x4eb557[_0x226c('0x54')]){if(_0x4eb557[_0x226c('0x54')][_0x226c('0x47')](_0x564d3a)){var _0x41d1fd=_0x4eb557[_0x226c('0x54')][_0x564d3a];var _0x4b7770={'id':_0x41d1fd['id'],'available':_0x41d1fd[_0x226c('0x51')],'loggedIn':_0x41d1fd[_0x226c('0x4d')],'name':_0x41d1fd[_0x226c('0x52')],'paused':_0x41d1fd['paused'],'waiting':_0x41d1fd['waiting']};_0x501597[_0x226c('0x1d')](_0x4b7770);}}_0x59c9c3({'count':_0x501597['length'],'rows':_0x501597});});},'FaxQueues':function(_0x1fb15d){return new Promise(function(_0x5a9c92,_0x4a94ad){var _0x5aa1bb=[];for(var _0x2246fd in _0x4eb557[_0x226c('0x55')]){if(_0x4eb557['faxQueues']['hasOwnProperty'](_0x2246fd)){var _0x5f3051=_0x4eb557['faxQueues'][_0x2246fd];var _0x23ab51={'id':_0x5f3051['id'],'available':_0x5f3051['available'],'loggedIn':_0x5f3051[_0x226c('0x4d')],'name':_0x5f3051[_0x226c('0x52')],'paused':_0x5f3051[_0x226c('0x4e')],'waiting':_0x5f3051[_0x226c('0x4f')]};_0x5aa1bb[_0x226c('0x1d')](_0x23ab51);}}_0x5a9c92({'count':_0x5aa1bb[_0x226c('0x17')],'rows':_0x5aa1bb});});},'WhatsappQueues':function(_0x3517fa){return new Promise(function(_0x882ec8,_0x58c2e1){var _0x3746c1=[];for(var _0x345ad9 in _0x4eb557[_0x226c('0x56')]){if(_0x4eb557[_0x226c('0x56')][_0x226c('0x47')](_0x345ad9)){var _0x3b9403=_0x4eb557[_0x226c('0x56')][_0x345ad9];var _0x3659d8={'id':_0x3b9403['id'],'available':_0x3b9403['available'],'loggedIn':_0x3b9403[_0x226c('0x4d')],'name':_0x3b9403[_0x226c('0x52')],'paused':_0x3b9403[_0x226c('0x4e')],'waiting':_0x3b9403[_0x226c('0x4f')]};_0x3746c1[_0x226c('0x1d')](_0x3659d8);}}_0x882ec8({'count':_0x3746c1[_0x226c('0x17')],'rows':_0x3746c1});});},'ChatQueuesWaitingInteractions':function(_0x2585cf){return new Promise(function(_0x5ef2a2,_0x19a525){var _0x357e86=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x57')]);_0x5ef2a2({'count':_0x357e86[_0x226c('0x17')],'rows':_0x357e86});});},'MailQueuesWaitingInteractions':function(_0x2ac44b){return new Promise(function(_0x5292cb,_0x2e1c6c){var _0xbf68ea=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x58')]);_0x5292cb({'count':_0xbf68ea[_0x226c('0x17')],'rows':_0xbf68ea});});},'OpenchannelQueuesWaitingInteractions':function(_0x868257){return new Promise(function(_0x20a47c,_0x5af32e){var _0x52b1c5=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x59')]);_0x20a47c({'count':_0x52b1c5['length'],'rows':_0x52b1c5});});},'SmsQueuesWaitingInteractions':function(_0xbd31d7){return new Promise(function(_0x5524c5,_0x48e0a6){var _0x2ad739=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x5a')]);_0x5524c5({'count':_0x2ad739[_0x226c('0x17')],'rows':_0x2ad739});});},'FaxQueuesWaitingInteractions':function(_0x6ef63d){return new Promise(function(_0x2d0155,_0x5aa822){var _0x15f1de=_[_0x226c('0x4b')](_0x4eb557['faxQueuesWaitingInteractions']);_0x2d0155({'count':_0x15f1de[_0x226c('0x17')],'rows':_0x15f1de});});},'WhatsappQueuesWaitingInteractions':function(_0x43088a){return new Promise(function(_0x13f463,_0x1558cc){var _0x454ee0=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x5b')]);_0x13f463({'count':_0x454ee0[_0x226c('0x17')],'rows':_0x454ee0});});}};var _0x28ede7=jayson[_0x226c('0x5c')](_0x15e13b)[_0x226c('0x5d')]();_0x28ede7['on'](_0x226c('0x3a'),function(_0x27fdbd){logger[_0x226c('0x3a')](JSON[_0x226c('0x5e')](_0x27fdbd));return _0x3cff57(_0x27fdbd);});_0x28ede7['listen'](0x232c,'127.0.0.1',function(){console[_0x226c('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x21d61b(_0x226c('0x60')+0x232c);});});};