c99e9ef71d2a3a14d97ece622d60ff9bc1d8673b
[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 _0x8164=['rules','channel','message','applications','isArray','length','existsSync','app','.js','autoreply','mail','push','slice','join','dialogflow','split','dialogflowv2','appdata','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','interaction','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','emit','complete','info','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','stringify','log','lodash','util','path','bluebird','uuid','../../../config/environment','routing','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','interval','listen'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x8164,0x170));var _0x4816=function(_0x1f88f0,_0x2dc0ac){_0x1f88f0=_0x1f88f0-0x0;var _0x3684f5=_0x8164[_0x1f88f0];return _0x3684f5;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var path=require(_0x4816('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x4816('0x3'));var uuid=require(_0x4816('0x4'));var utils=require('./applications/utils');var config=require(_0x4816('0x5'));var logger=require('../../../config/logger')(_0x4816('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x4816('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4816('0x8'))};var RuleEngine=require(_0x4816('0x9'));function getId(_0x170e7a,_0x383974,_0x2421e1){return util[_0x4816('0xa')](_0x4816('0xb'),_0x170e7a,_0x383974||0x0,_0x2421e1||0x0);}function getIntervals(_0x1e0118,_0x23d125){var _0x520153=[];if(!_[_0x4816('0xc')](_0x23d125['IntervalId'])&&!_[_0x4816('0xc')](_0x1e0118[_0x23d125[_0x4816('0xd')]])&&!_['isNil'](_0x1e0118[_0x23d125[_0x4816('0xd')]]['Intervals'])){_0x520153=_['map'](_0x1e0118[_0x23d125[_0x4816('0xd')]]['Intervals'],'interval');}else if(!_[_0x4816('0xc')](_0x23d125['interval'])){_0x520153=[_0x23d125[_0x4816('0xe')]];}return _0x520153;}exports[_0x4816('0xf')]=function(_0x13a685){_0x13a685[_0x4816('0x10')]={};return new BPromise(function(_0x42fc52,_0x248163){var _0x1eb683={'Start':function(_0x2a58b7){var _0x45c006=this;return new Promise(function(_0x21354c,_0x1ce1fb){if(_0x2a58b7){try{var _0x4678a9=[];var _0x6119f=getId(_0x2a58b7[_0x4816('0x11')],_0x2a58b7[_0x4816('0x12')]?_0x2a58b7[_0x4816('0x12')]['id']:0x0,_0x2a58b7['interaction']?_0x2a58b7['interaction']['id']:0x0);if(_0x2a58b7[_0x4816('0x13')]&&_[_0x4816('0x14')](_0x2a58b7[_0x4816('0x13')])&&_0x2a58b7[_0x4816('0x13')][_0x4816('0x15')]){for(var _0x37effd=0x0;_0x37effd<_0x2a58b7[_0x4816('0x13')][_0x4816('0x15')];_0x37effd+=0x1){var _0x3df423=_0x2a58b7['applications'][_0x37effd];if(fs[_0x4816('0x16')](path['join'](__dirname,'applications',_0x3df423[_0x4816('0x17')]+_0x4816('0x18')))){var _0x5de184=[];switch(_0x3df423[_0x4816('0x17')]['toLowerCase']()){case _0x4816('0x19'):var _0x41d7f0=_0x3df423['appdata']['split'](',');if(_0x2a58b7[_0x4816('0x11')]===_0x4816('0x1a')){_0x5de184[_0x4816('0x1b')](_0x41d7f0[0x0]);_0x5de184['push'](_0x41d7f0[0x1]);_0x5de184[_0x4816('0x1b')](_0x41d7f0[_0x4816('0x1c')](0x2,_0x41d7f0[_0x4816('0x15')])[_0x4816('0x1d')](','));}else{_0x5de184['push'](_0x41d7f0[0x0]);_0x5de184['push'](_0x41d7f0[_0x4816('0x1c')](0x1,_0x41d7f0[_0x4816('0x15')])['join'](','));}break;case _0x4816('0x1e'):var _0x4f9386=_0x3df423['appdata'][_0x4816('0x1f')](',');_0x5de184[_0x4816('0x1b')](_0x4f9386[0x0]);_0x5de184[_0x4816('0x1b')](_0x4f9386[0x1]);_0x5de184['push'](_0x4f9386[_0x4816('0x1c')](0x2,_0x4f9386['length'])[_0x4816('0x1d')](','));break;case _0x4816('0x20'):var _0x49c337=_0x3df423[_0x4816('0x21')][_0x4816('0x1f')](',');_0x5de184[_0x4816('0x1b')](_0x49c337[0x0]);_0x5de184[_0x4816('0x1b')](_0x49c337[0x1]);_0x5de184[_0x4816('0x1b')](_0x49c337[0x2]);_0x5de184[_0x4816('0x1b')](_0x49c337[0x3]);_0x5de184[_0x4816('0x1b')](_0x49c337[_0x4816('0x1c')](0x4,_0x49c337[_0x4816('0x15')])['join'](','));break;case _0x4816('0x22'):var _0x902962=_0x3df423['appdata']['split'](',');_0x5de184[_0x4816('0x1b')](_0x902962[0x0]);_0x5de184[_0x4816('0x1b')](_0x902962[0x1]);_0x5de184[_0x4816('0x1b')](_0x902962[0x2]);_0x5de184[_0x4816('0x1b')](_0x902962[0x3]);_0x5de184[_0x4816('0x1b')](_0x902962['slice'](0x4,_0x902962['length'])['join'](','));break;case _0x4816('0x12'):_0x5de184[_0x4816('0x1b')](_0x3df423[_0x4816('0x21')]);break;case _0x4816('0x23'):_0x5de184[_0x4816('0x1b')](_0x3df423[_0x4816('0x24')]);_0x5de184['push'](_0x3df423[_0x4816('0x21')]);break;case'tvox':var _0xc92865=utils[_0x4816('0x25')](_0x2a58b7[_0x4816('0x26')][_0x4816('0x27')],_0x2a58b7);var _0x192476=_0x3df423['appdata'][_0x4816('0x1f')](',');_0x5de184['push'](_0x192476[0x0]);_0x5de184['push'](_0x192476[0x1]);_0x5de184[_0x4816('0x1b')](_0x192476[0x2]);_0x5de184['push'](_0x192476[0x3]);_0x5de184['push'](_0x192476[0x4]);_0x5de184['push'](_0x192476[0x5]);_0x5de184['push'](_0x192476[0x6]);_0x5de184[_0x4816('0x1b')](_0x192476[0x7]);_0x5de184[_0x4816('0x1b')](_0x192476[0x8]);_0x5de184['push'](_0x192476[0x9]);_0x5de184[_0x4816('0x1b')](_0x192476[0xa]);_0x5de184[_0x4816('0x1b')](_0x2a58b7['interaction']['id']);_0x5de184[_0x4816('0x1b')](_0x2a58b7[_0x4816('0x12')]['id']);_0x5de184[_0x4816('0x1b')](_0x3df423[_0x4816('0x28')]);_0x5de184['push'](_0x2a58b7[_0x4816('0x29')][_0x4816('0x2a')]);_0x5de184[_0x4816('0x1b')](_0x2a58b7[_0x4816('0x2b')][_0x4816('0x2b')]);_0x5de184[_0x4816('0x1b')](_0xc92865);break;default:_0x5de184=_[_0x4816('0xc')](_0x3df423[_0x4816('0x21')])?[]:_0x3df423[_0x4816('0x21')][_0x4816('0x1f')](',');}var _0xcbded0={'id':util[_0x4816('0xa')](_0x4816('0x2c'),_0x6119f,_0x3df423['id'],_0x3df423['app']),'condition':require(_0x4816('0x2d'))[_0x4816('0x2e')](_0x6119f,getIntervals(_0x13a685[_0x4816('0x2f')],_0x3df423),_0x13a685),'consequence':require(_0x4816('0x30')+_0x3df423[_0x4816('0x17')])[_0x4816('0x31')](_0x6119f,_0x5de184,_0x13a685,_0x2a58b7),'p':_0x3df423[_0x4816('0x32')]||0x0};logger['info'](_0x4816('0x33'),_0xcbded0['id'],'on\x20interval',getIntervals(_0x13a685['intervals'],_0x3df423)[_0x4816('0x1d')](_0x4816('0x34')));_0x4678a9['push'](_0xcbded0);}else{logger[_0x4816('0x35')](_0x4816('0x36'),path[_0x4816('0x1d')](__dirname,'applications',_0x3df423[_0x4816('0x17')]+_0x4816('0x18')));}}_0x13a685[_0x4816('0x10')][_0x6119f]=new RuleEngine(_0x4678a9);_0x13a685[_0x4816('0x10')][_0x6119f][_0x4816('0x37')](_0x2a58b7,function(_0x39c713){logger['info'](_0x4816('0x38'),JSON['stringify'](_0x39c713['matchPath']));if(_0x13a685['rules'][_0x6119f]){_0x13a685[_0x4816('0x10')][_0x6119f][_0x4816('0x39')](_0x4816('0x3a'));}});return _0x21354c({'code':0xc8,'message':_0x2a58b7});}else{logger[_0x4816('0x3b')](_0x4816('0x3c'));return _0x21354c({'code':0xc8,'message':_0x2a58b7});}}catch(_0x22d8d3){logger[_0x4816('0x35')](_0x22d8d3[_0x4816('0x3d')]);return _0x1ce1fb(_0x45c006[_0x4816('0x35')](0x1f4,_0x22d8d3));}}return _0x1ce1fb(_0x4816('0x3e'));});},'AcceptMessage':function(_0x5e24bf){var _0x4ffae3=this;return new Promise(function(_0x258f5f,_0x374d25){if(_0x5e24bf[_0x4816('0x3f')]&&_0x5e24bf[_0x4816('0x3f')]['id']){if(_0x13a685[_0x4816('0x40')][_0x5e24bf[_0x4816('0x3f')]['id']]){_0x13a685[_0x4816('0x40')][_0x5e24bf[_0x4816('0x3f')]['id']]['busy']=![];_0x13a685[_0x4816('0x40')][_0x5e24bf[_0x4816('0x3f')]['id']][_0x4816('0x41')]=undefined;}}if(_0x5e24bf['message']&&_0x5e24bf['message']['id']){try{var _0x2ad19b=getId(_0x5e24bf[_0x4816('0x11')],_0x5e24bf[_0x4816('0x12')]?_0x5e24bf['message']['id']:0x0,_0x5e24bf[_0x4816('0x29')]?_0x5e24bf[_0x4816('0x29')]['id']:0x0);if(_0x13a685[_0x4816('0x10')][_0x2ad19b]){_0x13a685[_0x4816('0x10')][_0x2ad19b][_0x4816('0x39')](_0x4816('0x42'));if(rpc[_0x5e24bf[_0x4816('0x11')]+'QueueReport']){rpc[_0x5e24bf[_0x4816('0x11')]+_0x4816('0x43')][_0x4816('0x44')](_0x2ad19b,{'UserId':_0x5e24bf[_0x4816('0x12')][_0x4816('0x45')]})[_0x4816('0x46')](function(_0x309778){logger[_0x4816('0x35')](_0x4816('0x47'));});}}return _0x258f5f({'code':0xc8,'message':_0x5e24bf});}catch(_0x443d0d){logger[_0x4816('0x35')](_0x443d0d[_0x4816('0x3d')]);return _0x374d25(_0x4ffae3[_0x4816('0x35')](0x1f4,_0x443d0d));}}logger[_0x4816('0x35')](_0x4816('0x48'));return _0x374d25(_0x4ffae3[_0x4816('0x35')](0x1f4,_0x4816('0x48')));});},'RejectMessage':function(_0x11272b){var _0x2e619f=this;return new Promise(function(_0x56321c,_0x1702bf){if(_0x11272b[_0x4816('0x3f')]&&_0x11272b['agent']['id']){try{if(_0x13a685[_0x4816('0x40')][_0x11272b[_0x4816('0x3f')]['id']]){_0x13a685['agents'][_0x11272b[_0x4816('0x3f')]['id']][_0x4816('0x49')]=![];_0x13a685[_0x4816('0x40')][_0x11272b[_0x4816('0x3f')]['id']][_0x4816('0x41')]=undefined;}return _0x56321c({'code':0xc8,'message':_0x11272b});}catch(_0x3f6bf2){logger[_0x4816('0x35')](_0x3f6bf2[_0x4816('0x3d')]);return _0x1702bf(_0x2e619f[_0x4816('0x35')](0x1f4,_0x3f6bf2));}}logger[_0x4816('0x35')]('message\x20is\x20empty');return _0x1702bf(_0x2e619f[_0x4816('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x440ba5){var _0x199363=this;return new Promise(function(_0x57d72e,_0x157ee3){if(_0x440ba5[_0x4816('0x11')]&&_0x440ba5[_0x4816('0x29')]&&_0x440ba5[_0x4816('0x29')]['id']){try{var _0x170c23=getId(_0x440ba5['channel'],_0x440ba5[_0x4816('0x12')]?_0x440ba5[_0x4816('0x12')]['id']:0x0,_0x440ba5[_0x4816('0x29')]?_0x440ba5[_0x4816('0x29')]['id']:0x0);if(_0x13a685[_0x4816('0x10')][_0x170c23]){_0x13a685[_0x4816('0x10')][_0x170c23]['emit'](_0x4816('0x42'));}return _0x57d72e({'code':0xc8,'message':_0x440ba5});}catch(_0x43c287){logger[_0x4816('0x35')](_0x43c287['stack']);return _0x157ee3(_0x199363[_0x4816('0x35')](0x1f4,_0x43c287));}}logger[_0x4816('0x35')](_0x4816('0x48'));return _0x157ee3(_0x199363['error'](0x1f4,_0x4816('0x48')));});},'AgentCapacity':function(_0x1f790b){var _0xa67f45=this;return new Promise(function(_0xfb9e4a,_0x56d223){if(_0x13a685[_0x4816('0x40')][_0x4816('0x4a')](_0x1f790b['id'])){for(var _0x5210d2 in _0x1f790b['capacity']){if(_0x1f790b['capacity'][_0x4816('0x4a')](_0x5210d2)){if(_0x13a685[_0x4816('0x40')][_0x1f790b['id']][_0x4816('0x4a')](_0x5210d2+_0x4816('0x4b'))){_0x13a685[_0x4816('0x40')][_0x1f790b['id']][_0x5210d2+_0x4816('0x4b')]=parseInt(_0x1f790b[_0x4816('0x4c')][_0x5210d2],0xa);}}}_0x13a685['agents'][_0x1f790b['id']][_0x4816('0x4d')]();return _0xfb9e4a({'code':0xc8,'message':_0x13a685[_0x4816('0x40')][_0x1f790b['id']]});}else{return _0x56d223(_0xa67f45[_0x4816('0x35')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x356878){return new Promise(function(_0x27392e,_0xcc9277){var _0x2c2a8c=_[_0x4816('0x4e')](_0x13a685[_0x4816('0x40')]);_0x27392e({'count':_0x2c2a8c[_0x4816('0x15')],'rows':_0x2c2a8c});});},'ChatQueues':function(_0x52cf85){return new Promise(function(_0x171c2b,_0x11e6f9){var _0x11b12a=[];for(var _0x4a3cf9 in _0x13a685[_0x4816('0x4f')]){if(_0x13a685[_0x4816('0x4f')]['hasOwnProperty'](_0x4a3cf9)){var _0x3a1cf7=_0x13a685[_0x4816('0x4f')][_0x4a3cf9];var _0x211a2b={'id':_0x3a1cf7['id'],'available':_0x3a1cf7[_0x4816('0x50')],'loggedIn':_0x3a1cf7[_0x4816('0x51')],'name':_0x3a1cf7[_0x4816('0x52')],'paused':_0x3a1cf7[_0x4816('0x53')],'waiting':_0x3a1cf7['waiting']};_0x11b12a[_0x4816('0x1b')](_0x211a2b);}}_0x171c2b({'count':_0x11b12a['length'],'rows':_0x11b12a});});},'MailQueues':function(_0x483ad3){return new Promise(function(_0x4f357f,_0x4b3a3c){var _0x553093=[];for(var _0x15649e in _0x13a685[_0x4816('0x54')]){if(_0x13a685[_0x4816('0x54')]['hasOwnProperty'](_0x15649e)){var _0x3d6908=_0x13a685[_0x4816('0x54')][_0x15649e];var _0x115dc8={'id':_0x3d6908['id'],'available':_0x3d6908[_0x4816('0x50')],'loggedIn':_0x3d6908[_0x4816('0x51')],'name':_0x3d6908[_0x4816('0x52')],'paused':_0x3d6908[_0x4816('0x53')],'waiting':_0x3d6908['waiting']};_0x553093[_0x4816('0x1b')](_0x115dc8);}}_0x4f357f({'count':_0x553093['length'],'rows':_0x553093});});},'OpenchannelQueues':function(_0x44c2ec){return new Promise(function(_0x2cbc59,_0x5277dc){var _0x3002b7=[];for(var _0x9165c8 in _0x13a685[_0x4816('0x55')]){if(_0x13a685['openchannelQueues'][_0x4816('0x4a')](_0x9165c8)){var _0xd5d3b0=_0x13a685[_0x4816('0x55')][_0x9165c8];var _0x56b799={'id':_0xd5d3b0['id'],'available':_0xd5d3b0[_0x4816('0x50')],'loggedIn':_0xd5d3b0[_0x4816('0x51')],'name':_0xd5d3b0[_0x4816('0x52')],'paused':_0xd5d3b0['paused'],'waiting':_0xd5d3b0[_0x4816('0x56')]};_0x3002b7[_0x4816('0x1b')](_0x56b799);}}_0x2cbc59({'count':_0x3002b7[_0x4816('0x15')],'rows':_0x3002b7});});},'SmsQueues':function(_0x391329){return new Promise(function(_0x1c7fb4,_0x3d7d8b){var _0x23cfc4=[];for(var _0x5b7156 in _0x13a685[_0x4816('0x57')]){if(_0x13a685[_0x4816('0x57')][_0x4816('0x4a')](_0x5b7156)){var _0x24b0d5=_0x13a685[_0x4816('0x57')][_0x5b7156];var _0x24df14={'id':_0x24b0d5['id'],'available':_0x24b0d5[_0x4816('0x50')],'loggedIn':_0x24b0d5['loggedIn'],'name':_0x24b0d5[_0x4816('0x52')],'paused':_0x24b0d5[_0x4816('0x53')],'waiting':_0x24b0d5[_0x4816('0x56')]};_0x23cfc4[_0x4816('0x1b')](_0x24df14);}}_0x1c7fb4({'count':_0x23cfc4['length'],'rows':_0x23cfc4});});},'FaxQueues':function(_0x1e0bab){return new Promise(function(_0x1af0dc,_0x46f5f4){var _0xbb9848=[];for(var _0x12de01 in _0x13a685[_0x4816('0x58')]){if(_0x13a685[_0x4816('0x58')][_0x4816('0x4a')](_0x12de01)){var _0x28419c=_0x13a685[_0x4816('0x58')][_0x12de01];var _0x436d35={'id':_0x28419c['id'],'available':_0x28419c[_0x4816('0x50')],'loggedIn':_0x28419c[_0x4816('0x51')],'name':_0x28419c['name'],'paused':_0x28419c[_0x4816('0x53')],'waiting':_0x28419c[_0x4816('0x56')]};_0xbb9848[_0x4816('0x1b')](_0x436d35);}}_0x1af0dc({'count':_0xbb9848[_0x4816('0x15')],'rows':_0xbb9848});});},'WhatsappQueues':function(_0x21fe50){return new Promise(function(_0x35093e,_0x12d58f){var _0x619070=[];for(var _0x202d18 in _0x13a685[_0x4816('0x59')]){if(_0x13a685[_0x4816('0x59')][_0x4816('0x4a')](_0x202d18)){var _0xf439b3=_0x13a685['whatsappQueues'][_0x202d18];var _0xf05f49={'id':_0xf439b3['id'],'available':_0xf439b3[_0x4816('0x50')],'loggedIn':_0xf439b3[_0x4816('0x51')],'name':_0xf439b3['name'],'paused':_0xf439b3['paused'],'waiting':_0xf439b3[_0x4816('0x56')]};_0x619070[_0x4816('0x1b')](_0xf05f49);}}_0x35093e({'count':_0x619070['length'],'rows':_0x619070});});},'ChatQueuesWaitingInteractions':function(_0x1e2ead){return new Promise(function(_0x192832,_0x357800){var _0x317f3f=_['values'](_0x13a685[_0x4816('0x5a')]);_0x192832({'count':_0x317f3f[_0x4816('0x15')],'rows':_0x317f3f});});},'MailQueuesWaitingInteractions':function(_0x5f391e){return new Promise(function(_0x370439,_0x32ced6){var _0x4957e6=_[_0x4816('0x4e')](_0x13a685['mailQueuesWaitingInteractions']);_0x370439({'count':_0x4957e6[_0x4816('0x15')],'rows':_0x4957e6});});},'OpenchannelQueuesWaitingInteractions':function(_0x485505){return new Promise(function(_0x27ff4f,_0xa7f23c){var _0x30a190=_[_0x4816('0x4e')](_0x13a685['openchannelQueuesWaitingInteractions']);_0x27ff4f({'count':_0x30a190[_0x4816('0x15')],'rows':_0x30a190});});},'SmsQueuesWaitingInteractions':function(_0x4194f6){return new Promise(function(_0x1d0192,_0x2246b3){var _0x5e0b7e=_[_0x4816('0x4e')](_0x13a685[_0x4816('0x5b')]);_0x1d0192({'count':_0x5e0b7e[_0x4816('0x15')],'rows':_0x5e0b7e});});},'FaxQueuesWaitingInteractions':function(_0x1f0f2a){return new Promise(function(_0x5c68cc,_0xc1f850){var _0x37c2a1=_[_0x4816('0x4e')](_0x13a685[_0x4816('0x5c')]);_0x5c68cc({'count':_0x37c2a1[_0x4816('0x15')],'rows':_0x37c2a1});});},'WhatsappQueuesWaitingInteractions':function(_0x4a4e89){return new Promise(function(_0x2765ae,_0x4f43eb){var _0x1c0799=_[_0x4816('0x4e')](_0x13a685['whatsappQueuesWaitingInteractions']);_0x2765ae({'count':_0x1c0799[_0x4816('0x15')],'rows':_0x1c0799});});}};var _0x205cf1=jayson[_0x4816('0x5d')](_0x1eb683)['http']();_0x205cf1['on'](_0x4816('0x35'),function(_0x33eabd){logger['error'](JSON[_0x4816('0x5e')](_0x33eabd));return _0x248163(_0x33eabd);});_0x205cf1[_0x4816('0xf')](0x232c,'127.0.0.1',function(){console[_0x4816('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x42fc52('RPC\x20listening\x20on\x20port:'+0x232c);});});};