Built motion from commit 5293bb2a.|2.6.30
[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 _0x9c5b=['ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x4b7976,_0x55e10b){var _0x422298=function(_0x531d4b){while(--_0x531d4b){_0x4b7976['push'](_0x4b7976['shift']());}};_0x422298(++_0x55e10b);}(_0x9c5b,0x127));var _0xb9c5=function(_0x2f3370,_0x28e72a){_0x2f3370=_0x2f3370-0x0;var _0xf8db52=_0x9c5b[_0x2f3370];return _0xf8db52;};'use strict';var _=require(_0xb9c5('0x0'));var util=require(_0xb9c5('0x1'));var moment=require(_0xb9c5('0x2'));var BPromise=require(_0xb9c5('0x3'));var rs=require(_0xb9c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9c5('0x6'));var config=require(_0xb9c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb9c5('0x8')][_0xb9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x237363,_0x4750a5,_0x24dc7c){return new BPromise(function(_0x18d941,_0x216ba8){return client[_0xb9c5('0xa')](_0x237363,_0x24dc7c)[_0xb9c5('0xb')](function(_0x5f04bc){logger[_0xb9c5('0xc')](_0xb9c5('0xd'),_0x4750a5,'request\x20sent');logger[_0xb9c5('0xe')](_0xb9c5('0xf'),_0x4750a5,_0xb9c5('0x10'),JSON['stringify'](_0x5f04bc));if(_0x5f04bc[_0xb9c5('0x11')]){if(_0x5f04bc[_0xb9c5('0x11')][_0xb9c5('0x12')]===0x1f4){logger[_0xb9c5('0x11')](_0xb9c5('0xd'),_0x4750a5,_0x5f04bc[_0xb9c5('0x11')]['message']);return _0x216ba8(_0x5f04bc['error'][_0xb9c5('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x4750a5,_0x5f04bc[_0xb9c5('0x11')][_0xb9c5('0x13')]);return _0x18d941(_0x5f04bc['error'][_0xb9c5('0x13')]);}else{logger[_0xb9c5('0xc')](_0xb9c5('0xd'),_0x4750a5,_0xb9c5('0x10'));_0x18d941(_0x5f04bc[_0xb9c5('0x14')]['message']);}})[_0xb9c5('0x15')](function(_0x1a219f){logger[_0xb9c5('0x11')](_0xb9c5('0xd'),_0x4750a5,_0x1a219f);_0x216ba8(_0x1a219f);});});}