3d303ff054674965a540d50a9d0cdb46ad2252f2
[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 _0x64f5=['then','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x64f5,0xf2));var _0x564f=function(_0x4920a1,_0x5bc215){_0x4920a1=_0x4920a1-0x0;var _0x25ae52=_0x64f5[_0x4920a1];return _0x25ae52;};'use strict';var jayson=require(_0x564f('0x0'));var BPromise=require(_0x564f('0x1'));var logger=require(_0x564f('0x2'))('routing');var client=jayson['client'][_0x564f('0x3')]({'port':0x2329});client['Request']=function(_0x5a7bfc,_0x1c73b2){return new BPromise(function(_0x32efb5,_0x47be19){return client[_0x564f('0x4')](_0x5a7bfc,_0x1c73b2)[_0x564f('0x5')](function(_0x5141c2){logger['debug'](_0x564f('0x6'),_0x564f('0x7'),_0x5a7bfc,_0x1c73b2,_0x5141c2);if(_0x5141c2[_0x564f('0x8')]){logger[_0x564f('0x8')](_0x564f('0x6'),_0x564f('0x7'),_0x5a7bfc,_0x5141c2[_0x564f('0x8')][_0x564f('0x9')],_0x1c73b2);return _0x47be19(_0x5141c2[_0x564f('0x8')][_0x564f('0x9')]);}else{return _0x32efb5(_0x5141c2[_0x564f('0xa')]);}})[_0x564f('0xb')](function(_0x5544b5){logger['error'](_0x564f('0x6'),_0x564f('0x7'),_0x5a7bfc,_0x5544b5,_0x1c73b2);return _0x47be19(_0x5544b5);});});};module[_0x564f('0xc')]=client;