Built motion from commit 092f8824.|2.5.49
[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 _0xc30c=['Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','http'];(function(_0x5bb1cd,_0x3e5d55){var _0x50306c=function(_0x134b35){while(--_0x134b35){_0x5bb1cd['push'](_0x5bb1cd['shift']());}};_0x50306c(++_0x3e5d55);}(_0xc30c,0x15a));var _0xcc30=function(_0x24cd89,_0x4a82d9){_0x24cd89=_0x24cd89-0x0;var _0x23c687=_0xc30c[_0x24cd89];return _0x23c687;};'use strict';var jayson=require(_0xcc30('0x0'));var BPromise=require('bluebird');var logger=require(_0xcc30('0x1'))(_0xcc30('0x2'));var client=jayson['client'][_0xcc30('0x3')]({'port':0x2329});client[_0xcc30('0x4')]=function(_0x552056,_0x9d8eac){return new BPromise(function(_0x199da1,_0xd3092a){return client[_0xcc30('0x5')](_0x552056,_0x9d8eac)[_0xcc30('0x6')](function(_0x1f8ab0){logger[_0xcc30('0x7')](_0xcc30('0x8'),_0xcc30('0x2'),_0x552056,_0x9d8eac,_0x1f8ab0);if(_0x1f8ab0[_0xcc30('0x9')]){logger[_0xcc30('0x9')](_0xcc30('0x8'),_0xcc30('0x2'),_0x552056,_0x1f8ab0[_0xcc30('0x9')][_0xcc30('0xa')],_0x9d8eac);return _0xd3092a(_0x1f8ab0['error'][_0xcc30('0xa')]);}else{return _0x199da1(_0x1f8ab0[_0xcc30('0xb')]);}})[_0xcc30('0xc')](function(_0x86f631){logger[_0xcc30('0x9')](_0xcc30('0x8'),'routing',_0x552056,_0x86f631,_0x9d8eac);return _0xd3092a(_0x86f631);});});};module[_0xcc30('0xd')]=client;