0640f75aaaaa557caf05cd8e4f22ed0eeeb924ac
[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 _0xf8c3=['bluebird','./server','./realtime','./rpc/user','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','catch','log'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0xf8c3,0x84));var _0x3f8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8c3[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3f8c('0x0'));var server=require(_0x3f8c('0x1'));var Realtime=require(_0x3f8c('0x2'));var user=require(_0x3f8c('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x3f8c('0x4'));var faxQueue=require(_0x3f8c('0x5'));var whatsappQueue=require(_0x3f8c('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x3f8c('0x7')](user[_0x3f8c('0x8')]())[_0x3f8c('0x7')](realtime['initAgents']())[_0x3f8c('0x7')](interval[_0x3f8c('0x9')]())[_0x3f8c('0x7')](realtime[_0x3f8c('0xa')]())[_0x3f8c('0x7')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x3f8c('0xb')]())['then'](chatQueue['getChatQueues']())[_0x3f8c('0x7')](realtime[_0x3f8c('0xc')]())['then'](smsQueue[_0x3f8c('0xd')]())[_0x3f8c('0x7')](realtime[_0x3f8c('0xe')]())[_0x3f8c('0x7')](mailQueue[_0x3f8c('0xf')]())['then'](realtime[_0x3f8c('0x10')]())[_0x3f8c('0x7')](faxQueue[_0x3f8c('0x11')]())[_0x3f8c('0x7')](realtime[_0x3f8c('0x12')]())[_0x3f8c('0x7')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x3f8c('0x13')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x3f8c('0x7')](function(_0x3bad01){return initRealtime();})[_0x3f8c('0x7')](function(_0x11020e){return setInterval(initRealtime,0x1388);})[_0x3f8c('0x14')](function(_0xdff585){console[_0x3f8c('0x15')](_0xdff585);});}main();