Built motion from commit d69f4380.|2.6.29
[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 _0x9bef=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9bef,0x133));var _0xf9be=function(_0x28b2c2,_0x278d72){_0x28b2c2=_0x28b2c2-0x0;var _0x1957ea=_0x9bef[_0x28b2c2];return _0x1957ea;};'use strict';var _=require(_0xf9be('0x0'));var util=require(_0xf9be('0x1'));var moment=require('moment');var BPromise=require(_0xf9be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9be('0x3'));var db=require(_0xf9be('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9be('0x5'))('rpc');var config=require(_0xf9be('0x6'));var jayson=require(_0xf9be('0x7'));var client=jayson['client'][_0xf9be('0x8')]({'port':0x232a});config[_0xf9be('0x9')]=_[_0xf9be('0xa')](config[_0xf9be('0x9')],{'host':_0xf9be('0xb'),'port':0x18eb});var socket=require(_0xf9be('0xc'))(new Redis(config[_0xf9be('0x9')]));require(_0xf9be('0xd'))['register'](socket);function respondWithRpcPromise(_0x41a401,_0x5ec3e4,_0x471f02){return new BPromise(function(_0x33c615,_0x5ac324){return client[_0xf9be('0xe')](_0x41a401,_0x471f02)[_0xf9be('0xf')](function(_0x266245){logger[_0xf9be('0x10')](_0xf9be('0x11'),_0x5ec3e4,'request\x20sent');logger[_0xf9be('0x12')](_0xf9be('0x13'),_0x5ec3e4,_0xf9be('0x14'),JSON['stringify'](_0x266245));if(_0x266245[_0xf9be('0x15')]){if(_0x266245[_0xf9be('0x15')][_0xf9be('0x16')]===0x1f4){logger[_0xf9be('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5ec3e4,_0x266245[_0xf9be('0x15')][_0xf9be('0x17')]);return _0x5ac324(_0x266245[_0xf9be('0x15')][_0xf9be('0x17')]);}logger['error'](_0xf9be('0x11'),_0x5ec3e4,_0x266245['error'][_0xf9be('0x17')]);return _0x33c615(_0x266245['error'][_0xf9be('0x17')]);}else{logger[_0xf9be('0x10')](_0xf9be('0x11'),_0x5ec3e4,'request\x20sent');_0x33c615(_0x266245[_0xf9be('0x18')][_0xf9be('0x17')]);}})[_0xf9be('0x19')](function(_0x20f3c3){logger[_0xf9be('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5ec3e4,_0x20f3c3);_0x5ac324(_0x20f3c3);});});}