cf4999275b21ab0dbed056431fffde116a8ccb30
[motion2.git] / server / api / faxTransferReport / faxTransferReport.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 _0x71e0=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5c6951,_0x507abb){var _0x5ee145=function(_0x4f8b75){while(--_0x4f8b75){_0x5c6951['push'](_0x5c6951['shift']());}};_0x5ee145(++_0x507abb);}(_0x71e0,0xf6));var _0x071e=function(_0x2b4912,_0x147d1c){_0x2b4912=_0x2b4912-0x0;var _0x5a773a=_0x71e0[_0x2b4912];return _0x5a773a;};'use strict';var _=require(_0x071e('0x0'));var util=require(_0x071e('0x1'));var moment=require('moment');var BPromise=require(_0x071e('0x2'));var rs=require(_0x071e('0x3'));var fs=require('fs');var Redis=require(_0x071e('0x4'));var db=require(_0x071e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x071e('0x6'))('rpc');var config=require(_0x071e('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f81b5,_0x3db8bb,_0x103f89){return new BPromise(function(_0x5b565d,_0x384ff4){return client[_0x071e('0x8')](_0x2f81b5,_0x103f89)['then'](function(_0x4c6bb8){logger[_0x071e('0x9')](_0x071e('0xa'),_0x3db8bb,_0x071e('0xb'));logger['debug'](_0x071e('0xc'),_0x3db8bb,'request\x20sent',JSON[_0x071e('0xd')](_0x4c6bb8));if(_0x4c6bb8['error']){if(_0x4c6bb8[_0x071e('0xe')][_0x071e('0xf')]===0x1f4){logger[_0x071e('0xe')](_0x071e('0xa'),_0x3db8bb,_0x4c6bb8[_0x071e('0xe')][_0x071e('0x10')]);return _0x384ff4(_0x4c6bb8[_0x071e('0xe')][_0x071e('0x10')]);}logger[_0x071e('0xe')](_0x071e('0xa'),_0x3db8bb,_0x4c6bb8['error'][_0x071e('0x10')]);return _0x5b565d(_0x4c6bb8[_0x071e('0xe')][_0x071e('0x10')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x3db8bb,_0x071e('0xb'));_0x5b565d(_0x4c6bb8[_0x071e('0x11')]['message']);}})[_0x071e('0x12')](function(_0x8abac6){logger[_0x071e('0xe')](_0x071e('0xa'),_0x3db8bb,_0x8abac6);_0x384ff4(_0x8abac6);});});}