Built motion from commit (unavailable).|2.4.4
[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 _0xad71=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x100e22,_0x5a3cba){var _0x51bdfb=function(_0x1049d2){while(--_0x1049d2){_0x100e22['push'](_0x100e22['shift']());}};_0x51bdfb(++_0x5a3cba);}(_0xad71,0xb1));var _0x1ad7=function(_0x48c371,_0x3f2cd8){_0x48c371=_0x48c371-0x0;var _0x27c9df=_0xad71[_0x48c371];return _0x27c9df;};'use strict';var _=require('lodash');var util=require(_0x1ad7('0x0'));var moment=require(_0x1ad7('0x1'));var BPromise=require(_0x1ad7('0x2'));var rs=require(_0x1ad7('0x3'));var fs=require('fs');var Redis=require(_0x1ad7('0x4'));var db=require(_0x1ad7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ad7('0x6'))(_0x1ad7('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ad7('0x8'));var client=jayson[_0x1ad7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x137337,_0x1513d1,_0x149c08){return new BPromise(function(_0x354fa6,_0x128c35){return client['request'](_0x137337,_0x149c08)['then'](function(_0xbad875){logger[_0x1ad7('0xa')](_0x1ad7('0xb'),_0x1513d1,_0x1ad7('0xc'));logger['debug'](_0x1ad7('0xd'),_0x1513d1,_0x1ad7('0xc'),JSON[_0x1ad7('0xe')](_0xbad875));if(_0xbad875[_0x1ad7('0xf')]){if(_0xbad875[_0x1ad7('0xf')][_0x1ad7('0x10')]===0x1f4){logger[_0x1ad7('0xf')](_0x1ad7('0xb'),_0x1513d1,_0xbad875[_0x1ad7('0xf')]['message']);return _0x128c35(_0xbad875[_0x1ad7('0xf')][_0x1ad7('0x11')]);}logger[_0x1ad7('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x1513d1,_0xbad875[_0x1ad7('0xf')][_0x1ad7('0x11')]);return _0x354fa6(_0xbad875[_0x1ad7('0xf')][_0x1ad7('0x11')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x1513d1,_0x1ad7('0xc'));_0x354fa6(_0xbad875[_0x1ad7('0x12')][_0x1ad7('0x11')]);}})[_0x1ad7('0x13')](function(_0x294220){logger['error'](_0x1ad7('0xb'),_0x1513d1,_0x294220);_0x128c35(_0x294220);});});}