Built motion from commit (unavailable).|2.5.4
[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 _0x43fb=['message','result','catch','exports','bluebird','../../config/logger','ami','http','then','rpc','error'];(function(_0x64c4f3,_0x53d97f){var _0x1e6aed=function(_0x3e9f74){while(--_0x3e9f74){_0x64c4f3['push'](_0x64c4f3['shift']());}};_0x1e6aed(++_0x53d97f);}(_0x43fb,0x19b));var _0xb43f=function(_0x87a48a,_0x381b31){_0x87a48a=_0x87a48a-0x0;var _0x30db16=_0x43fb[_0x87a48a];return _0x30db16;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb43f('0x0'));var logger=require(_0xb43f('0x1'))(_0xb43f('0x2'));var client=jayson['client'][_0xb43f('0x3')]({'port':0x2329});client['Request']=function(_0x39afb5,_0x176525){return new BPromise(function(_0x45130c,_0x48405e){return client['request'](_0x39afb5,_0x176525)[_0xb43f('0x4')](function(_0x54dd4a){logger['debug'](_0xb43f('0x5'),'memberReport',_0x39afb5,_0x176525,_0x54dd4a);if(_0x54dd4a[_0xb43f('0x6')]){logger['error']('rpc','memberReport',_0x39afb5,_0x54dd4a[_0xb43f('0x6')][_0xb43f('0x7')],_0x176525);return _0x48405e(_0x54dd4a['error'][_0xb43f('0x7')]);}else{return _0x45130c(_0x54dd4a[_0xb43f('0x8')]);}})[_0xb43f('0x9')](function(_0x40c687){logger['error'](_0xb43f('0x5'),'memberReport',_0x39afb5,_0x40c687,_0x176525);return _0x48405e(_0x40c687);});});};module[_0xb43f('0xa')]=client;