Built motion from commit (unavailable).|2.5.21
[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 _0x4c1c=['result','catch','exports','jayson/promise','ami','client','http','request','then','debug','rpc','error','memberReport','message'];(function(_0x1951f4,_0x290fd0){var _0x158f70=function(_0x15b452){while(--_0x15b452){_0x1951f4['push'](_0x1951f4['shift']());}};_0x158f70(++_0x290fd0);}(_0x4c1c,0x161));var _0xc4c1=function(_0x489d1a,_0xe91bdd){_0x489d1a=_0x489d1a-0x0;var _0x2a9d76=_0x4c1c[_0x489d1a];return _0x2a9d76;};'use strict';var jayson=require(_0xc4c1('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xc4c1('0x1'));var client=jayson[_0xc4c1('0x2')][_0xc4c1('0x3')]({'port':0x2329});client['Request']=function(_0x579631,_0xc21317){return new BPromise(function(_0x34fc11,_0x2cfb8d){return client[_0xc4c1('0x4')](_0x579631,_0xc21317)[_0xc4c1('0x5')](function(_0x4572e8){logger[_0xc4c1('0x6')](_0xc4c1('0x7'),'memberReport',_0x579631,_0xc21317,_0x4572e8);if(_0x4572e8['error']){logger[_0xc4c1('0x8')](_0xc4c1('0x7'),_0xc4c1('0x9'),_0x579631,_0x4572e8['error'][_0xc4c1('0xa')],_0xc21317);return _0x2cfb8d(_0x4572e8[_0xc4c1('0x8')]['message']);}else{return _0x34fc11(_0x4572e8[_0xc4c1('0xb')]);}})[_0xc4c1('0xc')](function(_0x75c81b){logger['error'](_0xc4c1('0x7'),'memberReport',_0x579631,_0x75c81b,_0xc21317);return _0x2cfb8d(_0x75c81b);});});};module[_0xc4c1('0xd')]=client;