Built motion from commit b58257bb.|2.5.37
[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 _0x3425=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c016e,_0x27e48c){var _0x134963=function(_0x50be39){while(--_0x50be39){_0x1c016e['push'](_0x1c016e['shift']());}};_0x134963(++_0x27e48c);}(_0x3425,0x149));var _0x5342=function(_0x396d8f,_0x5afa8e){_0x396d8f=_0x396d8f-0x0;var _0x3c6799=_0x3425[_0x396d8f];return _0x3c6799;};'use strict';var _=require(_0x5342('0x0'));var util=require('util');var moment=require(_0x5342('0x1'));var BPromise=require(_0x5342('0x2'));var rs=require(_0x5342('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5342('0x4'))('rpc');var config=require(_0x5342('0x5'));var jayson=require(_0x5342('0x6'));var client=jayson[_0x5342('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233a9d,_0xf0c418,_0x1b5914){return new BPromise(function(_0x3825d0,_0x4ceeb3){return client['request'](_0x233a9d,_0x1b5914)['then'](function(_0xe71720){logger['info'](_0x5342('0x8'),_0xf0c418,_0x5342('0x9'));logger[_0x5342('0xa')](_0x5342('0xb'),_0xf0c418,_0x5342('0x9'),JSON[_0x5342('0xc')](_0xe71720));if(_0xe71720[_0x5342('0xd')]){if(_0xe71720[_0x5342('0xd')][_0x5342('0xe')]===0x1f4){logger['error'](_0x5342('0x8'),_0xf0c418,_0xe71720[_0x5342('0xd')][_0x5342('0xf')]);return _0x4ceeb3(_0xe71720[_0x5342('0xd')][_0x5342('0xf')]);}logger[_0x5342('0xd')](_0x5342('0x8'),_0xf0c418,_0xe71720['error']['message']);return _0x3825d0(_0xe71720[_0x5342('0xd')][_0x5342('0xf')]);}else{logger[_0x5342('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0xf0c418,_0x5342('0x9'));_0x3825d0(_0xe71720[_0x5342('0x11')][_0x5342('0xf')]);}})[_0x5342('0x12')](function(_0x369259){logger[_0x5342('0xd')](_0x5342('0x8'),_0xf0c418,_0x369259);_0x4ceeb3(_0x369259);});});}