Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / chatTransferReport / chatTransferReport.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 _0x8b63=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3b18e6,_0x35e310){var _0xaf05b7=function(_0x5f0cc8){while(--_0x5f0cc8){_0x3b18e6['push'](_0x3b18e6['shift']());}};_0xaf05b7(++_0x35e310);}(_0x8b63,0xfe));var _0x38b6=function(_0x1dc8b8,_0x199da3){_0x1dc8b8=_0x1dc8b8-0x0;var _0x52899a=_0x8b63[_0x1dc8b8];return _0x52899a;};'use strict';var _=require(_0x38b6('0x0'));var util=require(_0x38b6('0x1'));var moment=require(_0x38b6('0x2'));var BPromise=require(_0x38b6('0x3'));var rs=require(_0x38b6('0x4'));var fs=require('fs');var Redis=require(_0x38b6('0x5'));var db=require(_0x38b6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x38b6('0x7'));var jayson=require(_0x38b6('0x8'));var client=jayson[_0x38b6('0x9')][_0x38b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51fddc,_0x5570de,_0x35d937){return new BPromise(function(_0x43898b,_0x4cb2a8){return client[_0x38b6('0xb')](_0x51fddc,_0x35d937)[_0x38b6('0xc')](function(_0x367cc9){logger[_0x38b6('0xd')](_0x38b6('0xe'),_0x5570de,_0x38b6('0xf'));logger[_0x38b6('0x10')](_0x38b6('0x11'),_0x5570de,_0x38b6('0xf'),JSON['stringify'](_0x367cc9));if(_0x367cc9[_0x38b6('0x12')]){if(_0x367cc9[_0x38b6('0x12')][_0x38b6('0x13')]===0x1f4){logger['error'](_0x38b6('0xe'),_0x5570de,_0x367cc9[_0x38b6('0x12')][_0x38b6('0x14')]);return _0x4cb2a8(_0x367cc9[_0x38b6('0x12')][_0x38b6('0x14')]);}logger['error'](_0x38b6('0xe'),_0x5570de,_0x367cc9[_0x38b6('0x12')][_0x38b6('0x14')]);return _0x43898b(_0x367cc9[_0x38b6('0x12')][_0x38b6('0x14')]);}else{logger['info'](_0x38b6('0xe'),_0x5570de,'request\x20sent');_0x43898b(_0x367cc9[_0x38b6('0x15')][_0x38b6('0x14')]);}})[_0x38b6('0x16')](function(_0x3d238d){logger[_0x38b6('0x12')](_0x38b6('0xe'),_0x5570de,_0x3d238d);_0x4cb2a8(_0x3d238d);});});}