Built motion from commit (unavailable).|2.5.0
[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 _0xccdc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','lodash'];(function(_0x4e18d9,_0x36e07c){var _0x1dc37f=function(_0x4892e5){while(--_0x4892e5){_0x4e18d9['push'](_0x4e18d9['shift']());}};_0x1dc37f(++_0x36e07c);}(_0xccdc,0x9b));var _0xcccd=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xccdc[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xcccd('0x0'));var util=require('util');var moment=require(_0xcccd('0x1'));var BPromise=require(_0xcccd('0x2'));var rs=require(_0xcccd('0x3'));var fs=require('fs');var Redis=require(_0xcccd('0x4'));var db=require(_0xcccd('0x5'))['db'];var utils=require(_0xcccd('0x6'));var logger=require(_0xcccd('0x7'))(_0xcccd('0x8'));var config=require(_0xcccd('0x9'));var jayson=require(_0xcccd('0xa'));var client=jayson[_0xcccd('0xb')][_0xcccd('0xc')]({'port':0x232a});config[_0xcccd('0xd')]=_[_0xcccd('0xe')](config[_0xcccd('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xcccd('0xf'))(new Redis(config[_0xcccd('0xd')]));require(_0xcccd('0x10'))[_0xcccd('0x11')](socket);function respondWithRpcPromise(_0x562106,_0x36a827,_0x4b9d3b){return new BPromise(function(_0x149bd2,_0x1d6167){return client[_0xcccd('0x12')](_0x562106,_0x4b9d3b)['then'](function(_0x57d35b){logger[_0xcccd('0x13')](_0xcccd('0x14'),_0x36a827,_0xcccd('0x15'));logger[_0xcccd('0x16')](_0xcccd('0x17'),_0x36a827,_0xcccd('0x15'),JSON['stringify'](_0x57d35b));if(_0x57d35b[_0xcccd('0x18')]){if(_0x57d35b['error']['code']===0x1f4){logger['error'](_0xcccd('0x14'),_0x36a827,_0x57d35b[_0xcccd('0x18')][_0xcccd('0x19')]);return _0x1d6167(_0x57d35b[_0xcccd('0x18')][_0xcccd('0x19')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x36a827,_0x57d35b[_0xcccd('0x18')]['message']);return _0x149bd2(_0x57d35b[_0xcccd('0x18')][_0xcccd('0x19')]);}else{logger[_0xcccd('0x13')](_0xcccd('0x14'),_0x36a827,_0xcccd('0x15'));_0x149bd2(_0x57d35b['result'][_0xcccd('0x19')]);}})['catch'](function(_0x1261ef){logger[_0xcccd('0x18')](_0xcccd('0x14'),_0x36a827,_0x1261ef);_0x1d6167(_0x1261ef);});});}