5f2f7057ed4f9a877c325a6f0b3279349a3a7595
[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 _0x33cc=['resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x3a06a3,_0x49de97){var _0x4f8a4b=function(_0xe85551){while(--_0xe85551){_0x3a06a3['push'](_0x3a06a3['shift']());}};_0x4f8a4b(++_0x49de97);}(_0x33cc,0xe8));var _0xc33c=function(_0x3b6b36,_0x2df3c9){_0x3b6b36=_0x3b6b36-0x0;var _0x109c4a=_0x33cc[_0x3b6b36];return _0x109c4a;};'use strict';var BPromise=require(_0xc33c('0x0'));var server=require(_0xc33c('0x1'));var Realtime=require(_0xc33c('0x2'));var user=require(_0xc33c('0x3'));var interval=require(_0xc33c('0x4'));var openchannelQueue=require(_0xc33c('0x5'));var chatQueue=require(_0xc33c('0x6'));var smsQueue=require(_0xc33c('0x7'));var mailQueue=require(_0xc33c('0x8'));var faxQueue=require(_0xc33c('0x9'));var whatsappQueue=require(_0xc33c('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc33c('0xb')]()[_0xc33c('0xc')](user[_0xc33c('0xd')]())['then'](realtime[_0xc33c('0xe')]())[_0xc33c('0xc')](interval['getIntervals']())['then'](realtime[_0xc33c('0xf')]())[_0xc33c('0xc')](openchannelQueue[_0xc33c('0x10')]())[_0xc33c('0xc')](realtime[_0xc33c('0x11')]())['then'](chatQueue[_0xc33c('0x12')]())['then'](realtime[_0xc33c('0x13')]())[_0xc33c('0xc')](smsQueue[_0xc33c('0x14')]())['then'](realtime[_0xc33c('0x15')]())[_0xc33c('0xc')](mailQueue['getMailQueues']())['then'](realtime[_0xc33c('0x16')]())['then'](faxQueue['getFaxQueues']())['then'](realtime[_0xc33c('0x17')]())[_0xc33c('0xc')](whatsappQueue[_0xc33c('0x18')]())['then'](realtime[_0xc33c('0x19')]())['then'](function(){return realtime;});}function main(){return server[_0xc33c('0x1a')](realtime)[_0xc33c('0xc')](function(_0x2b4253){return initRealtime();})[_0xc33c('0xc')](function(_0xa03d5c){return setInterval(initRealtime,0x1388);})['catch'](function(_0x4bad33){console['log'](_0x4bad33);});}main();