Built motion from commit (unavailable).|2.5.0
[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 _0x7019=['error','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x204276,_0x1867a9){var _0x52e94a=function(_0x50c85c){while(--_0x50c85c){_0x204276['push'](_0x204276['shift']());}};_0x52e94a(++_0x1867a9);}(_0x7019,0xb0));var _0x9701=function(_0x50f75d,_0x24d667){_0x50f75d=_0x50f75d-0x0;var _0x460a87=_0x7019[_0x50f75d];return _0x460a87;};'use strict';var _=require('lodash');var util=require(_0x9701('0x0'));var moment=require(_0x9701('0x1'));var BPromise=require(_0x9701('0x2'));var rs=require(_0x9701('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9701('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9701('0x5'));var client=jayson[_0x9701('0x6')][_0x9701('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59b66b,_0x501050,_0x48b9be){return new BPromise(function(_0x253a09,_0x3249c3){return client[_0x9701('0x8')](_0x59b66b,_0x48b9be)[_0x9701('0x9')](function(_0x3267b0){logger['info'](_0x9701('0xa'),_0x501050,_0x9701('0xb'));logger[_0x9701('0xc')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x501050,'request\x20sent',JSON[_0x9701('0xd')](_0x3267b0));if(_0x3267b0[_0x9701('0xe')]){if(_0x3267b0[_0x9701('0xe')]['code']===0x1f4){logger['error'](_0x9701('0xa'),_0x501050,_0x3267b0[_0x9701('0xe')][_0x9701('0xf')]);return _0x3249c3(_0x3267b0[_0x9701('0xe')][_0x9701('0xf')]);}logger[_0x9701('0xe')](_0x9701('0xa'),_0x501050,_0x3267b0[_0x9701('0xe')][_0x9701('0xf')]);return _0x253a09(_0x3267b0[_0x9701('0xe')]['message']);}else{logger[_0x9701('0x10')](_0x9701('0xa'),_0x501050,_0x9701('0xb'));_0x253a09(_0x3267b0[_0x9701('0x11')]['message']);}})[_0x9701('0x12')](function(_0x41119f){logger[_0x9701('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x501050,_0x41119f);_0x3249c3(_0x41119f);});});}