Built motion from commit (unavailable).|2.5.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 _0xf528=['info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x518dfe,_0x5daa89){var _0xce3688=function(_0x4c8c95){while(--_0x4c8c95){_0x518dfe['push'](_0x518dfe['shift']());}};_0xce3688(++_0x5daa89);}(_0xf528,0x1bb));var _0x8f52=function(_0xb4f662,_0x4a9fb9){_0xb4f662=_0xb4f662-0x0;var _0x333a87=_0xf528[_0xb4f662];return _0x333a87;};'use strict';var _=require(_0x8f52('0x0'));var util=require('util');var moment=require(_0x8f52('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f52('0x2'));var fs=require('fs');var Redis=require(_0x8f52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f52('0x4'));var logger=require(_0x8f52('0x5'))(_0x8f52('0x6'));var config=require(_0x8f52('0x7'));var jayson=require(_0x8f52('0x8'));var client=jayson[_0x8f52('0x9')][_0x8f52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x599a26,_0x51bd59,_0x34ab46){return new BPromise(function(_0x2ceaac,_0x51abd8){return client[_0x8f52('0xb')](_0x599a26,_0x34ab46)['then'](function(_0x4a548e){logger['info'](_0x8f52('0xc'),_0x51bd59,_0x8f52('0xd'));logger[_0x8f52('0xe')](_0x8f52('0xf'),_0x51bd59,_0x8f52('0xd'),JSON[_0x8f52('0x10')](_0x4a548e));if(_0x4a548e[_0x8f52('0x11')]){if(_0x4a548e['error']['code']===0x1f4){logger['error'](_0x8f52('0xc'),_0x51bd59,_0x4a548e[_0x8f52('0x11')]['message']);return _0x51abd8(_0x4a548e[_0x8f52('0x11')]['message']);}logger[_0x8f52('0x11')](_0x8f52('0xc'),_0x51bd59,_0x4a548e[_0x8f52('0x11')]['message']);return _0x2ceaac(_0x4a548e[_0x8f52('0x11')][_0x8f52('0x12')]);}else{logger[_0x8f52('0x13')](_0x8f52('0xc'),_0x51bd59,_0x8f52('0xd'));_0x2ceaac(_0x4a548e[_0x8f52('0x14')][_0x8f52('0x12')]);}})[_0x8f52('0x15')](function(_0xcc326d){logger[_0x8f52('0x11')](_0x8f52('0xc'),_0x51bd59,_0xcc326d);_0x51abd8(_0xcc326d);});});}