56dd008498e62d90284d38a714ed76a70d8a079b
[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 _0x6893=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x6893,0x12b));var _0x3689=function(_0x45ce4e,_0x3a367c){_0x45ce4e=_0x45ce4e-0x0;var _0x4a105a=_0x6893[_0x45ce4e];return _0x4a105a;};'use strict';var _=require('lodash');var util=require(_0x3689('0x0'));var moment=require(_0x3689('0x1'));var BPromise=require(_0x3689('0x2'));var rs=require(_0x3689('0x3'));var fs=require('fs');var Redis=require(_0x3689('0x4'));var db=require(_0x3689('0x5'))['db'];var utils=require(_0x3689('0x6'));var logger=require(_0x3689('0x7'))(_0x3689('0x8'));var config=require(_0x3689('0x9'));var jayson=require(_0x3689('0xa'));var client=jayson[_0x3689('0xb')][_0x3689('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1911b8,_0x32fd9e,_0xdcdfed){return new BPromise(function(_0x357db1,_0x43cc58){return client[_0x3689('0xd')](_0x1911b8,_0xdcdfed)['then'](function(_0x45832f){logger['info'](_0x3689('0xe'),_0x32fd9e,'request\x20sent');logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x32fd9e,_0x3689('0xf'),JSON[_0x3689('0x10')](_0x45832f));if(_0x45832f['error']){if(_0x45832f[_0x3689('0x11')][_0x3689('0x12')]===0x1f4){logger[_0x3689('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x32fd9e,_0x45832f['error'][_0x3689('0x13')]);return _0x43cc58(_0x45832f[_0x3689('0x11')][_0x3689('0x13')]);}logger[_0x3689('0x11')](_0x3689('0xe'),_0x32fd9e,_0x45832f['error'][_0x3689('0x13')]);return _0x357db1(_0x45832f['error'][_0x3689('0x13')]);}else{logger[_0x3689('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x32fd9e,'request\x20sent');_0x357db1(_0x45832f[_0x3689('0x15')]['message']);}})[_0x3689('0x16')](function(_0xe797fa){logger['error'](_0x3689('0xe'),_0x32fd9e,_0xe797fa);_0x43cc58(_0xe797fa);});});}