Built motion from commit e1760111.|2.6.18
[motion2.git] / server / services / routing / server / index.js
index 2cde6d3..33fe56f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc78=['complete','format','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','name','waiting','mailQueues','available','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ContactId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','rules','execute','Applications\x20executed','matchPath','emit'];(function(_0x227b09,_0x3d432b){var _0x5493cc=function(_0x48f650){while(--_0x48f650){_0x227b09['push'](_0x227b09['shift']());}};_0x5493cc(++_0x3d432b);}(_0xdc78,0x89));var _0x8dc7=function(_0x3eceb2,_0x509ff8){_0x3eceb2=_0x3eceb2-0x0;var _0x818bc4=_0xdc78[_0x3eceb2];return _0x818bc4;};'use strict';var _=require(_0x8dc7('0x0'));var util=require(_0x8dc7('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x8dc7('0x2'));var BPromise=require(_0x8dc7('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x8dc7('0x4'));var logger=require('../../../config/logger')(_0x8dc7('0x5'));var rpc={'openchannelQueueReport':require(_0x8dc7('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x8dc7('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x8dc7('0x8')),'whatsappQueueReport':require(_0x8dc7('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3777e2,_0x35a25b,_0x5ab48d){return util['format']('%s.%s.%s',_0x3777e2,_0x35a25b||0x0,_0x5ab48d||0x0);}function getIntervals(_0x2f4e12,_0x4ab9db){var _0x44120c=[];if(!_[_0x8dc7('0xa')](_0x4ab9db[_0x8dc7('0xb')])&&!_[_0x8dc7('0xa')](_0x2f4e12[_0x4ab9db[_0x8dc7('0xb')]])&&!_[_0x8dc7('0xa')](_0x2f4e12[_0x4ab9db[_0x8dc7('0xb')]][_0x8dc7('0xc')])){_0x44120c=_[_0x8dc7('0xd')](_0x2f4e12[_0x4ab9db['IntervalId']][_0x8dc7('0xc')],'interval');}else if(!_[_0x8dc7('0xa')](_0x4ab9db[_0x8dc7('0xe')])){_0x44120c=[_0x4ab9db[_0x8dc7('0xe')]];}return _0x44120c;}exports[_0x8dc7('0xf')]=function(_0xa1aa68){_0xa1aa68['rules']={};return new BPromise(function(_0x5ebb72,_0x49a93f){var _0x3aaa3e={'Start':function(_0x5d5598){var _0x4b7f6a=this;return new Promise(function(_0x17b448,_0x25cc06){if(_0x5d5598){try{var _0x5d331c=[];var _0x113b29=getId(_0x5d5598[_0x8dc7('0x10')],_0x5d5598[_0x8dc7('0x11')]?_0x5d5598[_0x8dc7('0x11')]['id']:0x0,_0x5d5598[_0x8dc7('0x12')]?_0x5d5598[_0x8dc7('0x12')]['id']:0x0);var _0x5d3d97=sUtils[_0x8dc7('0x13')](_0xa1aa68,_0x5d5598);if(!_0x5d3d97&&_0x5d5598['applications']&&_[_0x8dc7('0x14')](_0x5d5598[_0x8dc7('0x15')])&&_0x5d5598[_0x8dc7('0x15')][_0x8dc7('0x16')]){for(var _0x229f39=0x0;_0x229f39<_0x5d5598['applications'][_0x8dc7('0x16')];_0x229f39+=0x1){var _0x267ab0=_0x5d5598[_0x8dc7('0x15')][_0x229f39];if(fs['existsSync'](path[_0x8dc7('0x17')](__dirname,_0x8dc7('0x15'),_0x267ab0[_0x8dc7('0x18')]+_0x8dc7('0x19')))){var _0x52f202=[];switch(_0x267ab0[_0x8dc7('0x18')][_0x8dc7('0x1a')]()){case'autoreply':var _0x36e3e3=_0x267ab0[_0x8dc7('0x1b')][_0x8dc7('0x1c')](',');if(_0x5d5598[_0x8dc7('0x10')]==='mail'){_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[_0x8dc7('0x1e')](0x2,_0x36e3e3[_0x8dc7('0x16')])[_0x8dc7('0x17')](','));}else{_0x52f202['push'](_0x36e3e3[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x36e3e3[_0x8dc7('0x1e')](0x1,_0x36e3e3[_0x8dc7('0x16')])[_0x8dc7('0x17')](','));}break;case _0x8dc7('0x1f'):var _0x2be07e=_0x267ab0[_0x8dc7('0x1b')]['split'](',');_0x52f202['push'](_0x2be07e[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x2be07e[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x2be07e[_0x8dc7('0x1e')](0x2,_0x2be07e[_0x8dc7('0x16')])[_0x8dc7('0x17')](','));break;case _0x8dc7('0x20'):var _0x48418c=_0x267ab0['appdata'][_0x8dc7('0x1c')](',');_0x52f202[_0x8dc7('0x1d')](_0x48418c[0x0]);_0x52f202[_0x8dc7('0x1d')](_0x48418c[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x48418c[0x2]);_0x52f202['push'](_0x48418c[0x3]);_0x52f202['push'](_0x48418c[_0x8dc7('0x1e')](0x4,_0x48418c[_0x8dc7('0x16')])['join'](','));break;case _0x8dc7('0x21'):var _0x3e8884=_0x267ab0[_0x8dc7('0x1b')][_0x8dc7('0x1c')](',');_0x52f202[_0x8dc7('0x1d')](_0x3e8884[0x0]);_0x52f202['push'](_0x3e8884[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x3e8884[0x2]);_0x52f202[_0x8dc7('0x1d')](_0x3e8884[0x3]);_0x52f202['push'](_0x3e8884[_0x8dc7('0x1e')](0x4,_0x3e8884['length'])[_0x8dc7('0x17')](','));break;case _0x8dc7('0x11'):_0x52f202[_0x8dc7('0x1d')](_0x267ab0['appdata']);break;case _0x8dc7('0x22'):_0x52f202[_0x8dc7('0x1d')](_0x267ab0[_0x8dc7('0x23')]);_0x52f202[_0x8dc7('0x1d')](_0x267ab0[_0x8dc7('0x1b')]);break;case _0x8dc7('0x24'):var _0x5674ef=utils[_0x8dc7('0x25')](_0x5d5598[_0x8dc7('0x26')]['notificationTemplate'],_0x5d5598);var _0x16d950=_0x267ab0['appdata'][_0x8dc7('0x1c')](',');_0x52f202['push'](_0x16d950[0x0]);_0x52f202['push'](_0x16d950[0x1]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x2]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x3]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x4]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x5]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x6]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x7]);_0x52f202['push'](_0x16d950[0x8]);_0x52f202[_0x8dc7('0x1d')](_0x16d950[0x9]);_0x52f202['push'](_0x16d950[0xa]);_0x52f202[_0x8dc7('0x1d')](_0x5d5598[_0x8dc7('0x12')]['id']);_0x52f202[_0x8dc7('0x1d')](_0x5d5598['message']['id']);_0x52f202[_0x8dc7('0x1d')](_0x267ab0['ChatWebsiteId']);_0x52f202['push'](_0x5d5598[_0x8dc7('0x12')][_0x8dc7('0x27')]);_0x52f202['push'](_0x5d5598['body']['body']);_0x52f202[_0x8dc7('0x1d')](_0x5674ef);break;default:_0x52f202=_[_0x8dc7('0xa')](_0x267ab0[_0x8dc7('0x1b')])?[]:_0x267ab0['appdata'][_0x8dc7('0x1c')](',');}var _0x473820={'id':util['format'](_0x8dc7('0x28'),_0x113b29,_0x267ab0['id'],_0x267ab0[_0x8dc7('0x18')]),'condition':require(_0x8dc7('0x29'))['condition'](_0x113b29,getIntervals(_0xa1aa68[_0x8dc7('0x2a')],_0x267ab0),_0xa1aa68),'consequence':require(_0x8dc7('0x2b')+_0x267ab0[_0x8dc7('0x18')])[_0x8dc7('0x2c')](_0x113b29,_0x52f202,_0xa1aa68,_0x5d5598),'p':_0x267ab0[_0x8dc7('0x2d')]||0x0};logger[_0x8dc7('0x2e')](_0x8dc7('0x2f'),_0x473820['id'],_0x8dc7('0x30'),getIntervals(_0xa1aa68[_0x8dc7('0x2a')],_0x267ab0)[_0x8dc7('0x17')](_0x8dc7('0x31')));_0x5d331c[_0x8dc7('0x1d')](_0x473820);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x8dc7('0x17')](__dirname,_0x8dc7('0x15'),_0x267ab0[_0x8dc7('0x18')]+'.js'));}}_0xa1aa68[_0x8dc7('0x32')][_0x113b29]=new RuleEngine(_0x5d331c);_0xa1aa68['rules'][_0x113b29][_0x8dc7('0x33')](_0x5d5598,function(_0x573b0d){logger[_0x8dc7('0x2e')](_0x8dc7('0x34'),JSON['stringify'](_0x573b0d[_0x8dc7('0x35')]));if(_0xa1aa68[_0x8dc7('0x32')][_0x113b29]){_0xa1aa68[_0x8dc7('0x32')][_0x113b29][_0x8dc7('0x36')](_0x8dc7('0x37'));}});return _0x17b448({'code':0xc8,'message':_0x5d5598});}else{if(_0x5d3d97){logger[_0x8dc7('0x2e')](util[_0x8dc7('0x38')](_0x8dc7('0x39'),_0x113b29));}else{logger[_0x8dc7('0x2e')](_0x8dc7('0x3a'));}return _0x17b448({'code':0xc8,'message':_0x5d5598});}}catch(_0x3f2b92){logger[_0x8dc7('0x3b')](_0x3f2b92[_0x8dc7('0x3c')]);return _0x25cc06(_0x4b7f6a[_0x8dc7('0x3b')](0x1f4,_0x3f2b92));}}return _0x25cc06(_0x8dc7('0x3d'));});},'AcceptMessage':function(_0x446e8c){var _0x42f3ea=this;return new Promise(function(_0x992f34,_0x3a61fc){if(_0x446e8c[_0x8dc7('0x3e')]&&_0x446e8c[_0x8dc7('0x3e')]['id']){if(_0xa1aa68[_0x8dc7('0x3f')][_0x446e8c[_0x8dc7('0x3e')]['id']]){_0xa1aa68[_0x8dc7('0x3f')][_0x446e8c['agent']['id']][_0x8dc7('0x40')]=![];_0xa1aa68['agents'][_0x446e8c['agent']['id']]['busyQueue']=undefined;}}if(_0x446e8c['message']&&_0x446e8c[_0x8dc7('0x11')]['id']){try{var _0x3ac822=getId(_0x446e8c[_0x8dc7('0x10')],_0x446e8c[_0x8dc7('0x11')]?_0x446e8c[_0x8dc7('0x11')]['id']:0x0,_0x446e8c[_0x8dc7('0x12')]?_0x446e8c[_0x8dc7('0x12')]['id']:0x0);if(_0xa1aa68[_0x8dc7('0x32')][_0x3ac822]){_0xa1aa68['rules'][_0x3ac822]['emit'](_0x8dc7('0x41'));if(rpc[_0x446e8c[_0x8dc7('0x10')]+_0x8dc7('0x42')]){rpc[_0x446e8c[_0x8dc7('0x10')]+_0x8dc7('0x42')]['update'](_0x3ac822,{'UserId':_0x446e8c[_0x8dc7('0x11')][_0x8dc7('0x43')]})[_0x8dc7('0x44')](function(){logger[_0x8dc7('0x3b')](_0x8dc7('0x45'));});}}return _0x992f34({'code':0xc8,'message':_0x446e8c});}catch(_0x3f1f7a){logger['error'](_0x3f1f7a[_0x8dc7('0x3c')]);return _0x3a61fc(_0x42f3ea['error'](0x1f4,_0x3f1f7a));}}logger[_0x8dc7('0x3b')](_0x8dc7('0x46'));return _0x3a61fc(_0x42f3ea['error'](0x1f4,_0x8dc7('0x46')));});},'RejectMessage':function(_0x2ebdc3){var _0x5765d3=this;return new Promise(function(_0x210acd,_0xfc7525){if(_0x2ebdc3[_0x8dc7('0x3e')]&&_0x2ebdc3[_0x8dc7('0x3e')]['id']){try{if(_0xa1aa68['agents'][_0x2ebdc3[_0x8dc7('0x3e')]['id']]){_0xa1aa68[_0x8dc7('0x3f')][_0x2ebdc3['agent']['id']][_0x8dc7('0x40')]=![];_0xa1aa68[_0x8dc7('0x3f')][_0x2ebdc3[_0x8dc7('0x3e')]['id']][_0x8dc7('0x47')]=undefined;}return _0x210acd({'code':0xc8,'message':_0x2ebdc3});}catch(_0x251066){logger[_0x8dc7('0x3b')](_0x251066[_0x8dc7('0x3c')]);return _0xfc7525(_0x5765d3[_0x8dc7('0x3b')](0x1f4,_0x251066));}}logger[_0x8dc7('0x3b')](_0x8dc7('0x46'));return _0xfc7525(_0x5765d3[_0x8dc7('0x3b')](0x1f4,_0x8dc7('0x46')));});},'AbandonInteraction':function(_0xc8908a){var _0x3f3083=this;return new Promise(function(_0x529f9d,_0x242275){if(_0xc8908a[_0x8dc7('0x10')]&&_0xc8908a['interaction']&&_0xc8908a['interaction']['id']){try{var _0x951d09=getId(_0xc8908a[_0x8dc7('0x10')],_0xc8908a[_0x8dc7('0x11')]?_0xc8908a['message']['id']:0x0,_0xc8908a['interaction']?_0xc8908a[_0x8dc7('0x12')]['id']:0x0);if(_0xa1aa68['rules'][_0x951d09]){_0xa1aa68[_0x8dc7('0x32')][_0x951d09][_0x8dc7('0x36')]('end');}return _0x529f9d({'code':0xc8,'message':_0xc8908a});}catch(_0x48aff5){logger[_0x8dc7('0x3b')](_0x48aff5[_0x8dc7('0x3c')]);return _0x242275(_0x3f3083[_0x8dc7('0x3b')](0x1f4,_0x48aff5));}}logger[_0x8dc7('0x3b')](_0x8dc7('0x46'));return _0x242275(_0x3f3083['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1f7091){var _0x3cf2cb=this;return new Promise(function(_0x494b62,_0x98976a){if(_0xa1aa68[_0x8dc7('0x3f')][_0x8dc7('0x48')](_0x1f7091['id'])){for(var _0x813384 in _0x1f7091[_0x8dc7('0x49')]){if(_0x1f7091[_0x8dc7('0x49')][_0x8dc7('0x48')](_0x813384)){if(_0xa1aa68['agents'][_0x1f7091['id']][_0x8dc7('0x48')](_0x813384+_0x8dc7('0x4a'))){_0xa1aa68[_0x8dc7('0x3f')][_0x1f7091['id']][_0x813384+_0x8dc7('0x4a')]=parseInt(_0x1f7091[_0x8dc7('0x49')][_0x813384],0xa);}}}_0xa1aa68[_0x8dc7('0x3f')][_0x1f7091['id']][_0x8dc7('0x4b')]();return _0x494b62({'code':0xc8,'message':_0xa1aa68[_0x8dc7('0x3f')][_0x1f7091['id']]});}else{return _0x98976a(_0x3cf2cb['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x43a2b9){return new Promise(function(_0x405a20){var _0x3d0e7a=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x3f')]);if(_0x43a2b9&&_0x43a2b9['id']){var _0x2562e7=_['find'](_0x3d0e7a,function(_0x4cd61f){return _0x4cd61f['id']===_0x43a2b9['id'];});_0x405a20(_0x2562e7);}else{_0x405a20({'count':_0x3d0e7a['length'],'rows':_0x3d0e7a});}});},'ChatQueues':function(){return new Promise(function(_0x2cd0c2){var _0xd84608=[];for(var _0x52c0dc in _0xa1aa68['chatQueues']){if(_0xa1aa68['chatQueues'][_0x8dc7('0x48')](_0x52c0dc)){var _0x3f0b48=_0xa1aa68['chatQueues'][_0x52c0dc];var _0x1f9eb3={'id':_0x3f0b48['id'],'available':_0x3f0b48['available'],'loggedIn':_0x3f0b48['loggedIn'],'name':_0x3f0b48[_0x8dc7('0x4d')],'paused':_0x3f0b48['paused'],'waiting':_0x3f0b48[_0x8dc7('0x4e')]};_0xd84608[_0x8dc7('0x1d')](_0x1f9eb3);}}_0x2cd0c2({'count':_0xd84608['length'],'rows':_0xd84608});});},'MailQueues':function(){return new Promise(function(_0x3bea7d){var _0x258414=[];for(var _0x2245cc in _0xa1aa68[_0x8dc7('0x4f')]){if(_0xa1aa68[_0x8dc7('0x4f')][_0x8dc7('0x48')](_0x2245cc)){var _0xeee187=_0xa1aa68['mailQueues'][_0x2245cc];var _0x203720={'id':_0xeee187['id'],'available':_0xeee187[_0x8dc7('0x50')],'loggedIn':_0xeee187[_0x8dc7('0x51')],'name':_0xeee187[_0x8dc7('0x4d')],'paused':_0xeee187[_0x8dc7('0x52')],'waiting':_0xeee187['waiting']};_0x258414[_0x8dc7('0x1d')](_0x203720);}}_0x3bea7d({'count':_0x258414[_0x8dc7('0x16')],'rows':_0x258414});});},'OpenchannelQueues':function(){return new Promise(function(_0x578989){var _0x4b4bcd=[];for(var _0x256678 in _0xa1aa68[_0x8dc7('0x53')]){if(_0xa1aa68[_0x8dc7('0x53')][_0x8dc7('0x48')](_0x256678)){var _0x27873e=_0xa1aa68['openchannelQueues'][_0x256678];var _0x5472df={'id':_0x27873e['id'],'available':_0x27873e[_0x8dc7('0x50')],'loggedIn':_0x27873e[_0x8dc7('0x51')],'name':_0x27873e['name'],'paused':_0x27873e[_0x8dc7('0x52')],'waiting':_0x27873e[_0x8dc7('0x4e')]};_0x4b4bcd[_0x8dc7('0x1d')](_0x5472df);}}_0x578989({'count':_0x4b4bcd[_0x8dc7('0x16')],'rows':_0x4b4bcd});});},'SmsQueues':function(){return new Promise(function(_0x121f63){var _0x3787a8=[];for(var _0x203126 in _0xa1aa68[_0x8dc7('0x54')]){if(_0xa1aa68[_0x8dc7('0x54')][_0x8dc7('0x48')](_0x203126)){var _0x466b51=_0xa1aa68[_0x8dc7('0x54')][_0x203126];var _0x409908={'id':_0x466b51['id'],'available':_0x466b51[_0x8dc7('0x50')],'loggedIn':_0x466b51[_0x8dc7('0x51')],'name':_0x466b51['name'],'paused':_0x466b51[_0x8dc7('0x52')],'waiting':_0x466b51[_0x8dc7('0x4e')]};_0x3787a8['push'](_0x409908);}}_0x121f63({'count':_0x3787a8[_0x8dc7('0x16')],'rows':_0x3787a8});});},'FaxQueues':function(){return new Promise(function(_0x33f90c){var _0x1189f8=[];for(var _0x1b8420 in _0xa1aa68[_0x8dc7('0x55')]){if(_0xa1aa68[_0x8dc7('0x55')][_0x8dc7('0x48')](_0x1b8420)){var _0x271ced=_0xa1aa68[_0x8dc7('0x55')][_0x1b8420];var _0x485dbc={'id':_0x271ced['id'],'available':_0x271ced[_0x8dc7('0x50')],'loggedIn':_0x271ced[_0x8dc7('0x51')],'name':_0x271ced[_0x8dc7('0x4d')],'paused':_0x271ced[_0x8dc7('0x52')],'waiting':_0x271ced['waiting']};_0x1189f8[_0x8dc7('0x1d')](_0x485dbc);}}_0x33f90c({'count':_0x1189f8['length'],'rows':_0x1189f8});});},'WhatsappQueues':function(){return new Promise(function(_0x1751bf){var _0x162dd6=[];for(var _0x5a7f1a in _0xa1aa68['whatsappQueues']){if(_0xa1aa68[_0x8dc7('0x56')]['hasOwnProperty'](_0x5a7f1a)){var _0x32d12a=_0xa1aa68['whatsappQueues'][_0x5a7f1a];var _0x35ad98={'id':_0x32d12a['id'],'available':_0x32d12a[_0x8dc7('0x50')],'loggedIn':_0x32d12a[_0x8dc7('0x51')],'name':_0x32d12a[_0x8dc7('0x4d')],'paused':_0x32d12a['paused'],'waiting':_0x32d12a[_0x8dc7('0x4e')]};_0x162dd6['push'](_0x35ad98);}}_0x1751bf({'count':_0x162dd6['length'],'rows':_0x162dd6});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x464062){var _0x31ce69=_[_0x8dc7('0x4c')](_0xa1aa68['chatQueuesWaitingInteractions']);_0x464062({'count':_0x31ce69['length'],'rows':_0x31ce69});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2cc70b){var _0x11ace9=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x57')]);_0x2cc70b({'count':_0x11ace9[_0x8dc7('0x16')],'rows':_0x11ace9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x593d41){var _0x121ce6=_['values'](_0xa1aa68[_0x8dc7('0x58')]);_0x593d41({'count':_0x121ce6[_0x8dc7('0x16')],'rows':_0x121ce6});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x120799){var _0x546692=_['values'](_0xa1aa68[_0x8dc7('0x59')]);_0x120799({'count':_0x546692[_0x8dc7('0x16')],'rows':_0x546692});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2b8891){var _0x173e4b=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x5a')]);_0x2b8891({'count':_0x173e4b[_0x8dc7('0x16')],'rows':_0x173e4b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x46b3bc){var _0x33ff2f=_[_0x8dc7('0x4c')](_0xa1aa68[_0x8dc7('0x5b')]);_0x46b3bc({'count':_0x33ff2f['length'],'rows':_0x33ff2f});});}};var _0x44d6f9=jayson[_0x8dc7('0x5c')](_0x3aaa3e)['http']();_0x44d6f9['on'](_0x8dc7('0x3b'),function(_0x55d72b){logger[_0x8dc7('0x3b')](JSON['stringify'](_0x55d72b));return _0x49a93f(_0x55d72b);});_0x44d6f9[_0x8dc7('0xf')](0x232c,_0x8dc7('0x5d'),function(){console[_0x8dc7('0x5e')](_0x8dc7('0x5f'),0x232c);return _0x5ebb72('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0x8fbb=['../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','.js','autoreply','split','mail','push','slice','dialogflow','dialogflowv2','appdata','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','on\x20interval','\x20|\x20','execute','stringify','matchPath','emit','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport'];(function(_0x37a896,_0x5569de){var _0x510515=function(_0x22eb4b){while(--_0x22eb4b){_0x37a896['push'](_0x37a896['shift']());}};_0x510515(++_0x5569de);}(_0x8fbb,0x1e2));var _0xb8fb=function(_0x3c8893,_0x3bb73e){_0x3c8893=_0x3c8893-0x0;var _0x3f9f4b=_0x8fbb[_0x3c8893];return _0x3f9f4b;};'use strict';var _=require(_0xb8fb('0x0'));var util=require(_0xb8fb('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xb8fb('0x2'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require(_0xb8fb('0x3'))(_0xb8fb('0x4'));var rpc={'openchannelQueueReport':require(_0xb8fb('0x5')),'mailQueueReport':require(_0xb8fb('0x6')),'chatQueueReport':require(_0xb8fb('0x7')),'smsQueueReport':require(_0xb8fb('0x8')),'faxQueueReport':require(_0xb8fb('0x9')),'whatsappQueueReport':require(_0xb8fb('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x56be3e,_0x47f4bc,_0x3f5bef){return util['format']('%s.%s.%s',_0x56be3e,_0x47f4bc||0x0,_0x3f5bef||0x0);}function getIntervals(_0xb6d37,_0x44f82f){var _0x56347c=[];if(!_[_0xb8fb('0xb')](_0x44f82f['IntervalId'])&&!_[_0xb8fb('0xb')](_0xb6d37[_0x44f82f[_0xb8fb('0xc')]])&&!_[_0xb8fb('0xb')](_0xb6d37[_0x44f82f['IntervalId']][_0xb8fb('0xd')])){_0x56347c=_[_0xb8fb('0xe')](_0xb6d37[_0x44f82f[_0xb8fb('0xc')]][_0xb8fb('0xd')],_0xb8fb('0xf'));}else if(!_['isNil'](_0x44f82f[_0xb8fb('0xf')])){_0x56347c=[_0x44f82f[_0xb8fb('0xf')]];}return _0x56347c;}exports['listen']=function(_0x3cb868){_0x3cb868[_0xb8fb('0x10')]={};return new BPromise(function(_0x4395b4,_0x988c9c){var _0x542260={'Start':function(_0x1d7864){var _0x4d59d8=this;return new Promise(function(_0x248241,_0x4fbca9){if(_0x1d7864){try{var _0x251e9d=[];var _0x3df743=getId(_0x1d7864[_0xb8fb('0x11')],_0x1d7864[_0xb8fb('0x12')]?_0x1d7864[_0xb8fb('0x12')]['id']:0x0,_0x1d7864[_0xb8fb('0x13')]?_0x1d7864['interaction']['id']:0x0);var _0x5b7ba3=sUtils[_0xb8fb('0x14')](_0x3cb868,_0x1d7864);if(!_0x5b7ba3&&_0x1d7864[_0xb8fb('0x15')]&&_['isArray'](_0x1d7864[_0xb8fb('0x15')])&&_0x1d7864[_0xb8fb('0x15')][_0xb8fb('0x16')]){for(var _0x354131=0x0;_0x354131<_0x1d7864[_0xb8fb('0x15')][_0xb8fb('0x16')];_0x354131+=0x1){var _0x202fac=_0x1d7864[_0xb8fb('0x15')][_0x354131];if(fs[_0xb8fb('0x17')](path[_0xb8fb('0x18')](__dirname,_0xb8fb('0x15'),_0x202fac[_0xb8fb('0x19')]+_0xb8fb('0x1a')))){var _0x5cf9e4=[];switch(_0x202fac[_0xb8fb('0x19')]['toLowerCase']()){case _0xb8fb('0x1b'):var _0x34e372=_0x202fac['appdata'][_0xb8fb('0x1c')](',');if(_0x1d7864[_0xb8fb('0x11')]===_0xb8fb('0x1d')){_0x5cf9e4[_0xb8fb('0x1e')](_0x34e372[0x0]);_0x5cf9e4[_0xb8fb('0x1e')](_0x34e372[0x1]);_0x5cf9e4[_0xb8fb('0x1e')](_0x34e372['slice'](0x2,_0x34e372[_0xb8fb('0x16')])[_0xb8fb('0x18')](','));}else{_0x5cf9e4[_0xb8fb('0x1e')](_0x34e372[0x0]);_0x5cf9e4[_0xb8fb('0x1e')](_0x34e372[_0xb8fb('0x1f')](0x1,_0x34e372[_0xb8fb('0x16')])[_0xb8fb('0x18')](','));}break;case _0xb8fb('0x20'):var _0x1ac55e=_0x202fac['appdata'][_0xb8fb('0x1c')](',');_0x5cf9e4[_0xb8fb('0x1e')](_0x1ac55e[0x0]);_0x5cf9e4[_0xb8fb('0x1e')](_0x1ac55e[0x1]);_0x5cf9e4[_0xb8fb('0x1e')](_0x1ac55e['slice'](0x2,_0x1ac55e[_0xb8fb('0x16')])['join'](','));break;case _0xb8fb('0x21'):var _0x47e835=_0x202fac[_0xb8fb('0x22')][_0xb8fb('0x1c')](',');_0x5cf9e4[_0xb8fb('0x1e')](_0x47e835[0x0]);_0x5cf9e4['push'](_0x47e835[0x1]);_0x5cf9e4[_0xb8fb('0x1e')](_0x47e835[0x2]);_0x5cf9e4[_0xb8fb('0x1e')](_0x47e835[0x3]);_0x5cf9e4[_0xb8fb('0x1e')](_0x47e835[_0xb8fb('0x1f')](0x4,_0x47e835[_0xb8fb('0x16')])[_0xb8fb('0x18')](','));break;case _0xb8fb('0x23'):var _0x5303a3=_0x202fac['appdata'][_0xb8fb('0x1c')](',');_0x5cf9e4[_0xb8fb('0x1e')](_0x5303a3[0x0]);_0x5cf9e4['push'](_0x5303a3[0x1]);_0x5cf9e4[_0xb8fb('0x1e')](_0x5303a3[0x2]);_0x5cf9e4[_0xb8fb('0x1e')](_0x5303a3[0x3]);_0x5cf9e4[_0xb8fb('0x1e')](_0x5303a3[_0xb8fb('0x1f')](0x4,_0x5303a3['length'])[_0xb8fb('0x18')](','));break;case _0xb8fb('0x12'):_0x5cf9e4[_0xb8fb('0x1e')](_0x202fac[_0xb8fb('0x22')]);break;case _0xb8fb('0x24'):_0x5cf9e4[_0xb8fb('0x1e')](_0x202fac[_0xb8fb('0x25')]);_0x5cf9e4[_0xb8fb('0x1e')](_0x202fac['appdata']);break;case _0xb8fb('0x26'):var _0x9a3abb=utils[_0xb8fb('0x27')](_0x1d7864[_0xb8fb('0x28')][_0xb8fb('0x29')],_0x1d7864);var _0x3e0954=_0x202fac[_0xb8fb('0x22')][_0xb8fb('0x1c')](',');_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x0]);_0x5cf9e4['push'](_0x3e0954[0x1]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x2]);_0x5cf9e4['push'](_0x3e0954[0x3]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x4]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x5]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x6]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x7]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x8]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0x9]);_0x5cf9e4[_0xb8fb('0x1e')](_0x3e0954[0xa]);_0x5cf9e4[_0xb8fb('0x1e')](_0x1d7864[_0xb8fb('0x13')]['id']);_0x5cf9e4[_0xb8fb('0x1e')](_0x1d7864['message']['id']);_0x5cf9e4[_0xb8fb('0x1e')](_0x202fac[_0xb8fb('0x2a')]);_0x5cf9e4[_0xb8fb('0x1e')](_0x1d7864[_0xb8fb('0x13')]['ContactId']);_0x5cf9e4[_0xb8fb('0x1e')](_0x1d7864[_0xb8fb('0x2b')][_0xb8fb('0x2b')]);_0x5cf9e4[_0xb8fb('0x1e')](_0x9a3abb);break;default:_0x5cf9e4=_['isNil'](_0x202fac[_0xb8fb('0x22')])?[]:_0x202fac['appdata'][_0xb8fb('0x1c')](',');}var _0x38a19d={'id':util['format'](_0xb8fb('0x2c'),_0x3df743,_0x202fac['id'],_0x202fac['app']),'condition':require(_0xb8fb('0x2d'))[_0xb8fb('0x2e')](_0x3df743,getIntervals(_0x3cb868[_0xb8fb('0x2f')],_0x202fac),_0x3cb868),'consequence':require(_0xb8fb('0x30')+_0x202fac[_0xb8fb('0x19')])[_0xb8fb('0x31')](_0x3df743,_0x5cf9e4,_0x3cb868,_0x1d7864),'p':_0x202fac['priority']||0x0};logger[_0xb8fb('0x32')]('Push\x20new\x20rule',_0x38a19d['id'],_0xb8fb('0x33'),getIntervals(_0x3cb868[_0xb8fb('0x2f')],_0x202fac)['join'](_0xb8fb('0x34')));_0x251e9d[_0xb8fb('0x1e')](_0x38a19d);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xb8fb('0x18')](__dirname,_0xb8fb('0x15'),_0x202fac[_0xb8fb('0x19')]+_0xb8fb('0x1a')));}}_0x3cb868[_0xb8fb('0x10')][_0x3df743]=new RuleEngine(_0x251e9d);_0x3cb868[_0xb8fb('0x10')][_0x3df743][_0xb8fb('0x35')](_0x1d7864,function(_0x4af4ed){logger[_0xb8fb('0x32')]('Applications\x20executed',JSON[_0xb8fb('0x36')](_0x4af4ed[_0xb8fb('0x37')]));if(_0x3cb868['rules'][_0x3df743]){_0x3cb868[_0xb8fb('0x10')][_0x3df743][_0xb8fb('0x38')]('complete');}});return _0x248241({'code':0xc8,'message':_0x1d7864});}else{if(_0x5b7ba3){logger[_0xb8fb('0x32')](util['format']('Skipped\x20routing\x20for\x20%s',_0x3df743));}else{logger[_0xb8fb('0x32')](_0xb8fb('0x39'));}return _0x248241({'code':0xc8,'message':_0x1d7864});}}catch(_0x3b070c){logger[_0xb8fb('0x3a')](_0x3b070c[_0xb8fb('0x3b')]);return _0x4fbca9(_0x4d59d8[_0xb8fb('0x3a')](0x1f4,_0x3b070c));}}return _0x4fbca9(_0xb8fb('0x3c'));});},'AcceptMessage':function(_0x248abe){var _0x479b85=this;return new Promise(function(_0x17d198,_0x1ee670){if(_0x248abe[_0xb8fb('0x3d')]&&_0x248abe[_0xb8fb('0x3d')]['id']){if(_0x3cb868['agents'][_0x248abe[_0xb8fb('0x3d')]['id']]){_0x3cb868[_0xb8fb('0x3e')][_0x248abe[_0xb8fb('0x3d')]['id']][_0xb8fb('0x3f')]=![];_0x3cb868[_0xb8fb('0x3e')][_0x248abe[_0xb8fb('0x3d')]['id']][_0xb8fb('0x40')]=undefined;}}if(_0x248abe[_0xb8fb('0x12')]&&_0x248abe[_0xb8fb('0x12')]['id']){try{var _0x1d074f=getId(_0x248abe[_0xb8fb('0x11')],_0x248abe['message']?_0x248abe[_0xb8fb('0x12')]['id']:0x0,_0x248abe[_0xb8fb('0x13')]?_0x248abe[_0xb8fb('0x13')]['id']:0x0);if(_0x3cb868[_0xb8fb('0x10')][_0x1d074f]){_0x3cb868['rules'][_0x1d074f][_0xb8fb('0x38')](_0xb8fb('0x41'));if(rpc[_0x248abe[_0xb8fb('0x11')]+_0xb8fb('0x42')]){rpc[_0x248abe[_0xb8fb('0x11')]+'QueueReport'][_0xb8fb('0x43')](_0x1d074f,{'UserId':_0x248abe[_0xb8fb('0x12')][_0xb8fb('0x44')]})[_0xb8fb('0x45')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x17d198({'code':0xc8,'message':_0x248abe});}catch(_0x33caea){logger[_0xb8fb('0x3a')](_0x33caea['stack']);return _0x1ee670(_0x479b85[_0xb8fb('0x3a')](0x1f4,_0x33caea));}}logger[_0xb8fb('0x3a')]('message\x20is\x20empty');return _0x1ee670(_0x479b85[_0xb8fb('0x3a')](0x1f4,_0xb8fb('0x46')));});},'RejectMessage':function(_0x3fc001){var _0x179b5d=this;return new Promise(function(_0x5c62e4,_0x27427b){if(_0x3fc001['agent']&&_0x3fc001[_0xb8fb('0x3d')]['id']){try{if(_0x3cb868['agents'][_0x3fc001[_0xb8fb('0x3d')]['id']]){_0x3cb868[_0xb8fb('0x3e')][_0x3fc001['agent']['id']][_0xb8fb('0x3f')]=![];_0x3cb868['agents'][_0x3fc001['agent']['id']][_0xb8fb('0x40')]=undefined;}return _0x5c62e4({'code':0xc8,'message':_0x3fc001});}catch(_0x15406d){logger[_0xb8fb('0x3a')](_0x15406d[_0xb8fb('0x3b')]);return _0x27427b(_0x179b5d['error'](0x1f4,_0x15406d));}}logger[_0xb8fb('0x3a')](_0xb8fb('0x46'));return _0x27427b(_0x179b5d[_0xb8fb('0x3a')](0x1f4,_0xb8fb('0x46')));});},'AbandonInteraction':function(_0xa0adee){var _0x3bea17=this;return new Promise(function(_0x4d7a98,_0x23b9dd){if(_0xa0adee[_0xb8fb('0x11')]&&_0xa0adee[_0xb8fb('0x13')]&&_0xa0adee[_0xb8fb('0x13')]['id']){try{var _0x4a6757=getId(_0xa0adee[_0xb8fb('0x11')],_0xa0adee['message']?_0xa0adee[_0xb8fb('0x12')]['id']:0x0,_0xa0adee[_0xb8fb('0x13')]?_0xa0adee[_0xb8fb('0x13')]['id']:0x0);if(_0x3cb868[_0xb8fb('0x10')][_0x4a6757]){_0x3cb868['rules'][_0x4a6757][_0xb8fb('0x38')](_0xb8fb('0x41'));}return _0x4d7a98({'code':0xc8,'message':_0xa0adee});}catch(_0x5e9171){logger[_0xb8fb('0x3a')](_0x5e9171[_0xb8fb('0x3b')]);return _0x23b9dd(_0x3bea17[_0xb8fb('0x3a')](0x1f4,_0x5e9171));}}logger[_0xb8fb('0x3a')]('message\x20is\x20empty');return _0x23b9dd(_0x3bea17[_0xb8fb('0x3a')](0x1f4,_0xb8fb('0x46')));});},'AgentCapacity':function(_0x5b9601){var _0x413e26=this;return new Promise(function(_0x3e8872,_0x3c4c67){if(_0x3cb868[_0xb8fb('0x3e')][_0xb8fb('0x47')](_0x5b9601['id'])){for(var _0x361518 in _0x5b9601[_0xb8fb('0x48')]){if(_0x5b9601[_0xb8fb('0x48')][_0xb8fb('0x47')](_0x361518)){if(_0x3cb868[_0xb8fb('0x3e')][_0x5b9601['id']][_0xb8fb('0x47')](_0x361518+_0xb8fb('0x49'))){_0x3cb868[_0xb8fb('0x3e')][_0x5b9601['id']][_0x361518+_0xb8fb('0x49')]=parseInt(_0x5b9601['capacity'][_0x361518],0xa);}}}_0x3cb868['agents'][_0x5b9601['id']][_0xb8fb('0x4a')]();return _0x3e8872({'code':0xc8,'message':_0x3cb868[_0xb8fb('0x3e')][_0x5b9601['id']]});}else{return _0x3c4c67(_0x413e26[_0xb8fb('0x3a')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x5acefa){return new Promise(function(_0x38314b){var _0x41d0c4=_['values'](_0x3cb868[_0xb8fb('0x3e')]);if(_0x5acefa&&_0x5acefa['id']){var _0x41972b=_[_0xb8fb('0x4b')](_0x41d0c4,function(_0x1a0ad7){return _0x1a0ad7['id']===_0x5acefa['id'];});_0x38314b(_0x41972b);}else{_0x38314b({'count':_0x41d0c4[_0xb8fb('0x16')],'rows':_0x41d0c4});}});},'ChatQueues':function(){return new Promise(function(_0x2baa68){var _0x86df77=[];for(var _0x2be9d7 in _0x3cb868[_0xb8fb('0x4c')]){if(_0x3cb868[_0xb8fb('0x4c')][_0xb8fb('0x47')](_0x2be9d7)){var _0x16f68b=_0x3cb868[_0xb8fb('0x4c')][_0x2be9d7];var _0x3f0d6d={'id':_0x16f68b['id'],'available':_0x16f68b[_0xb8fb('0x4d')],'loggedIn':_0x16f68b[_0xb8fb('0x4e')],'name':_0x16f68b[_0xb8fb('0x4f')],'paused':_0x16f68b[_0xb8fb('0x50')],'waiting':_0x16f68b[_0xb8fb('0x51')]};_0x86df77[_0xb8fb('0x1e')](_0x3f0d6d);}}_0x2baa68({'count':_0x86df77[_0xb8fb('0x16')],'rows':_0x86df77});});},'MailQueues':function(){return new Promise(function(_0x180319){var _0x42d5b8=[];for(var _0x4356c4 in _0x3cb868[_0xb8fb('0x52')]){if(_0x3cb868[_0xb8fb('0x52')]['hasOwnProperty'](_0x4356c4)){var _0x431fbc=_0x3cb868[_0xb8fb('0x52')][_0x4356c4];var _0x3becb6={'id':_0x431fbc['id'],'available':_0x431fbc[_0xb8fb('0x4d')],'loggedIn':_0x431fbc['loggedIn'],'name':_0x431fbc[_0xb8fb('0x4f')],'paused':_0x431fbc['paused'],'waiting':_0x431fbc[_0xb8fb('0x51')]};_0x42d5b8[_0xb8fb('0x1e')](_0x3becb6);}}_0x180319({'count':_0x42d5b8[_0xb8fb('0x16')],'rows':_0x42d5b8});});},'OpenchannelQueues':function(){return new Promise(function(_0x3a258c){var _0x3be8b8=[];for(var _0x3b6c12 in _0x3cb868[_0xb8fb('0x53')]){if(_0x3cb868[_0xb8fb('0x53')]['hasOwnProperty'](_0x3b6c12)){var _0x2ae6a8=_0x3cb868[_0xb8fb('0x53')][_0x3b6c12];var _0x4dda38={'id':_0x2ae6a8['id'],'available':_0x2ae6a8[_0xb8fb('0x4d')],'loggedIn':_0x2ae6a8[_0xb8fb('0x4e')],'name':_0x2ae6a8[_0xb8fb('0x4f')],'paused':_0x2ae6a8['paused'],'waiting':_0x2ae6a8[_0xb8fb('0x51')]};_0x3be8b8['push'](_0x4dda38);}}_0x3a258c({'count':_0x3be8b8[_0xb8fb('0x16')],'rows':_0x3be8b8});});},'SmsQueues':function(){return new Promise(function(_0x391dde){var _0x16d85f=[];for(var _0x41dbea in _0x3cb868[_0xb8fb('0x54')]){if(_0x3cb868['smsQueues']['hasOwnProperty'](_0x41dbea)){var _0xdcd0b2=_0x3cb868[_0xb8fb('0x54')][_0x41dbea];var _0x365839={'id':_0xdcd0b2['id'],'available':_0xdcd0b2[_0xb8fb('0x4d')],'loggedIn':_0xdcd0b2[_0xb8fb('0x4e')],'name':_0xdcd0b2[_0xb8fb('0x4f')],'paused':_0xdcd0b2[_0xb8fb('0x50')],'waiting':_0xdcd0b2['waiting']};_0x16d85f[_0xb8fb('0x1e')](_0x365839);}}_0x391dde({'count':_0x16d85f[_0xb8fb('0x16')],'rows':_0x16d85f});});},'FaxQueues':function(){return new Promise(function(_0x1b850a){var _0x525b7a=[];for(var _0x547da3 in _0x3cb868[_0xb8fb('0x55')]){if(_0x3cb868[_0xb8fb('0x55')]['hasOwnProperty'](_0x547da3)){var _0x3d3f36=_0x3cb868['faxQueues'][_0x547da3];var _0x1bf206={'id':_0x3d3f36['id'],'available':_0x3d3f36['available'],'loggedIn':_0x3d3f36[_0xb8fb('0x4e')],'name':_0x3d3f36['name'],'paused':_0x3d3f36['paused'],'waiting':_0x3d3f36[_0xb8fb('0x51')]};_0x525b7a[_0xb8fb('0x1e')](_0x1bf206);}}_0x1b850a({'count':_0x525b7a[_0xb8fb('0x16')],'rows':_0x525b7a});});},'WhatsappQueues':function(){return new Promise(function(_0x4f0793){var _0x462498=[];for(var _0x103b89 in _0x3cb868[_0xb8fb('0x56')]){if(_0x3cb868['whatsappQueues']['hasOwnProperty'](_0x103b89)){var _0x27b15c=_0x3cb868[_0xb8fb('0x56')][_0x103b89];var _0x59049c={'id':_0x27b15c['id'],'available':_0x27b15c[_0xb8fb('0x4d')],'loggedIn':_0x27b15c[_0xb8fb('0x4e')],'name':_0x27b15c[_0xb8fb('0x4f')],'paused':_0x27b15c[_0xb8fb('0x50')],'waiting':_0x27b15c[_0xb8fb('0x51')]};_0x462498[_0xb8fb('0x1e')](_0x59049c);}}_0x4f0793({'count':_0x462498[_0xb8fb('0x16')],'rows':_0x462498});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3f56de){var _0x2a3458=_[_0xb8fb('0x57')](_0x3cb868['chatQueuesWaitingInteractions']);_0x3f56de({'count':_0x2a3458[_0xb8fb('0x16')],'rows':_0x2a3458});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x86d552){var _0x467e52=_[_0xb8fb('0x57')](_0x3cb868['mailQueuesWaitingInteractions']);_0x86d552({'count':_0x467e52[_0xb8fb('0x16')],'rows':_0x467e52});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1d99d1){var _0x3eab7c=_[_0xb8fb('0x57')](_0x3cb868[_0xb8fb('0x58')]);_0x1d99d1({'count':_0x3eab7c[_0xb8fb('0x16')],'rows':_0x3eab7c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x540aa2){var _0x367dae=_[_0xb8fb('0x57')](_0x3cb868[_0xb8fb('0x59')]);_0x540aa2({'count':_0x367dae[_0xb8fb('0x16')],'rows':_0x367dae});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5ed2f1){var _0x3f1774=_['values'](_0x3cb868[_0xb8fb('0x5a')]);_0x5ed2f1({'count':_0x3f1774[_0xb8fb('0x16')],'rows':_0x3f1774});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x21a9ce){var _0x49e9b7=_[_0xb8fb('0x57')](_0x3cb868[_0xb8fb('0x5b')]);_0x21a9ce({'count':_0x49e9b7['length'],'rows':_0x49e9b7});});}};var _0xd248b7=jayson[_0xb8fb('0x5c')](_0x542260)['http']();_0xd248b7['on']('error',function(_0xb4781){logger[_0xb8fb('0x3a')](JSON[_0xb8fb('0x36')](_0xb4781));return _0x988c9c(_0xb4781);});_0xd248b7[_0xb8fb('0x5d')](0x232c,_0xb8fb('0x5e'),function(){console[_0xb8fb('0x5f')](_0xb8fb('0x60'),0x232c);return _0x4395b4(_0xb8fb('0x61')+0x232c);});});};
\ No newline at end of file