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 _0x46c9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','moment'];(function(_0x234687,_0x466576){var _0x151bca=function(_0xc7e228){while(--_0xc7e228){_0x234687['push'](_0x234687['shift']());}};_0x151bca(++_0x466576);}(_0x46c9,0x11b));var _0x946c=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x46c9[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x946c('0x0'));var util=require('util');var moment=require(_0x946c('0x1'));var BPromise=require('bluebird');var rs=require(_0x946c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x946c('0x3'))['db'];var utils=require(_0x946c('0x4'));var logger=require(_0x946c('0x5'))(_0x946c('0x6'));var config=require(_0x946c('0x7'));var jayson=require(_0x946c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x479bc9,_0x1f12ee,_0x8e5b2b){return new BPromise(function(_0x2bfda3,_0x2b97b3){return client[_0x946c('0x9')](_0x479bc9,_0x8e5b2b)[_0x946c('0xa')](function(_0x492585){logger[_0x946c('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x1f12ee,_0x946c('0xc'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1f12ee,_0x946c('0xc'),JSON[_0x946c('0xd')](_0x492585));if(_0x492585[_0x946c('0xe')]){if(_0x492585[_0x946c('0xe')][_0x946c('0xf')]===0x1f4){logger[_0x946c('0xe')](_0x946c('0x10'),_0x1f12ee,_0x492585['error'][_0x946c('0x11')]);return _0x2b97b3(_0x492585[_0x946c('0xe')]['message']);}logger[_0x946c('0xe')](_0x946c('0x10'),_0x1f12ee,_0x492585[_0x946c('0xe')][_0x946c('0x11')]);return _0x2bfda3(_0x492585[_0x946c('0xe')][_0x946c('0x11')]);}else{logger['info'](_0x946c('0x10'),_0x1f12ee,'request\x20sent');_0x2bfda3(_0x492585[_0x946c('0x12')][_0x946c('0x11')]);}})['catch'](function(_0x22d2e8){logger[_0x946c('0xe')](_0x946c('0x10'),_0x1f12ee,_0x22d2e8);_0x2b97b3(_0x22d2e8);});});}