Built motion from commit 64a6f4bc.|2.6.26
[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 _0x160f=['lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','tag','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','QueueReport','update','UserId','catch','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','find','chatQueues','available','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log'];(function(_0x4cb11a,_0x3b5a59){var _0x29f703=function(_0x3fb559){while(--_0x3fb559){_0x4cb11a['push'](_0x4cb11a['shift']());}};_0x29f703(++_0x3b5a59);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var fs=require('fs');var jayson=require(_0xf160('0x3'));var BPromise=require('bluebird');var utils=require(_0xf160('0x4'));var sUtils=require(_0xf160('0x5'));var logger=require(_0xf160('0x6'))(_0xf160('0x7'));var rpc={'openchannelQueueReport':require(_0xf160('0x8')),'mailQueueReport':require(_0xf160('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xf160('0xa')),'faxQueueReport':require(_0xf160('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x41e909,_0x5b76c8,_0x4bf890){return util['format'](_0xf160('0xc'),_0x41e909,_0x5b76c8||0x0,_0x4bf890||0x0);}function getIntervals(_0x90608,_0x393f70){var _0x2736b8=[];if(!_['isNil'](_0x393f70['IntervalId'])&&!_[_0xf160('0xd')](_0x90608[_0x393f70[_0xf160('0xe')]])&&!_[_0xf160('0xd')](_0x90608[_0x393f70['IntervalId']][_0xf160('0xf')])){_0x2736b8=_[_0xf160('0x10')](_0x90608[_0x393f70[_0xf160('0xe')]][_0xf160('0xf')],_0xf160('0x11'));}else if(!_['isNil'](_0x393f70[_0xf160('0x11')])){_0x2736b8=[_0x393f70['interval']];}return _0x2736b8;}exports[_0xf160('0x12')]=function(_0x26951a){_0x26951a[_0xf160('0x13')]={};return new BPromise(function(_0x2bb6c7,_0x3a4faa){var _0x31f7ae={'Start':function(_0x2643ba){var _0x172337=this;return new Promise(function(_0x1396ba,_0x59ac02){if(_0x2643ba){try{var _0x477e4d=[];var _0x400bda=getId(_0x2643ba[_0xf160('0x14')],_0x2643ba[_0xf160('0x15')]?_0x2643ba['message']['id']:0x0,_0x2643ba[_0xf160('0x16')]?_0x2643ba['interaction']['id']:0x0);var _0x5388c7=sUtils[_0xf160('0x17')](_0x26951a,_0x2643ba);if(_0x2643ba[_0xf160('0x18')]||!_0x5388c7&&_0x2643ba[_0xf160('0x19')]&&_[_0xf160('0x1a')](_0x2643ba[_0xf160('0x19')])&&_0x2643ba[_0xf160('0x19')][_0xf160('0x1b')]){for(var _0x1fdb38=0x0;_0x1fdb38<_0x2643ba['applications'][_0xf160('0x1b')];_0x1fdb38+=0x1){var _0xa20d5a=_0x2643ba[_0xf160('0x19')][_0x1fdb38];if(fs['existsSync'](path[_0xf160('0x1c')](__dirname,_0xf160('0x19'),_0xa20d5a[_0xf160('0x1d')]+_0xf160('0x1e')))){var _0x2e03c8=[];switch(_0xa20d5a[_0xf160('0x1d')][_0xf160('0x1f')]()){case'autoreply':var _0x3d1f6c=_0xa20d5a[_0xf160('0x20')][_0xf160('0x21')](',');if(_0x2643ba[_0xf160('0x14')]==='mail'){_0x2e03c8[_0xf160('0x22')](_0x3d1f6c[0x0]);_0x2e03c8[_0xf160('0x22')](_0x3d1f6c[0x1]);_0x2e03c8['push'](_0x3d1f6c['slice'](0x2,_0x3d1f6c[_0xf160('0x1b')])[_0xf160('0x1c')](','));}else{_0x2e03c8[_0xf160('0x22')](_0x3d1f6c[0x0]);_0x2e03c8['push'](_0x3d1f6c[_0xf160('0x23')](0x1,_0x3d1f6c[_0xf160('0x1b')])[_0xf160('0x1c')](','));}break;case _0xf160('0x24'):var _0x135e0f=_0xa20d5a[_0xf160('0x20')]['split'](',');_0x2e03c8['push'](_0x135e0f[0x0]);_0x2e03c8['push'](_0x135e0f[0x1]);_0x2e03c8[_0xf160('0x22')](_0x135e0f[_0xf160('0x23')](0x2,_0x135e0f[_0xf160('0x1b')])[_0xf160('0x1c')](','));break;case _0xf160('0x25'):var _0x563103=_0xa20d5a['appdata'][_0xf160('0x21')](',');_0x2e03c8['push'](_0x563103[0x0]);_0x2e03c8['push'](_0x563103[0x1]);_0x2e03c8[_0xf160('0x22')](_0x563103[0x2]);_0x2e03c8[_0xf160('0x22')](_0x563103[0x3]);_0x2e03c8['push'](_0x563103[_0xf160('0x23')](0x4,_0x563103[_0xf160('0x1b')])['join'](','));break;case'amazonlex':var _0x4b3ef4=_0xa20d5a['appdata'][_0xf160('0x21')](',');_0x2e03c8[_0xf160('0x22')](_0x4b3ef4[0x0]);_0x2e03c8[_0xf160('0x22')](_0x4b3ef4[0x1]);_0x2e03c8[_0xf160('0x22')](_0x4b3ef4[0x2]);_0x2e03c8[_0xf160('0x22')](_0x4b3ef4[0x3]);_0x2e03c8[_0xf160('0x22')](_0x4b3ef4['slice'](0x4,_0x4b3ef4['length'])['join'](','));break;case _0xf160('0x15'):_0x2e03c8['push'](_0xa20d5a['appdata']);break;case _0xf160('0x26'):_0x2e03c8[_0xf160('0x22')](_0xa20d5a['TagId']);_0x2e03c8[_0xf160('0x22')](_0xa20d5a[_0xf160('0x20')]);break;case _0xf160('0x27'):var _0x2a7a5a=utils[_0xf160('0x28')](_0x2643ba['account'][_0xf160('0x29')],_0x2643ba);var _0x2a7fcd=_0xa20d5a[_0xf160('0x20')]['split'](',');_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x0]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x1]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x2]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x3]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x4]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x5]);_0x2e03c8['push'](_0x2a7fcd[0x6]);_0x2e03c8['push'](_0x2a7fcd[0x7]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x8]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0x9]);_0x2e03c8[_0xf160('0x22')](_0x2a7fcd[0xa]);_0x2e03c8[_0xf160('0x22')](_0x2643ba[_0xf160('0x16')]['id']);_0x2e03c8[_0xf160('0x22')](_0x2643ba[_0xf160('0x15')]['id']);_0x2e03c8[_0xf160('0x22')](_0xa20d5a[_0xf160('0x2a')]);_0x2e03c8[_0xf160('0x22')](_0x2643ba[_0xf160('0x16')][_0xf160('0x2b')]);_0x2e03c8[_0xf160('0x22')](_0x2643ba[_0xf160('0x2c')][_0xf160('0x2c')]);_0x2e03c8[_0xf160('0x22')](_0x2a7a5a);break;default:_0x2e03c8=_[_0xf160('0xd')](_0xa20d5a[_0xf160('0x20')])?[]:_0xa20d5a[_0xf160('0x20')][_0xf160('0x21')](',');}var _0x13241c={'id':util[_0xf160('0x2d')](_0xf160('0x2e'),_0x400bda,_0xa20d5a['id'],_0xa20d5a[_0xf160('0x1d')]),'condition':require('./interval')[_0xf160('0x2f')](_0x400bda,getIntervals(_0x26951a[_0xf160('0x30')],_0xa20d5a),_0x26951a),'consequence':require(_0xf160('0x31')+_0xa20d5a[_0xf160('0x1d')])[_0xf160('0x32')](_0x400bda,_0x2e03c8,_0x26951a,_0x2643ba),'p':_0xa20d5a[_0xf160('0x33')]||0x0};logger[_0xf160('0x34')]('Push\x20new\x20rule',_0x13241c['id'],_0xf160('0x35'),getIntervals(_0x26951a['intervals'],_0xa20d5a)[_0xf160('0x1c')](_0xf160('0x36')));_0x477e4d['push'](_0x13241c);}else{logger[_0xf160('0x37')](_0xf160('0x38'),path[_0xf160('0x1c')](__dirname,_0xf160('0x19'),_0xa20d5a[_0xf160('0x1d')]+_0xf160('0x1e')));}}_0x26951a[_0xf160('0x13')][_0x400bda]=new RuleEngine(_0x477e4d);_0x26951a['rules'][_0x400bda][_0xf160('0x39')](_0x2643ba,function(_0x28d093){logger[_0xf160('0x34')](_0xf160('0x3a'),JSON[_0xf160('0x3b')](_0x28d093[_0xf160('0x3c')]));if(_0x26951a[_0xf160('0x13')][_0x400bda]){_0x26951a[_0xf160('0x13')][_0x400bda][_0xf160('0x3d')](_0xf160('0x3e'));}});return _0x1396ba({'code':0xc8,'message':_0x2643ba});}else{if(_0x5388c7){logger[_0xf160('0x34')](util['format']('Skipped\x20routing\x20for\x20%s',_0x400bda));}else{logger[_0xf160('0x34')](_0xf160('0x3f'));}return _0x1396ba({'code':0xc8,'message':_0x2643ba});}}catch(_0x2e9071){logger[_0xf160('0x37')](_0x2e9071[_0xf160('0x40')]);return _0x59ac02(_0x172337[_0xf160('0x37')](0x1f4,_0x2e9071));}}return _0x59ac02('routing\x20is\x20empty');});},'AcceptMessage':function(_0xb3bc25){var _0x5abc6a=this;return new Promise(function(_0x55ab52,_0x44fd52){if(_0xb3bc25[_0xf160('0x41')]&&_0xb3bc25['agent']['id']){if(_0x26951a['agents'][_0xb3bc25[_0xf160('0x41')]['id']]){_0x26951a[_0xf160('0x42')][_0xb3bc25[_0xf160('0x41')]['id']][_0xf160('0x43')]=![];_0x26951a['agents'][_0xb3bc25['agent']['id']]['busyQueue']=undefined;}}if(_0xb3bc25['message']&&_0xb3bc25[_0xf160('0x15')]['id']){try{var _0x57f5a9=getId(_0xb3bc25[_0xf160('0x14')],_0xb3bc25[_0xf160('0x15')]?_0xb3bc25[_0xf160('0x15')]['id']:0x0,_0xb3bc25[_0xf160('0x16')]?_0xb3bc25['interaction']['id']:0x0);if(_0x26951a[_0xf160('0x13')][_0x57f5a9]){_0x26951a[_0xf160('0x13')][_0x57f5a9][_0xf160('0x3d')]('end');if(rpc[_0xb3bc25[_0xf160('0x14')]+_0xf160('0x44')]){rpc[_0xb3bc25[_0xf160('0x14')]+'QueueReport'][_0xf160('0x45')](_0x57f5a9,{'UserId':_0xb3bc25[_0xf160('0x15')][_0xf160('0x46')]})[_0xf160('0x47')](function(){logger[_0xf160('0x37')]('error\x20update\x20queue\x20report');});}}return _0x55ab52({'code':0xc8,'message':_0xb3bc25});}catch(_0x4c90ab){logger[_0xf160('0x37')](_0x4c90ab['stack']);return _0x44fd52(_0x5abc6a[_0xf160('0x37')](0x1f4,_0x4c90ab));}}logger[_0xf160('0x37')]('message\x20is\x20empty');return _0x44fd52(_0x5abc6a['error'](0x1f4,_0xf160('0x48')));});},'RejectMessage':function(_0x260344){var _0x493e86=this;return new Promise(function(_0x2d1b68,_0x22fd05){if(_0x260344[_0xf160('0x41')]&&_0x260344[_0xf160('0x41')]['id']){try{if(_0x26951a['agents'][_0x260344[_0xf160('0x41')]['id']]){_0x26951a['agents'][_0x260344[_0xf160('0x41')]['id']][_0xf160('0x43')]=![];_0x26951a[_0xf160('0x42')][_0x260344[_0xf160('0x41')]['id']][_0xf160('0x49')]=undefined;}return _0x2d1b68({'code':0xc8,'message':_0x260344});}catch(_0x488cd8){logger[_0xf160('0x37')](_0x488cd8['stack']);return _0x22fd05(_0x493e86[_0xf160('0x37')](0x1f4,_0x488cd8));}}logger[_0xf160('0x37')](_0xf160('0x48'));return _0x22fd05(_0x493e86[_0xf160('0x37')](0x1f4,_0xf160('0x48')));});},'AbandonInteraction':function(_0x342fbf){var _0x11855b=this;return new Promise(function(_0x12c22,_0x4122a2){if(_0x342fbf[_0xf160('0x14')]&&_0x342fbf['interaction']&&_0x342fbf['interaction']['id']){try{var _0x22784f=getId(_0x342fbf[_0xf160('0x14')],_0x342fbf['message']?_0x342fbf[_0xf160('0x15')]['id']:0x0,_0x342fbf[_0xf160('0x16')]?_0x342fbf[_0xf160('0x16')]['id']:0x0);if(_0x26951a['rules'][_0x22784f]){_0x26951a['rules'][_0x22784f][_0xf160('0x3d')](_0xf160('0x4a'));}return _0x12c22({'code':0xc8,'message':_0x342fbf});}catch(_0x5eeab6){logger[_0xf160('0x37')](_0x5eeab6[_0xf160('0x40')]);return _0x4122a2(_0x11855b['error'](0x1f4,_0x5eeab6));}}logger[_0xf160('0x37')](_0xf160('0x48'));return _0x4122a2(_0x11855b[_0xf160('0x37')](0x1f4,_0xf160('0x48')));});},'AgentCapacity':function(_0x1761a5){var _0x3564c0=this;return new Promise(function(_0x4f96bc,_0x1a07ef){if(_0x26951a[_0xf160('0x42')][_0xf160('0x4b')](_0x1761a5['id'])){for(var _0x1364bc in _0x1761a5[_0xf160('0x4c')]){if(_0x1761a5['capacity'][_0xf160('0x4b')](_0x1364bc)){if(_0x26951a['agents'][_0x1761a5['id']][_0xf160('0x4b')](_0x1364bc+_0xf160('0x4d'))){_0x26951a[_0xf160('0x42')][_0x1761a5['id']][_0x1364bc+_0xf160('0x4d')]=parseInt(_0x1761a5[_0xf160('0x4c')][_0x1364bc],0xa);}}}_0x26951a[_0xf160('0x42')][_0x1761a5['id']]['updateRealtime']();return _0x4f96bc({'code':0xc8,'message':_0x26951a[_0xf160('0x42')][_0x1761a5['id']]});}else{return _0x1a07ef(_0x3564c0[_0xf160('0x37')](0x1f4,_0xf160('0x4e')));}});},'Agents':function(_0xd13928){return new Promise(function(_0x40e5a1){var _0x51ba63=_['values'](_0x26951a[_0xf160('0x42')]);if(_0xd13928&&_0xd13928['id']){var _0x2353df=_[_0xf160('0x4f')](_0x51ba63,function(_0x3d8c6c){return _0x3d8c6c['id']===_0xd13928['id'];});_0x40e5a1(_0x2353df);}else{_0x40e5a1({'count':_0x51ba63[_0xf160('0x1b')],'rows':_0x51ba63});}});},'ChatQueues':function(){return new Promise(function(_0x2d4591){var _0x4c151f=[];for(var _0x25f79e in _0x26951a[_0xf160('0x50')]){if(_0x26951a[_0xf160('0x50')][_0xf160('0x4b')](_0x25f79e)){var _0x18313b=_0x26951a[_0xf160('0x50')][_0x25f79e];var _0x2ad82e={'id':_0x18313b['id'],'available':_0x18313b[_0xf160('0x51')],'loggedIn':_0x18313b['loggedIn'],'name':_0x18313b[_0xf160('0x52')],'paused':_0x18313b['paused'],'waiting':_0x18313b[_0xf160('0x53')]};_0x4c151f[_0xf160('0x22')](_0x2ad82e);}}_0x2d4591({'count':_0x4c151f[_0xf160('0x1b')],'rows':_0x4c151f});});},'MailQueues':function(){return new Promise(function(_0x3a715b){var _0x3680f3=[];for(var _0x3c2db5 in _0x26951a['mailQueues']){if(_0x26951a[_0xf160('0x54')][_0xf160('0x4b')](_0x3c2db5)){var _0x134fd9=_0x26951a['mailQueues'][_0x3c2db5];var _0x1fa959={'id':_0x134fd9['id'],'available':_0x134fd9[_0xf160('0x51')],'loggedIn':_0x134fd9['loggedIn'],'name':_0x134fd9[_0xf160('0x52')],'paused':_0x134fd9[_0xf160('0x55')],'waiting':_0x134fd9[_0xf160('0x53')]};_0x3680f3['push'](_0x1fa959);}}_0x3a715b({'count':_0x3680f3[_0xf160('0x1b')],'rows':_0x3680f3});});},'OpenchannelQueues':function(){return new Promise(function(_0x2fddc4){var _0x4265e1=[];for(var _0x4b9d21 in _0x26951a[_0xf160('0x56')]){if(_0x26951a[_0xf160('0x56')][_0xf160('0x4b')](_0x4b9d21)){var _0xd67a1d=_0x26951a[_0xf160('0x56')][_0x4b9d21];var _0x15a214={'id':_0xd67a1d['id'],'available':_0xd67a1d[_0xf160('0x51')],'loggedIn':_0xd67a1d['loggedIn'],'name':_0xd67a1d[_0xf160('0x52')],'paused':_0xd67a1d[_0xf160('0x55')],'waiting':_0xd67a1d[_0xf160('0x53')]};_0x4265e1['push'](_0x15a214);}}_0x2fddc4({'count':_0x4265e1[_0xf160('0x1b')],'rows':_0x4265e1});});},'SmsQueues':function(){return new Promise(function(_0x46e889){var _0x3d2365=[];for(var _0x1ea18e in _0x26951a[_0xf160('0x57')]){if(_0x26951a[_0xf160('0x57')][_0xf160('0x4b')](_0x1ea18e)){var _0x59b63c=_0x26951a['smsQueues'][_0x1ea18e];var _0x3b3e14={'id':_0x59b63c['id'],'available':_0x59b63c[_0xf160('0x51')],'loggedIn':_0x59b63c[_0xf160('0x58')],'name':_0x59b63c[_0xf160('0x52')],'paused':_0x59b63c[_0xf160('0x55')],'waiting':_0x59b63c[_0xf160('0x53')]};_0x3d2365[_0xf160('0x22')](_0x3b3e14);}}_0x46e889({'count':_0x3d2365['length'],'rows':_0x3d2365});});},'FaxQueues':function(){return new Promise(function(_0x471bb7){var _0x3a40ec=[];for(var _0x54e3fd in _0x26951a['faxQueues']){if(_0x26951a[_0xf160('0x59')][_0xf160('0x4b')](_0x54e3fd)){var _0x489a71=_0x26951a[_0xf160('0x59')][_0x54e3fd];var _0x77c2ab={'id':_0x489a71['id'],'available':_0x489a71['available'],'loggedIn':_0x489a71[_0xf160('0x58')],'name':_0x489a71['name'],'paused':_0x489a71[_0xf160('0x55')],'waiting':_0x489a71[_0xf160('0x53')]};_0x3a40ec[_0xf160('0x22')](_0x77c2ab);}}_0x471bb7({'count':_0x3a40ec[_0xf160('0x1b')],'rows':_0x3a40ec});});},'WhatsappQueues':function(){return new Promise(function(_0x59d8a7){var _0x17b8e3=[];for(var _0x2c5d3e in _0x26951a[_0xf160('0x5a')]){if(_0x26951a[_0xf160('0x5a')][_0xf160('0x4b')](_0x2c5d3e)){var _0x527bd6=_0x26951a[_0xf160('0x5a')][_0x2c5d3e];var _0x1f856f={'id':_0x527bd6['id'],'available':_0x527bd6[_0xf160('0x51')],'loggedIn':_0x527bd6[_0xf160('0x58')],'name':_0x527bd6[_0xf160('0x52')],'paused':_0x527bd6[_0xf160('0x55')],'waiting':_0x527bd6[_0xf160('0x53')]};_0x17b8e3[_0xf160('0x22')](_0x1f856f);}}_0x59d8a7({'count':_0x17b8e3[_0xf160('0x1b')],'rows':_0x17b8e3});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x223862){var _0x18794f=_['values'](_0x26951a[_0xf160('0x5b')]);_0x223862({'count':_0x18794f[_0xf160('0x1b')],'rows':_0x18794f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x474d45){var _0x138dd2=_[_0xf160('0x5c')](_0x26951a['mailQueuesWaitingInteractions']);_0x474d45({'count':_0x138dd2[_0xf160('0x1b')],'rows':_0x138dd2});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3526cd){var _0x14d94b=_[_0xf160('0x5c')](_0x26951a[_0xf160('0x5d')]);_0x3526cd({'count':_0x14d94b[_0xf160('0x1b')],'rows':_0x14d94b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x36c24d){var _0x392674=_[_0xf160('0x5c')](_0x26951a[_0xf160('0x5e')]);_0x36c24d({'count':_0x392674[_0xf160('0x1b')],'rows':_0x392674});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4efd88){var _0x185c93=_['values'](_0x26951a[_0xf160('0x5f')]);_0x4efd88({'count':_0x185c93[_0xf160('0x1b')],'rows':_0x185c93});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xd0006f){var _0xf29ffa=_[_0xf160('0x5c')](_0x26951a['whatsappQueuesWaitingInteractions']);_0xd0006f({'count':_0xf29ffa[_0xf160('0x1b')],'rows':_0xf29ffa});});}};var _0x38426d=jayson[_0xf160('0x60')](_0x31f7ae)[_0xf160('0x61')]();_0x38426d['on']('error',function(_0x517d8f){logger[_0xf160('0x37')](JSON['stringify'](_0x517d8f));return _0x3a4faa(_0x517d8f);});_0x38426d[_0xf160('0x12')](0x232c,'127.0.0.1',function(){console[_0xf160('0x62')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2bb6c7('RPC\x20listening\x20on\x20port:'+0x232c);});});};