Built motion from commit (unavailable).|2.5.14
[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 _0x4986=['../../config/logger','http','Request','request','then','debug','error','rpc','routing','message','result','exports','jayson/promise','bluebird'];(function(_0x452c6e,_0x5d35ee){var _0x25302e=function(_0xa23bbe){while(--_0xa23bbe){_0x452c6e['push'](_0x452c6e['shift']());}};_0x25302e(++_0x5d35ee);}(_0x4986,0x6e));var _0x6498=function(_0x3d87db,_0x121d3e){_0x3d87db=_0x3d87db-0x0;var _0x140782=_0x4986[_0x3d87db];return _0x140782;};'use strict';var jayson=require(_0x6498('0x0'));var BPromise=require(_0x6498('0x1'));var logger=require(_0x6498('0x2'))('routing');var client=jayson['client'][_0x6498('0x3')]({'port':0x2329});client[_0x6498('0x4')]=function(_0x5d24c6,_0x15e8d3){return new BPromise(function(_0x12a6fb,_0x2c54ee){return client[_0x6498('0x5')](_0x5d24c6,_0x15e8d3)[_0x6498('0x6')](function(_0x8d1853){logger[_0x6498('0x7')]('rpc','routing',_0x5d24c6,_0x15e8d3,_0x8d1853);if(_0x8d1853[_0x6498('0x8')]){logger[_0x6498('0x8')](_0x6498('0x9'),_0x6498('0xa'),_0x5d24c6,_0x8d1853[_0x6498('0x8')]['message'],_0x15e8d3);return _0x2c54ee(_0x8d1853[_0x6498('0x8')][_0x6498('0xb')]);}else{return _0x12a6fb(_0x8d1853[_0x6498('0xc')]);}})['catch'](function(_0x55a564){logger[_0x6498('0x8')]('rpc',_0x6498('0xa'),_0x5d24c6,_0x55a564,_0x15e8d3);return _0x2c54ee(_0x55a564);});});};module[_0x6498('0xd')]=client;