Built motion from commit (unavailable).|2.4.18
[motion2.git] / server / api / chatOfflineMessage / chatOfflineMessage.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x54f8=['code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x54f8,0xae));var _0x854f=function(_0x25a316,_0x21dace){_0x25a316=_0x25a316-0x0;var _0x510e2c=_0x54f8[_0x25a316];return _0x510e2c;};'use strict';var _=require(_0x854f('0x0'));var util=require(_0x854f('0x1'));var moment=require(_0x854f('0x2'));var BPromise=require(_0x854f('0x3'));var rs=require(_0x854f('0x4'));var fs=require('fs');var Redis=require(_0x854f('0x5'));var db=require(_0x854f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x854f('0x7'))(_0x854f('0x8'));var config=require('../../config/environment');var jayson=require(_0x854f('0x9'));var client=jayson[_0x854f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b53e,_0x3640dc,_0x1e31b3){return new BPromise(function(_0x52ace6,_0x31a14f){return client[_0x854f('0xb')](_0x53b53e,_0x1e31b3)[_0x854f('0xc')](function(_0x1c6746){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x3640dc,_0x854f('0xd'));logger[_0x854f('0xe')](_0x854f('0xf'),_0x3640dc,_0x854f('0xd'),JSON[_0x854f('0x10')](_0x1c6746));if(_0x1c6746[_0x854f('0x11')]){if(_0x1c6746[_0x854f('0x11')][_0x854f('0x12')]===0x1f4){logger[_0x854f('0x11')](_0x854f('0x13'),_0x3640dc,_0x1c6746[_0x854f('0x11')][_0x854f('0x14')]);return _0x31a14f(_0x1c6746[_0x854f('0x11')][_0x854f('0x14')]);}logger[_0x854f('0x11')](_0x854f('0x13'),_0x3640dc,_0x1c6746['error'][_0x854f('0x14')]);return _0x52ace6(_0x1c6746['error'][_0x854f('0x14')]);}else{logger[_0x854f('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3640dc,_0x854f('0xd'));_0x52ace6(_0x1c6746[_0x854f('0x16')][_0x854f('0x14')]);}})[_0x854f('0x17')](function(_0x585165){logger[_0x854f('0x11')](_0x854f('0x13'),_0x3640dc,_0x585165);_0x31a14f(_0x585165);});});}