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 _0xcb8a=['error','code','message','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb8a,0x194));var _0xacb8=function(_0x5a35a3,_0x107b3c){_0x5a35a3=_0x5a35a3-0x0;var _0x24af1f=_0xcb8a[_0x5a35a3];return _0x24af1f;};'use strict';var _=require(_0xacb8('0x0'));var util=require('util');var moment=require(_0xacb8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacb8('0x2'));var db=require(_0xacb8('0x3'))['db'];var utils=require(_0xacb8('0x4'));var logger=require(_0xacb8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xacb8('0x6'));var client=jayson[_0xacb8('0x7')][_0xacb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x229fac,_0x586338,_0x4ef623){return new BPromise(function(_0x1df5ed,_0xe114cd){return client[_0xacb8('0x9')](_0x229fac,_0x4ef623)[_0xacb8('0xa')](function(_0x10c631){logger[_0xacb8('0xb')](_0xacb8('0xc'),_0x586338,_0xacb8('0xd'));logger[_0xacb8('0xe')](_0xacb8('0xf'),_0x586338,_0xacb8('0xd'),JSON['stringify'](_0x10c631));if(_0x10c631[_0xacb8('0x10')]){if(_0x10c631[_0xacb8('0x10')][_0xacb8('0x11')]===0x1f4){logger['error'](_0xacb8('0xc'),_0x586338,_0x10c631[_0xacb8('0x10')][_0xacb8('0x12')]);return _0xe114cd(_0x10c631[_0xacb8('0x10')]['message']);}logger['error'](_0xacb8('0xc'),_0x586338,_0x10c631[_0xacb8('0x10')][_0xacb8('0x12')]);return _0x1df5ed(_0x10c631[_0xacb8('0x10')][_0xacb8('0x12')]);}else{logger[_0xacb8('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x586338,'request\x20sent');_0x1df5ed(_0x10c631[_0xacb8('0x13')][_0xacb8('0x12')]);}})['catch'](function(_0x19d323){logger['error'](_0xacb8('0xc'),_0x586338,_0x19d323);_0xe114cd(_0x19d323);});});}