55bae63d1d5542f80c6158b3943a399975eba235
[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 _0x99d6=['../../config/utils','rpc','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99d6,0x1e0));var _0x699d=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x99d6[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0x699d('0x0'));var util=require(_0x699d('0x1'));var moment=require(_0x699d('0x2'));var BPromise=require(_0x699d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x699d('0x4'));var db=require(_0x699d('0x5'))['db'];var utils=require(_0x699d('0x6'));var logger=require('../../config/logger')(_0x699d('0x7'));var config=require('../../config/environment');var jayson=require(_0x699d('0x8'));var client=jayson['client'][_0x699d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d537e,_0x183238,_0x439948){return new BPromise(function(_0x37f077,_0x281c06){return client[_0x699d('0xa')](_0x3d537e,_0x439948)['then'](function(_0xa16e45){logger[_0x699d('0xb')](_0x699d('0xc'),_0x183238,_0x699d('0xd'));logger[_0x699d('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x183238,_0x699d('0xd'),JSON[_0x699d('0xf')](_0xa16e45));if(_0xa16e45[_0x699d('0x10')]){if(_0xa16e45[_0x699d('0x10')]['code']===0x1f4){logger['error'](_0x699d('0xc'),_0x183238,_0xa16e45[_0x699d('0x10')][_0x699d('0x11')]);return _0x281c06(_0xa16e45[_0x699d('0x10')][_0x699d('0x11')]);}logger[_0x699d('0x10')](_0x699d('0xc'),_0x183238,_0xa16e45[_0x699d('0x10')]['message']);return _0x37f077(_0xa16e45['error'][_0x699d('0x11')]);}else{logger['info'](_0x699d('0xc'),_0x183238,_0x699d('0xd'));_0x37f077(_0xa16e45['result'][_0x699d('0x11')]);}})['catch'](function(_0x985fe6){logger[_0x699d('0x10')](_0x699d('0xc'),_0x183238,_0x985fe6);_0x281c06(_0x985fe6);});});}