Built motion from commit 775e2a94.|2.6.3
[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 _0x1c52=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x46c6e1,_0x3e103d){var _0x23f5dd=function(_0xcc1bd5){while(--_0xcc1bd5){_0x46c6e1['push'](_0x46c6e1['shift']());}};_0x23f5dd(++_0x3e103d);}(_0x1c52,0xbd));var _0x21c5=function(_0x2e374e,_0x2c4963){_0x2e374e=_0x2e374e-0x0;var _0x2f1d37=_0x1c52[_0x2e374e];return _0x2f1d37;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require(_0x21c5('0x4'));var fs=require('fs');var Redis=require(_0x21c5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x21c5('0x7'));var jayson=require(_0x21c5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x325fda,_0x38023e,_0x5c9ef5){return new BPromise(function(_0x321507,_0x299b07){return client['request'](_0x325fda,_0x5c9ef5)[_0x21c5('0x9')](function(_0x2605a2){logger['info'](_0x21c5('0xa'),_0x38023e,_0x21c5('0xb'));logger[_0x21c5('0xc')](_0x21c5('0xd'),_0x38023e,_0x21c5('0xb'),JSON[_0x21c5('0xe')](_0x2605a2));if(_0x2605a2[_0x21c5('0xf')]){if(_0x2605a2['error']['code']===0x1f4){logger['error'](_0x21c5('0xa'),_0x38023e,_0x2605a2[_0x21c5('0xf')][_0x21c5('0x10')]);return _0x299b07(_0x2605a2[_0x21c5('0xf')][_0x21c5('0x10')]);}logger[_0x21c5('0xf')](_0x21c5('0xa'),_0x38023e,_0x2605a2[_0x21c5('0xf')][_0x21c5('0x10')]);return _0x321507(_0x2605a2[_0x21c5('0xf')][_0x21c5('0x10')]);}else{logger['info'](_0x21c5('0xa'),_0x38023e,_0x21c5('0xb'));_0x321507(_0x2605a2[_0x21c5('0x11')][_0x21c5('0x10')]);}})[_0x21c5('0x12')](function(_0x125eee){logger[_0x21c5('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x38023e,_0x125eee);_0x299b07(_0x125eee);});});}