Built motion from commit da617fac.|2.6.6
[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 _0x5f95=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals'];(function(_0x1f3ea3,_0x34f96a){var _0x805512=function(_0x135804){while(--_0x135804){_0x1f3ea3['push'](_0x1f3ea3['shift']());}};_0x805512(++_0x34f96a);}(_0x5f95,0x142));var _0x55f9=function(_0x4dffbd,_0x101fa3){_0x4dffbd=_0x4dffbd-0x0;var _0x21d414=_0x5f95[_0x4dffbd];return _0x21d414;};'use strict';var BPromise=require(_0x55f9('0x0'));var server=require(_0x55f9('0x1'));var Realtime=require('./realtime');var user=require(_0x55f9('0x2'));var interval=require(_0x55f9('0x3'));var openchannelQueue=require(_0x55f9('0x4'));var chatQueue=require(_0x55f9('0x5'));var smsQueue=require(_0x55f9('0x6'));var mailQueue=require(_0x55f9('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x55f9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x55f9('0x9')]()['then'](user[_0x55f9('0xa')]())[_0x55f9('0xb')](realtime[_0x55f9('0xc')]())[_0x55f9('0xb')](interval[_0x55f9('0xd')]())[_0x55f9('0xb')](realtime[_0x55f9('0xe')]())[_0x55f9('0xb')](openchannelQueue[_0x55f9('0xf')]())[_0x55f9('0xb')](realtime[_0x55f9('0x10')]())[_0x55f9('0xb')](chatQueue[_0x55f9('0x11')]())[_0x55f9('0xb')](realtime[_0x55f9('0x12')]())[_0x55f9('0xb')](smsQueue[_0x55f9('0x13')]())['then'](realtime['initSmsQueues']())[_0x55f9('0xb')](mailQueue[_0x55f9('0x14')]())[_0x55f9('0xb')](realtime[_0x55f9('0x15')]())[_0x55f9('0xb')](faxQueue[_0x55f9('0x16')]())[_0x55f9('0xb')](realtime[_0x55f9('0x17')]())[_0x55f9('0xb')](whatsappQueue[_0x55f9('0x18')]())[_0x55f9('0xb')](realtime['initWhatsappQueues']())[_0x55f9('0xb')](function(){return realtime;});}function main(){return server[_0x55f9('0x19')](realtime)['then'](function(_0x497c03){return initRealtime();})['then'](function(_0x23b416){return setInterval(initRealtime,0x1388);})[_0x55f9('0x1a')](function(_0x57e6ae){console[_0x55f9('0x1b')](_0x57e6ae);});}main();