1e13fe7ccc38a9d7d0c9aebf01fc7b049de1e80b
[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 _0x95e0=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x240c2f,_0x572aed){var _0x73d2f1=function(_0x423baa){while(--_0x423baa){_0x240c2f['push'](_0x240c2f['shift']());}};_0x73d2f1(++_0x572aed);}(_0x95e0,0x149));var _0x095e=function(_0xeba3f4,_0x5b7c97){_0xeba3f4=_0xeba3f4-0x0;var _0x357756=_0x95e0[_0xeba3f4];return _0x357756;};'use strict';var _=require(_0x095e('0x0'));var util=require(_0x095e('0x1'));var moment=require('moment');var BPromise=require(_0x095e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x095e('0x3'));var db=require(_0x095e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x095e('0x5'))(_0x095e('0x6'));var config=require(_0x095e('0x7'));var jayson=require(_0x095e('0x8'));var client=jayson[_0x095e('0x9')][_0x095e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1834f9,_0x59421b,_0x38c63f){return new BPromise(function(_0x3d6c96,_0x10a1e6){return client[_0x095e('0xb')](_0x1834f9,_0x38c63f)[_0x095e('0xc')](function(_0x4f3a06){logger[_0x095e('0xd')](_0x095e('0xe'),_0x59421b,_0x095e('0xf'));logger[_0x095e('0x10')](_0x095e('0x11'),_0x59421b,'request\x20sent',JSON['stringify'](_0x4f3a06));if(_0x4f3a06[_0x095e('0x12')]){if(_0x4f3a06[_0x095e('0x12')][_0x095e('0x13')]===0x1f4){logger['error'](_0x095e('0xe'),_0x59421b,_0x4f3a06[_0x095e('0x12')]['message']);return _0x10a1e6(_0x4f3a06[_0x095e('0x12')][_0x095e('0x14')]);}logger[_0x095e('0x12')](_0x095e('0xe'),_0x59421b,_0x4f3a06[_0x095e('0x12')][_0x095e('0x14')]);return _0x3d6c96(_0x4f3a06[_0x095e('0x12')]['message']);}else{logger[_0x095e('0xd')](_0x095e('0xe'),_0x59421b,_0x095e('0xf'));_0x3d6c96(_0x4f3a06[_0x095e('0x15')][_0x095e('0x14')]);}})[_0x095e('0x16')](function(_0x1e8ac3){logger['error'](_0x095e('0xe'),_0x59421b,_0x1e8ac3);_0x10a1e6(_0x1e8ac3);});});}