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 _0x6c09=['result','jayson/promise','bluebird','../../config/logger','client','Request','request','then','debug','rpc','error','routing','message'];(function(_0x5d4328,_0x26238d){var _0xc5d009=function(_0x2f7b19){while(--_0x2f7b19){_0x5d4328['push'](_0x5d4328['shift']());}};_0xc5d009(++_0x26238d);}(_0x6c09,0x160));var _0x96c0=function(_0x3f13a1,_0x10301a){_0x3f13a1=_0x3f13a1-0x0;var _0x5e882e=_0x6c09[_0x3f13a1];return _0x5e882e;};'use strict';var jayson=require(_0x96c0('0x0'));var BPromise=require(_0x96c0('0x1'));var logger=require(_0x96c0('0x2'))('routing');var client=jayson[_0x96c0('0x3')]['http']({'port':0x2329});client[_0x96c0('0x4')]=function(_0x264923,_0x5ede35){return new BPromise(function(_0x7b7bd5,_0x5d0a63){return client[_0x96c0('0x5')](_0x264923,_0x5ede35)[_0x96c0('0x6')](function(_0x517746){logger[_0x96c0('0x7')](_0x96c0('0x8'),'routing',_0x264923,_0x5ede35,_0x517746);if(_0x517746['error']){logger[_0x96c0('0x9')]('rpc',_0x96c0('0xa'),_0x264923,_0x517746[_0x96c0('0x9')][_0x96c0('0xb')],_0x5ede35);return _0x5d0a63(_0x517746[_0x96c0('0x9')]['message']);}else{return _0x7b7bd5(_0x517746[_0x96c0('0xc')]);}})['catch'](function(_0x2c3ea7){logger[_0x96c0('0x9')](_0x96c0('0x8'),_0x96c0('0xa'),_0x264923,_0x2c3ea7,_0x5ede35);return _0x5d0a63(_0x2c3ea7);});});};module['exports']=client;