8538d24ec2c89adaf6cdf0b4811a8d2d42f9e4b5
[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 _0x86f3=['jayson/promise','bluebird','../../config/logger','ami','client','http','Request','request','then','debug','rpc','memberReport','error','message','result','catch','exports'];(function(_0x3ae6cf,_0x53aecb){var _0x1ccdfe=function(_0xe43356){while(--_0xe43356){_0x3ae6cf['push'](_0x3ae6cf['shift']());}};_0x1ccdfe(++_0x53aecb);}(_0x86f3,0xee));var _0x386f=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x86f3[_0x3207aa];return _0x51758f;};'use strict';var jayson=require(_0x386f('0x0'));var BPromise=require(_0x386f('0x1'));var logger=require(_0x386f('0x2'))(_0x386f('0x3'));var client=jayson[_0x386f('0x4')][_0x386f('0x5')]({'port':0x2329});client[_0x386f('0x6')]=function(_0xd09313,_0x2e7390){return new BPromise(function(_0x8b6d1b,_0x5a2232){return client[_0x386f('0x7')](_0xd09313,_0x2e7390)[_0x386f('0x8')](function(_0x42039f){logger[_0x386f('0x9')](_0x386f('0xa'),_0x386f('0xb'),_0xd09313,_0x2e7390,_0x42039f);if(_0x42039f[_0x386f('0xc')]){logger[_0x386f('0xc')](_0x386f('0xa'),_0x386f('0xb'),_0xd09313,_0x42039f[_0x386f('0xc')]['message'],_0x2e7390);return _0x5a2232(_0x42039f[_0x386f('0xc')][_0x386f('0xd')]);}else{return _0x8b6d1b(_0x42039f[_0x386f('0xe')]);}})[_0x386f('0xf')](function(_0x36a77c){logger[_0x386f('0xc')](_0x386f('0xa'),_0x386f('0xb'),_0xd09313,_0x36a77c,_0x2e7390);return _0x5a2232(_0x36a77c);});});};module[_0x386f('0x10')]=client;