Built motion from commit d1eab355.|2.6.28
[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 _0x465b=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info'];(function(_0x264781,_0x27bf68){var _0x382f5a=function(_0x5628a9){while(--_0x5628a9){_0x264781['push'](_0x264781['shift']());}};_0x382f5a(++_0x27bf68);}(_0x465b,0x1dc));var _0xb465=function(_0x2440b8,_0x22f27f){_0x2440b8=_0x2440b8-0x0;var _0x3e8f05=_0x465b[_0x2440b8];return _0x3e8f05;};'use strict';var _=require(_0xb465('0x0'));var util=require(_0xb465('0x1'));var moment=require('moment');var BPromise=require(_0xb465('0x2'));var rs=require(_0xb465('0x3'));var fs=require('fs');var Redis=require(_0xb465('0x4'));var db=require(_0xb465('0x5'))['db'];var utils=require(_0xb465('0x6'));var logger=require('../../config/logger')(_0xb465('0x7'));var config=require(_0xb465('0x8'));var jayson=require(_0xb465('0x9'));var client=jayson[_0xb465('0xa')]['http']({'port':0x232a});config[_0xb465('0xb')]=_[_0xb465('0xc')](config[_0xb465('0xb')],{'host':_0xb465('0xd'),'port':0x18eb});var socket=require(_0xb465('0xe'))(new Redis(config[_0xb465('0xb')]));require('./chatInternalMessage.socket')[_0xb465('0xf')](socket);function respondWithRpcPromise(_0x24e2b3,_0xad0937,_0x3057bc){return new BPromise(function(_0x5026dc,_0x1f4ace){return client[_0xb465('0x10')](_0x24e2b3,_0x3057bc)['then'](function(_0x7d32e7){logger[_0xb465('0x11')](_0xb465('0x12'),_0xad0937,_0xb465('0x13'));logger[_0xb465('0x14')](_0xb465('0x15'),_0xad0937,_0xb465('0x13'),JSON['stringify'](_0x7d32e7));if(_0x7d32e7[_0xb465('0x16')]){if(_0x7d32e7[_0xb465('0x16')]['code']===0x1f4){logger['error'](_0xb465('0x12'),_0xad0937,_0x7d32e7['error'][_0xb465('0x17')]);return _0x1f4ace(_0x7d32e7['error'][_0xb465('0x17')]);}logger[_0xb465('0x16')](_0xb465('0x12'),_0xad0937,_0x7d32e7[_0xb465('0x16')][_0xb465('0x17')]);return _0x5026dc(_0x7d32e7[_0xb465('0x16')][_0xb465('0x17')]);}else{logger[_0xb465('0x11')](_0xb465('0x12'),_0xad0937,_0xb465('0x13'));_0x5026dc(_0x7d32e7[_0xb465('0x18')][_0xb465('0x17')]);}})[_0xb465('0x19')](function(_0x217d72){logger[_0xb465('0x16')](_0xb465('0x12'),_0xad0937,_0x217d72);_0x1f4ace(_0x217d72);});});}