Built motion from commit f3da74b7.|2.5.36
[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 _0xd926=['then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x4024ca,_0x318053){var _0x489730=function(_0x5273b8){while(--_0x5273b8){_0x4024ca['push'](_0x4024ca['shift']());}};_0x489730(++_0x318053);}(_0xd926,0xcb));var _0x6d92=function(_0x56be74,_0x207a86){_0x56be74=_0x56be74-0x0;var _0x5c22af=_0xd926[_0x56be74];return _0x5c22af;};'use strict';var jayson=require(_0x6d92('0x0'));var BPromise=require(_0x6d92('0x1'));var logger=require(_0x6d92('0x2'))(_0x6d92('0x3'));var client=jayson[_0x6d92('0x4')][_0x6d92('0x5')]({'port':0x2329});client[_0x6d92('0x6')]=function(_0x1ea4b4,_0x3b957d){return new BPromise(function(_0x21fac7,_0x4189df){return client['request'](_0x1ea4b4,_0x3b957d)[_0x6d92('0x7')](function(_0x1f680a){logger[_0x6d92('0x8')](_0x6d92('0x9'),'routing',_0x1ea4b4,_0x3b957d,_0x1f680a);if(_0x1f680a[_0x6d92('0xa')]){logger[_0x6d92('0xa')](_0x6d92('0x9'),_0x6d92('0x3'),_0x1ea4b4,_0x1f680a['error'][_0x6d92('0xb')],_0x3b957d);return _0x4189df(_0x1f680a[_0x6d92('0xa')][_0x6d92('0xb')]);}else{return _0x21fac7(_0x1f680a[_0x6d92('0xc')]);}})[_0x6d92('0xd')](function(_0xc151cc){logger['error'](_0x6d92('0x9'),_0x6d92('0x3'),_0x1ea4b4,_0xc151cc,_0x3b957d);return _0x4189df(_0xc151cc);});});};module[_0x6d92('0xe')]=client;