Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / chatApplication / chatApplication.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 _0x71ca=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x71ca,0x1c9));var _0xa71c=function(_0x37f230,_0x296a68){_0x37f230=_0x37f230-0x0;var _0x513738=_0x71ca[_0x37f230];return _0x513738;};'use strict';var _=require(_0xa71c('0x0'));var util=require(_0xa71c('0x1'));var moment=require(_0xa71c('0x2'));var BPromise=require(_0xa71c('0x3'));var rs=require(_0xa71c('0x4'));var fs=require('fs');var Redis=require(_0xa71c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa71c('0x6'));var logger=require(_0xa71c('0x7'))(_0xa71c('0x8'));var config=require(_0xa71c('0x9'));var jayson=require(_0xa71c('0xa'));var client=jayson[_0xa71c('0xb')][_0xa71c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f6306,_0x3fcb45,_0x45abed){return new BPromise(function(_0x1e29ee,_0x84a292){return client['request'](_0x3f6306,_0x45abed)[_0xa71c('0xd')](function(_0x1cff12){logger[_0xa71c('0xe')]('ChatApplication,\x20%s,\x20%s',_0x3fcb45,_0xa71c('0xf'));logger[_0xa71c('0x10')](_0xa71c('0x11'),_0x3fcb45,_0xa71c('0xf'),JSON[_0xa71c('0x12')](_0x1cff12));if(_0x1cff12[_0xa71c('0x13')]){if(_0x1cff12['error'][_0xa71c('0x14')]===0x1f4){logger[_0xa71c('0x13')](_0xa71c('0x15'),_0x3fcb45,_0x1cff12['error'][_0xa71c('0x16')]);return _0x84a292(_0x1cff12[_0xa71c('0x13')][_0xa71c('0x16')]);}logger[_0xa71c('0x13')](_0xa71c('0x15'),_0x3fcb45,_0x1cff12[_0xa71c('0x13')][_0xa71c('0x16')]);return _0x1e29ee(_0x1cff12['error'][_0xa71c('0x16')]);}else{logger[_0xa71c('0xe')](_0xa71c('0x15'),_0x3fcb45,_0xa71c('0xf'));_0x1e29ee(_0x1cff12[_0xa71c('0x17')]['message']);}})[_0xa71c('0x18')](function(_0x15cd70){logger['error'](_0xa71c('0x15'),_0x3fcb45,_0x15cd70);_0x84a292(_0x15cd70);});});}