Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.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 _0xe4b7=['message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2c8a32,_0x46f29e){var _0x22b3d7=function(_0x4d681a){while(--_0x4d681a){_0x2c8a32['push'](_0x2c8a32['shift']());}};_0x22b3d7(++_0x46f29e);}(_0xe4b7,0x189));var _0x7e4b=function(_0x23b106,_0x50acec){_0x23b106=_0x23b106-0x0;var _0x3c88e5=_0xe4b7[_0x23b106];return _0x3c88e5;};'use strict';var _=require(_0x7e4b('0x0'));var util=require(_0x7e4b('0x1'));var moment=require(_0x7e4b('0x2'));var BPromise=require(_0x7e4b('0x3'));var rs=require(_0x7e4b('0x4'));var fs=require('fs');var Redis=require(_0x7e4b('0x5'));var db=require(_0x7e4b('0x6'))['db'];var utils=require(_0x7e4b('0x7'));var logger=require(_0x7e4b('0x8'))(_0x7e4b('0x9'));var config=require(_0x7e4b('0xa'));var jayson=require(_0x7e4b('0xb'));var client=jayson[_0x7e4b('0xc')]['http']({'port':0x232a});config[_0x7e4b('0xd')]=_[_0x7e4b('0xe')](config[_0x7e4b('0xd')],{'host':_0x7e4b('0xf'),'port':0x18eb});var socket=require(_0x7e4b('0x10'))(new Redis(config[_0x7e4b('0xd')]));require(_0x7e4b('0x11'))[_0x7e4b('0x12')](socket);function respondWithRpcPromise(_0x4705e5,_0x1a5cb9,_0x1d224d){return new BPromise(function(_0x1873d4,_0x4d357c){return client[_0x7e4b('0x13')](_0x4705e5,_0x1d224d)[_0x7e4b('0x14')](function(_0x27b559){logger[_0x7e4b('0x15')](_0x7e4b('0x16'),_0x1a5cb9,'request\x20sent');logger[_0x7e4b('0x17')](_0x7e4b('0x18'),_0x1a5cb9,'request\x20sent',JSON['stringify'](_0x27b559));if(_0x27b559[_0x7e4b('0x19')]){if(_0x27b559[_0x7e4b('0x19')][_0x7e4b('0x1a')]===0x1f4){logger['error'](_0x7e4b('0x16'),_0x1a5cb9,_0x27b559['error'][_0x7e4b('0x1b')]);return _0x4d357c(_0x27b559[_0x7e4b('0x19')]['message']);}logger[_0x7e4b('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x1a5cb9,_0x27b559[_0x7e4b('0x19')]['message']);return _0x1873d4(_0x27b559['error'][_0x7e4b('0x1b')]);}else{logger['info'](_0x7e4b('0x16'),_0x1a5cb9,_0x7e4b('0x1c'));_0x1873d4(_0x27b559[_0x7e4b('0x1d')][_0x7e4b('0x1b')]);}})['catch'](function(_0x34bd98){logger[_0x7e4b('0x19')](_0x7e4b('0x16'),_0x1a5cb9,_0x34bd98);_0x4d357c(_0x34bd98);});});}