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 _0xab11=['info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../mysqldb','client','http','then'];(function(_0x374499,_0x6c157c){var _0x42f5ff=function(_0xcfe9a7){while(--_0xcfe9a7){_0x374499['push'](_0x374499['shift']());}};_0x42f5ff(++_0x6c157c);}(_0xab11,0x109));var _0x1ab1=function(_0x5d220b,_0x48d9ec){_0x5d220b=_0x5d220b-0x0;var _0x252226=_0xab11[_0x5d220b];return _0x252226;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ab1('0x0'));var BPromise=require(_0x1ab1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ab1('0x2'));var db=require(_0x1ab1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ab1('0x4')][_0x1ab1('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x507246,_0x52775b,_0x76686){return new BPromise(function(_0x34d905,_0xf5c881){return client['request'](_0x507246,_0x76686)[_0x1ab1('0x6')](function(_0x24f27b){logger[_0x1ab1('0x7')]('ServicenowConfiguration,\x20%s,\x20%s',_0x52775b,_0x1ab1('0x8'));logger[_0x1ab1('0x9')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x52775b,_0x1ab1('0x8'),JSON[_0x1ab1('0xa')](_0x24f27b));if(_0x24f27b['error']){if(_0x24f27b[_0x1ab1('0xb')][_0x1ab1('0xc')]===0x1f4){logger['error'](_0x1ab1('0xd'),_0x52775b,_0x24f27b['error'][_0x1ab1('0xe')]);return _0xf5c881(_0x24f27b[_0x1ab1('0xb')][_0x1ab1('0xe')]);}logger[_0x1ab1('0xb')](_0x1ab1('0xd'),_0x52775b,_0x24f27b[_0x1ab1('0xb')][_0x1ab1('0xe')]);return _0x34d905(_0x24f27b[_0x1ab1('0xb')][_0x1ab1('0xe')]);}else{logger[_0x1ab1('0x7')](_0x1ab1('0xd'),_0x52775b,_0x1ab1('0x8'));_0x34d905(_0x24f27b[_0x1ab1('0xf')][_0x1ab1('0xe')]);}})[_0x1ab1('0x10')](function(_0x24cdd6){logger[_0x1ab1('0xb')](_0x1ab1('0xd'),_0x52775b,_0x24cdd6);_0xf5c881(_0x24cdd6);});});}