1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xda3b=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x4789f0,_0x46b3c6){var _0x2cddcb=function(_0x51ef93){while(--_0x51ef93){_0x4789f0['push'](_0x4789f0['shift']());}};_0x2cddcb(++_0x46b3c6);}(_0xda3b,0x144));var _0xbda3=function(_0x2bd0f3,_0x259957){_0x2bd0f3=_0x2bd0f3-0x0;var _0x1aad5a=_0xda3b[_0x2bd0f3];return _0x1aad5a;};'use strict';var _=require(_0xbda3('0x0'));var util=require('util');var moment=require(_0xbda3('0x1'));var BPromise=require(_0xbda3('0x2'));var rs=require(_0xbda3('0x3'));var fs=require('fs');var Redis=require(_0xbda3('0x4'));var db=require(_0xbda3('0x5'))['db'];var utils=require(_0xbda3('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbda3('0x7'));var client=jayson[_0xbda3('0x8')][_0xbda3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e469f,_0x4e4d88,_0x8302c6){return new BPromise(function(_0x542ddf,_0x203e7b){return client[_0xbda3('0xa')](_0x1e469f,_0x8302c6)[_0xbda3('0xb')](function(_0x74d268){logger[_0xbda3('0xc')](_0xbda3('0xd'),_0x4e4d88,_0xbda3('0xe'));logger[_0xbda3('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4e4d88,_0xbda3('0xe'),JSON[_0xbda3('0x10')](_0x74d268));if(_0x74d268[_0xbda3('0x11')]){if(_0x74d268['error'][_0xbda3('0x12')]===0x1f4){logger[_0xbda3('0x11')](_0xbda3('0xd'),_0x4e4d88,_0x74d268['error']['message']);return _0x203e7b(_0x74d268[_0xbda3('0x11')]['message']);}logger[_0xbda3('0x11')](_0xbda3('0xd'),_0x4e4d88,_0x74d268['error']['message']);return _0x542ddf(_0x74d268[_0xbda3('0x11')]['message']);}else{logger[_0xbda3('0xc')](_0xbda3('0xd'),_0x4e4d88,'request\x20sent');_0x542ddf(_0x74d268[_0xbda3('0x13')]['message']);}})[_0xbda3('0x14')](function(_0x5c06e){logger[_0xbda3('0x11')](_0xbda3('0xd'),_0x4e4d88,_0x5c06e);_0x203e7b(_0x5c06e);});});}