Built motion from commit 3c2ce842.|2.6.31
[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 _0xe4a2=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','error','result','catch','rpc'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0xe4a2,0x1e1));var _0x2e4a=function(_0x529994,_0x5712de){_0x529994=_0x529994-0x0;var _0x22bedd=_0xe4a2[_0x529994];return _0x22bedd;};'use strict';var jayson=require(_0x2e4a('0x0'));var BPromise=require(_0x2e4a('0x1'));var logger=require(_0x2e4a('0x2'))(_0x2e4a('0x3'));var client=jayson[_0x2e4a('0x4')][_0x2e4a('0x5')]({'port':0x2329});client[_0x2e4a('0x6')]=function(_0x3e85cd,_0x403c6d){return new BPromise(function(_0xcdb2fb,_0x1da45d){return client['request'](_0x3e85cd,_0x403c6d)[_0x2e4a('0x7')](function(_0xf6c704){logger[_0x2e4a('0x8')]('rpc','routing',_0x3e85cd,_0x403c6d,_0xf6c704);if(_0xf6c704[_0x2e4a('0x9')]){logger[_0x2e4a('0x9')]('rpc',_0x2e4a('0x3'),_0x3e85cd,_0xf6c704['error']['message'],_0x403c6d);return _0x1da45d(_0xf6c704[_0x2e4a('0x9')]['message']);}else{return _0xcdb2fb(_0xf6c704[_0x2e4a('0xa')]);}})[_0x2e4a('0xb')](function(_0x2a5013){logger[_0x2e4a('0x9')](_0x2e4a('0xc'),_0x2e4a('0x3'),_0x3e85cd,_0x2a5013,_0x403c6d);return _0x1da45d(_0x2a5013);});});};module['exports']=client;