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 _0x06cb=['../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x06cb,0x104));var _0xb06c=function(_0x4eca50,_0x4b36ac){_0x4eca50=_0x4eca50-0x0;var _0xc88250=_0x06cb[_0x4eca50];return _0xc88250;};'use strict';var _=require('lodash');var util=require(_0xb06c('0x0'));var moment=require(_0xb06c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb06c('0x2'));var fs=require('fs');var Redis=require(_0xb06c('0x3'));var db=require(_0xb06c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb06c('0x5'));var config=require(_0xb06c('0x6'));var jayson=require(_0xb06c('0x7'));var client=jayson[_0xb06c('0x8')][_0xb06c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23b5a6,_0x4b6924,_0x2b88b5){return new BPromise(function(_0x2413a9,_0x4a4578){return client['request'](_0x23b5a6,_0x2b88b5)[_0xb06c('0xa')](function(_0x4e4d06){logger['info'](_0xb06c('0xb'),_0x4b6924,'request\x20sent');logger['debug'](_0xb06c('0xc'),_0x4b6924,_0xb06c('0xd'),JSON['stringify'](_0x4e4d06));if(_0x4e4d06[_0xb06c('0xe')]){if(_0x4e4d06[_0xb06c('0xe')][_0xb06c('0xf')]===0x1f4){logger['error'](_0xb06c('0xb'),_0x4b6924,_0x4e4d06['error']['message']);return _0x4a4578(_0x4e4d06[_0xb06c('0xe')]['message']);}logger[_0xb06c('0xe')](_0xb06c('0xb'),_0x4b6924,_0x4e4d06[_0xb06c('0xe')][_0xb06c('0x10')]);return _0x2413a9(_0x4e4d06['error'][_0xb06c('0x10')]);}else{logger[_0xb06c('0x11')](_0xb06c('0xb'),_0x4b6924,_0xb06c('0xd'));_0x2413a9(_0x4e4d06[_0xb06c('0x12')][_0xb06c('0x10')]);}})['catch'](function(_0x25b052){logger['error'](_0xb06c('0xb'),_0x4b6924,_0x25b052);_0x4a4578(_0x25b052);});});}