f85023ef6a6a92477de77a1b538502d82634e45c
[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 _0x5689=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s'];(function(_0x225cac,_0x5ee6d7){var _0x218772=function(_0xb365bb){while(--_0xb365bb){_0x225cac['push'](_0x225cac['shift']());}};_0x218772(++_0x5ee6d7);}(_0x5689,0x1a7));var _0x9568=function(_0x185952,_0x914ad8){_0x185952=_0x185952-0x0;var _0x3b2d90=_0x5689[_0x185952];return _0x3b2d90;};'use strict';var _=require(_0x9568('0x0'));var util=require(_0x9568('0x1'));var moment=require('moment');var BPromise=require(_0x9568('0x2'));var rs=require(_0x9568('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9568('0x4'))['db'];var utils=require(_0x9568('0x5'));var logger=require(_0x9568('0x6'))(_0x9568('0x7'));var config=require(_0x9568('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc16d,_0x341c36,_0x475801){return new BPromise(function(_0x4092e7,_0x637027){return client[_0x9568('0x9')](_0x3dc16d,_0x475801)[_0x9568('0xa')](function(_0x72a726){logger[_0x9568('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x341c36,'request\x20sent');logger['debug'](_0x9568('0xc'),_0x341c36,_0x9568('0xd'),JSON[_0x9568('0xe')](_0x72a726));if(_0x72a726[_0x9568('0xf')]){if(_0x72a726['error'][_0x9568('0x10')]===0x1f4){logger[_0x9568('0xf')](_0x9568('0x11'),_0x341c36,_0x72a726[_0x9568('0xf')][_0x9568('0x12')]);return _0x637027(_0x72a726[_0x9568('0xf')][_0x9568('0x12')]);}logger[_0x9568('0xf')](_0x9568('0x11'),_0x341c36,_0x72a726[_0x9568('0xf')][_0x9568('0x12')]);return _0x4092e7(_0x72a726[_0x9568('0xf')][_0x9568('0x12')]);}else{logger['info'](_0x9568('0x11'),_0x341c36,_0x9568('0xd'));_0x4092e7(_0x72a726[_0x9568('0x13')][_0x9568('0x12')]);}})[_0x9568('0x14')](function(_0x1d5857){logger[_0x9568('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x341c36,_0x1d5857);_0x637027(_0x1d5857);});});}