8a17b997e569c34197398444507bedb45ee84153
[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 _0x7c8d=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7c8d,0x133));var _0xd7c8=function(_0x20cbbb,_0x4900df){_0x20cbbb=_0x20cbbb-0x0;var _0xd1506c=_0x7c8d[_0x20cbbb];return _0xd1506c;};'use strict';var _=require(_0xd7c8('0x0'));var util=require(_0xd7c8('0x1'));var moment=require(_0xd7c8('0x2'));var BPromise=require(_0xd7c8('0x3'));var rs=require(_0xd7c8('0x4'));var fs=require('fs');var Redis=require(_0xd7c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd7c8('0x6'))(_0xd7c8('0x7'));var config=require(_0xd7c8('0x8'));var jayson=require(_0xd7c8('0x9'));var client=jayson[_0xd7c8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29855b,_0x254552,_0x5143a8){return new BPromise(function(_0x5dbff5,_0x5c1f37){return client[_0xd7c8('0xb')](_0x29855b,_0x5143a8)['then'](function(_0x286d3e){logger[_0xd7c8('0xc')](_0xd7c8('0xd'),_0x254552,_0xd7c8('0xe'));logger[_0xd7c8('0xf')](_0xd7c8('0x10'),_0x254552,'request\x20sent',JSON[_0xd7c8('0x11')](_0x286d3e));if(_0x286d3e[_0xd7c8('0x12')]){if(_0x286d3e[_0xd7c8('0x12')]['code']===0x1f4){logger['error'](_0xd7c8('0xd'),_0x254552,_0x286d3e[_0xd7c8('0x12')][_0xd7c8('0x13')]);return _0x5c1f37(_0x286d3e[_0xd7c8('0x12')][_0xd7c8('0x13')]);}logger[_0xd7c8('0x12')](_0xd7c8('0xd'),_0x254552,_0x286d3e[_0xd7c8('0x12')]['message']);return _0x5dbff5(_0x286d3e['error']['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x254552,'request\x20sent');_0x5dbff5(_0x286d3e[_0xd7c8('0x14')]['message']);}})[_0xd7c8('0x15')](function(_0x341278){logger[_0xd7c8('0x12')](_0xd7c8('0xd'),_0x254552,_0x341278);_0x5c1f37(_0x341278);});});}