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 _0x36d1=['request','then','error','rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0xc2efdb,_0xf7047){var _0x4c98c4=function(_0x16c6a2){while(--_0x16c6a2){_0xc2efdb['push'](_0xc2efdb['shift']());}};_0x4c98c4(++_0xf7047);}(_0x36d1,0x71));var _0x136d=function(_0x397473,_0x5b6ec2){_0x397473=_0x397473-0x0;var _0x57f0e5=_0x36d1[_0x397473];return _0x57f0e5;};'use strict';var jayson=require(_0x136d('0x0'));var BPromise=require(_0x136d('0x1'));var logger=require(_0x136d('0x2'))(_0x136d('0x3'));var client=jayson[_0x136d('0x4')][_0x136d('0x5')]({'port':0x2329});client[_0x136d('0x6')]=function(_0x44d6e8,_0x443b96){return new BPromise(function(_0x42c5c5,_0x350547){return client[_0x136d('0x7')](_0x44d6e8,_0x443b96)[_0x136d('0x8')](function(_0x94ee4b){logger['debug']('rpc',_0x136d('0x3'),_0x44d6e8,_0x443b96,_0x94ee4b);if(_0x94ee4b['error']){logger[_0x136d('0x9')](_0x136d('0xa'),_0x136d('0x3'),_0x44d6e8,_0x94ee4b[_0x136d('0x9')][_0x136d('0xb')],_0x443b96);return _0x350547(_0x94ee4b[_0x136d('0x9')][_0x136d('0xb')]);}else{return _0x42c5c5(_0x94ee4b[_0x136d('0xc')]);}})[_0x136d('0xd')](function(_0x2a816d){logger[_0x136d('0x9')](_0x136d('0xa'),_0x136d('0x3'),_0x44d6e8,_0x2a816d,_0x443b96);return _0x350547(_0x2a816d);});});};module[_0x136d('0xe')]=client;