Built motion from commit f541bb3b.|2.6.14
[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 _0x72f6=['./rpc/faxQueue','resolve','initAgents','then','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue'];(function(_0x1d60b3,_0x65a805){var _0x2c5d8c=function(_0x4a252f){while(--_0x4a252f){_0x1d60b3['push'](_0x1d60b3['shift']());}};_0x2c5d8c(++_0x65a805);}(_0x72f6,0x125));var _0x672f=function(_0x153e29,_0x14b328){_0x153e29=_0x153e29-0x0;var _0x1efb66=_0x72f6[_0x153e29];return _0x1efb66;};'use strict';var BPromise=require('bluebird');var server=require(_0x672f('0x0'));var Realtime=require(_0x672f('0x1'));var user=require(_0x672f('0x2'));var interval=require(_0x672f('0x3'));var openchannelQueue=require(_0x672f('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x672f('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x672f('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x672f('0x7')]()['then'](user['getAgents']())['then'](realtime[_0x672f('0x8')]())[_0x672f('0x9')](interval['getIntervals']())[_0x672f('0x9')](realtime[_0x672f('0xa')]())[_0x672f('0x9')](openchannelQueue[_0x672f('0xb')]())[_0x672f('0x9')](realtime[_0x672f('0xc')]())['then'](chatQueue[_0x672f('0xd')]())[_0x672f('0x9')](realtime[_0x672f('0xe')]())['then'](smsQueue[_0x672f('0xf')]())['then'](realtime['initSmsQueues']())[_0x672f('0x9')](mailQueue[_0x672f('0x10')]())[_0x672f('0x9')](realtime['initMailQueues']())[_0x672f('0x9')](faxQueue[_0x672f('0x11')]())[_0x672f('0x9')](realtime[_0x672f('0x12')]())[_0x672f('0x9')](whatsappQueue[_0x672f('0x13')]())[_0x672f('0x9')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x672f('0x14')](realtime)[_0x672f('0x9')](function(_0x2971f5){return initRealtime();})[_0x672f('0x9')](function(_0x142ef6){return setInterval(initRealtime,0x1388);})[_0x672f('0x15')](function(_0x355517){console[_0x672f('0x16')](_0x355517);});}main();