06c828f872b24e0ef739988c250d472b753fc642
[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 _0x9cf9=['code','message','result','catch','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f0c67,_0x378578){var _0x145360=function(_0x422efd){while(--_0x422efd){_0x5f0c67['push'](_0x5f0c67['shift']());}};_0x145360(++_0x378578);}(_0x9cf9,0x1d0));var _0x99cf=function(_0x1d2982,_0x48c979){_0x1d2982=_0x1d2982-0x0;var _0x5f381f=_0x9cf9[_0x1d2982];return _0x5f381f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x99cf('0x0'));var BPromise=require(_0x99cf('0x1'));var rs=require(_0x99cf('0x2'));var fs=require('fs');var Redis=require(_0x99cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99cf('0x4'));var config=require(_0x99cf('0x5'));var jayson=require(_0x99cf('0x6'));var client=jayson['client'][_0x99cf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f3706,_0x40815c,_0x17e377){return new BPromise(function(_0x5c18a4,_0x30398b){return client[_0x99cf('0x8')](_0x5f3706,_0x17e377)[_0x99cf('0x9')](function(_0x44e640){logger[_0x99cf('0xa')](_0x99cf('0xb'),_0x40815c,_0x99cf('0xc'));logger['debug'](_0x99cf('0xd'),_0x40815c,'request\x20sent',JSON[_0x99cf('0xe')](_0x44e640));if(_0x44e640['error']){if(_0x44e640[_0x99cf('0xf')][_0x99cf('0x10')]===0x1f4){logger[_0x99cf('0xf')](_0x99cf('0xb'),_0x40815c,_0x44e640[_0x99cf('0xf')][_0x99cf('0x11')]);return _0x30398b(_0x44e640['error'][_0x99cf('0x11')]);}logger[_0x99cf('0xf')](_0x99cf('0xb'),_0x40815c,_0x44e640[_0x99cf('0xf')][_0x99cf('0x11')]);return _0x5c18a4(_0x44e640[_0x99cf('0xf')][_0x99cf('0x11')]);}else{logger[_0x99cf('0xa')](_0x99cf('0xb'),_0x40815c,_0x99cf('0xc'));_0x5c18a4(_0x44e640[_0x99cf('0x12')]['message']);}})[_0x99cf('0x13')](function(_0x1e8e4b){logger['error'](_0x99cf('0xb'),_0x40815c,_0x1e8e4b);_0x30398b(_0x1e8e4b);});});}