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 _0x15a1=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowConfiguration,\x20%s,\x20%s','lodash','util','moment'];(function(_0x139224,_0x33502b){var _0x440def=function(_0x2e997f){while(--_0x2e997f){_0x139224['push'](_0x139224['shift']());}};_0x440def(++_0x33502b);}(_0x15a1,0x1b2));var _0x115a=function(_0x3c8d62,_0x4492a0){_0x3c8d62=_0x3c8d62-0x0;var _0x180cb6=_0x15a1[_0x3c8d62];return _0x180cb6;};'use strict';var _=require(_0x115a('0x0'));var util=require(_0x115a('0x1'));var moment=require(_0x115a('0x2'));var BPromise=require(_0x115a('0x3'));var rs=require(_0x115a('0x4'));var fs=require('fs');var Redis=require(_0x115a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x115a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x115a('0x7'));var jayson=require(_0x115a('0x8'));var client=jayson[_0x115a('0x9')][_0x115a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x151aa5,_0x343f96,_0x12c2e3){return new BPromise(function(_0x355556,_0x40ddb3){return client[_0x115a('0xb')](_0x151aa5,_0x12c2e3)[_0x115a('0xc')](function(_0x25ab78){logger[_0x115a('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x343f96,_0x115a('0xe'));logger['debug'](_0x115a('0xf'),_0x343f96,_0x115a('0xe'),JSON[_0x115a('0x10')](_0x25ab78));if(_0x25ab78[_0x115a('0x11')]){if(_0x25ab78[_0x115a('0x11')][_0x115a('0x12')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x343f96,_0x25ab78[_0x115a('0x11')]['message']);return _0x40ddb3(_0x25ab78[_0x115a('0x11')][_0x115a('0x13')]);}logger[_0x115a('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x343f96,_0x25ab78[_0x115a('0x11')]['message']);return _0x355556(_0x25ab78[_0x115a('0x11')][_0x115a('0x13')]);}else{logger[_0x115a('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x343f96,'request\x20sent');_0x355556(_0x25ab78[_0x115a('0x14')][_0x115a('0x13')]);}})[_0x115a('0x15')](function(_0x41368a){logger[_0x115a('0x11')](_0x115a('0x16'),_0x343f96,_0x41368a);_0x40ddb3(_0x41368a);});});}