Built motion from commit 616d3211.|2.6.4
[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 _0xbf6e=['complete','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','map','interval','listen','channel','message','interaction','applications','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','intervals','./applications/','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','matchPath','emit'];(function(_0x398196,_0x3f5fc9){var _0x4275db=function(_0x5d7483){while(--_0x5d7483){_0x398196['push'](_0x398196['shift']());}};_0x4275db(++_0x3f5fc9);}(_0xbf6e,0x149));var _0xebf6=function(_0x555ef8,_0x43e041){_0x555ef8=_0x555ef8-0x0;var _0x38cc30=_0xbf6e[_0x555ef8];return _0x38cc30;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0xebf6('0x0'));var fs=require('fs');var jayson=require(_0xebf6('0x1'));var BPromise=require(_0xebf6('0x2'));var uuid=require(_0xebf6('0x3'));var utils=require(_0xebf6('0x4'));var config=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0xebf6('0x7')),'mailQueueReport':require(_0xebf6('0x8')),'chatQueueReport':require(_0xebf6('0x9')),'smsQueueReport':require(_0xebf6('0xa')),'faxQueueReport':require(_0xebf6('0xb')),'whatsappQueueReport':require(_0xebf6('0xc'))};var RuleEngine=require(_0xebf6('0xd'));function getId(_0x548e9e,_0x1d8035,_0x40b28a){return util[_0xebf6('0xe')]('%s.%s.%s',_0x548e9e,_0x1d8035||0x0,_0x40b28a||0x0);}function getIntervals(_0x38cee4,_0x14f41e){var _0x5c6727=[];if(!_[_0xebf6('0xf')](_0x14f41e[_0xebf6('0x10')])&&!_[_0xebf6('0xf')](_0x38cee4[_0x14f41e[_0xebf6('0x10')]])&&!_[_0xebf6('0xf')](_0x38cee4[_0x14f41e[_0xebf6('0x10')]]['Intervals'])){_0x5c6727=_[_0xebf6('0x11')](_0x38cee4[_0x14f41e[_0xebf6('0x10')]]['Intervals'],_0xebf6('0x12'));}else if(!_[_0xebf6('0xf')](_0x14f41e[_0xebf6('0x12')])){_0x5c6727=[_0x14f41e[_0xebf6('0x12')]];}return _0x5c6727;}exports[_0xebf6('0x13')]=function(_0x4dbf51){_0x4dbf51['rules']={};return new BPromise(function(_0x56b8f8,_0x4cecbc){var _0x1ae2f7={'Start':function(_0x50d80f){var _0x35570e=this;return new Promise(function(_0x2c980f,_0xb164a1){if(_0x50d80f){try{var _0x642167=[];var _0x3100ee=getId(_0x50d80f[_0xebf6('0x14')],_0x50d80f[_0xebf6('0x15')]?_0x50d80f[_0xebf6('0x15')]['id']:0x0,_0x50d80f[_0xebf6('0x16')]?_0x50d80f[_0xebf6('0x16')]['id']:0x0);if(_0x50d80f['applications']&&_['isArray'](_0x50d80f[_0xebf6('0x17')])&&_0x50d80f[_0xebf6('0x17')][_0xebf6('0x18')]){for(var _0x410f06=0x0;_0x410f06<_0x50d80f[_0xebf6('0x17')][_0xebf6('0x18')];_0x410f06+=0x1){var _0x35f739=_0x50d80f[_0xebf6('0x17')][_0x410f06];if(fs['existsSync'](path[_0xebf6('0x19')](__dirname,_0xebf6('0x17'),_0x35f739[_0xebf6('0x1a')]+_0xebf6('0x1b')))){var _0x6303ac=[];switch(_0x35f739[_0xebf6('0x1a')][_0xebf6('0x1c')]()){case _0xebf6('0x1d'):var _0x244975=_0x35f739[_0xebf6('0x1e')][_0xebf6('0x1f')](',');if(_0x50d80f[_0xebf6('0x14')]===_0xebf6('0x20')){_0x6303ac[_0xebf6('0x21')](_0x244975[0x0]);_0x6303ac[_0xebf6('0x21')](_0x244975[0x1]);_0x6303ac[_0xebf6('0x21')](_0x244975[_0xebf6('0x22')](0x2,_0x244975[_0xebf6('0x18')])[_0xebf6('0x19')](','));}else{_0x6303ac['push'](_0x244975[0x0]);_0x6303ac['push'](_0x244975[_0xebf6('0x22')](0x1,_0x244975['length'])[_0xebf6('0x19')](','));}break;case _0xebf6('0x23'):var _0x5a01ea=_0x35f739['appdata'][_0xebf6('0x1f')](',');_0x6303ac[_0xebf6('0x21')](_0x5a01ea[0x0]);_0x6303ac[_0xebf6('0x21')](_0x5a01ea[0x1]);_0x6303ac[_0xebf6('0x21')](_0x5a01ea[_0xebf6('0x22')](0x2,_0x5a01ea[_0xebf6('0x18')])[_0xebf6('0x19')](','));break;case _0xebf6('0x24'):var _0x4c3495=_0x35f739[_0xebf6('0x1e')][_0xebf6('0x1f')](',');_0x6303ac['push'](_0x4c3495[0x0]);_0x6303ac[_0xebf6('0x21')](_0x4c3495[0x1]);_0x6303ac[_0xebf6('0x21')](_0x4c3495[0x2]);_0x6303ac['push'](_0x4c3495[0x3]);_0x6303ac[_0xebf6('0x21')](_0x4c3495[_0xebf6('0x22')](0x4,_0x4c3495[_0xebf6('0x18')])[_0xebf6('0x19')](','));break;case _0xebf6('0x25'):var _0x41da63=_0x35f739['appdata'][_0xebf6('0x1f')](',');_0x6303ac[_0xebf6('0x21')](_0x41da63[0x0]);_0x6303ac['push'](_0x41da63[0x1]);_0x6303ac['push'](_0x41da63[0x2]);_0x6303ac[_0xebf6('0x21')](_0x41da63[0x3]);_0x6303ac[_0xebf6('0x21')](_0x41da63['slice'](0x4,_0x41da63[_0xebf6('0x18')])[_0xebf6('0x19')](','));break;case'message':_0x6303ac[_0xebf6('0x21')](_0x35f739[_0xebf6('0x1e')]);break;case _0xebf6('0x26'):_0x6303ac['push'](_0x35f739[_0xebf6('0x27')]);_0x6303ac[_0xebf6('0x21')](_0x35f739[_0xebf6('0x1e')]);break;case _0xebf6('0x28'):var _0x4b6d95=utils['getMustacheRender'](_0x50d80f[_0xebf6('0x29')][_0xebf6('0x2a')],_0x50d80f);var _0x562f76=_0x35f739[_0xebf6('0x1e')][_0xebf6('0x1f')](',');_0x6303ac['push'](_0x562f76[0x0]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x1]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x2]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x3]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x4]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x5]);_0x6303ac['push'](_0x562f76[0x6]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x7]);_0x6303ac['push'](_0x562f76[0x8]);_0x6303ac[_0xebf6('0x21')](_0x562f76[0x9]);_0x6303ac['push'](_0x562f76[0xa]);_0x6303ac[_0xebf6('0x21')](_0x50d80f[_0xebf6('0x16')]['id']);_0x6303ac[_0xebf6('0x21')](_0x50d80f[_0xebf6('0x15')]['id']);_0x6303ac[_0xebf6('0x21')](_0x35f739[_0xebf6('0x2b')]);_0x6303ac['push'](_0x50d80f[_0xebf6('0x16')][_0xebf6('0x2c')]);_0x6303ac[_0xebf6('0x21')](_0x50d80f[_0xebf6('0x2d')][_0xebf6('0x2d')]);_0x6303ac[_0xebf6('0x21')](_0x4b6d95);break;default:_0x6303ac=_['isNil'](_0x35f739[_0xebf6('0x1e')])?[]:_0x35f739[_0xebf6('0x1e')][_0xebf6('0x1f')](',');}var _0x111ff7={'id':util[_0xebf6('0xe')](_0xebf6('0x2e'),_0x3100ee,_0x35f739['id'],_0x35f739['app']),'condition':require('./interval')['condition'](_0x3100ee,getIntervals(_0x4dbf51[_0xebf6('0x2f')],_0x35f739),_0x4dbf51),'consequence':require(_0xebf6('0x30')+_0x35f739[_0xebf6('0x1a')])['consequence'](_0x3100ee,_0x6303ac,_0x4dbf51,_0x50d80f),'p':_0x35f739[_0xebf6('0x31')]||0x0};logger[_0xebf6('0x32')](_0xebf6('0x33'),_0x111ff7['id'],'on\x20interval',getIntervals(_0x4dbf51[_0xebf6('0x2f')],_0x35f739)[_0xebf6('0x19')]('\x20|\x20'));_0x642167[_0xebf6('0x21')](_0x111ff7);}else{logger[_0xebf6('0x34')](_0xebf6('0x35'),path['join'](__dirname,_0xebf6('0x17'),_0x35f739['app']+'.js'));}}_0x4dbf51[_0xebf6('0x36')][_0x3100ee]=new RuleEngine(_0x642167);_0x4dbf51[_0xebf6('0x36')][_0x3100ee][_0xebf6('0x37')](_0x50d80f,function(_0x2ac140){logger['info'](_0xebf6('0x38'),JSON['stringify'](_0x2ac140[_0xebf6('0x39')]));if(_0x4dbf51[_0xebf6('0x36')][_0x3100ee]){_0x4dbf51[_0xebf6('0x36')][_0x3100ee][_0xebf6('0x3a')](_0xebf6('0x3b'));}});return _0x2c980f({'code':0xc8,'message':_0x50d80f});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x2c980f({'code':0xc8,'message':_0x50d80f});}}catch(_0xcee5ee){logger[_0xebf6('0x34')](_0xcee5ee[_0xebf6('0x3c')]);return _0xb164a1(_0x35570e[_0xebf6('0x34')](0x1f4,_0xcee5ee));}}return _0xb164a1('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2ccd4f){var _0x21999e=this;return new Promise(function(_0x41c4ce,_0x3b74bb){if(_0x2ccd4f[_0xebf6('0x3d')]&&_0x2ccd4f[_0xebf6('0x3d')]['id']){if(_0x4dbf51[_0xebf6('0x3e')][_0x2ccd4f['agent']['id']]){_0x4dbf51[_0xebf6('0x3e')][_0x2ccd4f[_0xebf6('0x3d')]['id']][_0xebf6('0x3f')]=![];_0x4dbf51[_0xebf6('0x3e')][_0x2ccd4f[_0xebf6('0x3d')]['id']][_0xebf6('0x40')]=undefined;}}if(_0x2ccd4f[_0xebf6('0x15')]&&_0x2ccd4f['message']['id']){try{var _0x24e368=getId(_0x2ccd4f['channel'],_0x2ccd4f[_0xebf6('0x15')]?_0x2ccd4f[_0xebf6('0x15')]['id']:0x0,_0x2ccd4f['interaction']?_0x2ccd4f[_0xebf6('0x16')]['id']:0x0);if(_0x4dbf51['rules'][_0x24e368]){_0x4dbf51[_0xebf6('0x36')][_0x24e368][_0xebf6('0x3a')](_0xebf6('0x41'));if(rpc[_0x2ccd4f[_0xebf6('0x14')]+_0xebf6('0x42')]){rpc[_0x2ccd4f['channel']+_0xebf6('0x42')][_0xebf6('0x43')](_0x24e368,{'UserId':_0x2ccd4f['message'][_0xebf6('0x44')]})[_0xebf6('0x45')](function(_0x1455c4){logger[_0xebf6('0x34')](_0xebf6('0x46'));});}}return _0x41c4ce({'code':0xc8,'message':_0x2ccd4f});}catch(_0x549892){logger[_0xebf6('0x34')](_0x549892[_0xebf6('0x3c')]);return _0x3b74bb(_0x21999e[_0xebf6('0x34')](0x1f4,_0x549892));}}logger[_0xebf6('0x34')]('message\x20is\x20empty');return _0x3b74bb(_0x21999e[_0xebf6('0x34')](0x1f4,_0xebf6('0x47')));});},'RejectMessage':function(_0xe346da){var _0x303997=this;return new Promise(function(_0x16abac,_0x2e7e30){if(_0xe346da[_0xebf6('0x3d')]&&_0xe346da[_0xebf6('0x3d')]['id']){try{if(_0x4dbf51[_0xebf6('0x3e')][_0xe346da['agent']['id']]){_0x4dbf51[_0xebf6('0x3e')][_0xe346da[_0xebf6('0x3d')]['id']][_0xebf6('0x3f')]=![];_0x4dbf51['agents'][_0xe346da[_0xebf6('0x3d')]['id']]['busyQueue']=undefined;}return _0x16abac({'code':0xc8,'message':_0xe346da});}catch(_0x5c11d8){logger[_0xebf6('0x34')](_0x5c11d8[_0xebf6('0x3c')]);return _0x2e7e30(_0x303997[_0xebf6('0x34')](0x1f4,_0x5c11d8));}}logger[_0xebf6('0x34')](_0xebf6('0x47'));return _0x2e7e30(_0x303997['error'](0x1f4,_0xebf6('0x47')));});},'AbandonInteraction':function(_0x5a1b51){var _0x4ed306=this;return new Promise(function(_0x4ef686,_0x34034d){if(_0x5a1b51[_0xebf6('0x14')]&&_0x5a1b51['interaction']&&_0x5a1b51[_0xebf6('0x16')]['id']){try{var _0x151476=getId(_0x5a1b51[_0xebf6('0x14')],_0x5a1b51[_0xebf6('0x15')]?_0x5a1b51[_0xebf6('0x15')]['id']:0x0,_0x5a1b51[_0xebf6('0x16')]?_0x5a1b51[_0xebf6('0x16')]['id']:0x0);if(_0x4dbf51['rules'][_0x151476]){_0x4dbf51[_0xebf6('0x36')][_0x151476][_0xebf6('0x3a')](_0xebf6('0x41'));}return _0x4ef686({'code':0xc8,'message':_0x5a1b51});}catch(_0x3101c2){logger[_0xebf6('0x34')](_0x3101c2[_0xebf6('0x3c')]);return _0x34034d(_0x4ed306['error'](0x1f4,_0x3101c2));}}logger[_0xebf6('0x34')](_0xebf6('0x47'));return _0x34034d(_0x4ed306[_0xebf6('0x34')](0x1f4,_0xebf6('0x47')));});},'AgentCapacity':function(_0x710084){var _0x317b5c=this;return new Promise(function(_0x5a6898,_0x33c973){if(_0x4dbf51[_0xebf6('0x3e')][_0xebf6('0x48')](_0x710084['id'])){for(var _0x2f661f in _0x710084[_0xebf6('0x49')]){if(_0x710084['capacity'][_0xebf6('0x48')](_0x2f661f)){if(_0x4dbf51[_0xebf6('0x3e')][_0x710084['id']][_0xebf6('0x48')](_0x2f661f+_0xebf6('0x4a'))){_0x4dbf51[_0xebf6('0x3e')][_0x710084['id']][_0x2f661f+_0xebf6('0x4a')]=parseInt(_0x710084[_0xebf6('0x49')][_0x2f661f],0xa);}}}_0x4dbf51[_0xebf6('0x3e')][_0x710084['id']][_0xebf6('0x4b')]();return _0x5a6898({'code':0xc8,'message':_0x4dbf51[_0xebf6('0x3e')][_0x710084['id']]});}else{return _0x33c973(_0x317b5c[_0xebf6('0x34')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x19a64d){return new Promise(function(_0x165fb9,_0x44b3a2){var _0x2c8db5=_[_0xebf6('0x4c')](_0x4dbf51[_0xebf6('0x3e')]);_0x165fb9({'count':_0x2c8db5['length'],'rows':_0x2c8db5});});},'ChatQueues':function(_0x10df09){return new Promise(function(_0x4b4179,_0x33dc96){var _0x34fa02=[];for(var _0x10272b in _0x4dbf51[_0xebf6('0x4d')]){if(_0x4dbf51[_0xebf6('0x4d')][_0xebf6('0x48')](_0x10272b)){var _0x398074=_0x4dbf51['chatQueues'][_0x10272b];var _0x4ddbbd={'id':_0x398074['id'],'available':_0x398074[_0xebf6('0x4e')],'loggedIn':_0x398074[_0xebf6('0x4f')],'name':_0x398074['name'],'paused':_0x398074[_0xebf6('0x50')],'waiting':_0x398074[_0xebf6('0x51')]};_0x34fa02['push'](_0x4ddbbd);}}_0x4b4179({'count':_0x34fa02[_0xebf6('0x18')],'rows':_0x34fa02});});},'MailQueues':function(_0x11812d){return new Promise(function(_0x5c8b29,_0x35a5c4){var _0x9c1801=[];for(var _0x3795b7 in _0x4dbf51[_0xebf6('0x52')]){if(_0x4dbf51[_0xebf6('0x52')][_0xebf6('0x48')](_0x3795b7)){var _0x2c7039=_0x4dbf51['mailQueues'][_0x3795b7];var _0x198298={'id':_0x2c7039['id'],'available':_0x2c7039[_0xebf6('0x4e')],'loggedIn':_0x2c7039[_0xebf6('0x4f')],'name':_0x2c7039[_0xebf6('0x53')],'paused':_0x2c7039[_0xebf6('0x50')],'waiting':_0x2c7039[_0xebf6('0x51')]};_0x9c1801[_0xebf6('0x21')](_0x198298);}}_0x5c8b29({'count':_0x9c1801[_0xebf6('0x18')],'rows':_0x9c1801});});},'OpenchannelQueues':function(_0x3bc43){return new Promise(function(_0x4c152d,_0x4e55ed){var _0x5045a1=[];for(var _0x1d2c92 in _0x4dbf51[_0xebf6('0x54')]){if(_0x4dbf51[_0xebf6('0x54')][_0xebf6('0x48')](_0x1d2c92)){var _0x4f10c8=_0x4dbf51[_0xebf6('0x54')][_0x1d2c92];var _0x1bc736={'id':_0x4f10c8['id'],'available':_0x4f10c8[_0xebf6('0x4e')],'loggedIn':_0x4f10c8[_0xebf6('0x4f')],'name':_0x4f10c8['name'],'paused':_0x4f10c8['paused'],'waiting':_0x4f10c8['waiting']};_0x5045a1[_0xebf6('0x21')](_0x1bc736);}}_0x4c152d({'count':_0x5045a1[_0xebf6('0x18')],'rows':_0x5045a1});});},'SmsQueues':function(_0x2b9b2b){return new Promise(function(_0xe56120,_0x119b15){var _0x7c0cc1=[];for(var _0x411f07 in _0x4dbf51[_0xebf6('0x55')]){if(_0x4dbf51['smsQueues'][_0xebf6('0x48')](_0x411f07)){var _0x285678=_0x4dbf51['smsQueues'][_0x411f07];var _0x5df93a={'id':_0x285678['id'],'available':_0x285678[_0xebf6('0x4e')],'loggedIn':_0x285678['loggedIn'],'name':_0x285678[_0xebf6('0x53')],'paused':_0x285678[_0xebf6('0x50')],'waiting':_0x285678[_0xebf6('0x51')]};_0x7c0cc1['push'](_0x5df93a);}}_0xe56120({'count':_0x7c0cc1[_0xebf6('0x18')],'rows':_0x7c0cc1});});},'FaxQueues':function(_0x19124d){return new Promise(function(_0x3bd659,_0xbadd1e){var _0x437bb8=[];for(var _0x3f912a in _0x4dbf51['faxQueues']){if(_0x4dbf51[_0xebf6('0x56')][_0xebf6('0x48')](_0x3f912a)){var _0x501f57=_0x4dbf51[_0xebf6('0x56')][_0x3f912a];var _0x1f3606={'id':_0x501f57['id'],'available':_0x501f57[_0xebf6('0x4e')],'loggedIn':_0x501f57['loggedIn'],'name':_0x501f57[_0xebf6('0x53')],'paused':_0x501f57[_0xebf6('0x50')],'waiting':_0x501f57['waiting']};_0x437bb8[_0xebf6('0x21')](_0x1f3606);}}_0x3bd659({'count':_0x437bb8[_0xebf6('0x18')],'rows':_0x437bb8});});},'WhatsappQueues':function(_0x41efb9){return new Promise(function(_0x32e747,_0xdca640){var _0x38c409=[];for(var _0x215d81 in _0x4dbf51[_0xebf6('0x57')]){if(_0x4dbf51[_0xebf6('0x57')][_0xebf6('0x48')](_0x215d81)){var _0x1b316e=_0x4dbf51[_0xebf6('0x57')][_0x215d81];var _0x845d0d={'id':_0x1b316e['id'],'available':_0x1b316e['available'],'loggedIn':_0x1b316e[_0xebf6('0x4f')],'name':_0x1b316e[_0xebf6('0x53')],'paused':_0x1b316e[_0xebf6('0x50')],'waiting':_0x1b316e[_0xebf6('0x51')]};_0x38c409[_0xebf6('0x21')](_0x845d0d);}}_0x32e747({'count':_0x38c409[_0xebf6('0x18')],'rows':_0x38c409});});},'ChatQueuesWaitingInteractions':function(_0x29232c){return new Promise(function(_0x3a1a88,_0x458239){var _0x16312a=_['values'](_0x4dbf51['chatQueuesWaitingInteractions']);_0x3a1a88({'count':_0x16312a[_0xebf6('0x18')],'rows':_0x16312a});});},'MailQueuesWaitingInteractions':function(_0x4929bc){return new Promise(function(_0xeebe81,_0x288e38){var _0x390cbe=_[_0xebf6('0x4c')](_0x4dbf51[_0xebf6('0x58')]);_0xeebe81({'count':_0x390cbe['length'],'rows':_0x390cbe});});},'OpenchannelQueuesWaitingInteractions':function(_0x43a6d9){return new Promise(function(_0x3441b7,_0x5251ce){var _0x18f9fd=_[_0xebf6('0x4c')](_0x4dbf51[_0xebf6('0x59')]);_0x3441b7({'count':_0x18f9fd[_0xebf6('0x18')],'rows':_0x18f9fd});});},'SmsQueuesWaitingInteractions':function(_0x4066ad){return new Promise(function(_0x53a07d,_0x4f4352){var _0x1b245d=_[_0xebf6('0x4c')](_0x4dbf51[_0xebf6('0x5a')]);_0x53a07d({'count':_0x1b245d[_0xebf6('0x18')],'rows':_0x1b245d});});},'FaxQueuesWaitingInteractions':function(_0x379295){return new Promise(function(_0x27f070,_0x24bb85){var _0x49ccfe=_['values'](_0x4dbf51[_0xebf6('0x5b')]);_0x27f070({'count':_0x49ccfe['length'],'rows':_0x49ccfe});});},'WhatsappQueuesWaitingInteractions':function(_0xe2b576){return new Promise(function(_0x8d3243,_0x111e49){var _0x5c68df=_[_0xebf6('0x4c')](_0x4dbf51['whatsappQueuesWaitingInteractions']);_0x8d3243({'count':_0x5c68df[_0xebf6('0x18')],'rows':_0x5c68df});});}};var _0x3b66ca=jayson[_0xebf6('0x5c')](_0x1ae2f7)[_0xebf6('0x5d')]();_0x3b66ca['on'](_0xebf6('0x34'),function(_0x539988){logger[_0xebf6('0x34')](JSON['stringify'](_0x539988));return _0x4cecbc(_0x539988);});_0x3b66ca[_0xebf6('0x13')](0x232c,_0xebf6('0x5e'),function(){console[_0xebf6('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x56b8f8(_0xebf6('0x60')+0x232c);});});};