1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x526a=['then','rpc','error','message','result','catch','jayson/promise','bluebird','routing','client','Request','request'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x526a,0xae));var _0xa526=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x526a[_0x46aff0];return _0x9d78cf;};'use strict';var jayson=require(_0xa526('0x0'));var BPromise=require(_0xa526('0x1'));var logger=require('../../config/logger')(_0xa526('0x2'));var client=jayson[_0xa526('0x3')]['http']({'port':0x2329});client[_0xa526('0x4')]=function(_0x33a7e8,_0x12650c){return new BPromise(function(_0x15075e,_0x58edd2){return client[_0xa526('0x5')](_0x33a7e8,_0x12650c)[_0xa526('0x6')](function(_0xdc6798){logger['debug'](_0xa526('0x7'),_0xa526('0x2'),_0x33a7e8,_0x12650c,_0xdc6798);if(_0xdc6798[_0xa526('0x8')]){logger[_0xa526('0x8')](_0xa526('0x7'),_0xa526('0x2'),_0x33a7e8,_0xdc6798['error'][_0xa526('0x9')],_0x12650c);return _0x58edd2(_0xdc6798[_0xa526('0x8')][_0xa526('0x9')]);}else{return _0x15075e(_0xdc6798[_0xa526('0xa')]);}})[_0xa526('0xb')](function(_0x1e973d){logger[_0xa526('0x8')](_0xa526('0x7'),'routing',_0x33a7e8,_0x1e973d,_0x12650c);return _0x58edd2(_0x1e973d);});});};module['exports']=client;