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 _0x49e3=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http'];(function(_0x2c74e2,_0x78daf1){var _0x14e004=function(_0x53ed83){while(--_0x53ed83){_0x2c74e2['push'](_0x2c74e2['shift']());}};_0x14e004(++_0x78daf1);}(_0x49e3,0x8f));var _0x349e=function(_0xf1e6f9,_0x527826){_0xf1e6f9=_0xf1e6f9-0x0;var _0x30556c=_0x49e3[_0xf1e6f9];return _0x30556c;};'use strict';var _=require(_0x349e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x349e('0x1'));var rs=require(_0x349e('0x2'));var fs=require('fs');var Redis=require(_0x349e('0x3'));var db=require(_0x349e('0x4'))['db'];var utils=require(_0x349e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x349e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x349e('0x7')][_0x349e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17fcaf,_0x46796e,_0x4f616a){return new BPromise(function(_0x45f944,_0xed623e){return client['request'](_0x17fcaf,_0x4f616a)[_0x349e('0x9')](function(_0x41f846){logger[_0x349e('0xa')](_0x349e('0xb'),_0x46796e,_0x349e('0xc'));logger[_0x349e('0xd')](_0x349e('0xe'),_0x46796e,_0x349e('0xc'),JSON['stringify'](_0x41f846));if(_0x41f846[_0x349e('0xf')]){if(_0x41f846['error']['code']===0x1f4){logger['error'](_0x349e('0xb'),_0x46796e,_0x41f846['error'][_0x349e('0x10')]);return _0xed623e(_0x41f846[_0x349e('0xf')][_0x349e('0x10')]);}logger[_0x349e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x46796e,_0x41f846[_0x349e('0xf')][_0x349e('0x10')]);return _0x45f944(_0x41f846[_0x349e('0xf')][_0x349e('0x10')]);}else{logger[_0x349e('0xa')](_0x349e('0xb'),_0x46796e,'request\x20sent');_0x45f944(_0x41f846[_0x349e('0x11')][_0x349e('0x10')]);}})[_0x349e('0x12')](function(_0x41cb78){logger[_0x349e('0xf')](_0x349e('0xb'),_0x46796e,_0x41cb78);_0xed623e(_0x41cb78);});});}