Built motion from commit (unavailable).|2.5.6
[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 _0x92e0=['../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','jayson/promise'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x092e('0x0'));var BPromise=require('bluebird');var logger=require(_0x092e('0x1'))(_0x092e('0x2'));var client=jayson[_0x092e('0x3')][_0x092e('0x4')]({'port':0x2329});client[_0x092e('0x5')]=function(_0xadc488,_0x3756db){return new BPromise(function(_0x416760,_0x15b057){return client[_0x092e('0x6')](_0xadc488,_0x3756db)['then'](function(_0x48af76){logger[_0x092e('0x7')](_0x092e('0x8'),_0x092e('0x2'),_0xadc488,_0x3756db,_0x48af76);if(_0x48af76['error']){logger[_0x092e('0x9')]('rpc','routing',_0xadc488,_0x48af76[_0x092e('0x9')][_0x092e('0xa')],_0x3756db);return _0x15b057(_0x48af76['error'][_0x092e('0xa')]);}else{return _0x416760(_0x48af76['result']);}})['catch'](function(_0x200936){logger['error'](_0x092e('0x8'),'routing',_0xadc488,_0x200936,_0x3756db);return _0x15b057(_0x200936);});});};module['exports']=client;