68a04c40b67f2504ffabf79a84b06b2b483d09a3
[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 _0x4d1b=['TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','app','./interval','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','Applications\x20executed','stringify','emit','complete','format','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','name','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag'];(function(_0x15166d,_0x3f5651){var _0x26c65d=function(_0x3f3963){while(--_0x3f3963){_0x15166d['push'](_0x15166d['shift']());}};_0x26c65d(++_0x3f5651);}(_0x4d1b,0x102));var _0xb4d1=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0x4d1b[_0x32a884];return _0x242f9b;};'use strict';var _=require(_0xb4d1('0x0'));var util=require('util');var path=require(_0xb4d1('0x1'));var fs=require('fs');var jayson=require(_0xb4d1('0x2'));var BPromise=require(_0xb4d1('0x3'));var utils=require(_0xb4d1('0x4'));var sUtils=require('./applications/strategy/util');var logger=require(_0xb4d1('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xb4d1('0x6')),'mailQueueReport':require(_0xb4d1('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xb4d1('0x8')),'faxQueueReport':require(_0xb4d1('0x9')),'whatsappQueueReport':require(_0xb4d1('0xa'))};var RuleEngine=require(_0xb4d1('0xb'));function getId(_0x49437b,_0x1e09fb,_0x205fe1){return util['format'](_0xb4d1('0xc'),_0x49437b,_0x1e09fb||0x0,_0x205fe1||0x0);}function getIntervals(_0x23c12e,_0xf3010d){var _0xfc12a6=[];if(!_[_0xb4d1('0xd')](_0xf3010d[_0xb4d1('0xe')])&&!_['isNil'](_0x23c12e[_0xf3010d[_0xb4d1('0xe')]])&&!_[_0xb4d1('0xd')](_0x23c12e[_0xf3010d[_0xb4d1('0xe')]][_0xb4d1('0xf')])){_0xfc12a6=_[_0xb4d1('0x10')](_0x23c12e[_0xf3010d[_0xb4d1('0xe')]][_0xb4d1('0xf')],_0xb4d1('0x11'));}else if(!_[_0xb4d1('0xd')](_0xf3010d[_0xb4d1('0x11')])){_0xfc12a6=[_0xf3010d[_0xb4d1('0x11')]];}return _0xfc12a6;}exports[_0xb4d1('0x12')]=function(_0x3baccd){_0x3baccd[_0xb4d1('0x13')]={};return new BPromise(function(_0x37cb4c,_0x295264){var _0x3ba994={'Start':function(_0x36c711){var _0x2599fd=this;return new Promise(function(_0x433e6d,_0x4987d1){if(_0x36c711){try{var _0x513886=[];var _0x785af3=getId(_0x36c711[_0xb4d1('0x14')],_0x36c711['message']?_0x36c711[_0xb4d1('0x15')]['id']:0x0,_0x36c711[_0xb4d1('0x16')]?_0x36c711['interaction']['id']:0x0);var _0x388798=sUtils[_0xb4d1('0x17')](_0x3baccd,_0x36c711);if(_0x36c711[_0xb4d1('0x18')]||!_0x388798&&_0x36c711['applications']&&_['isArray'](_0x36c711[_0xb4d1('0x19')])&&_0x36c711['applications']['length']){for(var _0x459615=0x0;_0x459615<_0x36c711[_0xb4d1('0x19')][_0xb4d1('0x1a')];_0x459615+=0x1){var _0x136d10=_0x36c711['applications'][_0x459615];if(fs[_0xb4d1('0x1b')](path['join'](__dirname,'applications',_0x136d10['app']+'.js'))){var _0x41fa10=[];switch(_0x136d10['app'][_0xb4d1('0x1c')]()){case'autoreply':var _0x3fe374=_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');if(_0x36c711[_0xb4d1('0x14')]===_0xb4d1('0x1f')){_0x41fa10['push'](_0x3fe374[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x3fe374[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x3fe374[_0xb4d1('0x21')](0x2,_0x3fe374[_0xb4d1('0x1a')])[_0xb4d1('0x22')](','));}else{_0x41fa10['push'](_0x3fe374[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x3fe374[_0xb4d1('0x21')](0x1,_0x3fe374[_0xb4d1('0x1a')])[_0xb4d1('0x22')](','));}break;case _0xb4d1('0x23'):var _0x3721fb=_0x136d10['appdata']['split'](',');_0x41fa10[_0xb4d1('0x20')](_0x3721fb[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x3721fb[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x3721fb[_0xb4d1('0x21')](0x2,_0x3721fb['length'])[_0xb4d1('0x22')](','));break;case _0xb4d1('0x24'):var _0x307abe=_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');_0x41fa10[_0xb4d1('0x20')](_0x307abe[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x307abe[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x307abe[0x2]);_0x41fa10['push'](_0x307abe[0x3]);_0x41fa10[_0xb4d1('0x20')](_0x307abe[_0xb4d1('0x21')](0x4,_0x307abe[_0xb4d1('0x1a')])['join'](','));break;case _0xb4d1('0x25'):var _0x516dd7=_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x2]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x3]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[_0xb4d1('0x21')](0x4,_0x516dd7[_0xb4d1('0x1a')])[_0xb4d1('0x22')](','));break;case _0xb4d1('0x15'):_0x41fa10[_0xb4d1('0x20')](_0x136d10['appdata']);break;case _0xb4d1('0x26'):_0x41fa10[_0xb4d1('0x20')](_0x136d10[_0xb4d1('0x27')]);_0x41fa10[_0xb4d1('0x20')](_0x136d10[_0xb4d1('0x1d')]);break;case'tvox':var _0x2d90d3=utils[_0xb4d1('0x28')](_0x36c711['account'][_0xb4d1('0x29')],_0x36c711);var _0x32f321=_0x136d10[_0xb4d1('0x1d')]['split'](',');_0x41fa10['push'](_0x32f321[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x2]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x3]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x4]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x5]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x6]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x7]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x8]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x9]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0xa]);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x16')]['id']);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x15')]['id']);_0x41fa10['push'](_0x136d10[_0xb4d1('0x2a')]);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x16')][_0xb4d1('0x2b')]);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x2c')][_0xb4d1('0x2c')]);_0x41fa10[_0xb4d1('0x20')](_0x2d90d3);break;default:_0x41fa10=_[_0xb4d1('0xd')](_0x136d10[_0xb4d1('0x1d')])?[]:_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');}var _0x2fbaf1={'id':util['format']('%s:%s:%s',_0x785af3,_0x136d10['id'],_0x136d10[_0xb4d1('0x2d')]),'condition':require(_0xb4d1('0x2e'))[_0xb4d1('0x2f')](_0x785af3,getIntervals(_0x3baccd[_0xb4d1('0x30')],_0x136d10),_0x3baccd),'consequence':require(_0xb4d1('0x31')+_0x136d10['app'])['consequence'](_0x785af3,_0x41fa10,_0x3baccd,_0x36c711),'p':_0x136d10[_0xb4d1('0x32')]||0x0};logger[_0xb4d1('0x33')]('Push\x20new\x20rule',_0x2fbaf1['id'],_0xb4d1('0x34'),getIntervals(_0x3baccd[_0xb4d1('0x30')],_0x136d10)['join'](_0xb4d1('0x35')));_0x513886[_0xb4d1('0x20')](_0x2fbaf1);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0xb4d1('0x19'),_0x136d10[_0xb4d1('0x2d')]+'.js'));}}_0x3baccd[_0xb4d1('0x13')][_0x785af3]=new RuleEngine(_0x513886);_0x3baccd[_0xb4d1('0x13')][_0x785af3]['execute'](_0x36c711,function(_0x576f0a){logger[_0xb4d1('0x33')](_0xb4d1('0x36'),JSON[_0xb4d1('0x37')](_0x576f0a['matchPath']));if(_0x3baccd[_0xb4d1('0x13')][_0x785af3]){_0x3baccd[_0xb4d1('0x13')][_0x785af3][_0xb4d1('0x38')](_0xb4d1('0x39'));}});return _0x433e6d({'code':0xc8,'message':_0x36c711});}else{if(_0x388798){logger['info'](util[_0xb4d1('0x3a')](_0xb4d1('0x3b'),_0x785af3));}else{logger[_0xb4d1('0x33')](_0xb4d1('0x3c'));}return _0x433e6d({'code':0xc8,'message':_0x36c711});}}catch(_0x362b77){logger[_0xb4d1('0x3d')](_0x362b77[_0xb4d1('0x3e')]);return _0x4987d1(_0x2599fd[_0xb4d1('0x3d')](0x1f4,_0x362b77));}}return _0x4987d1(_0xb4d1('0x3f'));});},'AcceptMessage':function(_0x19e006){var _0x3f0dcf=this;return new Promise(function(_0x576902,_0x3eeea7){if(_0x19e006[_0xb4d1('0x40')]&&_0x19e006[_0xb4d1('0x40')]['id']){if(_0x3baccd[_0xb4d1('0x41')][_0x19e006[_0xb4d1('0x40')]['id']]){_0x3baccd['agents'][_0x19e006[_0xb4d1('0x40')]['id']][_0xb4d1('0x42')]=![];_0x3baccd[_0xb4d1('0x41')][_0x19e006[_0xb4d1('0x40')]['id']][_0xb4d1('0x43')]=undefined;}}if(_0x19e006[_0xb4d1('0x15')]&&_0x19e006[_0xb4d1('0x15')]['id']){try{var _0x57e935=getId(_0x19e006[_0xb4d1('0x14')],_0x19e006[_0xb4d1('0x15')]?_0x19e006[_0xb4d1('0x15')]['id']:0x0,_0x19e006['interaction']?_0x19e006[_0xb4d1('0x16')]['id']:0x0);if(_0x3baccd[_0xb4d1('0x13')][_0x57e935]){_0x3baccd[_0xb4d1('0x13')][_0x57e935][_0xb4d1('0x38')](_0xb4d1('0x44'));if(rpc[_0x19e006['channel']+_0xb4d1('0x45')]){rpc[_0x19e006[_0xb4d1('0x14')]+_0xb4d1('0x45')][_0xb4d1('0x46')](_0x57e935,{'UserId':_0x19e006[_0xb4d1('0x15')][_0xb4d1('0x47')]})[_0xb4d1('0x48')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x576902({'code':0xc8,'message':_0x19e006});}catch(_0x5e529a){logger[_0xb4d1('0x3d')](_0x5e529a[_0xb4d1('0x3e')]);return _0x3eeea7(_0x3f0dcf['error'](0x1f4,_0x5e529a));}}logger[_0xb4d1('0x3d')]('message\x20is\x20empty');return _0x3eeea7(_0x3f0dcf[_0xb4d1('0x3d')](0x1f4,_0xb4d1('0x49')));});},'RejectMessage':function(_0xcf7067){var _0x4254cc=this;return new Promise(function(_0x21ef5b,_0xa733df){if(_0xcf7067[_0xb4d1('0x40')]&&_0xcf7067['agent']['id']){try{if(_0x3baccd[_0xb4d1('0x41')][_0xcf7067[_0xb4d1('0x40')]['id']]){_0x3baccd[_0xb4d1('0x41')][_0xcf7067[_0xb4d1('0x40')]['id']]['busy']=![];_0x3baccd[_0xb4d1('0x41')][_0xcf7067[_0xb4d1('0x40')]['id']][_0xb4d1('0x43')]=undefined;}return _0x21ef5b({'code':0xc8,'message':_0xcf7067});}catch(_0x1a9b79){logger[_0xb4d1('0x3d')](_0x1a9b79['stack']);return _0xa733df(_0x4254cc[_0xb4d1('0x3d')](0x1f4,_0x1a9b79));}}logger[_0xb4d1('0x3d')](_0xb4d1('0x49'));return _0xa733df(_0x4254cc[_0xb4d1('0x3d')](0x1f4,_0xb4d1('0x49')));});},'AbandonInteraction':function(_0x446498){var _0x51fff9=this;return new Promise(function(_0x259667,_0xe788d8){if(_0x446498['channel']&&_0x446498[_0xb4d1('0x16')]&&_0x446498[_0xb4d1('0x16')]['id']){try{var _0x1898e9=getId(_0x446498[_0xb4d1('0x14')],_0x446498[_0xb4d1('0x15')]?_0x446498[_0xb4d1('0x15')]['id']:0x0,_0x446498[_0xb4d1('0x16')]?_0x446498[_0xb4d1('0x16')]['id']:0x0);if(_0x3baccd[_0xb4d1('0x13')][_0x1898e9]){_0x3baccd[_0xb4d1('0x13')][_0x1898e9][_0xb4d1('0x38')](_0xb4d1('0x44'));}return _0x259667({'code':0xc8,'message':_0x446498});}catch(_0x1e4f6e){logger[_0xb4d1('0x3d')](_0x1e4f6e[_0xb4d1('0x3e')]);return _0xe788d8(_0x51fff9[_0xb4d1('0x3d')](0x1f4,_0x1e4f6e));}}logger['error'](_0xb4d1('0x49'));return _0xe788d8(_0x51fff9[_0xb4d1('0x3d')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x46e9e1){var _0x34cfff=this;return new Promise(function(_0x18b9ab,_0x4ec3d6){if(_0x3baccd[_0xb4d1('0x41')]['hasOwnProperty'](_0x46e9e1['id'])){for(var _0x2c1166 in _0x46e9e1[_0xb4d1('0x4a')]){if(_0x46e9e1[_0xb4d1('0x4a')][_0xb4d1('0x4b')](_0x2c1166)){if(_0x3baccd[_0xb4d1('0x41')][_0x46e9e1['id']][_0xb4d1('0x4b')](_0x2c1166+_0xb4d1('0x4c'))){_0x3baccd[_0xb4d1('0x41')][_0x46e9e1['id']][_0x2c1166+_0xb4d1('0x4c')]=parseInt(_0x46e9e1[_0xb4d1('0x4a')][_0x2c1166],0xa);}}}_0x3baccd[_0xb4d1('0x41')][_0x46e9e1['id']]['updateRealtime']();return _0x18b9ab({'code':0xc8,'message':_0x3baccd['agents'][_0x46e9e1['id']]});}else{return _0x4ec3d6(_0x34cfff[_0xb4d1('0x3d')](0x1f4,_0xb4d1('0x4d')));}});},'Agents':function(_0x1da2cb){return new Promise(function(_0x465623){var _0x16fc0e=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x41')]);if(_0x1da2cb&&_0x1da2cb['id']){var _0x5733ca=_['find'](_0x16fc0e,function(_0x3211c6){return _0x3211c6['id']===_0x1da2cb['id'];});_0x465623(_0x5733ca);}else{_0x465623({'count':_0x16fc0e[_0xb4d1('0x1a')],'rows':_0x16fc0e});}});},'ChatQueues':function(){return new Promise(function(_0x2cd71c){var _0x11bea3=[];for(var _0x17d1fa in _0x3baccd[_0xb4d1('0x4f')]){if(_0x3baccd[_0xb4d1('0x4f')][_0xb4d1('0x4b')](_0x17d1fa)){var _0x4ce9d4=_0x3baccd[_0xb4d1('0x4f')][_0x17d1fa];var _0x54204={'id':_0x4ce9d4['id'],'available':_0x4ce9d4[_0xb4d1('0x50')],'loggedIn':_0x4ce9d4[_0xb4d1('0x51')],'name':_0x4ce9d4['name'],'paused':_0x4ce9d4[_0xb4d1('0x52')],'waiting':_0x4ce9d4[_0xb4d1('0x53')]};_0x11bea3[_0xb4d1('0x20')](_0x54204);}}_0x2cd71c({'count':_0x11bea3[_0xb4d1('0x1a')],'rows':_0x11bea3});});},'MailQueues':function(){return new Promise(function(_0x37244b){var _0x1db58c=[];for(var _0x25495e in _0x3baccd[_0xb4d1('0x54')]){if(_0x3baccd[_0xb4d1('0x54')][_0xb4d1('0x4b')](_0x25495e)){var _0x1303f5=_0x3baccd[_0xb4d1('0x54')][_0x25495e];var _0x38e0ee={'id':_0x1303f5['id'],'available':_0x1303f5[_0xb4d1('0x50')],'loggedIn':_0x1303f5[_0xb4d1('0x51')],'name':_0x1303f5['name'],'paused':_0x1303f5[_0xb4d1('0x52')],'waiting':_0x1303f5[_0xb4d1('0x53')]};_0x1db58c['push'](_0x38e0ee);}}_0x37244b({'count':_0x1db58c['length'],'rows':_0x1db58c});});},'OpenchannelQueues':function(){return new Promise(function(_0x5f4c77){var _0x74487e=[];for(var _0x2eccff in _0x3baccd[_0xb4d1('0x55')]){if(_0x3baccd[_0xb4d1('0x55')][_0xb4d1('0x4b')](_0x2eccff)){var _0x871af3=_0x3baccd['openchannelQueues'][_0x2eccff];var _0x3305a0={'id':_0x871af3['id'],'available':_0x871af3['available'],'loggedIn':_0x871af3[_0xb4d1('0x51')],'name':_0x871af3['name'],'paused':_0x871af3[_0xb4d1('0x52')],'waiting':_0x871af3[_0xb4d1('0x53')]};_0x74487e[_0xb4d1('0x20')](_0x3305a0);}}_0x5f4c77({'count':_0x74487e[_0xb4d1('0x1a')],'rows':_0x74487e});});},'SmsQueues':function(){return new Promise(function(_0x316d2f){var _0x5d9074=[];for(var _0x202fab in _0x3baccd['smsQueues']){if(_0x3baccd['smsQueues'][_0xb4d1('0x4b')](_0x202fab)){var _0x14bfbe=_0x3baccd['smsQueues'][_0x202fab];var _0x5bf701={'id':_0x14bfbe['id'],'available':_0x14bfbe['available'],'loggedIn':_0x14bfbe[_0xb4d1('0x51')],'name':_0x14bfbe[_0xb4d1('0x56')],'paused':_0x14bfbe['paused'],'waiting':_0x14bfbe[_0xb4d1('0x53')]};_0x5d9074['push'](_0x5bf701);}}_0x316d2f({'count':_0x5d9074[_0xb4d1('0x1a')],'rows':_0x5d9074});});},'FaxQueues':function(){return new Promise(function(_0x2031d2){var _0x1cd16b=[];for(var _0x31bee3 in _0x3baccd['faxQueues']){if(_0x3baccd[_0xb4d1('0x57')][_0xb4d1('0x4b')](_0x31bee3)){var _0x3900f8=_0x3baccd[_0xb4d1('0x57')][_0x31bee3];var _0x15871c={'id':_0x3900f8['id'],'available':_0x3900f8[_0xb4d1('0x50')],'loggedIn':_0x3900f8['loggedIn'],'name':_0x3900f8['name'],'paused':_0x3900f8['paused'],'waiting':_0x3900f8[_0xb4d1('0x53')]};_0x1cd16b[_0xb4d1('0x20')](_0x15871c);}}_0x2031d2({'count':_0x1cd16b[_0xb4d1('0x1a')],'rows':_0x1cd16b});});},'WhatsappQueues':function(){return new Promise(function(_0x398f6f){var _0x10078e=[];for(var _0x5edbf2 in _0x3baccd[_0xb4d1('0x58')]){if(_0x3baccd[_0xb4d1('0x58')][_0xb4d1('0x4b')](_0x5edbf2)){var _0x58c4aa=_0x3baccd[_0xb4d1('0x58')][_0x5edbf2];var _0xe45d7f={'id':_0x58c4aa['id'],'available':_0x58c4aa['available'],'loggedIn':_0x58c4aa[_0xb4d1('0x51')],'name':_0x58c4aa[_0xb4d1('0x56')],'paused':_0x58c4aa[_0xb4d1('0x52')],'waiting':_0x58c4aa[_0xb4d1('0x53')]};_0x10078e[_0xb4d1('0x20')](_0xe45d7f);}}_0x398f6f({'count':_0x10078e['length'],'rows':_0x10078e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x15285a){var _0xa35671=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x59')]);_0x15285a({'count':_0xa35671['length'],'rows':_0xa35671});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1db69a){var _0x2b41d9=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x5a')]);_0x1db69a({'count':_0x2b41d9[_0xb4d1('0x1a')],'rows':_0x2b41d9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4fc3db){var _0x263e22=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x5b')]);_0x4fc3db({'count':_0x263e22['length'],'rows':_0x263e22});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2cd804){var _0x358dae=_['values'](_0x3baccd[_0xb4d1('0x5c')]);_0x2cd804({'count':_0x358dae[_0xb4d1('0x1a')],'rows':_0x358dae});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4adc46){var _0x567962=_['values'](_0x3baccd[_0xb4d1('0x5d')]);_0x4adc46({'count':_0x567962['length'],'rows':_0x567962});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1d3435){var _0x29d8dc=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x5e')]);_0x1d3435({'count':_0x29d8dc[_0xb4d1('0x1a')],'rows':_0x29d8dc});});}};var _0x5569e7=jayson['server'](_0x3ba994)[_0xb4d1('0x5f')]();_0x5569e7['on'](_0xb4d1('0x3d'),function(_0x355509){logger[_0xb4d1('0x3d')](JSON[_0xb4d1('0x37')](_0x355509));return _0x295264(_0x355509);});_0x5569e7['listen'](0x232c,_0xb4d1('0x60'),function(){console['log'](_0xb4d1('0x61'),0x232c);return _0x37cb4c(_0xb4d1('0x62')+0x232c);});});};