a080abb00ed85468c8a45b26a562edaf7889a838
[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 _0x544f=['then','debug','rpc','error','message','catch','exports','jayson/promise','routing','client','http','Request','request'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x544f,0x14c));var _0xf544=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x544f[_0x1da527];return _0x40fc7c;};'use strict';var jayson=require(_0xf544('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xf544('0x1'));var client=jayson[_0xf544('0x2')][_0xf544('0x3')]({'port':0x2329});client[_0xf544('0x4')]=function(_0x5ef358,_0x3aedf9){return new BPromise(function(_0x42f20a,_0x599d96){return client[_0xf544('0x5')](_0x5ef358,_0x3aedf9)[_0xf544('0x6')](function(_0x48029d){logger[_0xf544('0x7')](_0xf544('0x8'),_0xf544('0x1'),_0x5ef358,_0x3aedf9,_0x48029d);if(_0x48029d['error']){logger[_0xf544('0x9')]('rpc',_0xf544('0x1'),_0x5ef358,_0x48029d['error'][_0xf544('0xa')],_0x3aedf9);return _0x599d96(_0x48029d['error'][_0xf544('0xa')]);}else{return _0x42f20a(_0x48029d['result']);}})[_0xf544('0xb')](function(_0x166f77){logger[_0xf544('0x9')](_0xf544('0x8'),_0xf544('0x1'),_0x5ef358,_0x166f77,_0x3aedf9);return _0x599d96(_0x166f77);});});};module[_0xf544('0xc')]=client;