Built motion from commit 953226e6.|2.6.32
[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 _0x55e7=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x55e7,0x1e7));var _0x755e=function(_0x3816d0,_0x521e30){_0x3816d0=_0x3816d0-0x0;var _0x199b29=_0x55e7[_0x3816d0];return _0x199b29;};'use strict';var jayson=require(_0x755e('0x0'));var BPromise=require(_0x755e('0x1'));var logger=require(_0x755e('0x2'))(_0x755e('0x3'));var client=jayson[_0x755e('0x4')][_0x755e('0x5')]({'port':0x2329});client[_0x755e('0x6')]=function(_0x584fdd,_0x108660){return new BPromise(function(_0x348181,_0x5802f7){return client[_0x755e('0x7')](_0x584fdd,_0x108660)['then'](function(_0x4772e5){logger[_0x755e('0x8')](_0x755e('0x9'),'routing',_0x584fdd,_0x108660,_0x4772e5);if(_0x4772e5['error']){logger[_0x755e('0xa')](_0x755e('0x9'),'routing',_0x584fdd,_0x4772e5[_0x755e('0xa')][_0x755e('0xb')],_0x108660);return _0x5802f7(_0x4772e5['error'][_0x755e('0xb')]);}else{return _0x348181(_0x4772e5[_0x755e('0xc')]);}})[_0x755e('0xd')](function(_0x629587){logger[_0x755e('0xa')](_0x755e('0x9'),'routing',_0x584fdd,_0x629587,_0x108660);return _0x5802f7(_0x629587);});});};module[_0x755e('0xe')]=client;