Built motion from commit 994c64e1.|2.6.1
[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 _0x7965=['http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x200568,_0x3dac30){var _0xc7af08=function(_0x5c5c4e){while(--_0x5c5c4e){_0x200568['push'](_0x200568['shift']());}};_0xc7af08(++_0x3dac30);}(_0x7965,0x181));var _0x5796=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x7965[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0x5796('0x0'));var util=require(_0x5796('0x1'));var moment=require(_0x5796('0x2'));var BPromise=require(_0x5796('0x3'));var rs=require(_0x5796('0x4'));var fs=require('fs');var Redis=require(_0x5796('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5796('0x6'));var logger=require('../../config/logger')(_0x5796('0x7'));var config=require(_0x5796('0x8'));var jayson=require(_0x5796('0x9'));var client=jayson[_0x5796('0xa')][_0x5796('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x146bdd,_0x421156,_0x38e4c5){return new BPromise(function(_0x24e779,_0x5d037b){return client['request'](_0x146bdd,_0x38e4c5)[_0x5796('0xc')](function(_0x34a3d8){logger[_0x5796('0xd')](_0x5796('0xe'),_0x421156,'request\x20sent');logger[_0x5796('0xf')](_0x5796('0x10'),_0x421156,_0x5796('0x11'),JSON[_0x5796('0x12')](_0x34a3d8));if(_0x34a3d8['error']){if(_0x34a3d8[_0x5796('0x13')]['code']===0x1f4){logger[_0x5796('0x13')](_0x5796('0xe'),_0x421156,_0x34a3d8[_0x5796('0x13')][_0x5796('0x14')]);return _0x5d037b(_0x34a3d8[_0x5796('0x13')][_0x5796('0x14')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x421156,_0x34a3d8['error'][_0x5796('0x14')]);return _0x24e779(_0x34a3d8[_0x5796('0x13')][_0x5796('0x14')]);}else{logger[_0x5796('0xd')](_0x5796('0xe'),_0x421156,_0x5796('0x11'));_0x24e779(_0x34a3d8[_0x5796('0x15')][_0x5796('0x14')]);}})['catch'](function(_0xdfb7e1){logger['error'](_0x5796('0xe'),_0x421156,_0xdfb7e1);_0x5d037b(_0xdfb7e1);});});}