8e7e3ffff65dc0c82510fc7c33f315c67449d505
[motion2.git] / server / services / routing / 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 _0x732f=['./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime'];(function(_0x55aa06,_0x2e288f){var _0x267d72=function(_0x1a58f0){while(--_0x1a58f0){_0x55aa06['push'](_0x55aa06['shift']());}};_0x267d72(++_0x2e288f);}(_0x732f,0xce));var _0xf732=function(_0x155bd1,_0x1fce0d){_0x155bd1=_0x155bd1-0x0;var _0x932f67=_0x732f[_0x155bd1];return _0x932f67;};'use strict';var BPromise=require('bluebird');var server=require(_0xf732('0x0'));var Realtime=require(_0xf732('0x1'));var user=require(_0xf732('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xf732('0x3'));var smsQueue=require(_0xf732('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf732('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf732('0x6')]()[_0xf732('0x7')](user[_0xf732('0x8')]())[_0xf732('0x7')](realtime[_0xf732('0x9')]())[_0xf732('0x7')](interval[_0xf732('0xa')]())[_0xf732('0x7')](realtime[_0xf732('0xb')]())[_0xf732('0x7')](openchannelQueue['getOpenchannelQueues']())[_0xf732('0x7')](realtime[_0xf732('0xc')]())[_0xf732('0x7')](chatQueue[_0xf732('0xd')]())[_0xf732('0x7')](realtime[_0xf732('0xe')]())[_0xf732('0x7')](smsQueue[_0xf732('0xf')]())[_0xf732('0x7')](realtime[_0xf732('0x10')]())[_0xf732('0x7')](mailQueue[_0xf732('0x11')]())['then'](realtime[_0xf732('0x12')]())[_0xf732('0x7')](faxQueue[_0xf732('0x13')]())['then'](realtime[_0xf732('0x14')]())['then'](whatsappQueue[_0xf732('0x15')]())['then'](realtime[_0xf732('0x16')]())[_0xf732('0x7')](function(){return realtime;});}function main(){return server[_0xf732('0x17')](realtime)[_0xf732('0x7')](function(_0x4094a4){return initRealtime();})[_0xf732('0x7')](function(_0xa7b1d5){return setInterval(initRealtime,0x1388);})[_0xf732('0x18')](function(_0x27a722){console[_0xf732('0x19')](_0x27a722);});}main();