058a1052c961ca9975bcaf2882fe61e925471d9e
[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 _0x2ac8=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x1447e5,_0x2f7b77){var _0x1acefc=function(_0x481a41){while(--_0x481a41){_0x1447e5['push'](_0x1447e5['shift']());}};_0x1acefc(++_0x2f7b77);}(_0x2ac8,0x1d8));var _0x82ac=function(_0x252450,_0x3f129c){_0x252450=_0x252450-0x0;var _0x44c14e=_0x2ac8[_0x252450];return _0x44c14e;};'use strict';var _=require(_0x82ac('0x0'));var util=require('util');var moment=require(_0x82ac('0x1'));var BPromise=require(_0x82ac('0x2'));var rs=require(_0x82ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x82ac('0x4'));var logger=require(_0x82ac('0x5'))(_0x82ac('0x6'));var config=require(_0x82ac('0x7'));var jayson=require(_0x82ac('0x8'));var client=jayson['client'][_0x82ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a9538,_0x46b199,_0x2d765f){return new BPromise(function(_0x243de1,_0x7705f1){return client['request'](_0x5a9538,_0x2d765f)['then'](function(_0xf85dc0){logger[_0x82ac('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x46b199,_0x82ac('0xb'));logger[_0x82ac('0xc')](_0x82ac('0xd'),_0x46b199,'request\x20sent',JSON[_0x82ac('0xe')](_0xf85dc0));if(_0xf85dc0[_0x82ac('0xf')]){if(_0xf85dc0['error'][_0x82ac('0x10')]===0x1f4){logger['error'](_0x82ac('0x11'),_0x46b199,_0xf85dc0[_0x82ac('0xf')]['message']);return _0x7705f1(_0xf85dc0[_0x82ac('0xf')]['message']);}logger['error'](_0x82ac('0x11'),_0x46b199,_0xf85dc0[_0x82ac('0xf')][_0x82ac('0x12')]);return _0x243de1(_0xf85dc0[_0x82ac('0xf')][_0x82ac('0x12')]);}else{logger[_0x82ac('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x46b199,'request\x20sent');_0x243de1(_0xf85dc0[_0x82ac('0x13')][_0x82ac('0x12')]);}})[_0x82ac('0x14')](function(_0x1501f1){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x46b199,_0x1501f1);_0x7705f1(_0x1501f1);});});}