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 _0xc04a=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment'];(function(_0x40c306,_0x24bb42){var _0x4f1d0d=function(_0x15915f){while(--_0x15915f){_0x40c306['push'](_0x40c306['shift']());}};_0x4f1d0d(++_0x24bb42);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var util=require('util');var moment=require(_0xac04('0x1'));var BPromise=require('bluebird');var rs=require(_0xac04('0x2'));var fs=require('fs');var Redis=require(_0xac04('0x3'));var db=require(_0xac04('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac04('0x5'))(_0xac04('0x6'));var config=require(_0xac04('0x7'));var jayson=require(_0xac04('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f51d2,_0x4dab26,_0x2a6b1f){return new BPromise(function(_0x2f0311,_0xf1aed7){return client[_0xac04('0x9')](_0x4f51d2,_0x2a6b1f)[_0xac04('0xa')](function(_0x196ad0){logger[_0xac04('0xb')](_0xac04('0xc'),_0x4dab26,_0xac04('0xd'));logger['debug'](_0xac04('0xe'),_0x4dab26,'request\x20sent',JSON[_0xac04('0xf')](_0x196ad0));if(_0x196ad0[_0xac04('0x10')]){if(_0x196ad0[_0xac04('0x10')]['code']===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x4dab26,_0x196ad0['error'][_0xac04('0x11')]);return _0xf1aed7(_0x196ad0[_0xac04('0x10')][_0xac04('0x11')]);}logger['error'](_0xac04('0xc'),_0x4dab26,_0x196ad0[_0xac04('0x10')]['message']);return _0x2f0311(_0x196ad0[_0xac04('0x10')][_0xac04('0x11')]);}else{logger['info'](_0xac04('0xc'),_0x4dab26,_0xac04('0xd'));_0x2f0311(_0x196ad0['result']['message']);}})[_0xac04('0x12')](function(_0x592da0){logger[_0xac04('0x10')]('VtigerField,\x20%s,\x20%s',_0x4dab26,_0x592da0);_0xf1aed7(_0x592da0);});});}