Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / services / routing / client.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 _0xe5c1=['result','exports','jayson/promise','bluebird','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0x53ee43,_0x2a63ec){var _0x58b2ca=function(_0x35e8a0){while(--_0x35e8a0){_0x53ee43['push'](_0x53ee43['shift']());}};_0x58b2ca(++_0x2a63ec);}(_0xe5c1,0x128));var _0x1e5c=function(_0x2af68a,_0x42a579){_0x2af68a=_0x2af68a-0x0;var _0xbc7741=_0xe5c1[_0x2af68a];return _0xbc7741;};'use strict';var jayson=require(_0x1e5c('0x0'));var BPromise=require(_0x1e5c('0x1'));var logger=require('../../config/logger')(_0x1e5c('0x2'));var client=jayson[_0x1e5c('0x3')][_0x1e5c('0x4')]({'port':0x2329});client[_0x1e5c('0x5')]=function(_0x391a52,_0x2f3240){return new BPromise(function(_0x557b87,_0x48193c){return client[_0x1e5c('0x6')](_0x391a52,_0x2f3240)[_0x1e5c('0x7')](function(_0xad52b9){logger[_0x1e5c('0x8')](_0x1e5c('0x9'),'routing',_0x391a52,_0x2f3240,_0xad52b9);if(_0xad52b9[_0x1e5c('0xa')]){logger[_0x1e5c('0xa')](_0x1e5c('0x9'),'routing',_0x391a52,_0xad52b9['error'][_0x1e5c('0xb')],_0x2f3240);return _0x48193c(_0xad52b9[_0x1e5c('0xa')][_0x1e5c('0xb')]);}else{return _0x557b87(_0xad52b9[_0x1e5c('0xc')]);}})['catch'](function(_0x6c74e0){logger[_0x1e5c('0xa')](_0x1e5c('0x9'),_0x1e5c('0x2'),_0x391a52,_0x6c74e0,_0x2f3240);return _0x48193c(_0x6c74e0);});});};module[_0x1e5c('0xd')]=client;