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 _0x0d9c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x55607b,_0x41b9de){var _0x20a5b0=function(_0xedafb4){while(--_0xedafb4){_0x55607b['push'](_0x55607b['shift']());}};_0x20a5b0(++_0x41b9de);}(_0x0d9c,0xa3));var _0xc0d9=function(_0x273c83,_0x2b2100){_0x273c83=_0x273c83-0x0;var _0x1ade28=_0x0d9c[_0x273c83];return _0x1ade28;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc0d9('0x0'));var BPromise=require(_0xc0d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0d9('0x2'));var db=require(_0xc0d9('0x3'))['db'];var utils=require(_0xc0d9('0x4'));var logger=require(_0xc0d9('0x5'))('rpc');var config=require(_0xc0d9('0x6'));var jayson=require(_0xc0d9('0x7'));var client=jayson[_0xc0d9('0x8')][_0xc0d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b63de,_0x411bc5,_0x5cb881){return new BPromise(function(_0x5dc845,_0x5358ed){return client[_0xc0d9('0xa')](_0x4b63de,_0x5cb881)['then'](function(_0x307c3c){logger[_0xc0d9('0xb')](_0xc0d9('0xc'),_0x411bc5,'request\x20sent');logger[_0xc0d9('0xd')](_0xc0d9('0xe'),_0x411bc5,_0xc0d9('0xf'),JSON[_0xc0d9('0x10')](_0x307c3c));if(_0x307c3c['error']){if(_0x307c3c['error'][_0xc0d9('0x11')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x411bc5,_0x307c3c['error'][_0xc0d9('0x12')]);return _0x5358ed(_0x307c3c[_0xc0d9('0x13')][_0xc0d9('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x411bc5,_0x307c3c[_0xc0d9('0x13')][_0xc0d9('0x12')]);return _0x5dc845(_0x307c3c[_0xc0d9('0x13')]['message']);}else{logger[_0xc0d9('0xb')](_0xc0d9('0xc'),_0x411bc5,_0xc0d9('0xf'));_0x5dc845(_0x307c3c[_0xc0d9('0x14')][_0xc0d9('0x12')]);}})['catch'](function(_0x16002a){logger['error'](_0xc0d9('0xc'),_0x411bc5,_0x16002a);_0x5358ed(_0x16002a);});});}