Built motion from commit (unavailable).|2.5.23
[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 _0x3770=['bluebird','../../config/logger','ami','client','http','Request','request','debug','rpc','memberReport','error','message','result','catch','exports','jayson/promise'];(function(_0x164c1f,_0x32b331){var _0x628dc8=function(_0x5224ad){while(--_0x5224ad){_0x164c1f['push'](_0x164c1f['shift']());}};_0x628dc8(++_0x32b331);}(_0x3770,0x14f));var _0x0377=function(_0x2d8c39,_0x4f82ba){_0x2d8c39=_0x2d8c39-0x0;var _0x5c339a=_0x3770[_0x2d8c39];return _0x5c339a;};'use strict';var jayson=require(_0x0377('0x0'));var BPromise=require(_0x0377('0x1'));var logger=require(_0x0377('0x2'))(_0x0377('0x3'));var client=jayson[_0x0377('0x4')][_0x0377('0x5')]({'port':0x2329});client[_0x0377('0x6')]=function(_0xcdb223,_0x76d0c4){return new BPromise(function(_0x3ef3cc,_0x33f740){return client[_0x0377('0x7')](_0xcdb223,_0x76d0c4)['then'](function(_0x51edf9){logger[_0x0377('0x8')](_0x0377('0x9'),_0x0377('0xa'),_0xcdb223,_0x76d0c4,_0x51edf9);if(_0x51edf9[_0x0377('0xb')]){logger[_0x0377('0xb')](_0x0377('0x9'),_0x0377('0xa'),_0xcdb223,_0x51edf9[_0x0377('0xb')][_0x0377('0xc')],_0x76d0c4);return _0x33f740(_0x51edf9[_0x0377('0xb')][_0x0377('0xc')]);}else{return _0x3ef3cc(_0x51edf9[_0x0377('0xd')]);}})[_0x0377('0xe')](function(_0x533320){logger['error'](_0x0377('0x9'),_0x0377('0xa'),_0xcdb223,_0x533320,_0x76d0c4);return _0x33f740(_0x533320);});});};module[_0x0377('0xf')]=client;