d654321d04f9e5d4034bae00d63e8f2a73cfe14b
[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 _0xa44e=['debug','rpc','memberReport','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','ami','http','Request','request','then'];(function(_0x161f26,_0x5ca49d){var _0x2f231b=function(_0x456a5e){while(--_0x456a5e){_0x161f26['push'](_0x161f26['shift']());}};_0x2f231b(++_0x5ca49d);}(_0xa44e,0x142));var _0xea44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa44e[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xea44('0x0'));var BPromise=require(_0xea44('0x1'));var logger=require(_0xea44('0x2'))(_0xea44('0x3'));var client=jayson['client'][_0xea44('0x4')]({'port':0x2329});client[_0xea44('0x5')]=function(_0x1868f7,_0x4d1020){return new BPromise(function(_0x34bf93,_0x40e1c7){return client[_0xea44('0x6')](_0x1868f7,_0x4d1020)[_0xea44('0x7')](function(_0x2275cb){logger[_0xea44('0x8')](_0xea44('0x9'),_0xea44('0xa'),_0x1868f7,_0x4d1020,_0x2275cb);if(_0x2275cb[_0xea44('0xb')]){logger[_0xea44('0xb')](_0xea44('0x9'),_0xea44('0xa'),_0x1868f7,_0x2275cb[_0xea44('0xb')][_0xea44('0xc')],_0x4d1020);return _0x40e1c7(_0x2275cb['error'][_0xea44('0xc')]);}else{return _0x34bf93(_0x2275cb['result']);}})[_0xea44('0xd')](function(_0x56adc5){logger[_0xea44('0xb')](_0xea44('0x9'),_0xea44('0xa'),_0x1868f7,_0x56adc5,_0x4d1020);return _0x40e1c7(_0x56adc5);});});};module[_0xea44('0xe')]=client;