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 _0xa4cd=['info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x5a2299,_0x3e2922){var _0xedff0f=function(_0x1624cb){while(--_0x1624cb){_0x5a2299['push'](_0x5a2299['shift']());}};_0xedff0f(++_0x3e2922);}(_0xa4cd,0xb1));var _0xda4c=function(_0x261b6c,_0x564698){_0x261b6c=_0x261b6c-0x0;var _0x317163=_0xa4cd[_0x261b6c];return _0x317163;};'use strict';var _=require(_0xda4c('0x0'));var util=require(_0xda4c('0x1'));var moment=require('moment');var BPromise=require(_0xda4c('0x2'));var rs=require(_0xda4c('0x3'));var fs=require('fs');var Redis=require(_0xda4c('0x4'));var db=require(_0xda4c('0x5'))['db'];var utils=require(_0xda4c('0x6'));var logger=require(_0xda4c('0x7'))('rpc');var config=require(_0xda4c('0x8'));var jayson=require(_0xda4c('0x9'));var client=jayson[_0xda4c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x255139,_0x3129fc,_0x5296b9){return new BPromise(function(_0x1dfcc7,_0x5dc656){return client[_0xda4c('0xb')](_0x255139,_0x5296b9)['then'](function(_0x384db0){logger[_0xda4c('0xc')](_0xda4c('0xd'),_0x3129fc,_0xda4c('0xe'));logger[_0xda4c('0xf')](_0xda4c('0x10'),_0x3129fc,_0xda4c('0xe'),JSON[_0xda4c('0x11')](_0x384db0));if(_0x384db0['error']){if(_0x384db0['error'][_0xda4c('0x12')]===0x1f4){logger['error'](_0xda4c('0xd'),_0x3129fc,_0x384db0['error'][_0xda4c('0x13')]);return _0x5dc656(_0x384db0[_0xda4c('0x14')]['message']);}logger[_0xda4c('0x14')](_0xda4c('0xd'),_0x3129fc,_0x384db0['error'][_0xda4c('0x13')]);return _0x1dfcc7(_0x384db0[_0xda4c('0x14')][_0xda4c('0x13')]);}else{logger[_0xda4c('0xc')](_0xda4c('0xd'),_0x3129fc,_0xda4c('0xe'));_0x1dfcc7(_0x384db0['result'][_0xda4c('0x13')]);}})['catch'](function(_0x170a5f){logger['error'](_0xda4c('0xd'),_0x3129fc,_0x170a5f);_0x5dc656(_0x170a5f);});});}