4eb27dc0eda585005c1013bbedbee6a4980eccd2
[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 _0xfd3c=['getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','./realtime','./rpc/user','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xfd3c,0x1d7));var _0xcfd3=function(_0x181d5b,_0x128c5c){_0x181d5b=_0x181d5b-0x0;var _0x10eefb=_0xfd3c[_0x181d5b];return _0x10eefb;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xcfd3('0x0'));var user=require(_0xcfd3('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xcfd3('0x2'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xcfd3('0x3'));var faxQueue=require(_0xcfd3('0x4'));var whatsappQueue=require(_0xcfd3('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xcfd3('0x6')](user[_0xcfd3('0x7')]())[_0xcfd3('0x6')](realtime['initAgents']())[_0xcfd3('0x6')](interval[_0xcfd3('0x8')]())[_0xcfd3('0x6')](realtime[_0xcfd3('0x9')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xcfd3('0x6')](realtime[_0xcfd3('0xa')]())[_0xcfd3('0x6')](chatQueue[_0xcfd3('0xb')]())['then'](realtime[_0xcfd3('0xc')]())[_0xcfd3('0x6')](smsQueue[_0xcfd3('0xd')]())[_0xcfd3('0x6')](realtime['initSmsQueues']())[_0xcfd3('0x6')](mailQueue[_0xcfd3('0xe')]())['then'](realtime[_0xcfd3('0xf')]())[_0xcfd3('0x6')](faxQueue[_0xcfd3('0x10')]())[_0xcfd3('0x6')](realtime[_0xcfd3('0x11')]())[_0xcfd3('0x6')](whatsappQueue[_0xcfd3('0x12')]())[_0xcfd3('0x6')](realtime[_0xcfd3('0x13')]())[_0xcfd3('0x6')](function(){return realtime;});}function main(){return server[_0xcfd3('0x14')](realtime)['then'](function(_0x5e5289){return initRealtime();})[_0xcfd3('0x6')](function(_0x29564f){return setInterval(initRealtime,0x1388);})['catch'](function(_0x264a01){console[_0xcfd3('0x15')](_0x264a01);});}main();