Built motion from commit (unavailable).|2.4.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 _0xe767=['then','debug','rpc','memberReport','error','message','result','exports','bluebird','ami','http','Request','request'];(function(_0x2df13f,_0x3a3921){var _0x5c8a3f=function(_0x38aba4){while(--_0x38aba4){_0x2df13f['push'](_0x2df13f['shift']());}};_0x5c8a3f(++_0x3a3921);}(_0xe767,0x18e));var _0x7e76=function(_0x47d45c,_0x52383e){_0x47d45c=_0x47d45c-0x0;var _0x24cb12=_0xe767[_0x47d45c];return _0x24cb12;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7e76('0x0'));var logger=require('../../config/logger')(_0x7e76('0x1'));var client=jayson['client'][_0x7e76('0x2')]({'port':0x2329});client[_0x7e76('0x3')]=function(_0x4fb9fb,_0x5462d5){return new BPromise(function(_0x245f93,_0x713ba2){return client[_0x7e76('0x4')](_0x4fb9fb,_0x5462d5)[_0x7e76('0x5')](function(_0x3670a2){logger[_0x7e76('0x6')](_0x7e76('0x7'),_0x7e76('0x8'),_0x4fb9fb,_0x5462d5,_0x3670a2);if(_0x3670a2[_0x7e76('0x9')]){logger[_0x7e76('0x9')](_0x7e76('0x7'),_0x7e76('0x8'),_0x4fb9fb,_0x3670a2['error'][_0x7e76('0xa')],_0x5462d5);return _0x713ba2(_0x3670a2[_0x7e76('0x9')][_0x7e76('0xa')]);}else{return _0x245f93(_0x3670a2[_0x7e76('0xb')]);}})['catch'](function(_0x54b44b){logger[_0x7e76('0x9')](_0x7e76('0x7'),'memberReport',_0x4fb9fb,_0x54b44b,_0x5462d5);return _0x713ba2(_0x54b44b);});});};module[_0x7e76('0xc')]=client;