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 _0x9d65=['rpc','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','randomstring','ioredis','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d65,0x1ec));var _0x59d6=function(_0x2d024b,_0x187c75){_0x2d024b=_0x2d024b-0x0;var _0x53411c=_0x9d65[_0x2d024b];return _0x53411c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x59d6('0x0'));var BPromise=require('bluebird');var rs=require(_0x59d6('0x1'));var fs=require('fs');var Redis=require(_0x59d6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x59d6('0x3'));var logger=require('../../config/logger')(_0x59d6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x86e586,_0xb13c5,_0x18fbc3){return new BPromise(function(_0x7f4970,_0x37d6ec){return client[_0x59d6('0x5')](_0x86e586,_0x18fbc3)[_0x59d6('0x6')](function(_0x8218e4){logger[_0x59d6('0x7')](_0x59d6('0x8'),_0xb13c5,_0x59d6('0x9'));logger[_0x59d6('0xa')](_0x59d6('0xb'),_0xb13c5,_0x59d6('0x9'),JSON[_0x59d6('0xc')](_0x8218e4));if(_0x8218e4[_0x59d6('0xd')]){if(_0x8218e4[_0x59d6('0xd')][_0x59d6('0xe')]===0x1f4){logger[_0x59d6('0xd')](_0x59d6('0x8'),_0xb13c5,_0x8218e4[_0x59d6('0xd')][_0x59d6('0xf')]);return _0x37d6ec(_0x8218e4['error'][_0x59d6('0xf')]);}logger[_0x59d6('0xd')](_0x59d6('0x8'),_0xb13c5,_0x8218e4['error'][_0x59d6('0xf')]);return _0x7f4970(_0x8218e4[_0x59d6('0xd')][_0x59d6('0xf')]);}else{logger[_0x59d6('0x7')](_0x59d6('0x8'),_0xb13c5,_0x59d6('0x9'));_0x7f4970(_0x8218e4['result']['message']);}})['catch'](function(_0x7b90b6){logger[_0x59d6('0xd')](_0x59d6('0x8'),_0xb13c5,_0x7b90b6);_0x37d6ec(_0x7b90b6);});});}