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 _0x5571=['http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x7527f5,_0x2275ed){var _0x38a81a=function(_0x4faa4c){while(--_0x4faa4c){_0x7527f5['push'](_0x7527f5['shift']());}};_0x38a81a(++_0x2275ed);}(_0x5571,0x1ad));var _0x1557=function(_0x129a57,_0x330d03){_0x129a57=_0x129a57-0x0;var _0xa7147c=_0x5571[_0x129a57];return _0xa7147c;};'use strict';var _=require(_0x1557('0x0'));var util=require(_0x1557('0x1'));var moment=require(_0x1557('0x2'));var BPromise=require('bluebird');var rs=require(_0x1557('0x3'));var fs=require('fs');var Redis=require(_0x1557('0x4'));var db=require(_0x1557('0x5'))['db'];var utils=require(_0x1557('0x6'));var logger=require(_0x1557('0x7'))(_0x1557('0x8'));var config=require('../../config/environment');var jayson=require(_0x1557('0x9'));var client=jayson[_0x1557('0xa')][_0x1557('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1edff9,_0x113ee6,_0xedc186){return new BPromise(function(_0x5b2f66,_0x53b8ed){return client['request'](_0x1edff9,_0xedc186)[_0x1557('0xc')](function(_0xbd212f){logger[_0x1557('0xd')](_0x1557('0xe'),_0x113ee6,_0x1557('0xf'));logger[_0x1557('0x10')](_0x1557('0x11'),_0x113ee6,_0x1557('0xf'),JSON[_0x1557('0x12')](_0xbd212f));if(_0xbd212f[_0x1557('0x13')]){if(_0xbd212f[_0x1557('0x13')]['code']===0x1f4){logger['error'](_0x1557('0xe'),_0x113ee6,_0xbd212f['error'][_0x1557('0x14')]);return _0x53b8ed(_0xbd212f['error'][_0x1557('0x14')]);}logger[_0x1557('0x13')](_0x1557('0xe'),_0x113ee6,_0xbd212f['error'][_0x1557('0x14')]);return _0x5b2f66(_0xbd212f[_0x1557('0x13')]['message']);}else{logger[_0x1557('0xd')](_0x1557('0xe'),_0x113ee6,_0x1557('0xf'));_0x5b2f66(_0xbd212f['result']['message']);}})[_0x1557('0x15')](function(_0x1ed250){logger[_0x1557('0x13')](_0x1557('0xe'),_0x113ee6,_0x1ed250);_0x53b8ed(_0x1ed250);});});}