Built motion from commit (unavailable).|2.4.18
[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 _0xa4ba=['error','message','result','catch','exports','bluebird','../../config/logger','routing','client','Request','request','then','debug','rpc'];(function(_0x595919,_0x4ed5d7){var _0x28080c=function(_0x4d9b53){while(--_0x4d9b53){_0x595919['push'](_0x595919['shift']());}};_0x28080c(++_0x4ed5d7);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xa4ba[_0x36884e];return _0x1cc367;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var client=jayson[_0xaa4b('0x3')]['http']({'port':0x2329});client[_0xaa4b('0x4')]=function(_0x5e7bce,_0x54f0ce){return new BPromise(function(_0xeb83b1,_0x1b2ee8){return client[_0xaa4b('0x5')](_0x5e7bce,_0x54f0ce)[_0xaa4b('0x6')](function(_0x4809a9){logger[_0xaa4b('0x7')]('rpc',_0xaa4b('0x2'),_0x5e7bce,_0x54f0ce,_0x4809a9);if(_0x4809a9['error']){logger['error'](_0xaa4b('0x8'),_0xaa4b('0x2'),_0x5e7bce,_0x4809a9[_0xaa4b('0x9')][_0xaa4b('0xa')],_0x54f0ce);return _0x1b2ee8(_0x4809a9[_0xaa4b('0x9')][_0xaa4b('0xa')]);}else{return _0xeb83b1(_0x4809a9[_0xaa4b('0xb')]);}})[_0xaa4b('0xc')](function(_0xfb7353){logger[_0xaa4b('0x9')](_0xaa4b('0x8'),_0xaa4b('0x2'),_0x5e7bce,_0xfb7353,_0x54f0ce);return _0x1b2ee8(_0xfb7353);});});};module[_0xaa4b('0xd')]=client;