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 _0xf768=['ChatOfflineMessage,\x20%s,\x20%s','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x44fd6b,_0x338098){var _0x7cba12=function(_0x5a6bb5){while(--_0x5a6bb5){_0x44fd6b['push'](_0x44fd6b['shift']());}};_0x7cba12(++_0x338098);}(_0xf768,0x1dc));var _0x8f76=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf768[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x8f76('0x0'));var util=require('util');var moment=require(_0x8f76('0x1'));var BPromise=require(_0x8f76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f76('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f76('0x4'));var logger=require('../../config/logger')(_0x8f76('0x5'));var config=require(_0x8f76('0x6'));var jayson=require(_0x8f76('0x7'));var client=jayson['client'][_0x8f76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fe34e,_0x3a7142,_0x11b653){return new BPromise(function(_0x349482,_0x3ec8df){return client[_0x8f76('0x9')](_0x2fe34e,_0x11b653)[_0x8f76('0xa')](function(_0x2e4cd9){logger[_0x8f76('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3a7142,_0x8f76('0xc'));logger[_0x8f76('0xd')](_0x8f76('0xe'),_0x3a7142,_0x8f76('0xc'),JSON['stringify'](_0x2e4cd9));if(_0x2e4cd9[_0x8f76('0xf')]){if(_0x2e4cd9['error'][_0x8f76('0x10')]===0x1f4){logger[_0x8f76('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3a7142,_0x2e4cd9[_0x8f76('0xf')][_0x8f76('0x11')]);return _0x3ec8df(_0x2e4cd9[_0x8f76('0xf')][_0x8f76('0x11')]);}logger[_0x8f76('0xf')](_0x8f76('0x12'),_0x3a7142,_0x2e4cd9[_0x8f76('0xf')]['message']);return _0x349482(_0x2e4cd9[_0x8f76('0xf')][_0x8f76('0x11')]);}else{logger[_0x8f76('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3a7142,_0x8f76('0xc'));_0x349482(_0x2e4cd9['result'][_0x8f76('0x11')]);}})['catch'](function(_0x292045){logger[_0x8f76('0xf')](_0x8f76('0x12'),_0x3a7142,_0x292045);_0x3ec8df(_0x292045);});});}