Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / services / routing / server / index.js
index 0f663c2..1641095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf725=['busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty','busy','stack','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','amazonlex','tag','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','routing\x20is\x20empty','agent','agents'];(function(_0x51426b,_0x56069c){var _0xb53cc3=function(_0x24363c){while(--_0x24363c){_0x51426b['push'](_0x51426b['shift']());}};_0xb53cc3(++_0x56069c);}(_0xf725,0x7e));var _0x5f72=function(_0x1b536b,_0x12a816){_0x1b536b=_0x1b536b-0x0;var _0x1aca27=_0xf725[_0x1b536b];return _0x1aca27;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var path=require(_0x5f72('0x2'));var fs=require('fs');var jayson=require(_0x5f72('0x3'));var BPromise=require(_0x5f72('0x4'));var uuid=require(_0x5f72('0x5'));var config=require(_0x5f72('0x6'));var logger=require(_0x5f72('0x7'))(_0x5f72('0x8'));var rpc={'openchannelQueueReport':require(_0x5f72('0x9')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x5f72('0xa')),'smsQueueReport':require(_0x5f72('0xb')),'faxQueueReport':require(_0x5f72('0xc')),'whatsappQueueReport':require(_0x5f72('0xd'))};var RuleEngine=require(_0x5f72('0xe'));function getId(_0x4961d1,_0x158aa3,_0x523365){return util['format'](_0x5f72('0xf'),_0x4961d1,_0x158aa3||0x0,_0x523365||0x0);}function getIntervals(_0x3f189d,_0x5b74cf){var _0x994d2e=[];if(!_[_0x5f72('0x10')](_0x5b74cf['IntervalId'])&&!_[_0x5f72('0x10')](_0x3f189d[_0x5b74cf[_0x5f72('0x11')]])&&!_[_0x5f72('0x10')](_0x3f189d[_0x5b74cf[_0x5f72('0x11')]][_0x5f72('0x12')])){_0x994d2e=_[_0x5f72('0x13')](_0x3f189d[_0x5b74cf[_0x5f72('0x11')]]['Intervals'],_0x5f72('0x14'));}else if(!_[_0x5f72('0x10')](_0x5b74cf[_0x5f72('0x14')])){_0x994d2e=[_0x5b74cf[_0x5f72('0x14')]];}return _0x994d2e;}exports[_0x5f72('0x15')]=function(_0x57007a){_0x57007a[_0x5f72('0x16')]={};return new BPromise(function(_0x4f81e9,_0x50f8c8){var _0x1665be={'Start':function(_0x5a036c){var _0x3267a=this;return new Promise(function(_0x4adc76,_0x317eed){if(_0x5a036c){try{var _0x4e0c32=[];var _0x44893b=getId(_0x5a036c[_0x5f72('0x17')],_0x5a036c['message']?_0x5a036c[_0x5f72('0x18')]['id']:0x0,_0x5a036c[_0x5f72('0x19')]?_0x5a036c[_0x5f72('0x19')]['id']:0x0);if(_0x5a036c['applications']&&_['isArray'](_0x5a036c['applications'])&&_0x5a036c[_0x5f72('0x1a')][_0x5f72('0x1b')]){for(var _0x269dae=0x0;_0x269dae<_0x5a036c[_0x5f72('0x1a')][_0x5f72('0x1b')];_0x269dae+=0x1){var _0x16b13e=_0x5a036c[_0x5f72('0x1a')][_0x269dae];if(fs['existsSync'](path[_0x5f72('0x1c')](__dirname,_0x5f72('0x1a'),_0x16b13e[_0x5f72('0x1d')]+_0x5f72('0x1e')))){var _0x471a9c=[];switch(_0x16b13e[_0x5f72('0x1d')][_0x5f72('0x1f')]()){case _0x5f72('0x20'):var _0x27b1f6=_0x16b13e[_0x5f72('0x21')][_0x5f72('0x22')](',');if(_0x5a036c['channel']===_0x5f72('0x23')){_0x471a9c[_0x5f72('0x24')](_0x27b1f6[0x0]);_0x471a9c[_0x5f72('0x24')](_0x27b1f6[0x1]);_0x471a9c[_0x5f72('0x24')](_0x27b1f6['slice'](0x2,_0x27b1f6[_0x5f72('0x1b')])[_0x5f72('0x1c')](','));}else{_0x471a9c['push'](_0x27b1f6[0x0]);_0x471a9c[_0x5f72('0x24')](_0x27b1f6[_0x5f72('0x25')](0x1,_0x27b1f6[_0x5f72('0x1b')])['join'](','));}break;case'dialogflow':var _0x3d4cfe=_0x16b13e[_0x5f72('0x21')][_0x5f72('0x22')](',');_0x471a9c[_0x5f72('0x24')](_0x3d4cfe[0x0]);_0x471a9c[_0x5f72('0x24')](_0x3d4cfe[0x1]);_0x471a9c[_0x5f72('0x24')](_0x3d4cfe[_0x5f72('0x25')](0x2,_0x3d4cfe['length'])[_0x5f72('0x1c')](','));break;case'dialogflowv2':var _0xc8ca5a=_0x16b13e[_0x5f72('0x21')][_0x5f72('0x22')](',');_0x471a9c[_0x5f72('0x24')](_0xc8ca5a[0x0]);_0x471a9c[_0x5f72('0x24')](_0xc8ca5a[0x1]);_0x471a9c['push'](_0xc8ca5a[0x2]);_0x471a9c['push'](_0xc8ca5a[0x3]);_0x471a9c[_0x5f72('0x24')](_0xc8ca5a[_0x5f72('0x25')](0x4,_0xc8ca5a[_0x5f72('0x1b')])[_0x5f72('0x1c')](','));break;case _0x5f72('0x26'):var _0x7ed167=_0x16b13e[_0x5f72('0x21')]['split'](',');_0x471a9c[_0x5f72('0x24')](_0x7ed167[0x0]);_0x471a9c[_0x5f72('0x24')](_0x7ed167[0x1]);_0x471a9c[_0x5f72('0x24')](_0x7ed167[0x2]);_0x471a9c[_0x5f72('0x24')](_0x7ed167[0x3]);_0x471a9c[_0x5f72('0x24')](_0x7ed167['slice'](0x4,_0x7ed167[_0x5f72('0x1b')])[_0x5f72('0x1c')](','));break;case _0x5f72('0x18'):_0x471a9c[_0x5f72('0x24')](_0x16b13e[_0x5f72('0x21')]);break;case _0x5f72('0x27'):_0x471a9c['push'](_0x16b13e['TagId']);_0x471a9c[_0x5f72('0x24')](_0x16b13e[_0x5f72('0x21')]);break;default:_0x471a9c=_['isNil'](_0x16b13e[_0x5f72('0x21')])?[]:_0x16b13e[_0x5f72('0x21')][_0x5f72('0x22')](',');}var _0xf15ac8={'id':util[_0x5f72('0x28')](_0x5f72('0x29'),_0x44893b,_0x16b13e['id'],_0x16b13e[_0x5f72('0x1d')]),'condition':require(_0x5f72('0x2a'))[_0x5f72('0x2b')](_0x44893b,getIntervals(_0x57007a[_0x5f72('0x2c')],_0x16b13e),_0x57007a),'consequence':require(_0x5f72('0x2d')+_0x16b13e[_0x5f72('0x1d')])[_0x5f72('0x2e')](_0x44893b,_0x471a9c,_0x57007a,_0x5a036c),'p':_0x16b13e[_0x5f72('0x2f')]||0x0};logger['info'](_0x5f72('0x30'),_0xf15ac8['id'],'on\x20interval',getIntervals(_0x57007a['intervals'],_0x16b13e)[_0x5f72('0x1c')](_0x5f72('0x31')));_0x4e0c32[_0x5f72('0x24')](_0xf15ac8);}else{logger[_0x5f72('0x32')](_0x5f72('0x33'),path[_0x5f72('0x1c')](__dirname,'applications',_0x16b13e[_0x5f72('0x1d')]+_0x5f72('0x1e')));}}_0x57007a[_0x5f72('0x16')][_0x44893b]=new RuleEngine(_0x4e0c32);_0x57007a[_0x5f72('0x16')][_0x44893b][_0x5f72('0x34')](_0x5a036c,function(_0xccfc5d){logger[_0x5f72('0x35')](_0x5f72('0x36'),JSON[_0x5f72('0x37')](_0xccfc5d[_0x5f72('0x38')]));if(_0x57007a[_0x5f72('0x16')][_0x44893b]){_0x57007a[_0x5f72('0x16')][_0x44893b][_0x5f72('0x39')](_0x5f72('0x3a'));}});return _0x4adc76({'code':0xc8,'message':_0x5a036c});}else{logger[_0x5f72('0x35')]('No\x20applications\x20to\x20execute');return _0x4adc76({'code':0xc8,'message':_0x5a036c});}}catch(_0x594bb4){logger[_0x5f72('0x32')](_0x594bb4['stack']);return _0x317eed(_0x3267a['error'](0x1f4,_0x594bb4));}}return _0x317eed(_0x5f72('0x3b'));});},'AcceptMessage':function(_0x71e8e7){var _0x57d320=this;return new Promise(function(_0x3f0f8d,_0x42298c){if(_0x71e8e7['agent']&&_0x71e8e7[_0x5f72('0x3c')]['id']){if(_0x57007a[_0x5f72('0x3d')][_0x71e8e7[_0x5f72('0x3c')]['id']]){_0x57007a[_0x5f72('0x3d')][_0x71e8e7['agent']['id']]['busy']=![];_0x57007a[_0x5f72('0x3d')][_0x71e8e7[_0x5f72('0x3c')]['id']][_0x5f72('0x3e')]=undefined;}}if(_0x71e8e7[_0x5f72('0x18')]&&_0x71e8e7[_0x5f72('0x18')]['id']){try{var _0x6be017=getId(_0x71e8e7[_0x5f72('0x17')],_0x71e8e7['message']?_0x71e8e7[_0x5f72('0x18')]['id']:0x0,_0x71e8e7[_0x5f72('0x19')]?_0x71e8e7[_0x5f72('0x19')]['id']:0x0);if(_0x57007a[_0x5f72('0x16')][_0x6be017]){_0x57007a['rules'][_0x6be017][_0x5f72('0x39')](_0x5f72('0x3f'));if(rpc[_0x71e8e7[_0x5f72('0x17')]+_0x5f72('0x40')]){rpc[_0x71e8e7['channel']+_0x5f72('0x40')][_0x5f72('0x41')](_0x6be017,{'UserId':_0x71e8e7[_0x5f72('0x18')][_0x5f72('0x42')]})['catch'](function(_0x942c55){logger[_0x5f72('0x32')]('error\x20update\x20queue\x20report');});}}return _0x3f0f8d({'code':0xc8,'message':_0x71e8e7});}catch(_0x1911b0){logger[_0x5f72('0x32')](_0x1911b0['stack']);return _0x42298c(_0x57d320[_0x5f72('0x32')](0x1f4,_0x1911b0));}}logger[_0x5f72('0x32')](_0x5f72('0x43'));return _0x42298c(_0x57d320['error'](0x1f4,_0x5f72('0x43')));});},'RejectMessage':function(_0x5efa48){var _0x30a9b6=this;return new Promise(function(_0x355e23,_0x53e8d0){if(_0x5efa48[_0x5f72('0x3c')]&&_0x5efa48[_0x5f72('0x3c')]['id']){try{if(_0x57007a[_0x5f72('0x3d')][_0x5efa48[_0x5f72('0x3c')]['id']]){_0x57007a['agents'][_0x5efa48[_0x5f72('0x3c')]['id']][_0x5f72('0x44')]=![];_0x57007a[_0x5f72('0x3d')][_0x5efa48[_0x5f72('0x3c')]['id']]['busyQueue']=undefined;}return _0x355e23({'code':0xc8,'message':_0x5efa48});}catch(_0x16a452){logger['error'](_0x16a452[_0x5f72('0x45')]);return _0x53e8d0(_0x30a9b6[_0x5f72('0x32')](0x1f4,_0x16a452));}}logger[_0x5f72('0x32')](_0x5f72('0x43'));return _0x53e8d0(_0x30a9b6[_0x5f72('0x32')](0x1f4,_0x5f72('0x43')));});},'AbandonInteraction':function(_0x28008c){var _0x35116c=this;return new Promise(function(_0xfab233,_0x1d4a2f){if(_0x28008c['channel']&&_0x28008c[_0x5f72('0x19')]&&_0x28008c[_0x5f72('0x19')]['id']){try{var _0x5c5d94=getId(_0x28008c[_0x5f72('0x17')],_0x28008c[_0x5f72('0x18')]?_0x28008c['message']['id']:0x0,_0x28008c[_0x5f72('0x19')]?_0x28008c[_0x5f72('0x19')]['id']:0x0);if(_0x57007a[_0x5f72('0x16')][_0x5c5d94]){_0x57007a[_0x5f72('0x16')][_0x5c5d94][_0x5f72('0x39')]('end');}return _0xfab233({'code':0xc8,'message':_0x28008c});}catch(_0x540144){logger[_0x5f72('0x32')](_0x540144[_0x5f72('0x45')]);return _0x1d4a2f(_0x35116c[_0x5f72('0x32')](0x1f4,_0x540144));}}logger['error'](_0x5f72('0x43'));return _0x1d4a2f(_0x35116c[_0x5f72('0x32')](0x1f4,_0x5f72('0x43')));});},'AgentCapacity':function(_0x587edd){var _0x397b2a=this;return new Promise(function(_0x241231,_0x5e0fd9){if(_0x57007a['agents'][_0x5f72('0x46')](_0x587edd['id'])){for(var _0x57655b in _0x587edd['capacity']){if(_0x587edd[_0x5f72('0x47')][_0x5f72('0x46')](_0x57655b)){if(_0x57007a[_0x5f72('0x3d')][_0x587edd['id']][_0x5f72('0x46')](_0x57655b+_0x5f72('0x48'))){_0x57007a[_0x5f72('0x3d')][_0x587edd['id']][_0x57655b+_0x5f72('0x48')]=parseInt(_0x587edd['capacity'][_0x57655b],0xa);}}}_0x57007a[_0x5f72('0x3d')][_0x587edd['id']]['updateRealtime']();return _0x241231({'code':0xc8,'message':_0x57007a[_0x5f72('0x3d')][_0x587edd['id']]});}else{return _0x5e0fd9(_0x397b2a[_0x5f72('0x32')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4c3930){return new Promise(function(_0x2995dc,_0x269f23){var _0x39036d=_[_0x5f72('0x49')](_0x57007a['agents']);_0x2995dc({'count':_0x39036d[_0x5f72('0x1b')],'rows':_0x39036d});});},'ChatQueues':function(_0x1db15b){return new Promise(function(_0x14e20b,_0x48cae9){var _0x12a464=[];for(var _0x29113a in _0x57007a[_0x5f72('0x4a')]){if(_0x57007a[_0x5f72('0x4a')][_0x5f72('0x46')](_0x29113a)){var _0x36774e=_0x57007a[_0x5f72('0x4a')][_0x29113a];var _0x15e9a5={'id':_0x36774e['id'],'available':_0x36774e[_0x5f72('0x4b')],'loggedIn':_0x36774e[_0x5f72('0x4c')],'name':_0x36774e[_0x5f72('0x4d')],'paused':_0x36774e[_0x5f72('0x4e')],'waiting':_0x36774e['waiting']};_0x12a464[_0x5f72('0x24')](_0x15e9a5);}}_0x14e20b({'count':_0x12a464[_0x5f72('0x1b')],'rows':_0x12a464});});},'MailQueues':function(_0x27b9d7){return new Promise(function(_0x339a8d,_0xf1d356){var _0x39bc0e=[];for(var _0x55daf6 in _0x57007a[_0x5f72('0x4f')]){if(_0x57007a[_0x5f72('0x4f')][_0x5f72('0x46')](_0x55daf6)){var _0x419279=_0x57007a['mailQueues'][_0x55daf6];var _0x306c75={'id':_0x419279['id'],'available':_0x419279['available'],'loggedIn':_0x419279[_0x5f72('0x4c')],'name':_0x419279[_0x5f72('0x4d')],'paused':_0x419279[_0x5f72('0x4e')],'waiting':_0x419279[_0x5f72('0x50')]};_0x39bc0e['push'](_0x306c75);}}_0x339a8d({'count':_0x39bc0e[_0x5f72('0x1b')],'rows':_0x39bc0e});});},'OpenchannelQueues':function(_0x86b9a){return new Promise(function(_0x23d8c2,_0xb07770){var _0x59af10=[];for(var _0x50bd1a in _0x57007a[_0x5f72('0x51')]){if(_0x57007a['openchannelQueues']['hasOwnProperty'](_0x50bd1a)){var _0x130e4b=_0x57007a[_0x5f72('0x51')][_0x50bd1a];var _0x2a5dcb={'id':_0x130e4b['id'],'available':_0x130e4b['available'],'loggedIn':_0x130e4b[_0x5f72('0x4c')],'name':_0x130e4b[_0x5f72('0x4d')],'paused':_0x130e4b[_0x5f72('0x4e')],'waiting':_0x130e4b[_0x5f72('0x50')]};_0x59af10[_0x5f72('0x24')](_0x2a5dcb);}}_0x23d8c2({'count':_0x59af10[_0x5f72('0x1b')],'rows':_0x59af10});});},'SmsQueues':function(_0x342a31){return new Promise(function(_0x2475e9,_0x2369ec){var _0x24aa1e=[];for(var _0x196482 in _0x57007a[_0x5f72('0x52')]){if(_0x57007a[_0x5f72('0x52')]['hasOwnProperty'](_0x196482)){var _0x1c0ba1=_0x57007a[_0x5f72('0x52')][_0x196482];var _0x3753b5={'id':_0x1c0ba1['id'],'available':_0x1c0ba1['available'],'loggedIn':_0x1c0ba1[_0x5f72('0x4c')],'name':_0x1c0ba1['name'],'paused':_0x1c0ba1['paused'],'waiting':_0x1c0ba1['waiting']};_0x24aa1e['push'](_0x3753b5);}}_0x2475e9({'count':_0x24aa1e['length'],'rows':_0x24aa1e});});},'FaxQueues':function(_0x1cd273){return new Promise(function(_0x4cc70c,_0x551736){var _0x2a846b=[];for(var _0x2404fd in _0x57007a[_0x5f72('0x53')]){if(_0x57007a[_0x5f72('0x53')][_0x5f72('0x46')](_0x2404fd)){var _0x3352c5=_0x57007a[_0x5f72('0x53')][_0x2404fd];var _0x23ebb4={'id':_0x3352c5['id'],'available':_0x3352c5['available'],'loggedIn':_0x3352c5[_0x5f72('0x4c')],'name':_0x3352c5[_0x5f72('0x4d')],'paused':_0x3352c5[_0x5f72('0x4e')],'waiting':_0x3352c5[_0x5f72('0x50')]};_0x2a846b[_0x5f72('0x24')](_0x23ebb4);}}_0x4cc70c({'count':_0x2a846b[_0x5f72('0x1b')],'rows':_0x2a846b});});},'WhatsappQueues':function(_0x1da7de){return new Promise(function(_0x3317d9,_0x251883){var _0x14b72b=[];for(var _0x18e110 in _0x57007a[_0x5f72('0x54')]){if(_0x57007a[_0x5f72('0x54')][_0x5f72('0x46')](_0x18e110)){var _0x1d5d04=_0x57007a['whatsappQueues'][_0x18e110];var _0x164fba={'id':_0x1d5d04['id'],'available':_0x1d5d04[_0x5f72('0x4b')],'loggedIn':_0x1d5d04[_0x5f72('0x4c')],'name':_0x1d5d04['name'],'paused':_0x1d5d04[_0x5f72('0x4e')],'waiting':_0x1d5d04['waiting']};_0x14b72b[_0x5f72('0x24')](_0x164fba);}}_0x3317d9({'count':_0x14b72b[_0x5f72('0x1b')],'rows':_0x14b72b});});},'ChatQueuesWaitingInteractions':function(_0x43cfc0){return new Promise(function(_0x4281b7,_0x4ee2f6){var _0x8886b4=_[_0x5f72('0x49')](_0x57007a['chatQueuesWaitingInteractions']);_0x4281b7({'count':_0x8886b4[_0x5f72('0x1b')],'rows':_0x8886b4});});},'MailQueuesWaitingInteractions':function(_0x2ee75d){return new Promise(function(_0x3fb18b,_0x2cc457){var _0x2500d1=_[_0x5f72('0x49')](_0x57007a[_0x5f72('0x55')]);_0x3fb18b({'count':_0x2500d1[_0x5f72('0x1b')],'rows':_0x2500d1});});},'OpenchannelQueuesWaitingInteractions':function(_0x5ba635){return new Promise(function(_0x71d3c6,_0x653bd0){var _0xaaae35=_[_0x5f72('0x49')](_0x57007a[_0x5f72('0x56')]);_0x71d3c6({'count':_0xaaae35[_0x5f72('0x1b')],'rows':_0xaaae35});});},'SmsQueuesWaitingInteractions':function(_0x139175){return new Promise(function(_0x28e4e8,_0x50d2ae){var _0x2f1346=_[_0x5f72('0x49')](_0x57007a[_0x5f72('0x57')]);_0x28e4e8({'count':_0x2f1346['length'],'rows':_0x2f1346});});},'FaxQueuesWaitingInteractions':function(_0x3b2cff){return new Promise(function(_0xb078a3,_0x2aff96){var _0x54b9cd=_[_0x5f72('0x49')](_0x57007a[_0x5f72('0x58')]);_0xb078a3({'count':_0x54b9cd[_0x5f72('0x1b')],'rows':_0x54b9cd});});},'WhatsappQueuesWaitingInteractions':function(_0x3afc6a){return new Promise(function(_0xc929da,_0x310930){var _0x43064f=_['values'](_0x57007a['whatsappQueuesWaitingInteractions']);_0xc929da({'count':_0x43064f['length'],'rows':_0x43064f});});}};var _0x4d2539=jayson['server'](_0x1665be)[_0x5f72('0x59')]();_0x4d2539['on']('error',function(_0xa0db47){logger[_0x5f72('0x32')](JSON[_0x5f72('0x37')](_0xa0db47));return _0x50f8c8(_0xa0db47);});_0x4d2539[_0x5f72('0x15')](0x232c,_0x5f72('0x5a'),function(){console[_0x5f72('0x5b')](_0x5f72('0x5c'),0x232c);return _0x4f81e9(_0x5f72('0x5d')+0x232c);});});};
\ No newline at end of file
+var _0xd9dc=['emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','waiting','mailQueues','available','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','path','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Applications\x20executed','stringify'];(function(_0x3e9a9c,_0x19c96a){var _0x568a31=function(_0x4ffeb4){while(--_0x4ffeb4){_0x3e9a9c['push'](_0x3e9a9c['shift']());}};_0x568a31(++_0x19c96a);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x388b2b,_0x4bcdfb){_0x388b2b=_0x388b2b-0x0;var _0x491672=_0xd9dc[_0x388b2b];return _0x491672;};'use strict';var _=require('lodash');var util=require(_0xcd9d('0x0'));var path=require(_0xcd9d('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xcd9d('0x2'));var uuid=require(_0xcd9d('0x3'));var utils=require(_0xcd9d('0x4'));var config=require('../../../config/environment');var logger=require(_0xcd9d('0x5'))(_0xcd9d('0x6'));var rpc={'openchannelQueueReport':require(_0xcd9d('0x7')),'mailQueueReport':require(_0xcd9d('0x8')),'chatQueueReport':require(_0xcd9d('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xcd9d('0xa')),'whatsappQueueReport':require(_0xcd9d('0xb'))};var RuleEngine=require(_0xcd9d('0xc'));function getId(_0x285e75,_0x45130c,_0x549558){return util[_0xcd9d('0xd')](_0xcd9d('0xe'),_0x285e75,_0x45130c||0x0,_0x549558||0x0);}function getIntervals(_0x32dce7,_0x112c01){var _0x18f6a7=[];if(!_[_0xcd9d('0xf')](_0x112c01[_0xcd9d('0x10')])&&!_[_0xcd9d('0xf')](_0x32dce7[_0x112c01['IntervalId']])&&!_[_0xcd9d('0xf')](_0x32dce7[_0x112c01['IntervalId']][_0xcd9d('0x11')])){_0x18f6a7=_['map'](_0x32dce7[_0x112c01[_0xcd9d('0x10')]][_0xcd9d('0x11')],_0xcd9d('0x12'));}else if(!_['isNil'](_0x112c01[_0xcd9d('0x12')])){_0x18f6a7=[_0x112c01['interval']];}return _0x18f6a7;}exports[_0xcd9d('0x13')]=function(_0x957089){_0x957089[_0xcd9d('0x14')]={};return new BPromise(function(_0x582a92,_0x12edfc){var _0x64d51c={'Start':function(_0x50f14d){var _0x40d5aa=this;return new Promise(function(_0x5a7248,_0x3ea72c){if(_0x50f14d){try{var _0x534c8f=[];var _0x3e5e23=getId(_0x50f14d[_0xcd9d('0x15')],_0x50f14d[_0xcd9d('0x16')]?_0x50f14d[_0xcd9d('0x16')]['id']:0x0,_0x50f14d[_0xcd9d('0x17')]?_0x50f14d[_0xcd9d('0x17')]['id']:0x0);if(_0x50f14d[_0xcd9d('0x18')]&&_[_0xcd9d('0x19')](_0x50f14d[_0xcd9d('0x18')])&&_0x50f14d[_0xcd9d('0x18')][_0xcd9d('0x1a')]){for(var _0x497425=0x0;_0x497425<_0x50f14d[_0xcd9d('0x18')][_0xcd9d('0x1a')];_0x497425+=0x1){var _0x3599eb=_0x50f14d['applications'][_0x497425];if(fs[_0xcd9d('0x1b')](path[_0xcd9d('0x1c')](__dirname,_0xcd9d('0x18'),_0x3599eb[_0xcd9d('0x1d')]+_0xcd9d('0x1e')))){var _0x2891b6=[];switch(_0x3599eb[_0xcd9d('0x1d')][_0xcd9d('0x1f')]()){case'autoreply':var _0x5d7613=_0x3599eb[_0xcd9d('0x20')][_0xcd9d('0x21')](',');if(_0x50f14d[_0xcd9d('0x15')]===_0xcd9d('0x22')){_0x2891b6['push'](_0x5d7613[0x0]);_0x2891b6[_0xcd9d('0x23')](_0x5d7613[0x1]);_0x2891b6[_0xcd9d('0x23')](_0x5d7613[_0xcd9d('0x24')](0x2,_0x5d7613[_0xcd9d('0x1a')])[_0xcd9d('0x1c')](','));}else{_0x2891b6[_0xcd9d('0x23')](_0x5d7613[0x0]);_0x2891b6[_0xcd9d('0x23')](_0x5d7613[_0xcd9d('0x24')](0x1,_0x5d7613[_0xcd9d('0x1a')])[_0xcd9d('0x1c')](','));}break;case _0xcd9d('0x25'):var _0x3b1abd=_0x3599eb[_0xcd9d('0x20')]['split'](',');_0x2891b6[_0xcd9d('0x23')](_0x3b1abd[0x0]);_0x2891b6[_0xcd9d('0x23')](_0x3b1abd[0x1]);_0x2891b6['push'](_0x3b1abd['slice'](0x2,_0x3b1abd[_0xcd9d('0x1a')])[_0xcd9d('0x1c')](','));break;case'dialogflowv2':var _0xcf8b36=_0x3599eb[_0xcd9d('0x20')][_0xcd9d('0x21')](',');_0x2891b6[_0xcd9d('0x23')](_0xcf8b36[0x0]);_0x2891b6[_0xcd9d('0x23')](_0xcf8b36[0x1]);_0x2891b6['push'](_0xcf8b36[0x2]);_0x2891b6[_0xcd9d('0x23')](_0xcf8b36[0x3]);_0x2891b6[_0xcd9d('0x23')](_0xcf8b36[_0xcd9d('0x24')](0x4,_0xcf8b36['length'])[_0xcd9d('0x1c')](','));break;case _0xcd9d('0x26'):var _0x38e3e2=_0x3599eb['appdata'][_0xcd9d('0x21')](',');_0x2891b6[_0xcd9d('0x23')](_0x38e3e2[0x0]);_0x2891b6[_0xcd9d('0x23')](_0x38e3e2[0x1]);_0x2891b6[_0xcd9d('0x23')](_0x38e3e2[0x2]);_0x2891b6['push'](_0x38e3e2[0x3]);_0x2891b6['push'](_0x38e3e2[_0xcd9d('0x24')](0x4,_0x38e3e2['length'])['join'](','));break;case _0xcd9d('0x16'):_0x2891b6[_0xcd9d('0x23')](_0x3599eb[_0xcd9d('0x20')]);break;case _0xcd9d('0x27'):_0x2891b6['push'](_0x3599eb['TagId']);_0x2891b6[_0xcd9d('0x23')](_0x3599eb[_0xcd9d('0x20')]);break;case _0xcd9d('0x28'):var _0x57ac64=utils[_0xcd9d('0x29')](_0x50f14d[_0xcd9d('0x2a')][_0xcd9d('0x2b')],_0x50f14d);var _0x1cac92=_0x3599eb[_0xcd9d('0x20')][_0xcd9d('0x21')](',');_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x0]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x1]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x2]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x3]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x4]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x5]);_0x2891b6['push'](_0x1cac92[0x6]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x7]);_0x2891b6[_0xcd9d('0x23')](_0x1cac92[0x8]);_0x2891b6['push'](_0x1cac92[0x9]);_0x2891b6['push'](_0x1cac92[0xa]);_0x2891b6[_0xcd9d('0x23')](_0x50f14d['interaction']['id']);_0x2891b6['push'](_0x50f14d[_0xcd9d('0x16')]['id']);_0x2891b6[_0xcd9d('0x23')](_0x3599eb[_0xcd9d('0x2c')]);_0x2891b6[_0xcd9d('0x23')](_0x50f14d['interaction'][_0xcd9d('0x2d')]);_0x2891b6[_0xcd9d('0x23')](_0x50f14d['body'][_0xcd9d('0x2e')]);_0x2891b6[_0xcd9d('0x23')](_0x57ac64);break;default:_0x2891b6=_[_0xcd9d('0xf')](_0x3599eb[_0xcd9d('0x20')])?[]:_0x3599eb['appdata']['split'](',');}var _0x308488={'id':util['format'](_0xcd9d('0x2f'),_0x3e5e23,_0x3599eb['id'],_0x3599eb[_0xcd9d('0x1d')]),'condition':require(_0xcd9d('0x30'))['condition'](_0x3e5e23,getIntervals(_0x957089[_0xcd9d('0x31')],_0x3599eb),_0x957089),'consequence':require(_0xcd9d('0x32')+_0x3599eb[_0xcd9d('0x1d')])[_0xcd9d('0x33')](_0x3e5e23,_0x2891b6,_0x957089,_0x50f14d),'p':_0x3599eb[_0xcd9d('0x34')]||0x0};logger[_0xcd9d('0x35')](_0xcd9d('0x36'),_0x308488['id'],_0xcd9d('0x37'),getIntervals(_0x957089[_0xcd9d('0x31')],_0x3599eb)[_0xcd9d('0x1c')](_0xcd9d('0x38')));_0x534c8f['push'](_0x308488);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xcd9d('0x1c')](__dirname,_0xcd9d('0x18'),_0x3599eb[_0xcd9d('0x1d')]+'.js'));}}_0x957089[_0xcd9d('0x14')][_0x3e5e23]=new RuleEngine(_0x534c8f);_0x957089[_0xcd9d('0x14')][_0x3e5e23]['execute'](_0x50f14d,function(_0x44d0ca){logger['info'](_0xcd9d('0x39'),JSON[_0xcd9d('0x3a')](_0x44d0ca['matchPath']));if(_0x957089['rules'][_0x3e5e23]){_0x957089[_0xcd9d('0x14')][_0x3e5e23][_0xcd9d('0x3b')](_0xcd9d('0x3c'));}});return _0x5a7248({'code':0xc8,'message':_0x50f14d});}else{logger[_0xcd9d('0x35')](_0xcd9d('0x3d'));return _0x5a7248({'code':0xc8,'message':_0x50f14d});}}catch(_0x1081cd){logger['error'](_0x1081cd['stack']);return _0x3ea72c(_0x40d5aa['error'](0x1f4,_0x1081cd));}}return _0x3ea72c(_0xcd9d('0x3e'));});},'AcceptMessage':function(_0x3d1bc0){var _0x53a8b2=this;return new Promise(function(_0x45233f,_0x3cf390){if(_0x3d1bc0[_0xcd9d('0x3f')]&&_0x3d1bc0[_0xcd9d('0x3f')]['id']){if(_0x957089[_0xcd9d('0x40')][_0x3d1bc0[_0xcd9d('0x3f')]['id']]){_0x957089[_0xcd9d('0x40')][_0x3d1bc0[_0xcd9d('0x3f')]['id']][_0xcd9d('0x41')]=![];_0x957089[_0xcd9d('0x40')][_0x3d1bc0['agent']['id']][_0xcd9d('0x42')]=undefined;}}if(_0x3d1bc0[_0xcd9d('0x16')]&&_0x3d1bc0[_0xcd9d('0x16')]['id']){try{var _0x2b927c=getId(_0x3d1bc0[_0xcd9d('0x15')],_0x3d1bc0[_0xcd9d('0x16')]?_0x3d1bc0[_0xcd9d('0x16')]['id']:0x0,_0x3d1bc0[_0xcd9d('0x17')]?_0x3d1bc0['interaction']['id']:0x0);if(_0x957089[_0xcd9d('0x14')][_0x2b927c]){_0x957089[_0xcd9d('0x14')][_0x2b927c][_0xcd9d('0x3b')]('end');if(rpc[_0x3d1bc0[_0xcd9d('0x15')]+_0xcd9d('0x43')]){rpc[_0x3d1bc0[_0xcd9d('0x15')]+_0xcd9d('0x43')][_0xcd9d('0x44')](_0x2b927c,{'UserId':_0x3d1bc0[_0xcd9d('0x16')][_0xcd9d('0x45')]})[_0xcd9d('0x46')](function(_0x5c541e){logger[_0xcd9d('0x47')](_0xcd9d('0x48'));});}}return _0x45233f({'code':0xc8,'message':_0x3d1bc0});}catch(_0x293d30){logger[_0xcd9d('0x47')](_0x293d30['stack']);return _0x3cf390(_0x53a8b2[_0xcd9d('0x47')](0x1f4,_0x293d30));}}logger[_0xcd9d('0x47')](_0xcd9d('0x49'));return _0x3cf390(_0x53a8b2[_0xcd9d('0x47')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x27a363){var _0x3e6754=this;return new Promise(function(_0x1bf893,_0x425e86){if(_0x27a363[_0xcd9d('0x3f')]&&_0x27a363['agent']['id']){try{if(_0x957089[_0xcd9d('0x40')][_0x27a363[_0xcd9d('0x3f')]['id']]){_0x957089['agents'][_0x27a363[_0xcd9d('0x3f')]['id']][_0xcd9d('0x41')]=![];_0x957089['agents'][_0x27a363[_0xcd9d('0x3f')]['id']][_0xcd9d('0x42')]=undefined;}return _0x1bf893({'code':0xc8,'message':_0x27a363});}catch(_0x28f4bd){logger[_0xcd9d('0x47')](_0x28f4bd[_0xcd9d('0x4a')]);return _0x425e86(_0x3e6754[_0xcd9d('0x47')](0x1f4,_0x28f4bd));}}logger['error']('message\x20is\x20empty');return _0x425e86(_0x3e6754['error'](0x1f4,_0xcd9d('0x49')));});},'AbandonInteraction':function(_0x372bce){var _0x36ab7d=this;return new Promise(function(_0x4ba03e,_0x18d427){if(_0x372bce[_0xcd9d('0x15')]&&_0x372bce['interaction']&&_0x372bce[_0xcd9d('0x17')]['id']){try{var _0x1877fd=getId(_0x372bce[_0xcd9d('0x15')],_0x372bce['message']?_0x372bce[_0xcd9d('0x16')]['id']:0x0,_0x372bce[_0xcd9d('0x17')]?_0x372bce['interaction']['id']:0x0);if(_0x957089[_0xcd9d('0x14')][_0x1877fd]){_0x957089['rules'][_0x1877fd][_0xcd9d('0x3b')](_0xcd9d('0x4b'));}return _0x4ba03e({'code':0xc8,'message':_0x372bce});}catch(_0x1e350c){logger['error'](_0x1e350c[_0xcd9d('0x4a')]);return _0x18d427(_0x36ab7d[_0xcd9d('0x47')](0x1f4,_0x1e350c));}}logger[_0xcd9d('0x47')](_0xcd9d('0x49'));return _0x18d427(_0x36ab7d[_0xcd9d('0x47')](0x1f4,_0xcd9d('0x49')));});},'AgentCapacity':function(_0x2d1b93){var _0x288d3e=this;return new Promise(function(_0xf9b506,_0x542546){if(_0x957089[_0xcd9d('0x40')][_0xcd9d('0x4c')](_0x2d1b93['id'])){for(var _0x303584 in _0x2d1b93['capacity']){if(_0x2d1b93[_0xcd9d('0x4d')][_0xcd9d('0x4c')](_0x303584)){if(_0x957089[_0xcd9d('0x40')][_0x2d1b93['id']][_0xcd9d('0x4c')](_0x303584+_0xcd9d('0x4e'))){_0x957089[_0xcd9d('0x40')][_0x2d1b93['id']][_0x303584+'CurrentCapacity']=parseInt(_0x2d1b93['capacity'][_0x303584],0xa);}}}_0x957089[_0xcd9d('0x40')][_0x2d1b93['id']][_0xcd9d('0x4f')]();return _0xf9b506({'code':0xc8,'message':_0x957089[_0xcd9d('0x40')][_0x2d1b93['id']]});}else{return _0x542546(_0x288d3e[_0xcd9d('0x47')](0x1f4,_0xcd9d('0x50')));}});},'Agents':function(_0x55e3df){return new Promise(function(_0x39a73c,_0x55e1a3){var _0xe4aace=_['values'](_0x957089[_0xcd9d('0x40')]);_0x39a73c({'count':_0xe4aace['length'],'rows':_0xe4aace});});},'ChatQueues':function(_0x380e8b){return new Promise(function(_0x32fd7e,_0x5608f1){var _0x2f4bfa=[];for(var _0x5a7e9f in _0x957089[_0xcd9d('0x51')]){if(_0x957089[_0xcd9d('0x51')]['hasOwnProperty'](_0x5a7e9f)){var _0x305eff=_0x957089[_0xcd9d('0x51')][_0x5a7e9f];var _0x23998d={'id':_0x305eff['id'],'available':_0x305eff['available'],'loggedIn':_0x305eff[_0xcd9d('0x52')],'name':_0x305eff['name'],'paused':_0x305eff['paused'],'waiting':_0x305eff[_0xcd9d('0x53')]};_0x2f4bfa[_0xcd9d('0x23')](_0x23998d);}}_0x32fd7e({'count':_0x2f4bfa[_0xcd9d('0x1a')],'rows':_0x2f4bfa});});},'MailQueues':function(_0x538c53){return new Promise(function(_0x1b5467,_0x1787fb){var _0x251e68=[];for(var _0x26cad2 in _0x957089[_0xcd9d('0x54')]){if(_0x957089[_0xcd9d('0x54')]['hasOwnProperty'](_0x26cad2)){var _0x30fdc2=_0x957089[_0xcd9d('0x54')][_0x26cad2];var _0x52933d={'id':_0x30fdc2['id'],'available':_0x30fdc2[_0xcd9d('0x55')],'loggedIn':_0x30fdc2['loggedIn'],'name':_0x30fdc2[_0xcd9d('0x56')],'paused':_0x30fdc2[_0xcd9d('0x57')],'waiting':_0x30fdc2[_0xcd9d('0x53')]};_0x251e68[_0xcd9d('0x23')](_0x52933d);}}_0x1b5467({'count':_0x251e68[_0xcd9d('0x1a')],'rows':_0x251e68});});},'OpenchannelQueues':function(_0x2e1b36){return new Promise(function(_0xf8932c,_0xb62b90){var _0x2e7eef=[];for(var _0x4a16f8 in _0x957089[_0xcd9d('0x58')]){if(_0x957089['openchannelQueues'][_0xcd9d('0x4c')](_0x4a16f8)){var _0x124c5d=_0x957089[_0xcd9d('0x58')][_0x4a16f8];var _0x2f3c93={'id':_0x124c5d['id'],'available':_0x124c5d[_0xcd9d('0x55')],'loggedIn':_0x124c5d['loggedIn'],'name':_0x124c5d[_0xcd9d('0x56')],'paused':_0x124c5d[_0xcd9d('0x57')],'waiting':_0x124c5d[_0xcd9d('0x53')]};_0x2e7eef[_0xcd9d('0x23')](_0x2f3c93);}}_0xf8932c({'count':_0x2e7eef[_0xcd9d('0x1a')],'rows':_0x2e7eef});});},'SmsQueues':function(_0x5353ef){return new Promise(function(_0x5b4a56,_0xb6d303){var _0x47da2b=[];for(var _0x24f307 in _0x957089[_0xcd9d('0x59')]){if(_0x957089['smsQueues'][_0xcd9d('0x4c')](_0x24f307)){var _0x110be1=_0x957089[_0xcd9d('0x59')][_0x24f307];var _0x1e7665={'id':_0x110be1['id'],'available':_0x110be1['available'],'loggedIn':_0x110be1[_0xcd9d('0x52')],'name':_0x110be1['name'],'paused':_0x110be1['paused'],'waiting':_0x110be1['waiting']};_0x47da2b[_0xcd9d('0x23')](_0x1e7665);}}_0x5b4a56({'count':_0x47da2b['length'],'rows':_0x47da2b});});},'FaxQueues':function(_0x3d1bd0){return new Promise(function(_0x3f9a2d,_0x43374b){var _0x36e6ca=[];for(var _0x24684b in _0x957089[_0xcd9d('0x5a')]){if(_0x957089['faxQueues'][_0xcd9d('0x4c')](_0x24684b)){var _0x470a1d=_0x957089[_0xcd9d('0x5a')][_0x24684b];var _0x5527b8={'id':_0x470a1d['id'],'available':_0x470a1d[_0xcd9d('0x55')],'loggedIn':_0x470a1d[_0xcd9d('0x52')],'name':_0x470a1d[_0xcd9d('0x56')],'paused':_0x470a1d['paused'],'waiting':_0x470a1d[_0xcd9d('0x53')]};_0x36e6ca['push'](_0x5527b8);}}_0x3f9a2d({'count':_0x36e6ca[_0xcd9d('0x1a')],'rows':_0x36e6ca});});},'WhatsappQueues':function(_0x2fbeee){return new Promise(function(_0x26630d,_0x1cc657){var _0x2eefbc=[];for(var _0xa40477 in _0x957089[_0xcd9d('0x5b')]){if(_0x957089[_0xcd9d('0x5b')][_0xcd9d('0x4c')](_0xa40477)){var _0x7732f1=_0x957089['whatsappQueues'][_0xa40477];var _0x4b2edc={'id':_0x7732f1['id'],'available':_0x7732f1[_0xcd9d('0x55')],'loggedIn':_0x7732f1[_0xcd9d('0x52')],'name':_0x7732f1[_0xcd9d('0x56')],'paused':_0x7732f1[_0xcd9d('0x57')],'waiting':_0x7732f1['waiting']};_0x2eefbc['push'](_0x4b2edc);}}_0x26630d({'count':_0x2eefbc['length'],'rows':_0x2eefbc});});},'ChatQueuesWaitingInteractions':function(_0x339b4d){return new Promise(function(_0x4b2acf,_0x1aabf5){var _0xe82822=_[_0xcd9d('0x5c')](_0x957089[_0xcd9d('0x5d')]);_0x4b2acf({'count':_0xe82822[_0xcd9d('0x1a')],'rows':_0xe82822});});},'MailQueuesWaitingInteractions':function(_0x413a95){return new Promise(function(_0x1a64b3,_0x292303){var _0xb56e5a=_[_0xcd9d('0x5c')](_0x957089['mailQueuesWaitingInteractions']);_0x1a64b3({'count':_0xb56e5a[_0xcd9d('0x1a')],'rows':_0xb56e5a});});},'OpenchannelQueuesWaitingInteractions':function(_0x5d613d){return new Promise(function(_0x59490,_0x1cf4d3){var _0x3212fd=_[_0xcd9d('0x5c')](_0x957089[_0xcd9d('0x5e')]);_0x59490({'count':_0x3212fd[_0xcd9d('0x1a')],'rows':_0x3212fd});});},'SmsQueuesWaitingInteractions':function(_0x13d9e7){return new Promise(function(_0x1588d3,_0x21d255){var _0x4b1288=_[_0xcd9d('0x5c')](_0x957089[_0xcd9d('0x5f')]);_0x1588d3({'count':_0x4b1288[_0xcd9d('0x1a')],'rows':_0x4b1288});});},'FaxQueuesWaitingInteractions':function(_0x69da4c){return new Promise(function(_0x2d1581,_0x2def56){var _0x53da0f=_[_0xcd9d('0x5c')](_0x957089[_0xcd9d('0x60')]);_0x2d1581({'count':_0x53da0f[_0xcd9d('0x1a')],'rows':_0x53da0f});});},'WhatsappQueuesWaitingInteractions':function(_0x572afd){return new Promise(function(_0x14e45b,_0x591b4b){var _0x55dbdf=_[_0xcd9d('0x5c')](_0x957089['whatsappQueuesWaitingInteractions']);_0x14e45b({'count':_0x55dbdf[_0xcd9d('0x1a')],'rows':_0x55dbdf});});}};var _0x2620ac=jayson[_0xcd9d('0x61')](_0x64d51c)['http']();_0x2620ac['on'](_0xcd9d('0x47'),function(_0x10b945){logger['error'](JSON[_0xcd9d('0x3a')](_0x10b945));return _0x12edfc(_0x10b945);});_0x2620ac['listen'](0x232c,_0xcd9d('0x62'),function(){console[_0xcd9d('0x63')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x582a92(_0xcd9d('0x64')+0x232c);});});};
\ No newline at end of file