Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / services / ami / 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 _0x6a45=['memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','request','then','debug','rpc'];(function(_0x49efca,_0x4bdc73){var _0x12c325=function(_0x973a4e){while(--_0x973a4e){_0x49efca['push'](_0x49efca['shift']());}};_0x12c325(++_0x4bdc73);}(_0x6a45,0x149));var _0x56a4=function(_0x52d0d3,_0x49167f){_0x52d0d3=_0x52d0d3-0x0;var _0x15af73=_0x6a45[_0x52d0d3];return _0x15af73;};'use strict';var jayson=require(_0x56a4('0x0'));var BPromise=require(_0x56a4('0x1'));var logger=require(_0x56a4('0x2'))(_0x56a4('0x3'));var client=jayson[_0x56a4('0x4')][_0x56a4('0x5')]({'port':0x2329});client[_0x56a4('0x6')]=function(_0x154460,_0x470017){return new BPromise(function(_0x58925f,_0x3d7f63){return client[_0x56a4('0x7')](_0x154460,_0x470017)[_0x56a4('0x8')](function(_0xeeb71a){logger[_0x56a4('0x9')](_0x56a4('0xa'),_0x56a4('0xb'),_0x154460,_0x470017,_0xeeb71a);if(_0xeeb71a[_0x56a4('0xc')]){logger['error'](_0x56a4('0xa'),_0x56a4('0xb'),_0x154460,_0xeeb71a[_0x56a4('0xc')][_0x56a4('0xd')],_0x470017);return _0x3d7f63(_0xeeb71a['error'][_0x56a4('0xd')]);}else{return _0x58925f(_0xeeb71a[_0x56a4('0xe')]);}})[_0x56a4('0xf')](function(_0x14602c){logger[_0x56a4('0xc')](_0x56a4('0xa'),_0x56a4('0xb'),_0x154460,_0x14602c,_0x470017);return _0x3d7f63(_0x14602c);});});};module[_0x56a4('0x10')]=client;