Built motion from commit (unavailable).|2.5.18
[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 _0x15cc=['../../config/logger','ami','client','Request','rpc','memberReport','error','message','result','catch','exports','bluebird'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x15cc,0x9b));var _0xc15c=function(_0x23f09e,_0x38a061){_0x23f09e=_0x23f09e-0x0;var _0x4bf0ae=_0x15cc[_0x23f09e];return _0x4bf0ae;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc15c('0x0'));var logger=require(_0xc15c('0x1'))(_0xc15c('0x2'));var client=jayson[_0xc15c('0x3')]['http']({'port':0x2329});client[_0xc15c('0x4')]=function(_0x208425,_0x1e8c0d){return new BPromise(function(_0x4a8489,_0x981e3e){return client['request'](_0x208425,_0x1e8c0d)['then'](function(_0x52b7ba){logger['debug'](_0xc15c('0x5'),_0xc15c('0x6'),_0x208425,_0x1e8c0d,_0x52b7ba);if(_0x52b7ba['error']){logger[_0xc15c('0x7')](_0xc15c('0x5'),_0xc15c('0x6'),_0x208425,_0x52b7ba[_0xc15c('0x7')][_0xc15c('0x8')],_0x1e8c0d);return _0x981e3e(_0x52b7ba[_0xc15c('0x7')][_0xc15c('0x8')]);}else{return _0x4a8489(_0x52b7ba[_0xc15c('0x9')]);}})[_0xc15c('0xa')](function(_0x5c472d){logger[_0xc15c('0x7')](_0xc15c('0x5'),'memberReport',_0x208425,_0x5c472d,_0x1e8c0d);return _0x981e3e(_0x5c472d);});});};module[_0xc15c('0xb')]=client;