Built motion from commit (unavailable).|2.4.17
[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 _0xd541=['redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51a6ec,_0x1c3602){var _0x14a712=function(_0x32ab81){while(--_0x32ab81){_0x51a6ec['push'](_0x51a6ec['shift']());}};_0x14a712(++_0x1c3602);}(_0xd541,0x16d));var _0x1d54=function(_0xee588,_0x368239){_0xee588=_0xee588-0x0;var _0x58dd1a=_0xd541[_0xee588];return _0x58dd1a;};'use strict';var _=require(_0x1d54('0x0'));var util=require(_0x1d54('0x1'));var moment=require('moment');var BPromise=require(_0x1d54('0x2'));var rs=require(_0x1d54('0x3'));var fs=require('fs');var Redis=require(_0x1d54('0x4'));var db=require(_0x1d54('0x5'))['db'];var utils=require(_0x1d54('0x6'));var logger=require(_0x1d54('0x7'))(_0x1d54('0x8'));var config=require(_0x1d54('0x9'));var jayson=require(_0x1d54('0xa'));var client=jayson[_0x1d54('0xb')][_0x1d54('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1d54('0xd')],{'host':_0x1d54('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d54('0xd')]));require(_0x1d54('0xf'))[_0x1d54('0x10')](socket);function respondWithRpcPromise(_0x2133dd,_0xc04f23,_0x5917d0){return new BPromise(function(_0x56ccb5,_0x4159b1){return client[_0x1d54('0x11')](_0x2133dd,_0x5917d0)[_0x1d54('0x12')](function(_0x3de877){logger[_0x1d54('0x13')](_0x1d54('0x14'),_0xc04f23,_0x1d54('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xc04f23,_0x1d54('0x15'),JSON['stringify'](_0x3de877));if(_0x3de877[_0x1d54('0x16')]){if(_0x3de877[_0x1d54('0x16')][_0x1d54('0x17')]===0x1f4){logger[_0x1d54('0x16')](_0x1d54('0x14'),_0xc04f23,_0x3de877['error'][_0x1d54('0x18')]);return _0x4159b1(_0x3de877[_0x1d54('0x16')][_0x1d54('0x18')]);}logger['error'](_0x1d54('0x14'),_0xc04f23,_0x3de877[_0x1d54('0x16')][_0x1d54('0x18')]);return _0x56ccb5(_0x3de877[_0x1d54('0x16')][_0x1d54('0x18')]);}else{logger[_0x1d54('0x13')](_0x1d54('0x14'),_0xc04f23,_0x1d54('0x15'));_0x56ccb5(_0x3de877[_0x1d54('0x19')][_0x1d54('0x18')]);}})[_0x1d54('0x1a')](function(_0x10b75c){logger['error'](_0x1d54('0x14'),_0xc04f23,_0x10b75c);_0x4159b1(_0x10b75c);});});}