Built motion from commit 1ea47bf4.|2.6.34
[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 _0x1bc3=['code','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x452ab2,_0x6da72b){var _0x5e9940=function(_0x45c3d4){while(--_0x45c3d4){_0x452ab2['push'](_0x452ab2['shift']());}};_0x5e9940(++_0x6da72b);}(_0x1bc3,0x144));var _0x31bc=function(_0x521f4e,_0x1114c2){_0x521f4e=_0x521f4e-0x0;var _0x407fda=_0x1bc3[_0x521f4e];return _0x407fda;};'use strict';var _=require(_0x31bc('0x0'));var util=require('util');var moment=require(_0x31bc('0x1'));var BPromise=require(_0x31bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31bc('0x3'));var db=require(_0x31bc('0x4'))['db'];var utils=require(_0x31bc('0x5'));var logger=require(_0x31bc('0x6'))(_0x31bc('0x7'));var config=require(_0x31bc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x31bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d0112,_0x5b54a3,_0x16db44){return new BPromise(function(_0x1a6040,_0x1c4dde){return client['request'](_0x5d0112,_0x16db44)[_0x31bc('0xa')](function(_0x282049){logger['info'](_0x31bc('0xb'),_0x5b54a3,'request\x20sent');logger[_0x31bc('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5b54a3,_0x31bc('0xd'),JSON[_0x31bc('0xe')](_0x282049));if(_0x282049[_0x31bc('0xf')]){if(_0x282049[_0x31bc('0xf')][_0x31bc('0x10')]===0x1f4){logger[_0x31bc('0xf')](_0x31bc('0xb'),_0x5b54a3,_0x282049[_0x31bc('0xf')][_0x31bc('0x11')]);return _0x1c4dde(_0x282049['error'][_0x31bc('0x11')]);}logger[_0x31bc('0xf')](_0x31bc('0xb'),_0x5b54a3,_0x282049['error'][_0x31bc('0x11')]);return _0x1a6040(_0x282049[_0x31bc('0xf')][_0x31bc('0x11')]);}else{logger[_0x31bc('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5b54a3,_0x31bc('0xd'));_0x1a6040(_0x282049[_0x31bc('0x13')]['message']);}})['catch'](function(_0x2d4d1d){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b54a3,_0x2d4d1d);_0x1c4dde(_0x2d4d1d);});});}