Built motion from commit (unavailable).|2.5.31
[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 _0x41c8=['then','debug','rpc','error','memberReport','message','result','catch','jayson/promise','bluebird','http','Request','request'];(function(_0x566e79,_0x37450d){var _0x1b74a8=function(_0x17503b){while(--_0x17503b){_0x566e79['push'](_0x566e79['shift']());}};_0x1b74a8(++_0x37450d);}(_0x41c8,0xd8));var _0x841c=function(_0x393a25,_0x2b24e8){_0x393a25=_0x393a25-0x0;var _0x16ec6e=_0x41c8[_0x393a25];return _0x16ec6e;};'use strict';var jayson=require(_0x841c('0x0'));var BPromise=require(_0x841c('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x841c('0x2')]({'port':0x2329});client[_0x841c('0x3')]=function(_0x1ee5c9,_0x34158a){return new BPromise(function(_0x26604a,_0x176a2d){return client[_0x841c('0x4')](_0x1ee5c9,_0x34158a)[_0x841c('0x5')](function(_0x10a2a6){logger[_0x841c('0x6')](_0x841c('0x7'),'memberReport',_0x1ee5c9,_0x34158a,_0x10a2a6);if(_0x10a2a6[_0x841c('0x8')]){logger[_0x841c('0x8')](_0x841c('0x7'),_0x841c('0x9'),_0x1ee5c9,_0x10a2a6[_0x841c('0x8')]['message'],_0x34158a);return _0x176a2d(_0x10a2a6[_0x841c('0x8')][_0x841c('0xa')]);}else{return _0x26604a(_0x10a2a6[_0x841c('0xb')]);}})[_0x841c('0xc')](function(_0xaca1dd){logger[_0x841c('0x8')](_0x841c('0x7'),'memberReport',_0x1ee5c9,_0xaca1dd,_0x34158a);return _0x176a2d(_0xaca1dd);});});};module['exports']=client;